Properties SourceCde
txt
1
*---------------------------------------------------------------------*
2
*       FORM CALL_DYNPRO                                              *
3
*---------------------------------------------------------------------*
4
*       UF170200: transp. mode: don't fill CORR_KEYTAB-TABKEY with
5
*                 more than 120 chars
6
*
7
*---------------------------------------------------------------------*
8
FORM call_dynpro.
9
  DATA: state_init TYPE c, rc LIKE sy-subrc,
10
        dpl_sel_entries TYPE i, cd_specmode_safe(1) TYPE c,
11
        addr_e071k LIKE e071k, cd_addr_71ktab LIKE e071k OCCURS 0,
12
        object_key TYPE ad_objkey,
13
        max_trsp_keylength_in_byte type i.
14
 
15
  field-symbols: <object_keyx> type x.
16
 
17
  max_trsp_keylength_in_byte = vim_max_trsp_keylength
18
   * cl_abap_char_utilities=>charsize.
19
  CASE vim_adjust_middle_level_mode.
20
    WHEN space.
21
    WHEN subset OR 'X'.
22
      vim_special_mode = vim_direct_upgrade.
23
      IF vim_adjust_middle_level_mode EQ subset.
24
        x_namtab[] = vim_adj_namtab.
25
      ENDIF.
26
    WHEN 'L'.
27
      CLEAR vim_adjust_middle_level_mode. function = 'ENDE'.
28
      EXIT.
29
  ENDCASE.
30
* IF <STATUS>-ALR_SETUP EQ SPACE.
31
  IF <status>-initializd EQ space.
32
    PERFORM init_state_vector.
33
  ENDIF.
34
  DESCRIBE TABLE dpl_sellist LINES dpl_sel_entries.
35
  IF x_header-selection EQ space.
36
    IF dpl_sel_entries GT 0.
37
      MOVE 'X' TO x_header-selection.
38
      MODIFY x_header INDEX 1.
39
      ASSIGN dpl_sellist-*sys* TO <vim_ck_sellist>.
40
    ELSE.
41
      DESCRIBE TABLE dba_sellist.
42
      IF sy-tfill GT 0.
43
        MOVE 'X' TO x_header-selection.
44
        MODIFY x_header INDEX 1.
45
*       ASSIGN DBA_SELLIST-*SYS* TO <VIM_CK_SELLIST>.
46
      ENDIF.
47
      ASSIGN dba_sellist-*sys* TO <vim_ck_sellist>.
48
    ENDIF.
49
  ELSE.
50
    IF dpl_sel_entries GT 0.
51
      ASSIGN dpl_sellist-*sys* TO <vim_ck_sellist>.
52
    ELSE.
53
      ASSIGN dba_sellist-*sys* TO <vim_ck_sellist>.
54
    ENDIF.
55
  ENDIF.
56
  PERFORM vim_maint_selflag USING 'I'
57
                            CHANGING x_header-selection.
58
* Übergangslösung Sortierungsproblem Anfang
59
  IF <status>-alr_sorted EQ space.
60
    SORT total BY <vim_xtotal_key>.
61
    MOVE 'X' TO <status>-alr_sorted.
62
  ENDIF.
63
* Übergangslösung Sortierungsproblem Ende
64
  PERFORM exclude_cua_functions.
65
  IF x_header-frm_on_aut NE space AND  "4.5a: support indiv. auth. chck
66
     <status>-auth_check NE space.     "auth check is requested
67
    vim_auth_action = view_action.
68
    vim_auth_event = vim_auth_requested_check.
69
    ASSIGN <vim_ck_sellist> TO <vim_auth_sellist>.
70
    PERFORM (x_header-frm_on_aut) IN PROGRAM.
71
    IF vim_auth_rc NE 0.
72
      PERFORM vim_process_message USING vim_auth_msgid 'I' 'E'
73
                                        vim_auth_msgno
74
                                        vim_auth_msgv1 vim_auth_msgv2
75
                                        vim_auth_msgv3 vim_auth_msgv4.
76
      CASE vim_auth_rc.
77
        WHEN 4.                        "show only
78
          maint_mode = anzeigen.
79
          excl_cua_funct-function = 'AEND'. COLLECT excl_cua_funct.
80
        WHEN 8.                        "exit
81
          RAISE missing_corr_number.
82
      ENDCASE.
83
    ENDIF.
84
  ENDIF.
85
  IF maint_mode NE anzeigen AND maint_mode NE transportieren AND
86
     <status>-dlclalrckd EQ space.
87
    IF vim_system_type NE 'SAP' AND
88
       x_header-customauth CO sap_only_classes.
89
*     MESSAGE I137(SV). "keine Änderungen, Daten gehören SAP
90
      PERFORM vim_process_message USING 'SV' 'I' 'I' '137'
91
                                        space space space space.
