*---------------------------------------------------------------------* * FORM UPDATE_CORR * *---------------------------------------------------------------------* * update correction command file * * UF230499: no changing of X_HEADER-KEYLEN if key is to long for * transport. Move appropriate key length to KEYLEN instead. * UF170200: same for translated text fields *---------------------------------------------------------------------* * CORR_ACTION ->(glob) action: D - delete from, A - add to command file *---------------------------------------------------------------------* FORM update_corr. LOCAL: x_header. DATA: rc LIKE sy-subrc, fails TYPE i, flag TYPE c, rc1 LIKE sy-subrc, uc_addr_71ktab LIKE e071k OCCURS 0, addr_e071k LIKE e071k, object_key TYPE ad_objkey, keylen TYPE syfleng, txtkeylen TYPE syfleng, sys_type(10) TYPE c, texttab_wa TYPE REF TO data, max_trsp_keylength_in_byte type i. FIELD-SYMBOLS: TYPE x, TYPE ANY, TYPE x, TYPE ANY. CHECK maint_mode EQ aendern OR maint_mode EQ transportieren. CHECK x_header-flag NE vim_transport_denied. max_trsp_keylength_in_byte = vim_max_trsp_keylength * cl_abap_char_utilities=>charsize. CALL 'C_SAPGPARAM' ID 'NAME' FIELD 'transport/systemtype' ID 'VALUE' FIELD sys_type. IF x_header-keylen GT max_trsp_keylength_in_byte. keylen = x_header-maxtrkeyln. "UF230499 ELSE. "UF230499 keylen = x_header-keylen. "UF230499 ENDIF. IF x_header-textkeylen GT max_trsp_keylength_in_byte. txtkeylen = x_header-maxtrtxkln. "UF230499 ELSE. "UF230499 txtkeylen = x_header-textkeylen. "UF230499 ENDIF. IF x_header-adrnbrflag EQ 'N'. ASSIGN object_key TO CASTING. LOOP AT vim_addr_e071k_tab INTO addr_e071k. e071k-trkorr = -corr_nbr. ENDLOOP. ENDIF. IF status-action EQ transportieren. * force marked entries ************************************************************************ CHECK vim_client_state NE vim_local_clnt. IF status-mode EQ list_bild. * overview_screen IF ( x_header-frm_e071ks NE space OR x_header-flag EQ space ) AND vim_called_by_cluster NE space. PERFORM vim_store_state_info. CALL FUNCTION 'VIEWCLUSTER_TRANS_DEPENDENT' EXPORTING view_name = x_header-viewname action = corr_action status_mode = status-mode workarea = extract no_dialog = vim_external_mode corr_number = -corr_nbr. ENDIF. CLEAR counter. LOOP AT extract. CHECK EQ markiert. PERFORM move_extract_to_view_wa. IF x_header-flag EQ space. "standard logging required IF x_header-bastab EQ space. "view PERFORM (corr_formname) IN PROGRAM (sy-repid) USING corr_action rc. ELSE. "base table corr_keytab = e071k. corr_keytab-objname = x_header-maintview. MOVE TO (keylen). PERFORM update_corr_keytab USING corr_action rc. IF x_header-texttbexst NE space AND "base table with NE . "text table * only texttable's original language shall be transported internally corr_keytab = e071k. corr_keytab-objname = x_header-texttab. MOVE TO (txtkeylen). PERFORM update_corr_keytab USING corr_action rc1. IF rc1 EQ 0. MOVE rc1 TO rc. ENDIF. ENDIF. ENDIF. IF x_header-texttbexst <> space AND "SW Texttransl .. vim_texttab_is_ro EQ space. PERFORM vim_text_keytab_entry USING corr_action rc1. IF rc1 EQ 0. MOVE rc1 TO rc. ENDIF. ENDIF. ".. Texttransl IF x_header-adrnbrflag EQ 'O' AND NE space. PERFORM vim_address_keytab_entries USING corr_action rc1. IF rc1 EQ 0. MOVE rc1 TO rc. ENDIF. ELSEIF x_header-adrnbrflag EQ 'N' AND NE space. APPEND LINES OF vim_addr_e071k_tab TO uc_addr_71ktab. * object_key = . (keylen) = . "UF474925/2000 CALL FUNCTION 'ADDR_TRANSPORT_ENTRIES' EXPORTING addrnumber = table_name = vim_addr_basetable field_name = vim_addr_bastab_field objkey = object_key TABLES e071k_tab = uc_addr_71ktab. vim_exit_11_12_active = 'X'. LOOP AT uc_addr_71ktab INTO corr_keytab WHERE mastername = vim_addr_e071k_master_46 OR "UF688403/2000 mastername = vim_addr_e071k_master. * Rel < 4.6A: ignore old type address entries inserted only for downward * compatibility PERFORM update_corr_keytab USING corr_action rc1. IF rc1 EQ 0. MOVE rc1 TO rc. ENDIF. ENDLOOP. REFRESH uc_addr_71ktab. CLEAR vim_exit_11_12_active. ENDIF. ENDIF. "standard logging required IF x_header-frm_e071ks NE space. vim_exit_11_12_active = 'X'. PERFORM (x_header-frm_e071ks) IN PROGRAM (sy-repid). IF sy-subrc EQ 0. MOVE sy-subrc TO rc. ENDIF. CLEAR vim_exit_11_12_active. ELSE. IF x_header-frm_e071 NE space AND x_header-frm_e071ka EQ space. -keytbmodfd = 'X'. ENDIF. IF x_header-flag NE space. EXIT. ENDIF. ENDIF. IF rc NE 0. ADD 1 TO fails. IF replace_mode NE space. READ TABLE total WITH KEY BINARY SEARCH. = = nicht_markiert. MODIFY total INDEX sy-tabix. MODIFY extract. SUBTRACT: 1 FROM mark_total, 1 FROM mark_extract. ok_code = 'IGN '. ENDIF. ELSE. READ TABLE total WITH KEY BINARY SEARCH. = = nicht_markiert. * IF rc EQ 0. "??? UF222098 CASE corr_action. WHEN hinzufuegen. MOVE transportieren TO . WHEN geloescht. CLEAR . ENDCASE. = . * ENDIF. MODIFY total INDEX sy-tabix. MODIFY extract. SUBTRACT: 1 FROM mark_total, 1 FROM mark_extract. ENDIF. ADD 1 TO counter. ENDLOOP. IF counter GT fails. IF fails GT 0. MOVE 4 TO rc. ELSE. CLEAR rc. ENDIF. ELSE. MOVE 8 TO rc. ENDIF. IF replace_mode EQ space. IF corr_action EQ hinzufuegen. IF counter EQ 1. IF rc EQ 0. MESSAGE s098(sv) WITH -corr_nbr. "Eintr. in K. aufgen. ELSE. MESSAGE s107(sv) WITH -corr_nbr. "Eintr. schon enthal. ENDIF. ELSE. SUBTRACT fails FROM counter. CASE rc. WHEN 0. MESSAGE s105(sv) WITH counter -corr_nbr. "Eintr. in K. aufgen. WHEN 4. MESSAGE s109(sv) WITH counter fails -corr_nbr. "Eintr. schon enth. WHEN 8. MESSAGE s108(sv) WITH fails -corr_nbr. "Eintr. schon enth. ENDCASE. ENDIF. ELSE. IF counter EQ 1. IF rc EQ 0. MESSAGE s099(sv) WITH -corr_nbr. "Eintr.aus K. gelösch ELSE. MESSAGE s110(sv) WITH -corr_nbr. "Eintr. schon enthal. ENDIF. ELSE. SUBTRACT fails FROM counter. CASE rc. WHEN 0. MESSAGE s106(sv) WITH counter -corr_nbr. "Eintr. aus K. gelösch WHEN 4. MESSAGE s111(sv) WITH counter fails -corr_nbr. "Eintr. nicht enth. WHEN 8. MESSAGE s112(sv) WITH fails -corr_nbr. "Eintr. nicht enth. ENDCASE. ENDIF. ENDIF. ENDIF. "replace_mode eq space ELSE. * detail screen IF x_header-flag EQ space. * standard logging required IF x_header-bastab EQ space. * view PERFORM (corr_formname) IN PROGRAM (sy-repid) USING corr_action rc. ELSE. * base table corr_keytab = e071k. corr_keytab-objname = x_header-maintview. * MOVE TO corr_keytab-tabkey(x_header-keylen). MOVE TO (keylen). PERFORM update_corr_keytab USING corr_action rc. IF x_header-texttbexst NE space AND NE . * base table with text table corr_keytab = e071k. corr_keytab-objname = x_header-texttab. MOVE TO (txtkeylen). PERFORM update_corr_keytab USING corr_action rc1. IF rc1 EQ 0. MOVE rc1 TO rc. ENDIF. ENDIF. ENDIF. IF x_header-texttbexst <> space AND "SW Texttransl .. vim_texttab_is_ro EQ space. PERFORM vim_text_keytab_entry USING corr_action rc1. IF rc1 EQ 0. MOVE rc1 TO rc. ENDIF. ENDIF. ".. Texttransl IF x_header-adrnbrflag EQ 'O' AND NE space. PERFORM vim_address_keytab_entries USING corr_action rc1. IF rc1 EQ 0. MOVE rc1 TO rc. ENDIF. ELSEIF x_header-adrnbrflag EQ 'N' AND NE space. * transport addresses APPEND LINES OF vim_addr_e071k_tab TO uc_addr_71ktab. * object_key = . (keylen) = . CALL FUNCTION 'ADDR_TRANSPORT_ENTRIES' EXPORTING addrnumber = table_name = vim_addr_basetable field_name = vim_addr_bastab_field objkey = object_key TABLES e071k_tab = uc_addr_71ktab. vim_exit_11_12_active = 'X'. LOOP AT uc_addr_71ktab INTO corr_keytab WHERE mastername = vim_addr_e071k_master_46 OR "UF688403/2000 mastername = vim_addr_e071k_master. * Rel < 4.6A: ignore old type address entries inserted only for downward * compatibility PERFORM update_corr_keytab USING corr_action rc1. IF rc1 EQ 0. MOVE rc1 TO rc. ENDIF. ENDLOOP. REFRESH uc_addr_71ktab. CLEAR vim_exit_11_12_active. ENDIF. ENDIF. "standard logging required IF x_header-frm_e071ks NE space. vim_exit_11_12_active = 'X'. PERFORM (x_header-frm_e071ks) IN PROGRAM (sy-repid). IF sy-subrc EQ 0. MOVE sy-subrc TO rc. ENDIF. CLEAR vim_exit_11_12_active. ELSE. IF x_header-frm_e071 NE space AND x_header-frm_e071ka EQ space. IF x_header-flag NE space. -keytbmodfd = 'E'. ELSE. -keytbmodfd = 'X'. ENDIF. ENDIF. ENDIF. IF -keytbmodfd NE 'E'. IF vim_called_by_cluster NE space. PERFORM vim_store_state_info. CALL FUNCTION 'VIEWCLUSTER_TRANS_DEPENDENT' EXPORTING view_name = x_header-viewname action = corr_action status_mode = status-mode workarea = extract no_dialog = vim_external_mode corr_number = -corr_nbr. ENDIF. ELSE. -keytbmodfd = 'X'. ENDIF. READ TABLE total WITH KEY BINARY SEARCH. IF rc EQ 0. CASE corr_action. WHEN hinzufuegen. MOVE transportieren TO . WHEN geloescht. CLEAR . ENDCASE. = . MOVE 'X' TO flag. ELSE. IF replace_mode NE space. ok_code = 'IGN '. ENDIF. ENDIF. IF EQ markiert. = = nicht_markiert. SUBTRACT: 1 FROM mark_total, 1 FROM mark_extract. MOVE 'X' TO flag. ENDIF. IF flag NE space. MODIFY total INDEX sy-tabix. MODIFY extract INDEX nextline. ENDIF. IF replace_mode EQ space. IF corr_action EQ hinzufuegen. IF rc EQ 0. MESSAGE s098(sv) WITH -corr_nbr."Eintr. in K. aufg. ELSE. MESSAGE s107(sv) WITH -corr_nbr."Eintr. schon enthl. ENDIF. ELSE. IF rc EQ 0. MESSAGE s099(sv) WITH -corr_nbr."Eintr.aus K. gelösc ELSE. MESSAGE s110(sv) WITH -corr_nbr."Eintr. schon enthl. ENDIF. ENDIF. ENDIF. ENDIF. ELSE. * logging of changed entries *********************************************************************** CHECK vim_client_state EQ vim_log. corr_action = hinzufuegen. * REFRESH CORR_KEYTAB. "only delete all keys for current object LOOP AT vim_corr_objtab WHERE objfunc NE space. LOOP AT corr_keytab WHERE mastertype EQ vim_corr_objtab-object AND mastername EQ vim_corr_objtab-obj_name. DELETE corr_keytab. ENDLOOP. ENDLOOP. LOOP AT total. IF x_header-flag EQ space. "standard logging required IF x_header-bastab EQ space. "view CHECK NE original AND NE neuer_geloescht. MOVE TO . PERFORM (corr_formname) IN PROGRAM (sy-repid) USING corr_action rc. ELSE. "base table IF x_header-texttbexst EQ space. CHECK NE original AND NE neuer_geloescht. ELSE. CHECK NE original AND NE neuer_geloescht OR NE original AND NE neuer_geloescht. ENDIF. MOVE TO . corr_keytab = e071k. corr_keytab-objname = x_header-maintview. MOVE TO (keylen). PERFORM update_corr_keytab USING corr_action rc. IF x_header-texttbexst NE space AND "base table with NE . "text table corr_keytab = e071k. corr_keytab-objname = x_header-texttab. MOVE TO (txtkeylen). PERFORM update_corr_keytab USING corr_action rc1. ENDIF. ENDIF. "base table or view IF x_header-adrnbrflag EQ 'O' AND NE space. PERFORM vim_address_keytab_entries USING corr_action rc1. ELSEIF x_header-adrnbrflag EQ 'N' AND NE space. READ TABLE vim_addresses_to_save WITH KEY viewname = x_header-viewname addrnumber = BINARY SEARCH TRANSPORTING NO FIELDS. IF sy-subrc NE 0. "only existing addresses possible APPEND LINES OF vim_addr_e071k_tab TO uc_addr_71ktab. * object_key = . (keylen) = . "UF686454/2000 CALL FUNCTION 'ADDR_TRANSPORT_ENTRIES' EXPORTING addrnumber = table_name = vim_addr_basetable field_name = vim_addr_bastab_field objkey = object_key TABLES e071k_tab = uc_addr_71ktab. vim_exit_11_12_active = 'X'. LOOP AT uc_addr_71ktab INTO corr_keytab WHERE mastername = vim_addr_e071k_master_46 OR "UF688403/2000 mastername = vim_addr_e071k_master. * Rel < 4.6A: ignore old type address entries inserted only for downward * compatibility PERFORM update_corr_keytab USING corr_action rc1. IF rc1 EQ 0. MOVE rc1 TO rc. ENDIF. ENDLOOP. REFRESH uc_addr_71ktab. CLEAR vim_exit_11_12_active. ENDIF. ENDIF. ENDIF. "standard logging required IF x_header-frm_e071ks NE space. vim_exit_11_12_active = 'X'. PERFORM (x_header-frm_e071ks) IN PROGRAM (sy-repid). CLEAR vim_exit_11_12_active. ELSE. IF x_header-flag NE space. EXIT. ENDIF. ENDIF. ENDLOOP. IF x_header-flag EQ space AND "standard logging required x_header-texttbexst <> space. "SW Texttransl .. PERFORM vim_text_keytab_entries USING corr_action rc1 keylen "UF170200 txtkeylen. "UF170200 ENDIF. ".. Texttransl ENDIF. "maint_mode transport or update IF x_header-frm_e071ka NE space. vim_exit_11_12_active = 'X'. PERFORM (x_header-frm_e071ka) IN PROGRAM (sy-repid). CLEAR vim_exit_11_12_active. IF status-action EQ transportieren AND x_header-flag NE space AND x_header-frm_e071 NE space AND x_header-frm_e071ks EQ space AND vim_called_by_cluster NE space. PERFORM vim_store_state_info. CALL FUNCTION 'VIEWCLUSTER_TRANS_DEPENDENT' EXPORTING view_name = x_header-viewname action = corr_action status_mode = status-mode workarea = extract no_dialog = vim_external_mode corr_number = -corr_nbr. ENDIF. ENDIF. ENDFORM. "update_corr