Properties SourceCde
txt
1
*---------------------------------------------------------------------*
2
*       FORM INITIALISIEREN                                           *
3
*---------------------------------------------------------------------*
4
*       ........                                                      *
5
*---------------------------------------------------------------------*
6
FORM initialisieren.
7
  LOCAL: counter.
8
  TYPES: BEGIN OF i_fnamecnt,
9
           name LIKE vimsellist-viewfield,
10
           cnt TYPE i,
11
         END OF i_fnamecnt.
12
  DATA: keydate_alr_assigned(1) TYPE c,
13
        program LIKE d020s-prog,
14
        namlen TYPE i,
15
        length TYPE i,
16
        name(25) TYPE c,
17
        fname(50) TYPE c,
18
        dynnr LIKE liste,
19
        i_fnametb TYPE SORTED TABLE OF i_fnamecnt WITH UNIQUE KEY name,
20
        i_fnameln TYPE i_fnamecnt, initexclfldtabs(1) TYPE c,
21
        i_objtype LIKE objh-objecttype,
22
        f_fieldname(50) type c.
23
  DATA: h_f1(70) TYPE c, h_f2(8)  TYPE c, h_f3(20) TYPE c.
24
  FIELD-SYMBOLS: <m1>, <mili> TYPE ANY, <x_namtab> TYPE vimnamtab,
25
                 <f_fld_value> TYPE any.
26
 
27
  IF nbrd_texts_alr_read EQ space.
28
    CALL 'C_SAPGPARAM' ID 'NAME'  FIELD 'transport/systemtype'
29
                       ID 'VALUE' FIELD vim_system_type.
30
    PERFORM set_numbered_texts.
31
    length = vim_position_info_lg1 + 2 + vim_position_info_lg3.
32
* XB 585898B - remove the unused characters ';;'.
33
    IF sy-langu = 'J'.
34
      REPLACE ';;' IN svim_text_027 WITH '  '.
35
    ENDIF.
36
* XB 585898E
37
    WRITE: svim_text_027 TO
38
             vim_position_info_mask(vim_position_info_lg1),
39
           svim_text_028 TO
40
             vim_position_info_mask+length(vim_position_info_lg2).
41
    vim_posi_push = '@3Y@'. vim_posi_push+4 = svim_text_029.
42
    MOVE: 'I'   TO mark_functions-sign,
43
          'I'   TO adrnbr_domain-sign,
44
          'I'   TO exted_functions-sign,
45
          'EQ'  TO mark_functions-option,
46
          'EQ'  TO adrnbr_domain-option,
47
          'EQ'  TO exted_functions-option,
48
          space TO mark_functions-high,
49
          space TO adrnbr_domain-high,
50
          space TO exted_functions-high.
51
    MOVE 'ADDR' TO mark_functions-low. APPEND mark_functions.
52
    MOVE 'ALMK' TO mark_functions-low. APPEND mark_functions.
53
    MOVE 'DELE' TO mark_functions-low. APPEND mark_functions.
54
    MOVE 'DELM' TO mark_functions-low. APPEND mark_functions.
55
    MOVE 'EXPA' TO mark_functions-low. APPEND mark_functions.
56
    MOVE 'KOPE' TO mark_functions-low. APPEND mark_functions.
57
    MOVE 'MKLO' TO mark_functions-low. APPEND mark_functions.
58
    MOVE 'ORGI' TO mark_functions-low. APPEND mark_functions.
59
    MOVE 'REPL' TO mark_functions-low. APPEND mark_functions.
60
    MOVE 'TEXT' TO mark_functions-low. APPEND mark_functions.
61
    MOVE 'TREX' TO mark_functions-low. APPEND mark_functions.
62
    MOVE 'TRIN' TO mark_functions-low. APPEND mark_functions.
63
    MOVE 'UNDO' TO mark_functions-low. APPEND mark_functions.
64
    MOVE 'BCSH' TO mark_functions-low. APPEND mark_functions.
65
    MOVE 'UNDO' TO exted_functions-low. APPEND exted_functions.
66
    MOVE 'DELE' TO exted_functions-low. APPEND exted_functions.
67
    MOVE 'TRIN' TO exted_functions-low. APPEND exted_functions.
68
    MOVE 'TREX' TO exted_functions-low. APPEND exted_functions.
69
    PERFORM vim_fill_vim_guid_domain.
70
    PERFORM vim_fill_date_type.
71
    DO.
72
      ASSIGN COMPONENT sy-index OF STRUCTURE vim_adrnbr_domains TO <m1>.
73
      IF sy-subrc NE 0. EXIT. ENDIF.
74
      MOVE <m1> TO adrnbr_domain-low. APPEND adrnbr_domain.
75
    ENDDO.
76
    PERFORM vim_initialize_d0100.      " SW Texttransl
77
    MOVE 'X' TO nbrd_texts_alr_read.
78
  ENDIF.
79
  READ TABLE x_header INDEX 1.
80
  IF x_header-existency NE 'R'.
81
* SOBJ-Eintrag da?
82
    IF x_header-bastab EQ space OR
83
     ( x_header-maintview NE x_header-viewname AND          "UF160998
84
       x_header-bastab NE space ).
85
      i_objtype = 'V'.
86
    ELSE.
87
      i_objtype = 'S'.
88
    ENDIF.
89
    SELECT SINGLE * FROM objh WHERE objectname EQ x_header-viewname
90
                                AND objecttype EQ i_objtype.
91
    IF sy-subrc NE 0.                  "no obj.descr. -> run RSVIM30A
92
      MESSAGE a138(sv) WITH x_header-viewname x_header-area.
93
    ENDIF.
94
  ENDIF.
95
  CLEAR: vim_nbr_of_scrfrm_pointers.
