Properties SourceCde
txt
1
*---------------------------------------------------------------------*
2
*       FORM VIM_PROCESS_ASSIGNS                                      *
3
*---------------------------------------------------------------------*
4
* process assigns                                                     *
5
*---------------------------------------------------------------------*
6
FORM vim_process_assigns.
7
  DATA: length TYPE i, keydate_alr_assigned(1) TYPE c,
8
        tablength TYPE i, texttablength TYPE i, keylen_bef_date TYPE i,
9
        xlength type i.
10
 
11
  TRANSLATE vim_prtfky_assigned USING 'XY'.
12
  ASSIGN: <initial> TO <initial_x> CASTING,
13
          total TO <vim_ctotal> CASTING TYPE c,
14
          total TO <vim_total_struc> CASTING TYPE (x_header-maintview),
15
          total to <vim_xtotal> casting,
16
          extract TO <vim_cextract> CASTING TYPE c,
17
          extract TO <vim_extract_struc>
18
           CASTING TYPE (x_header-maintview),
19
          extract to <vim_xextract> casting,
20
          corr_keytab-tabkey to <vim_corr_keyx> casting.
21
  tablength = x_header-after_tabc / cl_abap_char_utilities=>charsize.
22
  texttablength =
23
   x_header-aft_txttbc / cl_abap_char_utilities=>charsize.
24
 
25
  IF x_header-bastab NE space AND x_header-texttbexst NE space.
26
    length = tablength + texttablength.
27
    xlength = x_header-texttablen + x_header-tablen.
28
    ASSIGN: <vim_ctotal>+tablength(texttablength) TO <total_text>,
29
            <vim_xtotal>+x_header-after_tabc(x_header-texttablen)
30
             to <vim_xtotal_text>,
31
            <vim_xtotal_text> to <vim_tot_txt_struc>
32
             casting type (x_header-texttab),
33
            <vim_cextract>(tablength) TO <extract_enti>,
34
            <vim_cextract>+tablength(texttablength) TO <extract_text>,
35
            <vim_xextract>+x_header-after_tabc(x_header-texttablen)
36
             to <vim_xextract_text>,
37
            <vim_xextract_text> to <vim_ext_txt_struc>
38
             casting type (x_header-texttab).
39
ELSE.
40
    length = tablength.
41
    xlength = x_header-tablen.
42
  ENDIF.
43
  ASSIGN: <vim_ctotal>+length(1) TO <action>,
44
          <action>+1(1) TO <mark>,
45
          <vim_cextract>(length) TO <table2>,
46
          <vim_xextract>(xlength) to <table2_x>,
47
          <vim_xextract>(x_header-tablen) to <vim_xextract_enti>,
48
          <vim_cextract>+length(1) TO <xact>,
49
          <xact>+1(1)  TO <xmark>,
50
          <vim_ctotal>(vim_ctabkeylen) TO <vim_total_key>,
51
          <vim_cextract>(vim_ctabkeylen) TO <vim_extract_key>,
52
          <vim_xtotal>(x_header-keylen) TO <vim_xtotal_key>,
53
          <vim_xextract>(x_header-keylen) TO <vim_xextract_key>.
54
 
55
  IF x_header-bastab NE space AND x_header-texttbexst NE space.
56
    ASSIGN: <mark>+1(1) TO <action_text>,
57
            <xmark>+1(1) TO <xact_text>.
58
  ENDIF.
59
  IF x_header-adrnbrflag NE space.
60
    assign vim_addresses_to_save-handle to <vim_addr_handle_x> casting.
61
    LOOP AT x_namtab WHERE domname IN adrnbr_domain.
62
      ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE
63
       <vim_total_struc> TO <vim_total_address_number>.
64
      EXIT.
65
    ENDLOOP.
66
  ENDIF.
67
  IF x_header-delmdtflag NE space.
68
    LOOP AT x_namtab WHERE domname EQ vim_delim_date_domain
69
                       AND ( rollname in vim_begda_types or
70
                             rollname in vim_endda_types ).
71
      IF x_namtab-rollname in vim_begda_types.
72
* begin date
73
        IF x_header-delmdtflag EQ 'E'.
74
* end date is key field
75
          IF x_namtab-texttabfld EQ space.
76
            ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE
77
             <vim_total_struc> TO <vim_begdate>.
78
*            ASSIGN total+x_namtab-position(x_namtab-flength)
79
*                                   TO <vim_begdate> TYPE 'D'.
80
          ENDIF.
81
        ELSE.                          "begin date is key field
82
          CHECK keydate_alr_assigned EQ space OR
83
                keydate_alr_assigned EQ 'E' AND
84
                x_namtab-texttabfld NE space OR
85
                keydate_alr_assigned EQ 'T' AND
86
                x_namtab-texttabfld EQ space.
87
          IF x_namtab-texttabfld EQ space.
88
            TRANSLATE keydate_alr_assigned USING ' ETX'.
89
            ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE
90
             <vim_total_struc> TO <vim_enddate>.
91
*            ASSIGN total+x_namtab-position(x_namtab-flength)
92
*                                  TO <vim_enddate> TYPE 'D'.
93
            IF x_namtab-position GT 0.
94
              ASSIGN: <vim_xtotal>(x_namtab-position)
95
                       TO <vim_tot_mkey_beforex> casting,
