Method SAVE_PREPARE
Use
The SAVE_PREPARE method takes preparatory measures for saving. The most important preparatory measure is the second part of the connection to the transport system. Transport-relevant objects (in other words, the tables affected) that were specified roughly in the GET_TRANSPORT_OBJECTS method are made more specific here or restricted.
Sample source text:
Only the main parts of the source text are mentioned below.
*------ transport connection ------------------------------------------
DATA:
lv_is_local_object TYPE brf_boole_d.
CALL METHOD cl_aux_brf=>get_applclass_details
EXPORTING
iv_applclass = ms_brf150_cur-applclass
IMPORTING
ev_is_local_object = lv_is_local_object
EXCEPTIONS
applclass_not_in_tadir = 1
OTHERS = 2.
*------ no transport entries for local object -------------------------
IF sy-subrc = 0 AND NOT lv_is_local_object IS INITIAL.
REFRESH et_e071.
EXIT.
ENDIF.
CALL METHOD super->if_maintenance_brf~save_prepare
IMPORTING
et_e071 = et_e071
et_e071k = et_e071k.
*------ transport key entry for tbrf142 -------------------------------
ls_tables = 'TBRF142'.
READ TABLE mt_changed_tables FROM ls_tables
TRANSPORTING NO FIELDS.
IF sy-subrc EQ 0.
IF mv_edit_mode NE '4'.
ls_brf142 = ms_brf142_cur.
ELSE.
ls_brf142 = ms_brf142_old.
ENDIF.
CALL METHOD cl_aux_brf=>get_tabkey_as_char
EXPORTING
iv_data = ls_brf142
iv_type = ls_tables
IMPORTING
ev_e071k = ls_e071k.
APPEND ls_e071k TO et_e071k.
ELSE.
DELETE et_e071 WHERE pgmid EQ 'R3TR'
AND object EQ 'TABU'
AND obj_name EQ ls_tables.
ENDIF.
Description:
-
Before method SAVE_PREPARE of the super-class is called, the system ensures that no objects in non-transportable application classes get into a transport request.
-
Then the method SAVE_PREPARE of the superclass is called.
This call is obligatory, as the base class determines all tables in which changes have been made. To do so, the base class calls the IS_MODIFIED method. Member table mt_changed_table is set up. This member table only contains the names of tables in which table entries have been changed.
-
Then the table of transport-relevant table entries is set up, based on the data records that have actually been changed (table et_e071k).
This table et_e071k contains the following details in a row:
-
Name of the database table
-
Key of the table entry that you want to transport
-
-
The setup of table et_e071k is made easier by the following static service methods in class CL_AUX_BRF.
-
Method GET_TABKEY_AS_CHAR
Method GET_TABKEY_AS_CHAR takes the transferred structure (in this case, structure LS_BRF142) and the name of the structure (LV_TABLES, 'TBRF142') to create a transport entry. This transport entry is added to table ET_071K.
-
Method ADD_TABKEYS_FOR_TR
Method ADD_TABKEYS_FOR_TR determines the transport entries on the basis of the CUR and OLD tables.
With this method, bear in mind the behavior with deletion. If entries need to be deleted, you must also create transport entries for the entries you want to delete.
-