96
  vim_view_name = vim_addresses_to_save-viewname = x_header-viewname.
97
  MOVE: x_header-liste TO liste,
98
        x_header-detail TO detail.
99
  CASE x_header-type.
100
    WHEN '1'. MOVE einstufig TO status-type.
101
    WHEN '2'. MOVE zweistufig TO status-type.
102
  ENDCASE.
103
  counter = strlen( x_header-ddtext ).
104
  IF counter EQ 0. counter = 1. x_header-ddtext(1) = '?'. ENDIF.
105
  vim_title_name = x_header-ddtext.
106
  ASSIGN: vim_title_name(counter) TO <name>.
107
  MOVE <name> TO vim_frame_field.
108
* set up status vector
109
  IF x_header-bastab NE space.
110
    MOVE: 'STATUS_' TO name,
111
          x_header-maintview TO name+7.                     "Subviews
112
    ASSIGN (name) TO <status>.
113
    MOVE: '*' TO name,
114
          x_header-maintview TO name+1.
115
    ASSIGN (x_header-maintview) TO <table1>.
116
    IF sy-subrc = 4.
117
      MESSAGE a173(sv) WITH x_header-maintview x_header-area.
118
    ENDIF.
119
    ASSIGN (name) TO <initial> CASTING TYPE (x_header-maintview).
120
* XB H606530B
121
* check if the time-field exists: Yes, then reset initial value.
122
    loop at x_namtab where datatype = 'TIMS'.
123
      CONCATENATE '<initial>' x_namtab-viewfield into f_fieldname
124
              SEPARATED BY '-'.
125
      assign (f_fieldname) to <f_fld_value>.
126
      clear <f_fld_value> with space.
127
    endloop.
128
* XB H606530E
129
    IF x_header-texttbexst NE space.
130
      MOVE x_header-texttab TO name+1.
131
      ASSIGN: (x_header-texttab)  TO <table1_text>,
132
              (name)              TO <text_initial>,
133
              <table1_text>       TO <table1_xtext> CASTING,
134
              <table1_xtext>(x_header-textkeylen)  TO <textkey_x>,
135
              <text_initial>      TO <text_initial_x> CASTING,
136
              <text_initial_x>(x_header-textkeylen)
137
               TO <initial_textkey_x>.
138
      IF x_header-generictrp <> 'X'
139
       AND cl_abap_char_utilities=>charsize = 1.
140
* charlike key and non-unicode-system (FS only assigned for
141
* downward compatibility).
142
        ASSIGN: <table1_text>(x_header-textkeylen) TO <textkey>,
143
           <text_initial>(x_header-textkeylen) TO <initial_textkey>.
144
      ELSE.
145
        ASSIGN: <table1_xtext> TO <textkey>,
146
               <initial_textkey_x> TO <initial_textkey>.
147
      ENDIF.
148
    ENDIF.
149
    IF x_header-viewname = x_header-maintview.              "Subviews
150
      CLEAR e071k-viewname.
151
      master_type = transp_object.
152
    ELSE.      "View auf Tab.                              "Subviews ..
153
      e071k-viewname = view_name.
154
      master_type = vim_view_type.
155
    ENDIF.                             ".. Subviews
156
  ELSE.                                                     "view
157
* XB H606530B
158
* check if the time-field exists: Yes, then reset initial value.
159
    loop at x_namtab where datatype = 'TIMS'.
160
      CONCATENATE '<initial>' x_namtab-viewfield into f_fieldname
161
              SEPARATED BY '-'.
162
      assign (f_fieldname) to <f_fld_value>.
163
      clear <f_fld_value> with space.
164
    endloop.
165
* XB H606530B
166
    WRITE: x_header-maintview TO compl_formname+compl_form_offs,
167
           x_header-maintview TO corr_formname+corr_form_offs.
168
    MOVE: view_name     TO e071k-viewname,
169
          vim_view_type TO master_type.
170
  ENDIF.
171
* set up screens
172
  MOVE: 'TCTRL_' TO name,
173
        x_header-maintview TO name+6.
174
* Übergangslösung Tablecontrol Anfang
175
  DATA: h LIKE d020s, f LIKE d021s OCCURS 10, e LIKE d022s OCCURS 10,
176
        m LIKE d023s OCCURS 10, e_h LIKE d022s,
177
        i_dynid(44) TYPE c.            "VALUE 'SAPL'.
178
  i_dynid  = x_header-fpoolname.                            "4.0B
179
  i_dynid+40(4) = x_header-liste.
180
  IMPORT DYNPRO h f e m ID i_dynid.
181
  IF sy-subrc EQ 0.
182
    LOOP AT e INTO e_h WHERE line CS name.
183
      EXIT.
184
    ENDLOOP.
185
    IF sy-subrc EQ 0.
186
      vim_tabctrl_active = 'X'.
187
    ELSE.
188
      CLEAR vim_tabctrl_active.
189
    ENDIF.
190
    ASSIGN h-mili TO <mili> CASTING TYPE x.
191
    IF <mili> O vim_template_dynpro.   "SW: gen. Dynpros sind evtl.
192
      h-mili = h-mili - vim_template_dynpro.   "fälschlicherweise als
193
      EXPORT DYNPRO h f e m ID i_dynid."Vorlagedynpros gekennzeichnet
194
      GENERATE DYNPRO h f e m ID i_dynid
195
                              MESSAGE h_f1 LINE h_f2 WORD h_f3.
196
    ENDIF.
197
  ELSE.
198
    CLEAR vim_tabctrl_active.
199
  ENDIF.
200
  IF x_header-type = '2'.
201
    i_dynid+40(4) = x_header-detail.
202
    IMPORT DYNPRO h f e m ID i_dynid.
203
    ASSIGN h-mili TO <mili> CASTING TYPE x.
