*$*$----------------------------------------------------------------$*$*
*$ Correction Inst. 0020751258 0001802081 $*
*$--------------------------------------------------------------------$*
*$ Valid for : $*
*$ Software Component S4CORE $*
*$ Release 108 To SAPK-10804INS4CORE $*
*$*$----------------------------------------------------------------$*$*
*&--------------------------------------------------------------------*
*& Object FUNC /SLOAE/DEPLOY
*& Object Header FUGR /SLOAE/REMOTE_EXECUTION
*&--------------------------------------------------------------------*
*& FUNCTION /SLOAE/DEPLOY
*&--------------------------------------------------------------------*
...
FUNCTION /sloae/deploy.
*>>>> START OF DELETION <<<<<
DATA:
lv_guid TYPE guid,
lv_guid_dummy TYPE guid,
lv_timestamp TYPE timestamp,
lv_timestamp_n TYPE char14,
ls_module TYPE /sloae/s_module_generate,
lv_tabix TYPE i,
lv_error TYPE i,
ls_title TYPE /sloae/s_title,
lv_write_repository TYPE boole_d,
ls_analysis_db TYPE /sloae/ex_analys,
ls_module_db TYPE /sloae/ex_module,
ls_module_db_old TYPE /sloae/ex_module,
ls_config_db TYPE /sloae/ex_config,
ls_run_db TYPE /sloae/ex_run,
ls_run_m_db TYPE /sloae/ex_run_m,
ls_title_db TYPE /sloae/ex_title,
ls_tadir_db TYPE tadir.
CLEAR:
et_module_guid_syn_error.
CALL FUNCTION 'CNV_MBT_AUTHORITY_CHECK'
EXPORTING
im_area = 'SLOP'
im_level = 'PACKAGE'
im_activity = '02'
EXCEPTIONS
no_authority = 1.
IF sy-subrc EQ 1.
RAISE missing_authorization.
ENDIF.
ls_analysis_db-analysis_guid = iv_analysis_guid.
ls_analysis_db-out_profile_guid = iv_out_profile_guid.
ls_analysis_db-create_user = iv_create_user.
GET TIME STAMP FIELD lv_timestamp.
CONVERT TIME STAMP lv_timestamp TIME ZONE sy-zonlo INTO
DATE ls_analysis_db-create_date
TIME ls_analysis_db-create_time.
ls_analysis_db-create_timezone = sy-zonlo.
INSERT /sloae/ex_analys FROM ls_analysis_db.
IF sy-subrc NE 0.
RAISE data_inconsistency.
ENDIF.
CALL FUNCTION 'GUID_CREATE'
IMPORTING
ev_guid_16 = lv_guid.
ls_run_db-analysis_guid = iv_analysis_guid.
ls_run_db-out_profile_guid = iv_out_profile_guid.
ls_run_db-run_guid = lv_guid.
ls_run_db-status = gc_sta_anl_initial.
lv_timestamp_n = lv_timestamp.
CONCATENATE 'SLOAP' lv_timestamp_n INTO ls_run_db-clust_id_prefix.
INSERT /sloae/ex_run FROM ls_run_db.
IF sy-subrc NE 0.
RAISE data_inconsistency.
ENDIF.
SELECT SINGLE analysis_guid FROM /sloae/ex_home
INTO lv_guid_dummy WHERE
analysis_guid EQ iv_analysis_guid.
IF sy-subrc NE 0.
lv_write_repository = abap_true.
ELSE.
lv_write_repository = abap_false.
ENDIF.
* delete old configurations of profile - relevant if:
* - profile is still in system from another execution and
* - the profile contains release dependent modules and
* - an upgrade was done in the meantime
DELETE FROM /sloae/ex_config WHERE
out_profile_guid EQ iv_out_profile_guid.
ls_config_db-out_profile_guid = iv_out_profile_guid.
ls_run_m_db-run_guid = lv_guid.
ls_run_m_db-status = gc_sta_mod_initial.
LOOP AT it_module INTO ls_module.
lv_tabix = sy-tabix.
ls_config_db-module_guid = ls_module-module_guid.
ls_module_db-module_guid = ls_module-module_guid.
ls_module_db-report_name = ls_module-report_name.
ls_run_m_db-module_guid = ls_module-module_guid.
ls_run_m_db-clust_id_suffix = lv_tabix.
INSERT /sloae/ex_config FROM ls_config_db.
IF sy-subrc NE 0.
RAISE data_inconsistency.
ENDIF.
INSERT /sloae/ex_module FROM ls_module_db.
IF sy-subrc NE 0.
* if module is already in - check if report name is still the same
* if not: resident code is outdated -> update report name and delete
* old report
SELECT SINGLE * FROM /sloae/ex_module INTO ls_module_db_old WHERE
module_guid EQ ls_module_db-module_guid.
IF ls_module_db_old-report_name NE ls_module_db-report_name.
UPDATE /sloae/ex_module SET
report_name = ls_module_db-report_name WHERE
module_guid EQ ls_module_db-module_guid.
IF lv_write_repository EQ abap_true.
DELETE REPORT ls_module_db_old-report_name.
DELETE FROM tadir WHERE
pgmid EQ 'R3TR' AND
object EQ 'PROG' AND
obj_name EQ ls_module_db_old-report_name.
ENDIF.
ENDIF.
ENDIF.
INSERT /sloae/ex_run_m FROM ls_run_m_db.
IF sy-subrc NE 0.
RAISE data_inconsistency.
ENDIF.
IF lv_write_repository EQ abap_true.
INSERT REPORT ls_module-report_name FROM ls_module-t_code
STATE 'A'.
ls_tadir_db-devclass = '$TMP'.
ls_tadir_db-pgmid = 'R3TR'.
ls_tadir_db-object = 'PROG'.
ls_tadir_db-obj_name = ls_module-report_name.
ls_tadir_db-srcsystem = sy-sysid.
ls_tadir_db-genflag = 'T'.
ls_tadir_db-cproject = ' S'.
ls_tadir_db-masterlang = 'EN'.
ls_tadir_db-component = 'SAP_AP'.
ls_tadir_db-crelease = sy-saprl.
MODIFY tadir FROM ls_tadir_db.
ENDIF.
CALL FUNCTION 'EDITOR_SYNTAX_CHECK'
EXPORTING
i_program = ls_module-report_name
IMPORTING
o_error_subrc = lv_error
TABLES
i_source = ls_module-t_code.
IF lv_error NE 0.
APPEND ls_module-module_guid TO et_module_guid_syn_error.
ENDIF.
ENDLOOP.
* texts needed for local execution
LOOP AT it_title INTO ls_title.
ls_title_db-entity_guid = ls_title-guid.
ls_title_db-language = ls_title-language.
ls_title_db-text = ls_title-text.
INSERT /sloae/ex_title FROM ls_title_db.
* no check on sy-subrc necessary - texts could be already in by
* previous deployments
ENDLOOP.
* select options needed for local execution
MODIFY /sloae/ex_selopt FROM TABLE it_selopt.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
**"*"Lokale Schnittstelle:
**" IMPORTING
**" VALUE(IV_ANALYSIS_GUID) TYPE GUID
**" VALUE(IV_OUT_PROFILE_GUID) TYPE GUID
**" VALUE(IV_CREATE_USER) TYPE UNAME
**" VALUE(IT_MODULE) TYPE /SLOAE/T_MODULE_GENERATE
**" VALUE(IT_TITLE) TYPE /SLOAE/T_TITLE
**" VALUE(IT_SELOPT) TYPE /SLOAE/T_SELOPT_GENERATE
**" EXPORTING
**" VALUE(ET_MODULE_GUID_SYN_ERROR) TYPE /SLOAE/EX_T_GUID
**" EXCEPTIONS
**" DATA_INCONSISTENCY
**" MISSING_AUTHORIZATION
**"----------------------------------------------------------------------
*
* DATA:
* lv_guid TYPE guid,
* lv_guid_dummy TYPE guid,
* lv_timestamp TYPE timestamp,
* lv_timestamp_n TYPE char14,
* ls_module TYPE /sloae/s_module_generate,
* lv_tabix TYPE i,
* lv_error TYPE i,
* ls_title TYPE /sloae/s_title,
* lv_write_repository TYPE boole_d,
*
* ls_analysis_db TYPE /sloae/ex_analys,
* ls_module_db TYPE /sloae/ex_module,
* ls_module_db_old TYPE /sloae/ex_module,
* ls_config_db TYPE /sloae/ex_config,
* ls_run_db TYPE /sloae/ex_run,
* ls_run_m_db TYPE /sloae/ex_run_m,
* ls_title_db TYPE /sloae/ex_title,
* ls_tadir_db TYPE tadir.
*
* CLEAR:
* et_module_guid_syn_error.
*
* CALL FUNCTION 'CNV_MBT_AUTHORITY_CHECK'
* EXPORTING
* im_area = 'SLOP'
* im_level = 'PACKAGE'
* im_activity = '02'
* EXCEPTIONS
* no_authority = 1.
*
* IF sy-subrc EQ 1.
* RAISE missing_authorization.
* ENDIF.
*
* ls_analysis_db-analysis_guid = iv_analysis_guid.
* ls_analysis_db-out_profile_guid = iv_out_profile_guid.
* ls_analysis_db-create_user = iv_create_user.
*
* GET TIME STAMP FIELD lv_timestamp.
*
* CONVERT TIME STAMP lv_timestamp TIME ZONE sy-zonlo INTO
* DATE ls_analysis_db-create_date
* TIME ls_analysis_db-create_time.
*
* ls_analysis_db-create_timezone = sy-zonlo.
*
* INSERT /sloae/ex_analys FROM ls_analysis_db.
* IF sy-subrc NE 0.
* RAISE data_inconsistency.
* ENDIF.
*
* CALL FUNCTION 'GUID_CREATE'
* IMPORTING
* ev_guid_16 = lv_guid.
*
* ls_run_db-analysis_guid = iv_analysis_guid.
* ls_run_db-out_profile_guid = iv_out_profile_guid.
* ls_run_db-run_guid = lv_guid.
* ls_run_db-status = gc_sta_anl_initial.
*
* lv_timestamp_n = lv_timestamp.
* CONCATENATE 'SLOAP' lv_timestamp_n INTO ls_run_db-clust_id_prefix.
*
* INSERT /sloae/ex_run FROM ls_run_db.
* IF sy-subrc NE 0.
* RAISE data_inconsistency.
* ENDIF.
*
* SELECT SINGLE analysis_guid FROM /sloae/ex_home
* INTO lv_guid_dummy WHERE
* analysis_guid EQ iv_analysis_guid.
* IF sy-subrc NE 0.
* lv_write_repository = abap_true.
* ELSE.
* lv_write_repository = abap_false.
* ENDIF.
*
** delete old configurations of profile - relevant if:
** - profile is still in system from another execution and
** - the profile contains release dependent modules and
** - an upgrade was done in the meantime
* DELETE FROM /sloae/ex_config WHERE
* out_profile_guid EQ iv_out_profile_guid.
*
* ls_config_db-out_profile_guid = iv_out_profile_guid.
*
* ls_run_m_db-run_guid = lv_guid.
* ls_run_m_db-status = gc_sta_mod_initial.
*
* LOOP AT it_module INTO ls_module.
* lv_tabix = sy-tabix.
*
* ls_config_db-module_guid = ls_module-module_guid.
*
* ls_module_db-module_guid = ls_module-module_guid.
* ls_module_db-report_name = ls_module-report_name.
*
* ls_run_m_db-module_guid = ls_module-module_guid.
* ls_run_m_db-clust_id_suffix = lv_tabix.
*
* INSERT /sloae/ex_config FROM ls_config_db.
* IF sy-subrc NE 0.
* RAISE data_inconsistency.
* ENDIF.
*
* INSERT /sloae/ex_module FROM ls_module_db.
* IF sy-subrc NE 0.
** if module is already in - check if report name is still the same
** if not: resident code is outdated -> update report name and delete
** old report
* SELECT SINGLE * FROM /sloae/ex_module INTO ls_module_db_old WHERE
* module_guid EQ ls_module_db-module_guid.
* IF ls_module_db_old-report_name NE ls_module_db-report_name.
* UPDATE /sloae/ex_module SET
* report_name = ls_module_db-report_name WHERE
* module_guid EQ ls_module_db-module_guid.
* IF lv_write_repository EQ abap_true.
* DELETE REPORT ls_module_db_old-report_name.
* DELETE FROM tadir WHERE
* pgmid EQ 'R3TR' AND
* object EQ 'PROG' AND
* obj_name EQ ls_module_db_old-report_name.
* ENDIF.
* ENDIF.
* ENDIF.
*
* INSERT /sloae/ex_run_m FROM ls_run_m_db.
* IF sy-subrc NE 0.
* RAISE data_inconsistency.
* ENDIF.
*
* IF lv_write_repository EQ abap_true.
* INSERT REPORT ls_module-report_name FROM ls_module-t_code
* STATE 'A'.
*
* ls_tadir_db-devclass = '$TMP'.
* ls_tadir_db-pgmid = 'R3TR'.
* ls_tadir_db-object = 'PROG'.
* ls_tadir_db-obj_name = ls_module-report_name.
* ls_tadir_db-srcsystem = sy-sysid.
* ls_tadir_db-genflag = 'T'.
* ls_tadir_db-cproject = ' S'.
* ls_tadir_db-masterlang = 'EN'.
* ls_tadir_db-component = 'SAP_AP'.
* ls_tadir_db-crelease = sy-saprl.
* MODIFY tadir FROM ls_tadir_db.
* ENDIF.
*
* CALL FUNCTION 'EDITOR_SYNTAX_CHECK'
* EXPORTING
* i_program = ls_module-report_name
* IMPORTING
* o_error_subrc = lv_error
* TABLES
* i_source = ls_module-t_code.
*
* IF lv_error NE 0.
* APPEND ls_module-module_guid TO et_module_guid_syn_error.
* ENDIF.
* ENDLOOP.
*
** texts needed for local execution
* LOOP AT it_title INTO ls_title.
* ls_title_db-entity_guid = ls_title-guid.
* ls_title_db-language = ls_title-language.
* ls_title_db-text = ls_title-text.
* INSERT /sloae/ex_title FROM ls_title_db.
** no check on sy-subrc necessary - texts could be already in by
** previous deployments
* ENDLOOP.
*
** select options needed for local execution
* MODIFY /sloae/ex_selopt FROM TABLE it_selopt.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
>>> A T T E N T I O N: P L E A S E N O T E: <<<
>>> Correction contains additional changes that are NOT shown here <<<
>>> Display all changes by Note Assistant Note display functionality <<<