92
    ENDIF.
93
    MOVE 'X' TO <status>-dlclalrckd.
94
  ENDIF.
95
  IF x_header-subsetflag NE space AND <status>-sbsid_rcvd CO ' R'.
96
    PERFORM init_subset_keyfields.
97
  ENDIF.
98
  IF x_header-selection NE space AND <status>-selcd_rcvd EQ space.
99
    LOOP AT dpl_sellist WHERE ddic EQ space OR ( operator EQ 'GE' OR
100
                                                 operator EQ 'GT' OR
101
                                                 operator EQ 'LE' OR
102
                                                 operator EQ 'LT' ).
103
      MOVE 'X' TO state_init.
104
      EXIT.
105
    ENDLOOP.
106
    IF sy-subrc NE 0. "no entries in DPL_SELLIST -> all entries req.
107
      DESCRIBE TABLE total.
108
      IF <status>-maxlines NE sy-tfill AND  "missing entries in EXTRACT
109
         <status>-st_data EQ gesamtdaten.   "and no selection made
110
        IF x_header-delmdtflag NE space.
111
*         DESCRIBE TABLE VIM_COLLAPSED_MAINKEYS. "SW int.M. 1599934/1999
112
*         IF <STATUS>-MAXLINES NE SY-TFILL."missing entries in EXTRACT
113
          IF <status>-maxlines = 0.    "SW int.M. 1599934/1999
114
            MOVE 'X' TO state_init.
115
          ENDIF.
116
        ELSE.
117
          MOVE 'X' TO state_init.
118
        ENDIF.
119
      ENDIF.
120
    ENDIF.
121
    IF state_init NE space.
122
      CLEAR: <status>-maxlines,
123
             <status>-cur_field,
124
             <status>-cur_offset.
125
      MOVE: 1 TO <status>-cur_line,
126
            1 TO <status>-firstline,
127
            nicht_geloescht TO <status>-st_delete,
128
            maint_mode TO <status>-st_action,
129
            list_bild TO <status>-st_mode.
130
      PERFORM set_status_nokeyselcnds.
131
    ENDIF.
132
    MOVE 'X' TO <status>-selcd_rcvd.
133
  ENDIF.
134
  IF <status>-initializd EQ 'x'.
135
    PERFORM set_status_nokeyselcnds.
136
  ENDIF.
137
  IF maint_mode NE anzeigen AND
138
     corr_nbr NE space AND corr_nbr NE <status>-corr_nbr.
139
    MOVE: <status>-corr_nbr TO <status>-l_corr_nbr,
140
          corr_nbr TO <status>-corr_nbr.
141
  ENDIF.
142
  IF maint_mode EQ transportieren.
143
    PERFORM request_corr_number.
144
    IF x_header-flag EQ vim_transport_denied.
145
      MESSAGE i142(sv).
146
      function = ucomm = end. EXIT.
147
    ENDIF.
148
  ELSEIF maint_mode EQ aendern.
149
    PERFORM check_transp_objs_for_maint USING rc.
150
    CASE rc.
151
      WHEN 4.
152
        maint_mode = anzeigen.
153
        excl_cua_funct-function = 'AEND'. COLLECT excl_cua_funct.
154
      WHEN 8.
155
        RAISE missing_corr_number.
156
    ENDCASE.
157
  ELSE.
158
    vim_client_state = vim_noact.
159
  ENDIF.
160
  MOVE: maint_mode          TO status-action,
161
        <status>-st_delete  TO status-delete,
162
        <status>-st_data    TO status-data,
163
        <status>-title      TO title,
164
        <status>-firstline  TO firstline,
165
        <status>-mk_xt      TO mark_extract,
166
        <status>-mk_to      TO mark_total,
167
        <status>-cur_line   TO l,
168
        <status>-cur_field  TO f,
169
        <status>-cur_offset TO o,
170
        <status>-maxlines   TO maxlines,
171
        maint_mode          TO title-action,
172
        firstline           TO nextline.
173
  IF status-action EQ aendern AND   "ignore history when mode was chngd.
174
     <status>-st_action EQ hinzufuegen.
175
    MOVE: <status>-st_action TO status-action,
176
          <status>-st_action TO title-action.
177
  ENDIF.
178
  IF <status>-st_delete EQ geloescht.
179
    DESCRIBE TABLE extract LINES maxlines.
180
    IF maxlines EQ 0.
181
      CLEAR status-delete.
182
      MOVE list_bild TO <status>-st_mode.
183
    ENDIF.
184
  ELSEIF <status>-st_mode = detail_bild"SW (1248405/98) ..
185
     AND <status>-st_action <> hinzufuegen.
186
    DESCRIBE TABLE extract LINES maxlines.
187
    IF maxlines EQ 0.
188
      MOVE list_bild TO <status>-st_mode.