204
    IF sy-subrc = 0
205
     AND <mili> O vim_template_dynpro. "UF: Auch Einzelbilder sind
206
      h-mili = h-mili - vim_template_dynpro.   "evtl. fälschlicherweise
207
      EXPORT DYNPRO h f e m ID i_dynid."als Vorlagedynpros
208
      GENERATE DYNPRO h f e m ID i_dynid       "gekennzeichnet
209
       MESSAGE h_f1 LINE h_f2 WORD h_f3.
210
    ENDIF.
211
  ENDIF.
212
  IF vim_tabctrl_active NE space.
213
* Übergangslösung Tablecontrol Ende
214
    ASSIGN (name) TO <vim_tctrl>.
215
    IF sy-subrc EQ 0.
216
      vim_tabctrl_active = 'X'.
217
      IF last_view_info <> space.      "Subviews ..
218
        REFRESH CONTROL name FROM SCREEN x_header-liste.
219
      ENDIF.                           ".. Subviews
220
      IF vim_restore_mode EQ space.
221
        <status>-l_sel_mode = <vim_tctrl>-line_sel_mode.
222
      ENDIF.
223
      IF x_header-maintview <> x_header-viewname.           "Subviews ..
224
        LOOP AT x_namtab WHERE readonly = vim_hidden.
225
          CONCATENATE x_header-maintview '-' x_namtab-viewfield
226
                                                             INTO fname.
227
          LOOP AT <vim_tctrl>-cols INTO vim_tc_cols
228
                                   WHERE screen-name = fname.
229
            vim_tc_cols-vislength = 0.
230
            vim_tc_cols-invisible = '1'.
231
            MODIFY <vim_tctrl>-cols FROM vim_tc_cols.
232
            EXIT.
233
          ENDLOOP.
234
        ENDLOOP.
235
      ENDIF.                           ".. Subviews
236
    ELSE.
237
      CLEAR vim_tabctrl_active.
238
    ENDIF.
239
  ENDIF.
240
* process assigns to structure
241
  vim_ctabkeylen =
242
   x_header-after_keyc / cl_abap_char_utilities=>charsize.
243
  IF x_header-clidep NE space.
244
    READ TABLE x_namtab ASSIGNING <x_namtab>
245
     WITH KEY datatype = 'CLNT'.
246
    ASSIGN COMPONENT <x_namtab>-viewfield OF STRUCTURE <table1>
247
     TO <client>.
248
    ASSIGN COMPONENT <x_namtab>-viewfield OF STRUCTURE <initial>
249
     TO <vim_client_initial>.
250
    <vim_client_initial> = sy-mandt.
251
  ELSE.
252
    ASSIGN mandant TO <vim_client_initial>.
253
  ENDIF.
254
  master_name = view_name.
255
  ASSIGN: (x_header-maintview) TO <table1_x> CASTING,
256
          <table1_x>(x_header-keylen) TO <f1_x>,
257
          vim_view_wax TO <table1_wa>
258
           CASTING TYPE (x_header-maintview),
259
          vim_view_wax TO <table1_wax> CASTING,
260
          <table1_wax>(x_header-keylen) TO <f1_wax> CASTING.
261
  IF x_header-generictrp <> 'X'
262
   AND cl_abap_char_utilities=>charsize = 1.
263
* charlike key or non-unicode-system (<f1> is only assigned for
264
* downward compatibility).
265
    ASSIGN <table1>(vim_ctabkeylen) TO <f1>.
266
  ELSE.
267
    ASSIGN <f1_x> TO <f1>.
268
  ENDIF.
269
  PERFORM vim_set_init_from_sellist USING x_header-maintview
270
                                          x_namtab[]
271
                                          dba_sellist[]
272
                                          vim_hidden
273
                                    CHANGING <initial>.
274
  IF last_view_info NE space.          "store old exclfldtabs
275
    MOVE: last_view_info TO vim_excl_xxx_tab_safe-viewname,
276
          excl_pos_tab[] TO vim_excl_xxx_tab_safe-excl_pos_tab,
277
          excl_rpl_tab[] TO vim_excl_xxx_tab_safe-excl_rpl_tab,
278
          excl_que_tab[] TO vim_excl_xxx_tab_safe-excl_que_tab.
279
    MODIFY TABLE vim_excl_xxx_tab_safe.
280
    IF sy-subrc NE 0.
281
      INSERT TABLE vim_excl_xxx_tab_safe.
282
    ENDIF.
283
  ENDIF.
284
  READ TABLE vim_excl_xxx_tab_safe WITH TABLE KEY
285
                                   viewname = x_header-viewname.
286
  IF sy-subrc EQ 0.
287
    excl_pos_tab[] = vim_excl_xxx_tab_safe-excl_pos_tab.
288
    excl_rpl_tab[] = vim_excl_xxx_tab_safe-excl_rpl_tab.
289
    excl_que_tab[] = vim_excl_xxx_tab_safe-excl_que_tab.
290
  ELSE.
291
    REFRESH: excl_rpl_tab, excl_que_tab, excl_pos_tab, exclude_tab.
292
    CLEAR: excl_rpl_tab, excl_que_tab, excl_pos_tab, exclude_tab.
293
    initexclfldtabs = 'X'.
294
  ENDIF.
295
  IF x_header-subsetflag NE space OR x_header-adrnbrflag NE space OR
296
     x_header-rdonlyflag NE space OR x_header-usrexiflag NE space OR
297
     x_header-hiddenflag NE space OR x_header-scrfrmflag NE space OR
298
     x_header-guidflag NE space.
299
* no positioning or replacing for certain kinds of fields
300
    LOOP AT x_namtab WHERE readonly NE space
301
                        OR domname IN adrnbr_domain
302
                        OR domname EQ vim_scrform_domain