96
                      <vim_xextract>(x_namtab-position)
97
                       TO <vim_ext_mkey_beforex> casting.
98
* for downward compatibility only:
99
              keylen_bef_date =
100
               x_namtab-position DIV cl_abap_char_utilities=>charsize.
101
              ASSIGN: <vim_ctotal>(keylen_bef_date)
102
                                     TO <vim_tot_mkey_before> TYPE 'C',
103
                      <vim_cextract>(keylen_bef_date)
104
                                     TO <vim_ext_mkey_before> TYPE 'C'.
105
            ELSE.
106
              ASSIGN:
107
*      begin correction if position <= 0, should be fitted to unicode.
108
                      vim_dummy_mainkey TO <vim_tot_mkey_beforex>
109
                                                              casting ,
110
                      vim_dummy_mainkey TO <vim_tot_mkey_beforex>
111
                                                              casting ,
112
*      end correction von XB am 22.03.02 for csn int1332679 2002
113
                      vim_dummy_mainkey TO <vim_tot_mkey_before>
114
                                                              TYPE 'C',
115
                      <vim_tot_mkey_before> TO <vim_ext_mkey_before>
116
                                                              TYPE 'C'.
117
            ENDIF.
118
            IF vim_mkey_after_exists NE space.
119
              PERFORM vim_assign_mkey_after_2 USING sy-tabix.
120
            ENDIF.
121
          ELSE.
122
            TRANSLATE keydate_alr_assigned USING ' TEX'.
123
            ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE
124
             <vim_tot_txt_struc> TO <vim_text_enddate>.
125
*            ASSIGN total+x_namtab-position(x_namtab-flength)
126
*                                  TO <vim_text_enddate> TYPE 'D'.
127
          ENDIF.
128
        ENDIF.                         "x_header-delmdtflag eq 'E'
129
      ELSE.
130
* end date
131
        IF x_header-delmdtflag EQ 'E'.
132
* end date is key field
133
          CHECK keydate_alr_assigned EQ space OR
134
                keydate_alr_assigned EQ 'E' AND
135
                x_namtab-texttabfld NE space OR
136
                keydate_alr_assigned EQ 'T' AND
137
                x_namtab-texttabfld EQ space.
138
          IF x_namtab-texttabfld EQ space.
139
            TRANSLATE keydate_alr_assigned USING ' ETX'.
140
            ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE
141
             <vim_total_struc> TO <vim_enddate>.
142
*            ASSIGN total+x_namtab-position(x_namtab-flength)
143
*                                  TO <vim_enddate> TYPE 'D'.
144
            IF x_namtab-position GT 0.
145
              ASSIGN: <vim_xtotal>(x_namtab-position)
146
                       TO <vim_tot_mkey_beforex> casting,
147
                      <vim_xextract>(x_namtab-position)
148
                       TO <vim_ext_mkey_beforex> casting.
149
* for downward compatibility only:
150
              keylen_bef_date =
151
               x_namtab-position DIV cl_abap_char_utilities=>charsize.
152
              ASSIGN:
153
                      <vim_ctotal>(keylen_bef_date)
154
                                     TO <vim_tot_mkey_before> TYPE 'C',
155
                      <vim_cextract>(keylen_bef_date)
156
                                     TO <vim_ext_mkey_before> TYPE 'C'.
157
*              ASSIGN: total(x_namtab-position)
158
*                                     TO <vim_tot_mkey_before> TYPE 'C',
159
*                      extract(x_namtab-position)
160
*                                     TO <vim_ext_mkey_before> TYPE 'C'.
161
            ELSE.
162
              ASSIGN:
163
*      begin correction if position <= 0, should be fitted to unicode.
164
                      vim_dummy_mainkey TO <vim_tot_mkey_beforex>
165
                                                              casting ,
166
                      vim_dummy_mainkey TO <vim_ext_mkey_beforex>
167
                                                              casting ,
168
*      end correction von XB am 22.03.02 for csn int1332679 2002
169
                      vim_dummy_mainkey TO <vim_tot_mkey_before>
170
                                                              TYPE 'C',
171
                      <vim_tot_mkey_before> TO <vim_ext_mkey_before>
172
                                                              TYPE 'C'.
173
            ENDIF.
174
            IF vim_mkey_after_exists NE space.
175
              PERFORM vim_assign_mkey_after_2 USING sy-tabix.
176
            ENDIF.
177
          ELSE.
178
            TRANSLATE keydate_alr_assigned USING ' TEX'.
179
            ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE
180
             <vim_tot_txt_struc> TO <vim_text_enddate>.
181
*            ASSIGN total+x_namtab-position(x_namtab-flength)
182
*                                  TO <vim_text_enddate> TYPE 'D'.
183
          ENDIF.
184
        ELSE.                          "begin date is key field
185
          IF x_namtab-texttabfld EQ space.
186
            ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE
187
             <vim_total_struc> TO <vim_begdate>.
188
*            ASSIGN total+x_namtab-position(x_namtab-flength)
189
*                                   TO <vim_begdate> TYPE 'D'.
190
          ENDIF.
191
        ENDIF.                         "x_header-delmdtflag eq 'E'
192
      ENDIF.
193
    ENDLOOP.
194
  ENDIF.
195
ENDFORM.                               "vim_process_assigns