189
*    nur ein Eintrag  -> automatisch wieder auf Detailbild verzweigt
190
*    mehrere Einträge -> Listbild, da kein Eintrag ausgezeichnet
191
    ENDIF.                             ".. SW
192
  ENDIF.
193
  IF ( status-action EQ transportieren AND                  "UF28042000
194
      <status>-l_corr_nbr NE <status>-corr_nbr )
195
   OR ( vim_client_state EQ vim_log AND 'ST' NS status-action ) .
196
    PERFORM prepare_corr.
197
  ENDIF.
198
  IF status-action EQ transportieren AND get_corr_keytab NE space.
199
    PERFORM get_keytab.
200
  ENDIF.
201
  IF status-action EQ transportieren AND <status>-crcntsknwn EQ space.
202
    LOOP AT vim_addr_e071k_tab INTO addr_e071k.
203
      addr_e071k-trkorr = <status>-corr_nbr.
204
      MODIFY vim_addr_e071k_tab FROM addr_e071k.
205
    ENDLOOP.
206
    LOOP AT total.    "note entries already contained in CORR_KEYTAB
207
      MOVE <vim_total_struc> TO <table1>.
208
      IF x_header-bastab EQ space.     "view
209
        PERFORM (corr_formname) IN PROGRAM (sy-repid) USING pruefen rc.
210
      ELSE.                            "base table
211
        corr_keytab =  e071k.
212
        corr_keytab-objname = x_header-maintview.
213
        IF x_header-keylen GT max_trsp_keylength_in_byte.
214
*        IF x_header-keylen GT vim_max_trsp_keylength.     "UF170200b
215
          MOVE <vim_xtotal_key> TO <vim_corr_keyx>(x_header-maxtrkeyln).
216
*          MOVE total TO corr_keytab-tabkey(x_header-maxtrkeyln).
217
        ELSE.                          "UF170200e
218
          MOVE <vim_xtotal_key> TO <vim_corr_keyx>(x_header-keylen).
219
*          MOVE total TO corr_keytab-tabkey(x_header-keylen).
220
        ENDIF.                                              "UF170200
221
        PERFORM update_corr_keytab USING pruefen rc.
222
        IF rc EQ 0.
223
          IF x_header-texttbexst NE space AND  "text table
224
             <vim_xtotal_text> NE <text_initial_x>.
225
*             <total_text> NE <text_initial>.
226
            corr_keytab =  e071k.
227
            corr_keytab-objname = x_header-texttab.
228
            IF x_header-textkeylen GT max_trsp_keylength_in_byte.
229
*           IF x_header-textkeylen GT vim_max_trsp_keylength. "UF170200b
230
              MOVE <vim_xtotal_text> TO
231
                             <vim_corr_keyx>(x_header-maxtrkeyln).
232
*              MOVE <total_text> TO
233
*                             corr_keytab-tabkey(x_header-maxtrtxkln).
234
            ELSE.                      "UF170200e
235
              MOVE <vim_xtotal_text> TO
236
                             <vim_corr_keyx>(x_header-textkeylen).
237
*              MOVE <total_text> TO
238
*                             corr_keytab-tabkey(x_header-textkeylen).
239
            ENDIF.                                          "UF170200
240
            PERFORM update_corr_keytab USING pruefen rc.
241
          ENDIF.
242
        ENDIF.
243
      ENDIF.
244
      IF rc = 0 AND x_header-texttbexst <> space AND "SW Texttransl ..
245
        vim_texttab_is_ro EQ space.
246
        PERFORM vim_text_keytab_entry USING <vim_xtotal_key> pruefen rc.
247
      ENDIF.                           ".. Texttransl
248
      IF rc EQ 0.
249
        MOVE transportieren TO <action>.
250
        IF x_header-adrnbrflag EQ 'O' AND <address_number> NE space.
251
          PERFORM vim_address_keytab_entries USING pruefen rc.
252
        ELSEIF x_header-adrnbrflag EQ 'N' AND <address_number> NE space.
253
          APPEND LINES OF vim_addr_e071k_tab TO cd_addr_71ktab.
254
          assign object_key to <object_keyx> casting.
255
          move <vim_xtotal_key> to <object_keyx>(x_header-keylen).
256
*          object_key = <vim_total_key>.
257
          CALL FUNCTION 'ADDR_TRANSPORT_ENTRIES'
258
               EXPORTING
259
                    addrnumber = <address_number>
260
                    table_name = vim_addr_basetable
261
                    field_name = vim_addr_bastab_field
262
                    objkey     = object_key
263
               TABLES
264
                    e071k_tab  = cd_addr_71ktab.
265
          vim_exit_11_12_active = 'X'.
266
          LOOP AT cd_addr_71ktab INTO corr_keytab WHERE