303
                        OR domname IN vim_guid_domain.
304
      IF x_namtab-domname IN adrnbr_domain.
305
*        ASSIGN <table1>+x_namtab-position(x_namtab-flength)
306
*                    TO <address_number>.
307
        ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE <table1>
308
         TO <address_number>.
309
        MOVE x_namtab-readonly TO adrnbr_roflag.
310
        vim_addr_basetable = x_namtab-bastabname.
311
        vim_addr_bastab_field = x_namtab-bastabfld.
312
        CHECK initexclfldtabs NE space.
313
        MOVE x_namtab-viewfield TO excl_rpl_tab-fieldname.
314
        MOVE x_namtab-viewfield TO excl_que_tab-fieldname.
315
        MOVE x_namtab-viewfield TO excl_pos_tab-fieldname.
316
        COLLECT excl_rpl_tab.
317
        COLLECT excl_que_tab.
318
        COLLECT excl_pos_tab.
319
        CONTINUE.
320
      ELSEIF x_namtab-domname EQ vim_scrform_domain.
321
*        ASSIGN <table1>+x_namtab-position(x_namtab-flength)
322
*                    TO <vim_scrform_name>.
323
        ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE <table1>
324
         TO <vim_scrform_name>.
325
        ADD 1 TO vim_nbr_of_scrfrm_pointers.
326
      ELSEIF x_namtab-domname IN vim_guid_domain.
327
        MOVE x_namtab-viewfield TO excl_rpl_tab-fieldname.
328
        MOVE x_namtab-viewfield TO excl_que_tab-fieldname.
329
        MOVE x_namtab-viewfield TO excl_pos_tab-fieldname.
330
        COLLECT excl_rpl_tab.
331
        COLLECT excl_que_tab.
332
        COLLECT excl_pos_tab.
333
        CONTINUE.
334
      ENDIF.
335
      CHECK initexclfldtabs NE space.
336
      CASE x_namtab-readonly.
337
        WHEN subset.
338
          MOVE x_namtab-viewfield TO excl_rpl_tab-fieldname.
339
          MOVE x_namtab-viewfield TO excl_que_tab-fieldname.
340
          APPEND excl_rpl_tab.
341
          APPEND excl_que_tab.
342
        WHEN usrexi.
343
*         check initexclfldtabs ne space.
344
          MOVE x_namtab-viewfield TO excl_rpl_tab-fieldname.
345
          MOVE x_namtab-viewfield TO excl_que_tab-fieldname.
346
          MOVE x_namtab-viewfield TO excl_pos_tab-fieldname.
347
          APPEND excl_rpl_tab.
348
          APPEND excl_que_tab.
349
          APPEND excl_pos_tab.
350
        WHEN vim_hidden.
351
          MOVE x_namtab-viewfield TO excl_rpl_tab-fieldname.
352
          MOVE x_namtab-viewfield TO excl_que_tab-fieldname.
353
          MOVE x_namtab-viewfield TO excl_pos_tab-fieldname.
354
          APPEND excl_rpl_tab.
355
          APPEND excl_que_tab.
356
          APPEND excl_pos_tab.
357
        WHEN rdonly.
358
          MOVE x_namtab-viewfield TO excl_rpl_tab-fieldname.
359
          APPEND excl_rpl_tab.
360
      ENDCASE.
361
    ENDLOOP.
362
  ENDIF.
363
  IF x_header-scrfrmflag NE space AND vim_nbr_of_scrfrm_pointers EQ 1.
364
    mark_functions-low = 'SCRF'. APPEND mark_functions.
365
  ELSE.
366
    DELETE mark_functions WHERE low EQ 'SCRF'.
367
  ENDIF.
368
  IF x_header-selection NE space AND initexclfldtabs NE space.
369
    i_fnameln-cnt = 1.
370
    LOOP AT dba_sellist WHERE ddic CO ddic_marks
371
                        AND ( negation EQ space AND operator EQ 'EQ' OR
372
                              negation EQ 'NOT' AND operator EQ 'NE' ).
373
      i_fnameln-name = dba_sellist-viewfield.
374
      COLLECT i_fnameln INTO i_fnametb.
375
    ENDLOOP.
376
    LOOP AT i_fnametb INTO i_fnameln WHERE cnt EQ 1.
377
      excl_rpl_tab-fieldname = i_fnameln-name.
378
      COLLECT excl_rpl_tab.
379
      excl_que_tab-fieldname = i_fnameln-name.
380
      COLLECT excl_que_tab.
381
    ENDLOOP.
382
  ENDIF.
383
  IF x_header-delmdtflag NE space.
384
    VIM_TDEP_TITLE = svim_text_104.
385
    CLEAR: vim_old_viewkey, vim_old_st_selected.          "SW wegen Vcl
386
    REFRESH vim_sval_tab. CLEAR vim_sval_tab.
387
    MOVE: x_header-viewname TO vim_sval_tab-tabname,
388
          x_header-maintview TO vim_begdate_name-tabname,
389
          x_header-maintview TO vim_enddate_name-tabname,
390
          'X' TO vim_sval_tab-field_obl,
391
          sy-datum TO vim_sval_tab-value.
392
    vim_begdate_name-dash = vim_enddate_name-dash = '-'.
393
    IF x_header-delmdtflag EQ 'E'.
394
      ASSIGN d0001_field_tab-end TO <key_date>.
395
    ELSE.
396
      ASSIGN d0001_field_tab-begin TO <key_date>.
397
    ENDIF.
398
    ASSIGN: vim_mainkey TO <vim_h_mkey> CASTING,
399
            vim_old_viewkey TO <vim_h_old_mkey> CASTING,
400
            vim_collapsed_mainkeys-mainkey TO <vim_h_coll_mkey> CASTING,
401
            vim_collapsed_mainkeys-log_key TO <vim_h_coll_logkey>
402
             CASTING,
403
            vim_collapsed_mainkeys-mkey_bf TO <vim_h_coll_bfkey>
404
             CASTING,
405
            vim_merged_entries-merged_key TO <vim_h_merged_key> CASTING.
406
    LOOP AT x_namtab WHERE domname EQ vim_delim_date_domain
407
                       AND ( rollname IN vim_begda_types OR
408
                             rollname IN vim_endda_types ).
409
      IF x_namtab-rollname IN vim_begda_types.
410
* begin date
411
        IF x_header-delmdtflag EQ 'E'.
412
* end date is key field
413
          IF x_namtab-texttabfld EQ space.
414
*            ASSIGN: <table1>+x_namtab-position(x_namtab-flength)
415
*                                   TO <vim_new_begdate> TYPE 'D',
416
*                    <table1>+x_namtab-position(x_namtab-flength)
417
*                                   TO <vim_begdate_mask> TYPE 'C'.
418
            ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE <table1>
419
             TO <vim_new_begdate>.
420
            ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE <table1>
421
             TO <vim_begdate_mask> CASTING TYPE c.
422
            MOVE: x_namtab-viewfield TO vim_sval_tab-fieldname,
423
                  x_namtab-viewfield TO vim_begdate_name-fieldname.
424
            vim_begdate_is_ro = x_namtab-readonly.
425
          ENDIF.
426
        ELSE.
427
* begin date is key field
428
          CHECK keydate_alr_assigned EQ space.
429
          keydate_alr_assigned = 'X'.
430
          IF x_namtab-texttabfld EQ space.
431
*            ASSIGN: <table1>+x_namtab-position(x_namtab-flength)
432
*                                   TO <vim_enddate_mask> TYPE 'C'.
433
            ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE <table1>
434
             TO <vim_enddate_mask> CASTING TYPE c.
435
            IF x_namtab-position GT 0.
436
              IF x_header-generictrp <> 'X'.
437
** charlike key or non-unicode-system (FS is only assigned for
438
** downward compatibility).
439
                length = x_namtab-position
440
                          DIV cl_abap_char_utilities=>charsize.
441
                ASSIGN: <table1>(length)
442
                         TO <vim_f1_before> CASTING TYPE c,
443
                        vim_mainkey(length)
444
                          TO <vim_mkey_before> CASTING TYPE c,
445
                        vim_old_viewkey(length)
446
                          TO <vim_old_mkey_before> CASTING TYPE c.
447
              ENDIF.
448
              IF NOT ( <vim_f1_before> IS ASSIGNED
449
                       OR <vim_mkey_before> IS ASSIGNED
450
                       OR <vim_old_mkey_before> IS ASSIGNED ).
451
** could not be assigned because unicode flag is set in function
452
** group and key is non charlike
453
                ASSIGN: <table1_x>(x_namtab-position)
454
                         TO <vim_f1_before> CASTING TYPE x,
455
                        <vim_h_mkey>(x_namtab-position)
456
                          TO <vim_mkey_before> CASTING TYPE x,
457
                        <vim_h_old_mkey>(x_namtab-position)
458
                          TO <vim_old_mkey_before> CASTING TYPE x.
459
              ENDIF.
460
              ASSIGN: <table1_x>(x_namtab-position)
461
                       TO <vim_f1_beforex>,
462
                      <vim_h_mkey>(x_namtab-position)
463
                        TO <vim_mkey_beforex>,
464
                      <vim_h_old_mkey>(x_namtab-position)
465
                        TO <vim_old_mkey_beforex>,
466
                      <vim_h_coll_bfkey>(x_namtab-position)
467
                        TO <vim_collapsed_mkey_bfx>.
468
              CLEAR vim_no_mainkey_exists.
469
            ELSE.
470
              ASSIGN: vim_dummy_mainkey TO <vim_mkey_before> TYPE 'C',
471
                      <vim_mkey_before> TO <vim_old_mkey_before>,
472
                      <vim_mkey_before> TO <vim_f1_before>,
473
                      vim_dummy_mainkey TO <vim_mkey_beforex> CASTING,
474
                      <vim_mkey_beforex> TO <vim_old_mkey_beforex>,
475
                      <vim_mkey_beforex> TO <vim_f1_beforex>,
476
                      <vim_mkey_beforex> TO <vim_collapsed_mkey_bfx>.
477
              vim_no_mainkey_exists = 'X'.
478
            ENDIF.
479
            MOVE x_namtab-viewfield TO vim_enddate_name-fieldname.
480
            PERFORM vim_assign_mainkey_after USING sy-tabix.
481
          ENDIF.
482
        ENDIF.                         "x_header-delmdtflag eq 'E'
483
      ELSE.
484
* end date
485
        IF x_header-delmdtflag EQ 'E'.
486
* end date is key field
487
          CHECK keydate_alr_assigned EQ space.
488
          keydate_alr_assigned = 'X'.
489
          IF x_namtab-texttabfld EQ space.
490
*            ASSIGN: <table1>+x_namtab-position(x_namtab-flength)
491
*                                   TO <vim_enddate_mask> TYPE 'C'.
492
            ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE <table1>
493
             TO <vim_enddate_mask> CASTING TYPE c.
494
            IF x_namtab-position GT 0.
495
              IF x_header-generictrp <> 'X'.
496
** charlike key or non-unicode-system (FS is only assigned for
497
** downward compatibility).
498
                length = x_namtab-position
499
                          DIV cl_abap_char_utilities=>charsize.
500
                ASSIGN: <table1>(length)
501
                         TO <vim_f1_before> CASTING TYPE c,
502
                        vim_mainkey(length)
503
                          TO <vim_mkey_before> CASTING TYPE c,