267
           mastername = vim_addr_e071k_master_46 or    "UF688403/2000
268
           mastername = vim_addr_e071k_master.
269
* Rel < 4.6A: ignore old type address entries inserted only for downward
270
*             compatibility
271
            PERFORM update_corr_keytab USING pruefen rc.
272
            IF rc NE 0. EXIT. ENDIF.
273
          ENDLOOP.
274
          CLEAR vim_exit_11_12_active.
275
        ENDIF.
276
        IF rc EQ 0.
277
          IF x_header-frm_e071ks NE space.
278
            vim_exit_11_12_active = 'X'.
279
            MOVE pruefen TO corr_action.
280
            PERFORM (x_header-frm_e071ks) IN PROGRAM (sy-repid).
281
            IF sy-subrc NE 0. CLEAR <action>. ENDIF.
282
            CLEAR vim_exit_11_12_active.
283
          ENDIF.
284
        ELSE.
285
          CLEAR <action>.
286
        ENDIF.
287
      ELSE.
288
        CLEAR <action>.
289
      ENDIF.
290
      IF maxlines GT 0 AND
291
         vim_special_mode NE vim_extedit.                "SW 1.4.1998
292
        READ TABLE extract WITH KEY <f1_x>.
293
        IF sy-subrc EQ 0.
294
          MOVE: <mark> TO <xmark>, <action> TO <xact>.
295
          MODIFY extract INDEX sy-tabix.
296
        ENDIF.
297
      ENDIF.
298
      MODIFY total.
299
    ENDLOOP.
300
    MOVE 'X' TO <status>-crcntsknwn.
301
  ENDIF.
302
  IF vim_restore_mode NE space.
303
    status-mode = <status>-st_mode.
304
    CLEAR vim_restore_mode.
305
    EXIT.
306
  ENDIF.
307
  IF vim_special_mode NE vim_extedit.
308
    CASE vim_single_entry_function.
309
      WHEN space OR 'UPD' OR 'SHOW'.
310
        IF <status>-st_mode EQ detail_bild.
311
          MOVE: 'DETA' TO function,
312
                nextline TO firstline.
313
          nextline = firstline + l - 1.
314
          DESCRIBE TABLE extract LINES maxlines.
315
          IF maxlines EQ 0.
316
            IF <status>-st_action EQ hinzufuegen.
317
              neuer = 'J'.
318
            ELSE.
319
              PERFORM fill_extract.
320
            ENDIF.
321
          ENDIF.
322
*         CALL SCREEN DETAIL.
323
          PERFORM process_detail_screen USING 'C'.
324
        ELSE.
325
          CALL SCREEN liste.
326
        ENDIF.
327
      WHEN 'INS'.
328
        function = 'NEWL'. PERFORM hinzufuegen.
329
      WHEN 'DEL'.
330
        cd_specmode_safe = vim_special_mode.
331
        vim_special_mode = vim_extedit.
332
        READ TABLE total INTO extract INDEX 1. <xact> = geloescht.
333
        APPEND extract.
334
        PERFORM vim_external_edit.
335
        vim_special_mode = cd_specmode_safe.
336
        excl_cua_funct-function = 'UNDO'. COLLECT excl_cua_funct.
337
        PERFORM selektiere USING geloescht.
338
    ENDCASE.
339
    MOVE: function TO ucomm.
340
* only relevant in viewcluster(navigation from detail screen):
341
    IF status-mode = detail_bild.
342
      last_act_entry = nextline.
343
    ELSE.
344
* navigation in viewcluster by tree-control: unuseable
345
      last_act_entry = <status>-firstline + <status>-cur_line - 1.
346
    ENDIF.
347
  ELSE.                                "ext. edit.
348
    PERFORM vim_external_edit.
349
    <status>-maxlines = 0.             "SW  int. Meldung 519239/1999
350
  ENDIF.
351
  IF function NE 'ORGD' AND function NE 'ORGL' AND
352
     function NE 'SAVE' AND function NE 'TRSP' AND function NE 'TRAE'.
353
    IF x_header-subsetflag NE space AND <status>-sbsid_rcvd NE 'S'.
354
      CLEAR <status>-sbsid_rcvd.
355
    ENDIF.
356
*   ELSEIF X_HEADER-SUBSETFLAG EQ SPACE AND
357
    IF x_header-selection NE space AND
358
       <status>-selcd_rcvd NE space.
359
      CLEAR <status>-selcd_rcvd.
360
    ENDIF.
361
    IF x_header-delmdtflag NE space.
362
      EXPORT vim_collapsed_mainkeys TO MEMORY ID vim_memory_id_1.
363
    ENDIF.
364
    ASSIGN dba_sellist-*sys* TO <vim_sellist>.
365
    vim_enqueue_range = x_header-subsetflag.
366
  ENDIF.
367
ENDFORM.