504
                        vim_old_viewkey(length)
505
                          TO <vim_old_mkey_before> CASTING TYPE c.
506
              ENDIF.
507
              IF NOT ( <vim_f1_before> IS ASSIGNED
508
                       OR <vim_mkey_before> IS ASSIGNED
509
                       OR <vim_old_mkey_before> IS ASSIGNED ).
510
** could not be assigned because unicode flag is set in function
511
** group and key is non charlike
512
                ASSIGN: <table1_x>(x_namtab-position)
513
                         TO <vim_f1_before> CASTING TYPE x,
514
                        vim_mainkey(x_namtab-position)
515
                          TO <vim_mkey_before> CASTING TYPE x,
516
                        vim_old_viewkey(x_namtab-position)
517
                          TO <vim_old_mkey_before> CASTING TYPE x.
518
              ENDIF.
519
              ASSIGN: <table1_x>(x_namtab-position)
520
                       TO <vim_f1_beforex>,
521
                      <vim_h_mkey>(x_namtab-position)
522
                        TO <vim_mkey_beforex>,
523
                      <vim_h_old_mkey>(x_namtab-position)
524
                        TO <vim_old_mkey_beforex>,
525
                      <vim_h_coll_bfkey>(x_namtab-position)
526
                        TO <vim_collapsed_mkey_bfx>.
527
*              ASSIGN: <table1>(x_namtab-position)
528
*                                     TO <vim_f1_before> TYPE 'C',
529
*                      vim_mainkey(x_namtab-position)
530
*                                     TO <vim_mkey_before> TYPE 'C',
531
*                      vim_old_viewkey(x_namtab-position)
532
*                                     TO <vim_old_mkey_before> TYPE 'C'.
533
              CLEAR vim_no_mainkey_exists.
534
            ELSE.
535
              ASSIGN: vim_dummy_mainkey TO <vim_mkey_before> TYPE 'C',
536
                      <vim_mkey_before> TO <vim_old_mkey_before>,
537
                      <vim_mkey_before> TO <vim_f1_before>,
538
                      vim_dummy_mainkey TO <vim_mkey_beforex> CASTING,
539
                      <vim_mkey_beforex> TO <vim_old_mkey_beforex>,
540
                      <vim_mkey_beforex> TO <vim_f1_beforex>,
541
                      <vim_mkey_beforex> TO <vim_collapsed_mkey_bfx>.
542
              vim_no_mainkey_exists = 'X'.
543
            ENDIF.
544
            MOVE x_namtab-viewfield TO vim_enddate_name-fieldname.
545
            PERFORM vim_assign_mainkey_after USING sy-tabix.
546
          ENDIF.
547
        ELSE.
548
* begin date is key field
549
          IF x_namtab-texttabfld EQ space.
550
*            ASSIGN: <table1>+x_namtab-position(x_namtab-flength)
551
*                                   TO <vim_new_begdate> TYPE 'D',
552
*                    <table1>+x_namtab-position(x_namtab-flength)
553
*                                   TO <vim_begdate_mask> TYPE 'C'.
554
            ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE <table1>
555
             TO <vim_new_begdate>.
556
            ASSIGN COMPONENT x_namtab-viewfield OF STRUCTURE <table1>
557
             TO <vim_begdate_mask> CASTING TYPE c.
558
            MOVE: x_namtab-viewfield TO vim_sval_tab-fieldname,
559
                  x_namtab-viewfield TO vim_begdate_name-fieldname.
560
            vim_begdate_is_ro = x_namtab-readonly.
561
          ENDIF.
562
        ENDIF.                         "x_header-delmdtflag eq 'E'
563
      ENDIF.
564
    ENDLOOP.
565
    APPEND vim_sval_tab.
566
    CONDENSE: vim_begdate_name NO-GAPS, vim_enddate_name NO-GAPS.
567
    MOVE: x_header-viewname TO vim_memory_id_1-viewname,
568
          sy-uname          TO vim_memory_id_1-user.
569
    IMPORT vim_collapsed_mainkeys FROM MEMORY ID vim_memory_id_1.
570
    IF sy-subrc NE 0.
571
      REFRESH vim_collapsed_mainkeys.
572
    ENDIF.
573
    ASSIGN: <vim_h_coll_mkey>(x_header-keylen)
574
                              TO <vim_collapsed_keyx>,
575
            <vim_h_coll_logkey>(x_header-keylen)
576
                              TO <vim_collapsed_logkeyx>,
577
            <vim_h_merged_key>(x_header-keylen)
578
                              TO <vim_merged_keyx>.
579
    IF x_header-generictrp <> 'X'.
580
      ASSIGN: vim_collapsed_mainkeys-mainkey(x_header-keylen)
581
                                    TO <vim_collapsed_key>,
582
              vim_collapsed_mainkeys-log_key(x_header-keylen)
583
                                    TO <vim_collapsed_logkey>,
584
              vim_merged_entries-merged_key(x_header-keylen)
585
                                    TO <vim_merged_key>.
586
    ELSE.
587
      ASSIGN: <vim_collapsed_keyx> TO <vim_collapsed_key>,
588
              <vim_collapsed_logkeyx> TO <vim_collapsed_logkey>,
589
              <vim_merged_keyx> TO <vim_merged_key>.
590
    ENDIF.
591
  ENDIF.                               "x_header-delmdtflag ne space
592
* if necessary. -> how to decide this ? X_HEADER-PTFRKYEXST, later
593
  ASSIGN vim_mainkey(x_header-keylen) TO <vim_mainkey_mask>.
594
  CLEAR vim_prtfky_assigned.
595
* endif.
596
* consider clusters in transport defaults
597
  IF vim_called_by_cluster NE space.
598
    master_type = vim_clus_type.
599
    master_name = vim_calling_cluster.
600
  ENDIF.
601
* set transport defaults.....
602
  MOVE: transporter   TO e071-pgmid,
603
        master_type   TO e071-object,
604
        master_name   TO e071-obj_name,
605
        e071_objfunc  TO e071-objfunc,
606
        transporter   TO e071k-pgmid,
607
        transp_object TO e071k-object,
608
        space         TO e071k-as4pos,
609
        master_type   TO e071k-mastertype,
610
        master_name   TO e071k-mastername,
611
        space         TO e071k-objfunc,
612
        space         TO e071k-flag.
613
  PERFORM vim_get_img_activity
614
   CHANGING e071k-activity.           "UF738595/2001
615
  IF x_header-existency EQ space OR x_header-existency EQ 'M'.
616
    MOVE sortflag_with_existency TO e071k-sortflag.
617
  ELSE.
618
    MOVE sortflag_without_existency TO e071k-sortflag.
619
  ENDIF.
620
  REFRESH vim_corr_objtab. CLEAR vim_corr_obj_viewname.
621
  IF x_header-texttbexst <> space.     "SW Texttransl
622
    PERFORM vim_initialize_texttab.
623
    vim_texttab_is_ro = 'X'.
624
    LOOP AT x_namtab WHERE keyflag EQ space
625
                       AND bastabname EQ x_header-texttab
626
                       AND readonly NE rdonly.
627
      CLEAR vim_texttab_is_ro.
628
      EXIT.
629
    ENDLOOP.
630
  ENDIF.
631
  CLEAR looplines.
632
* possible to select profiles?
633
  vim_coming_from_img = 'N'.
634
  IF vim_called_by_cluster = space.
635
*    IF x_header-adrnbrflag = space.
636
*      CALL FUNCTION 'SCPR_MEMORY_FLAG'
637
*        IMPORTING
638
*          coming_from_img = vim_coming_from_img.
639
*    ENDIF.
640
  ELSE.
641
    CALL FUNCTION 'VIEWCLUSTER_PR_IMPORT_CTRL'
642
      EXPORTING
643
        viewname        = x_header-viewname
644
        action          = 'P'
645
      CHANGING
646
        coming_from_img = vim_coming_from_img
647
      EXCEPTIONS
648
        wrong_parameter = 1
649
        OTHERS          = 2.
650
  ENDIF.
651
  last_view_info = view_name.
652
  PERFORM vim_maint_selflag USING    'I'
653
                            CHANGING x_header-selection.
654
ENDFORM.                    "initialisieren
655
 
656
*---------------------------------------------------------------------*
657
*       FORM VIM_INITIALIZE_TEXTTAB                                   *
658
*---------------------------------------------------------------------*
659
* Initialisierung vin <VIM_TEXTTAB> und <VIM_READ_LANGUS>
660
*---------------------------------------------------------------------*
661
FORM vim_initialize_texttab.
662
  DATA: idx LIKE sy-tabix,
663
        texttab_l TYPE i.
664
 
665
  READ TABLE vim_texttab_container WITH KEY viewname = view_name
666
                                   BINARY SEARCH.
667
  vim_texttab_container_index = sy-tabix.
668
  IF sy-subrc <> 0.
669
    CLEAR vim_texttab_container-tabdata-valid_idx.
670
    REFRESH vim_texttab_container-tabdata-tab_us.
671
    REFRESH vim_texttab_container-tabdata-tab_vs.
672
    REFRESH vim_texttab_container-tabdata-tab_s.
673
    REFRESH vim_texttab_container-tabdata-tab_m.
674
    REFRESH vim_texttab_container-tabdata-tab_l.
675
    REFRESH vim_texttab_container-tabdata-tab_vl.
676
    REFRESH vim_texttab_container-tabdata-tab_ul.
677
    REFRESH vim_texttab_container-sel_langus.
678
    CLEAR vim_texttab_container.
679
 
680
    vim_texttab_container-viewname = view_name.
681
*   Texttabellenbreite bestimmen
682
    texttab_l = ( x_header-after_keyc + x_header-aft_txttbc )
683
                 / cl_abap_char_utilities=>charsize + 1.
684
*    texttab_l = x_header-keylen + x_header-texttablen + 1.
685
    IF texttab_l LE ultra_short_tab.
686
      vim_texttab_container-tabdata-valid_idx = 2.
687
    ELSEIF texttab_l LE very_short_tab.
688
      vim_texttab_container-tabdata-valid_idx = 3.
689
    ELSEIF texttab_l LE short_tab.
690
      vim_texttab_container-tabdata-valid_idx = 4.
691
    ELSEIF texttab_l LE middle_tab.
692
      vim_texttab_container-tabdata-valid_idx = 5.
693
    ELSEIF texttab_l LE long_tab.
694
      vim_texttab_container-tabdata-valid_idx = 6.
695
    ELSEIF texttab_l LE very_long_tab.
696
      vim_texttab_container-tabdata-valid_idx = 7.
697
    ELSEIF texttab_l LE ultra_long_tab.
698
      vim_texttab_container-tabdata-valid_idx = 8.
699
    ENDIF.
700
    INSERT vim_texttab_container INDEX vim_texttab_container_index.
701
  ENDIF.
702
  idx = vim_texttab_container-tabdata-valid_idx.
703
  ASSIGN COMPONENT idx OF STRUCTURE
704
         vim_texttab_container-tabdata TO <vim_texttab>.
705
  ASSIGN vim_texttab_container-sel_langus TO <vim_read_langus>.
706
ENDFORM.                               "VIM_INITIALIZE_TEXTTAB
707
*&---------------------------------------------------------------------*
708
*&      Form  vim_fill_vim_guid_domain
709
*&---------------------------------------------------------------------*
710
*       text
711
*----------------------------------------------------------------------*
712
*  -->  p1        text
713
*  <--  p2        text
714
*----------------------------------------------------------------------*
715
FORM vim_fill_vim_guid_domain.
716
  MOVE: 'I'   TO vim_guid_domain-sign,
717
        'EQ'  TO vim_guid_domain-option.
718
  MOVE 'SYSUUID' TO vim_guid_domain-low. APPEND vim_guid_domain.
719
  MOVE 'SYSUUID_C' TO vim_guid_domain-low. APPEND vim_guid_domain.
720
  MOVE 'SYSUUID_22' TO vim_guid_domain-low. APPEND vim_guid_domain.
721
  MOVE 'SYSUUID_25' TO vim_guid_domain-low. APPEND vim_guid_domain.
722
ENDFORM.                    " vim_fill_vim_guid_domain
723
*&---------------------------------------------------------------------*
724
*&      Form  vim_set_init_from_sellist
725
*&---------------------------------------------------------------------*
726
*       If sellist defines values unambiguously, set them into initial
727
*       WA.
728
*----------------------------------------------------------------------*
729
*      -->P_TABNAME   tabname
730
*      -->P_NAMTAB[]  nametab info
731
*      -->P_SELLIST   selection
732
*      <--P_INIT      initial view-wa
733
*----------------------------------------------------------------------*
734
FORM vim_set_init_from_sellist USING    p_tabname TYPE tabname
735
                                        p_namtab LIKE x_namtab[]
736
                                        p_sellist LIKE dba_sellist[]
737
                                        p_maintdesc TYPE vfldroflag
738
                               CHANGING p_init TYPE any.
739
 
740
  DATA: count TYPE i, h_ix TYPE i, rcode TYPE xfeld,
741
        tabfld TYPE tabfield.
742
  FIELD-SYMBOLS: <namtab> TYPE vimnamtab, <sel_wa> TYPE vimsellist,
743
                 <value> TYPE ANY.
744
 
745
  LOOP AT p_namtab ASSIGNING <namtab> WHERE readonly = p_maintdesc.
746
    CLEAR: rcode, count, h_ix.
747
    LOOP AT p_sellist ASSIGNING <sel_wa>
748
     WHERE viewfield EQ <namtab>-viewfield
749
           AND ( negation EQ space AND operator EQ 'EQ' OR
750
                 negation EQ 'NOT' AND operator EQ 'NE' )
751
           AND ( ddic      CO 'XB' OR
752
                 ddic      CO 'SB' ).
753
      ADD 1 TO count.
754
      CHECK <sel_wa>-and_or EQ space OR <sel_wa>-and_or EQ 'AND'.
755
      rcode = 'X'. h_ix = sy-tabix.
756
    ENDLOOP.
757
    IF rcode = space OR count > 1.
758
      CLEAR: rcode, count.
759
      LOOP AT p_sellist ASSIGNING <sel_wa>
760
       WHERE viewfield EQ <namtab>-viewfield
761
        AND ( negation EQ space AND operator EQ 'EQ' OR
762
                   negation EQ 'NOT' AND operator EQ 'NE' )
763
             AND ( ddic EQ 'A' ).
764
        ADD 1 TO count.
765
        CHECK <sel_wa>-and_or EQ space OR <sel_wa>-and_or EQ 'AND'.
766
        rcode = 'X'. h_ix = sy-tabix.
767
      ENDLOOP.
768
    ENDIF.
769
    IF rcode <> space AND count = 1.
770
     ASSIGN COMPONENT <namtab>-viewfield OF STRUCTURE p_init TO <value>.
771
      CHECK sy-subrc = 0.
772
      tabfld-tabname = p_tabname.
773
      tabfld-fieldname = tabfld-lfieldname = <namtab>-viewfield.
774
      CALL FUNCTION 'RS_CONV_EX_2_IN'
775
        EXPORTING
776
          input_external  = <sel_wa>-value
777
          table_field     = tabfld
778
        IMPORTING
779
          output_internal = <value>
780
        EXCEPTIONS
781
          OTHERS          = 1.
782
      IF sy-subrc <> 0.
783
        CLEAR <value>.
784
      ENDIF.
785
    ENDIF.
786
  ENDLOOP.
787
ENDFORM.                    " vim_set_init_from_sellist
788
*&---------------------------------------------------------------------*
789
*&      Form  vim_fill_date_type
790
*&---------------------------------------------------------------------*
791
*       text
792
*----------------------------------------------------------------------*
793
*  -->  p1        text
794
*  <--  p2        text
795
*----------------------------------------------------------------------*
796
FORM vim_fill_date_type.
797
 
798
  MOVE: 'I'   TO vim_begda_types-sign,
799
        'EQ'  TO vim_begda_types-option.
800
  MOVE vim_begdate_dtel1 TO vim_begda_types-low. APPEND vim_begda_types.
801
  MOVE vim_begdate_dtel2 TO vim_begda_types-low. APPEND vim_begda_types.
802
  MOVE vim_begdate_dtel3 TO vim_begda_types-low. APPEND vim_begda_types.
803
  MOVE vim_begdate_dtel4 TO vim_begda_types-low. APPEND vim_begda_types.
804
  MOVE vim_enddate_dtel1 TO vim_begda_types-low.
805
  APPEND vim_begda_types TO vim_endda_types.
806
  MOVE vim_enddate_dtel2 TO vim_begda_types-low.
807
  APPEND vim_begda_types TO vim_endda_types.
808
  MOVE vim_enddate_dtel3 TO vim_begda_types-low.
809
  APPEND vim_begda_types TO vim_endda_types.
810
  MOVE vim_enddate_dtel4 TO vim_begda_types-low.
811
  APPEND vim_begda_types TO vim_endda_types.
812
ENDFORM.                    " vim_fill_date_type