0% found this document useful (0 votes)
165 views46 pages

Znote 1786253

This document contains code for an SAP transport assistant. It defines constants, data types, and class methods for initializing the assistant, getting object texts, creating packages, messages, documentation, and performing other tasks related to transporting code between systems. The code handles tasks like reading logs, displaying objects, and filling batch input sessions.

Uploaded by

arvish_84
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
165 views46 pages

Znote 1786253

This document contains code for an SAP transport assistant. It defines constants, data types, and class methods for initializing the assistant, getting object texts, creating packages, messages, documentation, and performing other tasks related to transporting code between systems. The code handles tasks like reading logs, displaying objects, and filling batch input sessions.

Uploaded by

arvish_84
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 46

*&---------------------------------------------------------------------*

*& Report ZNOTE_1786253


*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT znote_1786253.

* Generated by SAP_LOCAL_DOWNPORT_ASSISTANT Version 3.56 on 14.10.2013

* The individual coding starts at 'FORM action.' ( line 2.152 )


* Perform global search (menu edit - find) for "-- to get a complete list of
changed objects

PARAMETERS testrun RADIOBUTTON GROUP mode.


PARAMETERS update RADIOBUTTON GROUP mode.
DATA genview.
PARAMETERS showlogs RADIOBUTTON GROUP mode.
DATA: gv_copy_translation.

TYPE-POOLS: seox, seoc, seok, seex, bcwbn, ststc, trmtd, trexe, scua.

TYPES: t_switch_id TYPE char30, "sfw_switch_id does not exist in SAP_BASIS 640
t_bfunction TYPE char30, "sfw_bfunction does not exist in SAP_BASIS 640
BEGIN OF t_bf_sw, "sfw_bf_sw
switch_id TYPE t_switch_id,
version,
bfunction TYPE t_bfunction,
no_check,
END OF t_bf_sw,
BEGIN OF t_permission, client_pak(30), intf_name(30), err_sever(4), END OF
t_permission, "has to be in sync with structure permission
BEGIN OF
dd43v,typename(30),seckeyname(30),ddlanguage,seckeyunique,accessmode,kind,keydescri
ption(80),END OF dd43v.

TYPES: BEGIN OF t_pak_projects, mandt TYPE mandt, project_guid TYPE cdraw16,


project_id(24), short_text_en(40), short_text_de(40), inactive, fetch_date TYPE d,
END OF t_pak_projects.

TYPES: tt_dd05m TYPE TABLE OF dd05m,


tt_dd17v TYPE TABLE OF dd17v,
tt_dd26v TYPE TABLE OF dd26v,
tt_dd27p TYPE TABLE OF dd27p,
tt_dd28v TYPE TABLE OF dd28v,
tt_dd30v TYPE TABLE OF dd30v,
tt_dd30tv TYPE TABLE OF dd30tv,
tt_dd31v TYPE TABLE OF dd31v,
tt_dd32v TYPE TABLE OF dd32v,
tt_dd32p TYPE TABLE OF dd32p,
tt_dd33v TYPE TABLE OF dd33v,
tt_dd36m TYPE TABLE OF dd36m,
tt_dd42v TYPE TABLE OF dd42v,
tt_dd43v TYPE TABLE OF dd43v,
tt_e071k TYPE TABLE OF e071k,
tt_permission TYPE TABLE OF t_permission,
tt_tstca TYPE TABLE OF tstca,
tt_langu TYPE TABLE OF sylangu,
tt_sta TYPE TABLE OF rsmpe_stat,
tt_fun TYPE TABLE OF rsmpe_funt,
tt_men TYPE TABLE OF rsmpe_men,
tt_mtx TYPE TABLE OF rsmpe_mnlt,
tt_act TYPE TABLE OF rsmpe_act,
tt_but TYPE TABLE OF rsmpe_but,
tt_pfk TYPE TABLE OF rsmpe_pfk,
tt_set TYPE TABLE OF rsmpe_staf,
tt_doc TYPE TABLE OF rsmpe_atrt,
tt_tit TYPE TABLE OF rsmpe_titt,
tt_biv TYPE TABLE OF rsmpe_buts,
tt_dypara TYPE TABLE OF rpy_dypara.

DATA: gr_devclass TYPE RANGE OF devclass,


gr_domname TYPE RANGE OF domname,
gr_rollname TYPE RANGE OF rollname,
gr_tabname TYPE RANGE OF tabname, "structures and database tables
gs_tabname LIKE LINE OF gr_tabname VALUE 'IEQ',
gr_dbtabname TYPE RANGE OF tabname, "only database tables
gt_tabname TYPE TABLE OF tabname,
gr_indexes TYPE RANGE OF trobj_name,
gr_indxtab TYPE RANGE OF tabname,
gr_indxname TYPE RANGE OF indexid,
gr_shlpname TYPE RANGE OF shlpname,
gr_enqname TYPE RANGE OF enqname,
gr_viewname TYPE RANGE OF viewname,
gr_ttypname TYPE RANGE OF ttypename,
gt_ttypname TYPE TABLE OF ttypename,
gr_guistatus TYPE RANGE OF progname,
gr_switchname TYPE RANGE OF t_switch_id,
gr_msg_class TYPE RANGE OF msgid,
gv_trkorr TYPE trkorr,
gt_trkey TYPE TABLE OF trkey,
gv_unit_test,
gv_translation,
gv_repository_changed,
gv_errors_occured,
gv_uname TYPE syuname,
gv_log_handle TYPE balloghndl.

CONSTANTS: c_bal_object TYPE balobj_d VALUE 'SNOTE',


c_bal_subobj TYPE balsubobj VALUE space,
c_bal_context TYPE tabname VALUE 'ADIR_KEY',
c_include6 TYPE fieldname VALUE '.INCLU', ".INCLUDE or .INCLU--AP or
.INCLU-_BY
c_memory_id(40) VALUE 'SAP_LOCAL_DOWNPORT_ASSISTANT',
c_logical_object VALUE 'L'.

CONSTANTS: gc_report TYPE text15 VALUE 'Report', "#EC NOTEXT


gc_local LIKE gc_report VALUE 'Local', "#EC NOTEXT
gc_snote LIKE gc_report VALUE 'SNote', "#EC NOTEXT
gc_manual LIKE gc_report VALUE 'Manual Instr. ', "#EC NOTEXT
gc_bcset LIKE gc_report VALUE 'Manual/BC-Set', "#EC NOTEXT
gc_ignore LIKE gc_report VALUE '-', "#EC NOTEXT
gc_generate LIKE gc_report VALUE 'Generation', "#EC NOTEXT
gc_suppack LIKE gc_report VALUE 'Supp.Pack.', "#EC NOTEXT
gc_dest_init TYPE rfcdest VALUE 'MISSING INITIALIZATION'. "#EC NOTEXT
DATA: akb_get_tadir TYPE funcname VALUE 'AKB_GET_TADIR'.

*&---------------------------------------------------------------------*
*& Form bal_callback_ucomm
*&---------------------------------------------------------------------*
* called from ballog, e.g. during double click
*----------------------------------------------------------------------*
FORM bal_callback_ucomm CHANGING c_state TYPE bal_s_cbuc. "#EC CALLED
DATA: ls_msg TYPE bal_s_msg,
l_date(8),
ls_tadir TYPE adir_key.
CASE c_state-ucomm.
WHEN '%LONGTEXT' OR '&IC1'.
CALL FUNCTION 'BAL_LOG_MSG_READ'
EXPORTING
i_s_msg_handle = c_state-list_msgh
IMPORTING
e_s_msg = ls_msg
EXCEPTIONS
log_not_found = 1
msg_not_found = 2
OTHERS = 3.
IF ls_msg-msgid EQ 'DO' AND ls_msg-msgno EQ '626'.
"MESSAGE i626(do) WITH 'Click this message to view' 'detailed activation
logs with name' l_logname INTO sy-lisel. "#EC *
SPLIT ls_msg-msgv3 AT ':' INTO sy-lisel l_date.
SUBMIT radprotb WITH protname EQ ls_msg-msgv3 "#EC CI_SUBMIT
WITH date EQ l_date
* with TIME
* with USER
AND RETURN.
c_state-ucomm_exec = 'X'.
ELSEIF c_state-ucomm EQ '&IC1'.
ls_tadir = ls_msg-context-value.
CHECK ls_tadir-object IS NOT INITIAL.
CALL FUNCTION 'RS_TOOL_ACCESS'
EXPORTING
operation = 'SHOW'
object_name = ls_tadir-obj_name
object_type = ls_tadir-object
EXCEPTIONS
OTHERS = 1.
CHECK sy-subrc EQ 0.
c_state-ucomm_exec = 'X'.
ENDIF.
ENDCASE.
ENDFORM. "bal_callback_ucomm
*&---------------------------------------------------------------------*
*& Form bdc_field
*&---------------------------------------------------------------------*
DEFINE bdc_field.
clear: ls_bdc.
ls_bdc-fnam = &1.
ls_bdc-fval = &2.
append ls_bdc to lt_bdc.
END-OF-DEFINITION.
*&---------------------------------------------------------------------*
*& Form bdc_field
*&---------------------------------------------------------------------*
DEFINE bdc_screen.
clear ls_bdc.
ls_bdc-program = &1.
ls_bdc-dynpro = &2.
ls_bdc-dynbegin = 'X'.
append ls_bdc to lt_bdc.
END-OF-DEFINITION.
*----------------------------------------------------------------------*
* CLASS lcl_wb DEFINITION
*----------------------------------------------------------------------*
CLASS lcl_wb DEFINITION.
PUBLIC SECTION.

CLASS-METHODS init
IMPORTING
value(i_note) TYPE clike OPTIONAL "note which indicates that report
is not needed anymore
value(i_cinst) TYPE cwbcialeid OPTIONAL "correction instruction which
describes the validity of the report
EXCEPTIONS
stop_processing.

CLASS-METHODS get_object_text
IMPORTING
i_object TYPE e071-object "e.g. TABD
i_obj_name TYPE c OPTIONAL "for DOCU
RETURNING value(r_text) TYPE string.

CLASS-METHODS create_package
IMPORTING
i_devclass TYPE devclass
i_langu TYPE sylangu DEFAULT 'E'
i_ctext TYPE tdevc-ctext
i_dlvunit TYPE tdevc-dlvunit
i_parentcl TYPE tdevc-parentcl "super package
i_translayer TYPE tdevc-pdevclass "transport layer
i_comp_posid TYPE char24 "AKHKOMPO
i_project_id TYPE t_pak_projects-project_id OPTIONAL
i_tpclass TYPE tdevc-tpclass
i_mainpack TYPE tdevc-mainpack OPTIONAL
i_restricted TYPE tdevc-restricted OPTIONAL
i_korrflag TYPE tdevc-korrflag DEFAULT 'X'
i_srv_check TYPE tdevc-srv_check
EXCEPTIONS
package_not_created.

CLASS-METHODS create_message
IMPORTING
i_msgid TYPE msgid
i_msgno TYPE msgno
i_langu TYPE sylangu DEFAULT 'E' "Default EN
i_text TYPE natxt
i_selfdef TYPE doku_selfd DEFAULT 'X'.

CLASS-METHODS create_mess_docu
IMPORTING
i_msgid TYPE msgid
i_msgno TYPE msgno
i_langu TYPE sylangu DEFAULT 'E' "Default EN
i_line TYPE string OPTIONAL "all lines get collected until i_line is
omitted
EXPORTING
et_lines TYPE tline_tab.

CLASS-METHODS create_other_docu
IMPORTING
i_devclass TYPE devclass OPTIONAL "only needed for new objects with own
TADIR
i_docname TYPE thead-tdname "e.g. TXCDESK_PARAM, where TX
represents general text
i_typ TYPE dokil-typ DEFAULT 'E' "E or T
i_langu TYPE sylangu DEFAULT 'E' "Default EN
i_line TYPE string OPTIONAL "all lines get collected until i_line is
omitted
EXPORTING
et_lines TYPE tline_tab.

CLASS-METHODS create_program_text
IMPORTING
i_devclass TYPE devclass OPTIONAL "needed if report texts are created
before the program exists
i_progname TYPE progname
i_langu TYPE sylangu DEFAULT 'E' "Default EN
i_id TYPE textpool-id DEFAULT 'I' "I = Text element, S =
Selection Text, R = Title
i_key TYPE textpool-key "space for title
i_text TYPE textpool-entry
i_length TYPE textpool-length OPTIONAL. "can be defaulted from length
of text

CLASS-METHODS modify_stcs
IMPORTING
i_devclass TYPE devclass
i_langu TYPE sylangu DEFAULT 'E' "Default EN
value(is_hdr) TYPE any
it_hdt TYPE ANY TABLE
it_tsk TYPE ANY TABLE
it_att TYPE ANY TABLE OPTIONAL.

CLASS-METHODS execute_method
IMPORTING
i_method TYPE c. "AFTER_IMP or BEFORE_EXP

CLASS-METHODS add_to_transport
IMPORTING
i_object TYPE e071-object "TABD
i_obj_name TYPE c "flexible number of characters
i_devclass TYPE devclass OPTIONAL
i_langu TYPE sylangu OPTIONAL
EXCEPTIONS
error
simulation.

CLASS-METHODS log_message.
CLASS-METHODS display_log.

CLASS-METHODS set_context
IMPORTING i_object TYPE e071-object
i_obj_name TYPE c
i_obj_name2 TYPE c OPTIONAL
i_text TYPE c OPTIONAL
i_langu TYPE sylangu.

CLASS-METHODS activate
IMPORTING i_result_auth_check TYPE sysubrc OPTIONAL.

CLASS-METHODS mass_activation
IMPORTING
i_step TYPE i DEFAULT 1
i_inactive TYPE c OPTIONAL
i_ddmode TYPE ddmode DEFAULT 'O'
i_logname TYPE c
EXCEPTIONS
error.
ENDCLASS. "lcl_wb DEFINITION
*----------------------------------------------------------------------*
* CLASS lcl_dcm_to_po_bridge IMPLEMENTATION
*----------------------------------------------------------------------*
CLASS lcl_wb IMPLEMENTATION.

METHOD init.

CLEAR gv_errors_occured.

CALL FUNCTION 'AUTHORITY_CHECK_TCODE'


EXPORTING
tcode = 'SNOTE'
EXCEPTIONS
ok = 0
OTHERS = 1.
IF sy-subrc NE 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
gv_errors_occured = 'X'.
RAISE stop_processing.
ENDIF.

IF showlogs IS NOT INITIAL.


CALL METHOD display_log.
LEAVE PROGRAM.
ENDIF.

DATA: ls_log TYPE bal_s_log.


"prepare application log
ls_log-object = c_bal_object.
ls_log-subobject = c_bal_subobj.
ls_log-extnumber = sy-cprog.
ls_log-aldate = sy-datum.
ls_log-altime = sy-uzeit.
ls_log-aluser = sy-uname.
ls_log-alprog = sy-repid.
ls_log-altcode = sy-tcode.
"create standard application log handle
CALL FUNCTION 'BAL_LOG_CREATE'
EXPORTING
i_s_log = ls_log
IMPORTING
e_log_handle = gv_log_handle
EXCEPTIONS
log_header_inconsistent = 1
OTHERS = 2.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
EXPORT gv_log_handle FROM gv_log_handle TO MEMORY ID c_memory_id.

CALL METHOD set_context


EXPORTING
i_langu = space
i_object = space
i_obj_name = space.

"Main check: Last changed by SAP -> Report came via SP / Upgrade
"==> no execution anymore.
IF sy-cprog NE 'SAP_LOCAL_DOWNPORT_ASSISTANT'.
SELECT SINGLE prog FROM d010sinf INTO sy-lisel
WHERE prog EQ sy-repid
AND ( unam EQ 'SAP' OR cnam EQ 'SAP' ).
IF sy-subrc EQ 0.
MESSAGE w666(01) WITH 'The neccessary changes already came' 'via support
package.' 'Report execution not required anymore.' INTO sy-lisel. "#EC *
CALL METHOD log_message.
CALL METHOD display_log.
RAISE stop_processing.
ENDIF.
ENDIF.

IF i_note IS NOT INITIAL.


* that that note is not already implemented
* this must not be the note containing the generated report for DDIC but a
follow-up note with the coding using that new DDIC
DATA l_status TYPE c.
CALL FUNCTION 'SCWB_NOTE_IMPL_STATUS_SIMPLE'
EXPORTING
iv_numm = i_note
IMPORTING
ev_status = l_status
EXCEPTIONS
OTHERS = 1.
CASE l_status.
WHEN 'E'.
MESSAGE w666(01) WITH 'SAP Note' i_note 'completely implemented;' 'Report
execution not required anymore.' INTO sy-lisel. "#EC *
CALL METHOD log_message.
CALL METHOD display_log.
RAISE stop_processing.
WHEN 'O'.
MESSAGE w666(01) WITH 'SAP Note' i_note 'is obsolete;' 'Report execution
not required anymore.' INTO sy-lisel. "#EC *
CALL METHOD log_message.
CALL METHOD display_log.
RAISE stop_processing.
WHEN OTHERS. "okay
DATA: ls_note TYPE bcwbn_note.
ls_note-key-numm = i_note.
CALL FUNCTION 'SCWB_NOTE_READ'
EXPORTING
iv_read_corr_instructions = 'X'
CHANGING
cs_note = ls_note
EXCEPTIONS
note_not_found = 1
language_not_found = 2
unreadable_text_format = 3
corr_instruction_not_found = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE e666(01) WITH 'SAP Note' i_note 'cannot be read;' 'Ensure
correct download of note first.' INTO sy-lisel. "#EC *
CALL METHOD log_message.
CALL METHOD display_log.
RAISE stop_processing.
ENDIF.
*------
FIELD-SYMBOLS: <ls_corr> TYPE bcwbn_corr_instruction.
DATA: l_valid TYPE bcwbn_bool.
LOOP AT ls_note-corr_instructions ASSIGNING <ls_corr>.
IF i_cinst IS NOT INITIAL.
CHECK <ls_corr>-key-aleid = i_cinst.
ENDIF.
CALL FUNCTION 'SCWB_CINST_CHECK_VALID'
IMPORTING
ev_valid = l_valid
CHANGING
cs_corr_instruction = <ls_corr>
EXCEPTIONS
corr_inst_not_found = 1
inconsistent_delivery_data = 2
undefined = 3
OTHERS = 4.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
IF l_valid IS NOT INITIAL.
EXIT.
ENDIF.
ENDLOOP.
IF l_valid IS INITIAL.
MESSAGE e666(01) WITH 'Manual changes cannot be applied;' 'Correction
instruction invalid' 'for current patch level' INTO sy-lisel. "#EC *
CALL METHOD log_message.
CALL METHOD display_log.
RAISE stop_processing.
ENDIF.
ENDCASE.
ENDIF.
CALL FUNCTION 'SCWG_TOOLFLAG_SET'. "Reset will happen at leave of program

IF testrun IS INITIAL.
MESSAGE i666(01) WITH 'Running in Update Mode' INTO sy-lisel. "#EC *
ELSE.
MESSAGE w666(01) WITH 'Running in Test Mode' INTO sy-lisel. "#EC *
ENDIF.
CALL METHOD log_message.

ENDMETHOD. "init

METHOD get_object_text.

STATICS: lt_object_text TYPE TABLE OF ko100,


lt_doktypes TYPE TABLE OF dd07v.

DATA: ls_object_text TYPE ko100,


ls_doktype TYPE dd07v.

IF lt_object_text IS INITIAL.
CALL FUNCTION 'TR_OBJECT_TABLE'
TABLES
wt_object_text = lt_object_text.
SORT lt_object_text BY object.

CALL FUNCTION 'DDIF_DOMA_GET'


EXPORTING
name = 'DOK_ID'
langu = sy-langu
TABLES
dd07v_tab = lt_doktypes
EXCEPTIONS
OTHERS = 0.
SORT lt_doktypes BY domvalue_l.
ENDIF.

IF i_object EQ 'DOCU'.
READ TABLE lt_doktypes INTO ls_doktype BINARY SEARCH
WITH KEY domvalue_l = i_obj_name(2).
IF sy-subrc EQ 0.
CONCATENATE 'Documentation' ls_doktype-ddtext INTO r_text SEPARATED BY
space. "#EC NOTEXT
ELSE.
r_text = 'Documentation'. "#EC NOTEXT
ENDIF.
ELSEIF i_object IS NOT INITIAL.
READ TABLE lt_object_text INTO ls_object_text BINARY SEARCH
WITH KEY object = i_object. "ignore PGMID!
IF sy-subrc EQ 0.
r_text = ls_object_text-text.
ENDIF.
ENDIF.

ENDMETHOD. "get_object_text

METHOD create_package.
DATA: BEGIN OF ls_package_data,
devclass TYPE tdevc-devclass,
dlvunit TYPE tdevc-dlvunit,
parentcl TYPE tdevc-parentcl,
tpclass TYPE tdevc-tpclass,
pdevclass TYPE tdevc-pdevclass,
srv_check TYPE tdevc-srv_check,
mainpack TYPE tdevc-mainpack,
restricted TYPE tdevc-restricted,
korrflag TYPE tdevc-korrflag,
as4user TYPE tdevc-as4user,
masterlang TYPE tdevct-spras,
ctext TYPE tdevct-ctext,
comp_posid LIKE i_comp_posid,
project_guid TYPE t_pak_projects-project_guid,
END OF ls_package_data,
l_dref TYPE REF TO data,
ls_devclass LIKE LINE OF gr_devclass VALUE 'IEQ'.
FIELD-SYMBOLS: <ls_package_data> TYPE ANY.

ls_devclass-low = i_devclass.
COLLECT ls_devclass INTO gr_devclass.

CALL METHOD set_context


EXPORTING
i_langu = i_langu
i_object = 'DEVC'
i_obj_name = i_devclass.

SELECT SINGLE * FROM tdevct INTO CORRESPONDING FIELDS OF ls_package_data


WHERE devclass EQ i_devclass
AND spras EQ i_langu.
SELECT SINGLE * FROM tdevc INTO CORRESPONDING FIELDS OF ls_package_data
WHERE devclass EQ i_devclass.
IF sy-subrc EQ 0. "entry in TDEVC exists
IF "ls_package_data-ctext EQ i_ctext AND
ls_package_data-dlvunit EQ i_dlvunit AND
ls_package_data-parentcl EQ i_parentcl AND
"ls_package_data-comp_posid EQ i_comp_posid AND
ls_package_data-tpclass EQ i_tpclass AND
ls_package_data-srv_check EQ i_srv_check.
MESSAGE i666(01) WITH 'No update necessary' INTO sy-lisel. "#EC *
ELSE.
MESSAGE i666(01) WITH 'Update not supported.' 'Please delete package'
i_devclass 'and execute again' INTO sy-lisel. "#EC *
ENDIF.
CALL METHOD log_message.
RETURN.
ENDIF.

CHECK testrun IS INITIAL.

IF i_translayer IS NOT INITIAL.


ls_package_data-pdevclass = i_translayer.
ELSE.
"take same layer as any other package in same dlvunit (SCM, SAP_APPL)
SELECT SINGLE pdevclass FROM tdevc INTO ls_package_data-pdevclass "#EC
CI_GENBUFF
WHERE dlvunit EQ i_dlvunit
AND pdevclass NE space.
ENDIF.

IF ls_package_data-pdevclass IS INITIAL.
"initial transport layer only makes sense for local/home packages
IF ls_package_data-dlvunit NE 'HOME' AND
ls_package_data-dlvunit NE 'LOCAL'.
MESSAGE i666(01) WITH 'Could not determine transport layer.' 'Please copy
via generated report' 'or create package manually '. "#EC *
RAISE package_not_created.
ENDIF.
ENDIF.

SELECT SINGLE translayer FROM tcetral INTO sy-lisel "#EC CI_GENBUFF


WHERE translayer EQ ls_package_data-pdevclass.
IF sy-subrc NE 0.
MESSAGE i666(01) WITH 'Please enter a valid transport layer' 'in parameter
TRNLAYER'. "#EC *
RAISE package_not_created.
ENDIF.

ls_package_data-devclass = i_devclass.
ls_package_data-ctext = i_ctext.
ls_package_data-masterlang = i_langu.
ls_package_data-dlvunit = i_dlvunit.
ls_package_data-parentcl = i_parentcl.
ls_package_data-comp_posid = i_comp_posid.
ls_package_data-tpclass = i_tpclass.
ls_package_data-srv_check = i_srv_check.
ls_package_data-mainpack = i_mainpack.
ls_package_data-restricted = i_restricted.
ls_package_data-korrflag = i_korrflag.
ls_package_data-as4user = sy-uname.

IF i_project_id IS NOT INITIAL.


SELECT SINGLE project_guid FROM ('PAK_PROJECTS') INTO ls_package_data-
project_guid
WHERE project_id EQ i_project_id.
IF sy-subrc NE 0.
"MESSAGE w417(package_builder01) WITH i_project_id INTO sy-lisel.
MESSAGE w666(01) WITH 'Project' i_project_id 'does not exist.' INTO sy-
lisel. "#EC *
CALL METHOD log_message.
ENDIF.
ENDIF.

CREATE DATA l_dref TYPE ('SCOMPKDTLN').


ASSIGN l_dref->* TO <ls_package_data>.
MOVE-CORRESPONDING ls_package_data TO <ls_package_data>.

DATA: pa_maintain_package_dark TYPE funcname VALUE 'PA_MAINTAIN_PACKAGE_DARK'.


CALL FUNCTION pa_maintain_package_dark
EXPORTING
i_operation = 'CREATE'
* I_MODIFY_DATA_SIGN =
* I_CASCADE_CPRO_INFO =
* I_SUPPRESS_DIALOG = ' '
CHANGING
c_package_data = <ls_package_data>
c_transport_request = gv_trkorr
EXCEPTIONS
api_init_failed = 1
operation_not_supported = 2
no_authorization = 3
package_not_existing = 4
package_deleted = 5
package_already_existing = 6
package_not_empty = 7
invalid_package_name = 8
invalid_software_component = 9
invalid_transport_layer = 10
invalid_transport_properties = 11
invalid_author = 12
invalid_application_component = 13
short_text_missing = 14
cancelled_in_corr = 15
locked_by_other_user = 16
internal_error = 17
invalid_translation_depth = 18
wrong_mainpack_value = 19
superpackage_invalid = 20
error_in_cts_checks = 21
OTHERS = 22.
IF sy-subrc NE 0.
CALL METHOD log_message.
CALL METHOD display_log.
RAISE package_not_created.
ENDIF.

MESSAGE i666(01) WITH 'Package created with transportation layer'


ls_package_data-pdevclass '.' INTO sy-lisel. "#EC *
CALL METHOD log_message.

ENDMETHOD. "create_package

METHOD activate.

DATA: lt_dwinactiv TYPE TABLE OF dwinactiv,


lt_dwinactiv_ddic TYPE TABLE OF dwinactiv,
lv_answer,
l_logname TYPE ddprh-protname,
ls_job TYPE tbtcjob,
lv_rc TYPE sysubrc,
l_dref TYPE REF TO data,
l_message TYPE sy-lisel,
ls_tabname LIKE LINE OF gr_tabname.

FIELD-SYMBOLS: <ls_dwinactiv> LIKE LINE OF lt_dwinactiv.

CALL METHOD set_context


EXPORTING
i_langu = space
i_object = space
i_obj_name = 'Activation'. "#EC *

IF testrun IS INITIAL.
"activate switches "online"
IF gr_switchname IS NOT INITIAL.
SELECT * FROM dwinactiv INTO TABLE lt_dwinactiv
WHERE obj_name IN gr_switchname.
IF lt_dwinactiv[] IS NOT INITIAL.
LOOP AT lt_dwinactiv ASSIGNING <ls_dwinactiv>
WHERE uname NE sy-uname
AND obj_name IN gr_switchname.
<ls_dwinactiv>-uname = sy-uname.
ENDLOOP.
INSERT dwinactiv FROM TABLE lt_dwinactiv ACCEPTING DUPLICATE KEYS.
ENDIF.

MESSAGE s357(scwn).
CALL FUNCTION 'RS_WORKING_OBJECT_ACTIVATE'
EXPORTING
dictionary_only = 'X'
TABLES
OBJECTS = lt_dwinactiv
EXCEPTIONS
OTHERS = 5.
ENDIF.

"make sure that ranges are not empty


APPEND 'IEQ' TO: "gr_switchname,
gr_domname,
gr_rollname,
gr_tabname,
gr_shlpname,
gr_viewname,
gr_enqname,
gr_ttypname,
gr_guistatus,
gr_indexes,
gr_indxtab,
gr_indxname.

SELECT * FROM dwinactiv INTO TABLE lt_dwinactiv


WHERE ( object NE space ) "dummy
AND ( "obj_name IN gr_switchname OR
obj_name IN gr_domname
OR obj_name IN gr_rollname
OR obj_name IN gr_tabname
OR obj_name IN gr_shlpname
OR obj_name IN gr_viewname
OR obj_name IN gr_enqname
OR obj_name IN gr_ttypname
OR obj_name IN gr_guistatus
OR obj_name IN gr_indexes ).
ENDIF.

"add all relevant inactive objects also to current user's worklist


"gets relevant if a different user is doing the activation.
"entries for all users will be deleted if any user activates the object
LOOP AT lt_dwinactiv ASSIGNING <ls_dwinactiv> WHERE uname NE sy-uname.
<ls_dwinactiv>-uname = sy-uname.
ENDLOOP.
INSERT dwinactiv FROM TABLE lt_dwinactiv ACCEPTING DUPLICATE KEYS.
LOOP AT lt_dwinactiv ASSIGNING <ls_dwinactiv>
WHERE object EQ 'DOMA' OR
object EQ 'DTEL' OR
object EQ 'TABL' OR
object EQ 'INDX' OR
object EQ 'VIEW' OR
object EQ 'ENQU' OR
object EQ 'TTYP' OR
object EQ 'SHLP'.
CALL FUNCTION 'RS_DD_CHECK_ACTIVATE'
EXPORTING
objtype = <ls_dwinactiv>-object
objname = <ls_dwinactiv>-obj_name
* i_no_ui = 'X' "not in all sap_basis releases
EXCEPTIONS
OTHERS = 1.
CALL FUNCTION 'RS_DD_CHECK_ACTIVATE'
EXPORTING
objtype = <ls_dwinactiv>-object
objname = <ls_dwinactiv>-obj_name
* i_no_ui = 'X' "not in all sap_basis releases
EXCEPTIONS
OTHERS = 1.

"check dependent database tables similar to DD_TABL_ACT


"==> shall be part of RS_DD_CHECK_ACTIVATE of DD_TABL_ACT
DATA: lt_dd02v_inc TYPE TABLE OF dd02v,
ls_dd02v_inc TYPE dd02v,
l_obj_name TYPE e071-obj_name,
l_auth_subrc TYPE sysubrc.

IF sy-subrc EQ 0.
CALL FUNCTION 'DD_GET_INCLUDING_TABLES' "Get tables which are
EXPORTING "importing table TABNAME
tabname = <ls_dwinactiv>-obj_name(30)
TABLES
tabnames = lt_dd02v_inc.
CLEAR l_auth_subrc.
LOOP AT lt_dd02v_inc INTO ls_dd02v_inc.
l_obj_name = ls_dd02v_inc-tabname.
CALL FUNCTION 'RS_DD_CHECK_ACTIVATE'
EXPORTING
objtype = 'TABL'
objname = l_obj_name
* i_no_ui = 'X' "not in all sap_basis releases
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
l_auth_subrc = sy-subrc.
MESSAGE e666(01) WITH 'No authorization to activate database table'
<ls_dwinactiv>-obj_name '. Call transaction SU53 for details' INTO sy-lisel. "#EC *
CALL METHOD log_message.
EXIT.
ENDIF.
ENDLOOP.
sy-subrc = l_auth_subrc.
ENDIF.

IF sy-subrc EQ 0.
"DDIC always via RADMASG0
"move DDIC objects to separate worklist
APPEND <ls_dwinactiv> TO lt_dwinactiv_ddic.
DELETE lt_dwinactiv.
ELSE.
MESSAGE e666(01) WITH 'No authorization to activate' <ls_dwinactiv>-object
<ls_dwinactiv>-obj_name '. Call transaction SU53 for details' INTO sy-lisel. "#EC *
CALL METHOD log_message.
CASE <ls_dwinactiv>-object.
WHEN 'DOMA'. DELETE gr_domname WHERE low EQ <ls_dwinactiv>-obj_name.
WHEN 'DTEL'. DELETE gr_rollname WHERE low EQ <ls_dwinactiv>-obj_name.
WHEN 'TABL'.
DELETE gr_tabname WHERE low EQ <ls_dwinactiv>-obj_name.
DELETE gr_indxtab WHERE low EQ <ls_dwinactiv>-obj_name.
WHEN 'INDX'. DELETE gr_indxname WHERE low EQ <ls_dwinactiv>-obj_name.
WHEN 'VIEW'. DELETE gr_viewname WHERE low EQ <ls_dwinactiv>-obj_name.
WHEN 'ENQU'. DELETE gr_enqname WHERE low EQ <ls_dwinactiv>-obj_name.
WHEN 'TTYP'. DELETE gr_ttypname WHERE low EQ <ls_dwinactiv>-obj_name.
WHEN 'SHLP'. DELETE gr_shlpname WHERE low EQ <ls_dwinactiv>-obj_name.
ENDCASE.
DELETE lt_dwinactiv.
ENDIF.
ENDLOOP.

IF lt_dwinactiv[] IS INITIAL AND lt_dwinactiv_ddic[] IS INITIAL AND


gv_repository_changed IS INITIAL.
IF testrun IS NOT INITIAL.
MESSAGE i666(01) WITH 'No activation neccessary' '' '' '' INTO sy-lisel.
"#EC *
CALL METHOD log_message.
IF sy-cprog EQ 'SAP_LOCAL_DOWNPORT_ASSISTANT'.
MESSAGE i666(01) WITH 'Press button Back (F3) to leave the simulation.'
'' '' '' INTO sy-lisel. "#EC *
CALL METHOD log_message.
ENDIF.
IF gv_translation EQ 'X' OR gv_copy_translation EQ 'X'.
MESSAGE i666(01) WITH 'Translation has been updated' '' '' '' INTO sy-
lisel. "#EC *
CALL METHOD log_message.
ENDIF.
ENDIF.
ELSEIF gv_errors_occured IS NOT INITIAL.
MESSAGE w666(01) WITH 'Activation was skipped because of errors' 'in previous
steps. Please try again.' INTO sy-lisel. "#EC *
CALL METHOD log_message.
ELSEIF i_result_auth_check IS NOT INITIAL.
MESSAGE e666(01) WITH 'No authorization to activate the DDIC changes.' 'Call
transaction SU53 for details' '' '' INTO sy-lisel. "#EC *
CALL METHOD log_message.
ELSE. "do the activation

IF lt_dwinactiv[] IS NOT INITIAL.


"1) activate non DDIC objects (e.g. CUAD) online
MESSAGE s357(scwn).
CALL FUNCTION 'RS_WORKING_OBJECT_ACTIVATE'
EXPORTING
dictionary_only = ' '
* cwb_mode = 'X'
TABLES
OBJECTS = lt_dwinactiv
EXCEPTIONS
OTHERS = 5.
IF sy-subrc NE 0.
lv_answer = 'A'.
CALL METHOD log_message.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDIF.

IF lt_dwinactiv_ddic[] IS NOT INITIAL AND lv_answer NE 'A'.


IF gv_unit_test IS NOT INITIAL OR genview IS NOT INITIAL.
lv_answer = '1'. "force online activation
ELSE.
CALL FUNCTION 'POPUP_TO_CONFIRM'
EXPORTING
titlebar = 'Activation' "#EC NOTEXT
text_question = 'How do you want to activate DDIC?' "#EC
NOTEXT
text_button_1 = 'Online' "#EC NOTEXT
text_button_2 = 'Batch' "#EC NOTEXT
display_cancel_button = 'X'
IMPORTING
answer = lv_answer
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE 'I' NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
CALL METHOD log_message.
ENDIF.
ENDIF.
ENDIF.

IF sy-repid(2) EQ '%_'. "Temp. Subroutine Pool


l_logname = 'UDO'.
ELSEIF sy-repid(1) EQ '/'.
SPLIT sy-repid AT '/' INTO l_logname l_logname l_logname. "remove namespace
ELSE.
l_logname = sy-repid.
ENDIF.
CONCATENATE l_logname sy-datum sy-uzeit INTO l_logname SEPARATED BY '_'.

IF lv_answer EQ '1'. "online


"2a) activate DDIC online
IF sy-repid(2) EQ '%_'. "Temp. Subroutine Pool
l_logname = 'UDO'.
ELSEIF sy-repid(1) EQ '/'.
SPLIT sy-repid AT '/' INTO l_logname l_logname l_logname. "remove
namespace
ELSE.
l_logname = sy-repid.
ENDIF.

CONCATENATE l_logname ':' sy-datum ':' sy-uzeit INTO l_logname.

CALL METHOD mass_activation "Step 1


EXPORTING
i_step = 1
i_logname = space "no log, any error messages will appear in step 2
also
i_ddmode = 'T'
i_inactive = 'X'
EXCEPTIONS
error = 1.
IF sy-subrc EQ 0.
CALL METHOD mass_activation "Step 2
EXPORTING
i_step = 2
i_logname = l_logname
i_ddmode = 'O'
i_inactive = ' '
EXCEPTIONS
error = 1.
ENDIF.

CLEAR l_message.
IF sy-subrc EQ 0.
LOOP AT gr_dbtabname INTO ls_tabname WHERE low IS NOT INITIAL.
"make a test SELECT * FROM table UP TP 1 ROWS to see whether it is
really consistent
"go via RFC to have the chance to catch short dumps
"or GET_TABLE_KEYLIST_RFC
DATA: lt_options TYPE TABLE OF rfc_db_opt,
lt_fields TYPE TABLE OF rfc_db_fld,
lt_data TYPE TABLE OF tab512.

CALL FUNCTION 'RFC_READ_TABLE' DESTINATION 'NONE'


EXPORTING
query_table = ls_tabname-low
rowcount = 1
TABLES
OPTIONS = lt_options
fields = lt_fields
data = lt_data
EXCEPTIONS
system_failure = 1 MESSAGE l_message
table_not_available = 0
OTHERS = 0.
IF sy-subrc <> 0.
IF l_message CS 'ASSIGN ... CASTING'. "RFC_READ_TABLE does not like
SSTRING fields
MESSAGE i666(01) WITH 'Skipping additional check' 'for database
table' ls_tabname-low INTO sy-lisel. "#EC *
CLEAR l_message. "we do not treat the as an error
ELSE.
MESSAGE e666(01) WITH l_message INTO sy-lisel. "#EC *
ENDIF.
CALL METHOD log_message.
ENDIF.
ENDLOOP.

APPEND LINES OF gr_ttypname TO gr_tabname.


APPEND LINES OF gr_rollname TO gr_tabname.

LOOP AT gr_tabname INTO ls_tabname WHERE low IS NOT INITIAL.


TRY.
CREATE DATA l_dref TYPE (ls_tabname-low).
CATCH cx_sy_create_data_error.
MESSAGE e666(01) WITH 'Data Type' ls_tabname-low 'is inconsistent'
INTO l_message. "#EC *
CALL METHOD log_message.
ENDTRY.
ENDLOOP.
IF l_message IS INITIAL.
CLEAR sy-subrc.
ELSE.
MESSAGE e666(01) WITH 'DDIC activation step 3 ended with errors.' INTO
sy-lisel. "#EC *
CALL METHOD log_message.
sy-subrc = 4.
ENDIF.
ENDIF.

IF sy-subrc EQ 0.
MESSAGE s666(01) WITH 'DDIC activation successful' INTO sy-lisel. "#EC *
CALL METHOD log_message.
MESSAGE i626(do) WITH 'Click this message to view' 'detailed activation
logs with name' l_logname INTO sy-lisel. "#EC *
CALL METHOD log_message.
ELSE.
"e.g. no authorization for activation or conversion of dependent database
tables
"make sure that the objects appear as inactive; corresponding are removed
by DDIC activation phase 1 although phase 2 or 3 may fail.
MODIFY dwinactiv FROM TABLE lt_dwinactiv_ddic.
MESSAGE e626(do) WITH 'Click this message to view' 'detailed activation
logs with name' l_logname INTO sy-lisel. "#EC *
CALL METHOD log_message.
ENDIF.

ELSEIF lv_answer EQ '2' .


"2b) activate DDIC objects via batch job
ls_job-jobname = sy-repid.

CALL FUNCTION 'JOB_OPEN'


EXPORTING
jobname = ls_job-jobname
IMPORTING
jobcount = ls_job-jobcount
CHANGING
ret = lv_rc
EXCEPTIONS
cant_create_job = 1
invalid_job_data = 2
jobname_missing = 3
OTHERS = 4.
IF sy-subrc <> 0 OR lv_rc NE 0.
MESSAGE e026(bt) WITH ls_job-jobname INTO sy-lisel. "#EC *
CALL METHOD log_message.
ELSE.
SUBMIT radmasg0 WITH domname IN gr_domname "#EC CI_SUBMIT
WITH rollname IN gr_rollname
WITH tabname IN gr_tabname
WITH indxtab IN gr_indxtab
WITH indxname IN gr_indxname
WITH viewname IN gr_viewname
WITH ttypname IN gr_ttypname
WITH shlpname IN gr_shlpname
WITH logname EQ l_logname
WITH logshow EQ 'X' "show log in SPOOL

WITH ddmode EQ 'T'


WITH inactive EQ 'X'

VIA JOB ls_job-jobname


NUMBER ls_job-jobcount
AND RETURN.

SUBMIT radmasg0 WITH domname IN gr_domname "#EC CI_SUBMIT


WITH rollname IN gr_rollname
WITH tabname IN gr_tabname
WITH indxtab IN gr_indxtab
WITH indxname IN gr_indxname
WITH viewname IN gr_viewname
WITH ttypname IN gr_ttypname
WITH shlpname IN gr_shlpname
WITH logname EQ l_logname
WITH logshow EQ 'X' "show log in SPOOL

WITH ddmode EQ 'O'


WITH inactive EQ ' '

VIA JOB ls_job-jobname


NUMBER ls_job-jobcount
AND RETURN.

CALL FUNCTION 'JOB_CLOSE'


EXPORTING
jobcount = ls_job-jobcount
jobname = ls_job-jobname
strtimmed = 'X'
EXCEPTIONS
OTHERS = 1.
IF sy-subrc EQ 0.
MESSAGE s305(ut) WITH ls_job-jobname INTO sy-lisel. "#EC *
CALL METHOD log_message.
MESSAGE i666(01) WITH 'Use Report RADPROTB to view' 'activation log'
l_logname 'after job has finished in transaction SMX.'. "#EC *
CALL METHOD log_message.
ELSE.
MESSAGE e026(bt) WITH ls_job-jobname INTO sy-lisel. "#EC *
CALL METHOD log_message.
ENDIF.
ENDIF.
ENDIF.

CALL METHOD lcl_wb=>execute_method "e.g. OSOD, SCP2


EXPORTING
i_method = trmtd_after_imp.

ENDIF.

SET PARAMETER ID 'EUK' FIELD space.


EXPORT current_devclass FROM space TO MEMORY ID 'EUK'.
ENDMETHOD. "activate

METHOD mass_activation.

DATA: lt_log TYPE TABLE OF trlog,


ls_log TYPE trlog.

SUBMIT radmasg0 WITH domname IN gr_domname "#EC CI_SUBMIT


WITH rollname IN gr_rollname
WITH tabname IN gr_tabname
WITH indxtab IN gr_indxtab
WITH indxname IN gr_indxname
WITH viewname IN gr_viewname
WITH enquname IN gr_enqname
WITH ttypname IN gr_ttypname
WITH shlpname IN gr_shlpname
WITH logname EQ i_logname
WITH logshow EQ space

WITH inactive EQ i_inactive


WITH ddmode EQ i_ddmode

AND RETURN.

IMPORT act_rc TO sy-subrc FROM MEMORY ID 'ACRC'.

CHECK i_logname IS NOT INITIAL.

IF sy-subrc > 4. "4 is only warning


CHECK i_step <> 1. "messages of step 1 have to be ignored
MESSAGE e666(01) WITH 'DDIC activation step' i_step 'ended with errors:' INTO
sy-lisel. "#EC *
CALL METHOD log_message.
CALL FUNCTION 'TR_READ_LOG'
EXPORTING
iv_log_type = 'DB'
iv_logname_db = i_logname
TABLES
et_lines = lt_log
EXCEPTIONS
invalid_input = 1
access_error = 2
OTHERS = 3.
"append errors from activation log
LOOP AT lt_log INTO ls_log WHERE severity EQ 'E'.
MESSAGE e666(01) WITH ls_log-line INTO sy-lisel. "#EC *
CALL METHOD log_message.
ENDLOOP.
RAISE error.
ENDIF.

ENDMETHOD. "mass_activation

METHOD execute_method.

DATA: ls_e070 TYPE e070,


ls_e071 TYPE e071,
lt_e071 TYPE TABLE OF e071,
lt_e071k TYPE TABLE OF e071k,
ls_trkey TYPE trkey.
DATA: lt_result TYPE scts_cl_results. ">=SAPBASIS700
DATA: lt_client TYPE trexe_t_client.

DATA: lt_trlog TYPE TABLE OF trlog,


ls_trlog TYPE trlog.

FIELD-SYMBOLS: <ls_method_call> TYPE trmtd_method_call.

CHECK i_method IS NOT INITIAL.

"get AFTER_IMP method


SORT gt_trkey.
DELETE ADJACENT DUPLICATES FROM gt_trkey COMPARING obj_type obj_name.
LOOP AT gt_trkey INTO ls_trkey.
ls_e071-pgmid = 'R3TR'.
ls_e071-object = ls_trkey-obj_type.
ls_e071-obj_name = ls_trkey-obj_name.
APPEND ls_e071 TO lt_e071.
ENDLOOP.

CALL FUNCTION 'TRINT_FREE_MEMORY'.


* CALL FUNCTION 'TR_INITIALIZE_LOG' "to much action, do the main stuff only:
DATA: gv_mem_id(9) VALUE 'prot_file'.
EXPORT gv_mem_file FROM space TO MEMORY ID gv_mem_id.

* DATA: TRINT_CALL_AFTER_IMP_METHOD TYPE funcname VALUE


'TRINT_CALL_AFTER_IMP_METHOD'.
* IF sy-saprl >= 700.
* APPEND sy-mandt TO lt_result.
">=SAPBASIS700
* CALL FUNCTION trint_call_after_imp_method
* EXPORTING
* iv_trkorr = space
* is_e070 = ls_e070
* it_e071 = lt_e071[]
* it_e071k = lt_e071k[]
* iv_update_lockflag = '' "'X'
* CHANGING
">=SAPBASIS700
* it_client = lt_result.
">=SAPBASIS700
* . "keep . for 640!
* ELSE.
* APPEND sy-mandt TO lt_client.
* CALL FUNCTION trint_call_after_imp_method
* EXPORTING
* iv_trkorr = space
* is_e070 = ls_e070
* it_e071 = lt_e071[]
* it_e071k = lt_e071k[]
* iv_update_lockflag = '' "'X'
* it_client = lt_client.
* ENDIF.

CALL FUNCTION 'TR_READ_LOG'


EXPORTING
iv_log_type = 'MEMORY'
* IV_LOGNAME_FILE =
* IV_LOGNAME_DB =
iv_logname_memory = 'APPEND_LOG'
* IV_TIMESTAMP = '00000000000000'
* IV_CLIENT = ' '
* IV_LANGUAGE = SYST-LANGU
TABLES
et_lines = lt_trlog
EXCEPTIONS
invalid_input = 1
access_error = 2
OTHERS = 3.

"append messages from ,ethod execution log


LOOP AT lt_trlog INTO ls_trlog WHERE NOT ( class EQ 'PU' AND number EQ '131' ).
"WHERE severity EQ 'E'.
MESSAGE i856(tr) WITH ls_trlog-line(50) ls_trlog-line+50(50) ls_trlog-
line+100(31) INTO sy-lisel. "#EC *
sy-msgty = ls_trlog-severity.
CALL METHOD log_message.
ENDLOOP.

ENDMETHOD. "execute_method

METHOD add_to_transport.

STATICS: s_object LIKE i_object,


s_obj_name TYPE string,
s_subrc TYPE sysubrc.

DATA: l_tadir_name TYPE tadir-obj_name,


l_object_name TYPE string,
l_object_class TYPE string,
l_extend,
l_global_lock,
ls_trkey TYPE trkey,
ls_t000 TYPE t000,
l_bcset_clients TYPE string.

CLEAR sy-subrc.
CHECK gv_copy_translation IS INITIAL.
CHECK testrun IS INITIAL.

IF i_object NE s_object OR
i_obj_name NE s_obj_name.

s_object = i_object.
s_obj_name = i_obj_name.

CASE i_object.
WHEN 'SCP1'.
WHEN 'SCP2'.
"check if there is any BCSet client.
SELECT mandt FROM t000 INTO ls_t000 WHERE ccorigcont EQ 'X'. "AND
cccategory EQ 'C' <- sometimes not customized as C but T, e.g. E27
CONCATENATE l_bcset_clients ls_t000-mandt INTO l_bcset_clients
SEPARATED BY space.
ENDSELECT.
IF l_bcset_clients IS NOT INITIAL.
"check if current client is a BCSet client
IF l_bcset_clients NS sy-mandt.
MESSAGE e666(01) WITH 'BCSets can only be changed in one' 'of the
following clients:' l_bcset_clients INTO sy-lisel. "#EC *
CALL METHOD log_message.
RAISE error.
ENDIF.
ENDIF.
ENDCASE.

CASE i_object.
WHEN 'REPT' OR 'FUNC' OR 'CUAD' OR 'DOCU'.
l_object_class = i_object.
l_object_name = i_obj_name.
WHEN 'DOCV' OR 'DOCT' OR 'DSYS' OR 'STCS' OR 'MSAG'
OR 'IWPR' OR 'IWMO' OR 'IWSV' OR 'IWOM' OR 'IWSG' OR 'SICF' "SEGW
OR 'SFRN' OR 'CUS0' OR 'CUS1' OR 'CUS2' "IMG
OR 'OSOD'
OR 'SCP1' OR 'SCP2'. "logical transport object
l_object_class = i_object.
l_object_name = i_obj_name.
l_global_lock = 'X'.
l_extend = 'X'.
l_tadir_name = i_obj_name.
WHEN 'MESS'.
l_object_class = 'T100'.
l_object_name = i_obj_name.
WHEN 'CLAS' OR 'FUGR' OR 'PARA' OR 'VCLS' OR 'AUTH'.
l_object_class = i_object.
l_object_name = i_obj_name.
l_tadir_name = i_obj_name.
l_global_lock = 'X'.
WHEN 'DOMA' OR 'DTEL' OR 'TABL' OR 'VIEW' OR 'INDX' OR 'TTYP' OR 'SHLP' OR
'ENQU'.
l_object_class = 'DICT'.
CONCATENATE i_object i_obj_name INTO l_object_name.
l_tadir_name = i_obj_name.
WHEN 'DYNP'.
l_object_class = 'SCRP'.
l_object_name = i_obj_name.
WHEN OTHERS.
l_object_class = i_object.
l_object_name = i_obj_name.
ENDCASE.

"create TADIR entry in advance avoid popup


IF l_tadir_name IS NOT INITIAL.
DATA: ls_tadir_old TYPE tadir.
SELECT SINGLE * FROM tadir INTO ls_tadir_old
WHERE pgmid EQ 'R3TR'
AND object EQ i_object
AND obj_name EQ l_tadir_name.
IF sy-subrc NE 0. "V3.52
IF l_object_class EQ 'DICT' AND "V3.52
i_object NE 'INDX'. "V3.52
l_global_lock = 'X'. "similar to MSDXXBAS_FORMS 463 "V3.52
ENDIF. "V3.52
ENDIF. "V3.52
IF i_langu CA 'ED'.
"set correct language and package on first call per object
"skip this for other languages than EN/DE.
CALL FUNCTION 'TR_TADIR_INTERFACE'
EXPORTING
* WI_DELETE_TADIR_ENTRY = ' '
wi_test_modus = space
wi_tadir_pgmid = 'R3TR'
wi_tadir_object = i_object
wi_tadir_obj_name = l_tadir_name
wi_tadir_devclass = i_devclass
wi_tadir_masterlang = i_langu
EXCEPTIONS
OTHERS = 25.
IF sy-subrc <> 0.
ENDIF.
ENDIF.
IF i_devclass IS NOT INITIAL.
"set correct package in memory
EXPORT current_devclass FROM i_devclass TO MEMORY ID 'EUK'.
SET PARAMETER ID 'EUK' FIELD i_devclass.
ENDIF.
ENDIF.

CALL FUNCTION 'RS_CORR_INSERT' "and create TADIR-entry


EXPORTING
object = l_object_name
object_class = l_object_class
devclass = i_devclass
korrnum = gv_trkorr
global_lock = l_global_lock
* AUTHOR = ' '
master_language = i_langu
* GENFLAG = ' '
* PROGRAM = ' '
* OBJECT_CLASS_SUPPORTS_MA = ' '
extend = l_extend
* SUPPRESS_DIALOG = ' '
* MOD_LANGU = ' '
* ACTIVATION_CALL = ' '
IMPORTING
korrnum = gv_trkorr
* ORDERNUM =
* NEW_CORR_ENTRY =
* AUTHOR =
transport_key = ls_trkey
* NEW_EXTEND =
EXCEPTIONS
cancelled = 1
permission_failure = 2
unknown_objectclass = 3
OTHERS = 4.
s_subrc = sy-subrc.

IF sy-subrc EQ 0.
"collect objects with update
COLLECT ls_trkey INTO gt_trkey.
"correct master language if neccessary
IF l_tadir_name IS NOT INITIAL AND ls_tadir_old IS INITIAL.
IF i_langu CA 'ED'.
UPDATE tadir SET masterlang = i_langu
WHERE pgmid EQ 'R3TR'
AND object EQ i_object
AND obj_name EQ l_tadir_name
AND masterlang NE i_langu.
ENDIF.
ENDIF.
ENDIF.

ENDIF.

IF s_subrc NE 0.
MESSAGE e666(01) WITH 'Could not add to transport request' INTO sy-lisel.
"#EC *
CALL METHOD log_message.
RAISE error.
ENDIF.

ENDMETHOD. "add_to_transport

METHOD create_message.

DATA: lt_bdc TYPE TABLE OF bdcdata,


ls_bdc TYPE bdcdata,
ls_bdcp TYPE bdcdata,
ls_opt TYPE ctu_params.
DATA: ls_t100 TYPE t100,
ls_t100a TYPE t100a,
ls_t100u TYPE t100u,
l_obj_name TYPE dokil-object,
ls_msg_class LIKE LINE OF gr_msg_class VALUE 'IEQ'.

ls_msg_class-low = i_msgid.
COLLECT ls_msg_class INTO gr_msg_class.

CALL METHOD set_context


EXPORTING
i_langu = i_langu
i_object = 'MESS'
i_obj_name = i_msgid
i_obj_name2 = i_msgno.

SELECT SINGLE * FROM t100a INTO ls_t100a


WHERE arbgb EQ i_msgid.
IF sy-subrc NE 0.
IF testrun IS INITIAL OR i_msgid NOT IN gr_msg_class.
MESSAGE e509(eu) WITH i_msgid INTO sy-lisel. "#EC *
CALL METHOD log_message.
ENDIF.
RETURN.
ENDIF.

SELECT SINGLE * FROM t100 INTO ls_t100


WHERE sprsl EQ i_langu
AND arbgb EQ i_msgid
AND msgnr EQ i_msgno.

SELECT SINGLE * FROM t100u INTO ls_t100u


WHERE arbgb EQ i_msgid
AND msgnr EQ i_msgno.
IF i_text EQ ls_t100-text.
IF i_selfdef IS INITIAL AND ls_t100u-selfdef IS INITIAL OR
i_selfdef IS NOT INITIAL AND ls_t100u-selfdef IS NOT INITIAL.
MESSAGE i666(01) WITH 'No update necessary' INTO sy-lisel. "#EC *
CALL METHOD log_message.
RETURN.
ENDIF.
ENDIF.

CHECK testrun IS INITIAL.

CALL FUNCTION 'DOCU_OBJECT_NAME_CONCATENATE'


EXPORTING
docu_id = 'NA'
element = i_msgid
addition = i_msgno
IMPORTING
object = l_obj_name
EXCEPTIONS
OTHERS = 0.

CALL METHOD add_to_transport


EXPORTING
i_object = 'MESS'
i_obj_name = l_obj_name
EXCEPTIONS
OTHERS = 1.
CHECK sy-subrc EQ 0.

IF i_langu EQ ls_t100a-masterlang AND gv_copy_translation IS INITIAL.


"create or change message and write into transport request
"if sy-langu is different from master language SE91 will switch to master
lang

"-------------------------------------------
ls_bdcp-program = 'SAPLWBMESSAGES'.
ls_bdcp-dynpro = '0100'.
ls_bdcp-dynbegin = 'X'.
APPEND ls_bdcp TO lt_bdc.

* ls_bdc-fnam = 'BDC_CURSOR'.
* ls_bdc-fval = 'MSG_NUMMER'.
* APPEND ls_bdc TO lt_bdc.

ls_bdc-fnam = 'RSDAG-ARBGB'.
ls_bdc-fval = i_msgid.
APPEND ls_bdc TO lt_bdc.

ls_bdc-fnam = 'MSG_NUMMER'.
ls_bdc-fval = i_msgno.
APPEND ls_bdc TO lt_bdc.

ls_bdc-fnam = 'RSDAG-MSGFLAG'.
ls_bdc-fval = 'X'.
APPEND ls_bdc TO lt_bdc.

ls_bdc-fnam = 'BDC_OKCODE'.
ls_bdc-fval = '=WB_EDIT'.
APPEND ls_bdc TO lt_bdc.

"-------------------------------------------
ls_bdcp-dynpro = '1000'.
ls_bdcp-dynbegin = 'X'.
APPEND ls_bdcp TO lt_bdc.

ls_bdc-fnam = 'BDC_SUBSCR'.
ls_bdc-fval = 'SAPLWBMESSAGES 0101SUB'.
APPEND ls_bdc TO lt_bdc.

ls_bdc-fnam = 'T100-TEXT(01)'.
ls_bdc-fval = i_text.
APPEND ls_bdc TO lt_bdc.

ls_bdc-fnam = 'LISTTAB-DOKU_FLAG(01)'.
IF i_selfdef IS INITIAL.
ls_bdc-fval = ' '.
ELSE.
ls_bdc-fval = 'X'.
ENDIF.
APPEND ls_bdc TO lt_bdc.

ls_bdc-fnam = 'BDC_OKCODE'.
ls_bdc-fval = '=WB_SAVE'.
APPEND ls_bdc TO lt_bdc.

"-------------------------------------------
ls_bdcp-dynpro = '1000'.
ls_bdcp-dynbegin = 'X'.
APPEND ls_bdcp TO lt_bdc.

ls_bdc-fnam = 'BDC_OKCODE'.
ls_bdc-fval = '=WB_BACK'.
APPEND ls_bdc TO lt_bdc.

"-------------------------------------------
ls_bdcp-dynpro = '0100'.
ls_bdcp-dynbegin = 'X'.
APPEND ls_bdcp TO lt_bdc.

ls_bdc-fnam = 'BDC_OKCODE'.
ls_bdc-fval = '=WB_BACK'.
APPEND ls_bdc TO lt_bdc.

ls_opt-dismode = 'E'.
ls_opt-racommit = 'X'.
ls_opt-nobinpt = 'X'.
ls_opt-nobiend = 'X'.

"-------------------------------------------
CALL TRANSACTION 'SE91' USING lt_bdc OPTIONS FROM ls_opt.
ELSE.
"update translation only
ls_t100-arbgb = i_msgid.
ls_t100-msgnr = i_msgno.
ls_t100-sprsl = i_langu.
ls_t100-text = i_text.
MODIFY t100 FROM ls_t100. "no activation needed
ENDIF.
MESSAGE i666(01) WITH 'Update successful' INTO sy-lisel. "#EC *
CALL METHOD log_message.
gv_translation = 'X'.
gv_repository_changed = 'X'.

ENDMETHOD. "create_message

METHOD create_mess_docu.

STATICS: lt_line TYPE TABLE OF tline.

DATA: ls_head TYPE thead,


lt_line_old LIKE lt_line,
ls_line TYPE tline,
ls_tadir TYPE tadir,
lv_no_masterlang.

IF i_line IS NOT INITIAL.


ls_line = i_line.
SHIFT ls_line-tdline LEFT.
APPEND ls_line TO lt_line.
ELSE.
CALL METHOD set_context
EXPORTING
i_langu = i_langu
i_object = 'MESS'
i_obj_name = i_msgid
i_obj_name2 = i_msgno
i_text = 'Message Longtext'. "#EC NOTEXT

ls_head-tdobject = 'DOKU'.
CONCATENATE i_msgid i_msgno INTO ls_head-tdname.
ls_head-tdid = 'NA'. "Nachricht/Message
ls_head-tdspras = i_langu.
ls_head-tdform = 'S_DOCU_SHOW'.
ls_head-tdstyle = 'S_DOCUS1'.

CALL FUNCTION 'DOCU_GET'


EXPORTING
id = ls_head-tdid(2)
langu = ls_head-tdspras
object = ls_head-tdname(60)
TABLES
line = lt_line_old
EXCEPTIONS
OTHERS = 0.

IF et_lines IS SUPPLIED.
et_lines[] = lt_line[] = lt_line_old[].
RETURN.
ENDIF.
IF lt_line_old[] EQ lt_line.
REFRESH lt_line.
"no update necessary
MESSAGE i666(01) WITH 'No update necessary' INTO sy-lisel. "#EC *
CALL METHOD log_message.
RETURN.
ENDIF.

IF testrun IS INITIAL.

CONCATENATE ls_head-tdid ls_head-tdname INTO ls_tadir-obj_name.

CALL METHOD add_to_transport


EXPORTING
i_object = 'DOCU'
i_obj_name = ls_tadir-obj_name
EXCEPTIONS
OTHERS = 0.

SELECT SINGLE * FROM tadir INTO ls_tadir


WHERE pgmid EQ 'R3TR'
AND object EQ 'MSAG'
AND obj_name EQ i_msgid.
IF ls_head-tdspras NE ls_tadir-masterlang.
lv_no_masterlang = 'X'.
ENDIF.

"create new version


DATA l_dokversion TYPE dokhl-dokversion.
SELECT MAX( dokversion ) FROM dokhl INTO l_dokversion "#EC *
WHERE id = ls_head-tdid(2)
AND object = ls_head-tdname
AND langu = ls_head-tdspras.
ADD 1 TO l_dokversion.

ls_head-tdfdate = sy-datum.
ls_head-tdftime = sy-uzeit.
ls_head-tdfuser = sy-uname.
ls_head-tdldate = sy-datum.
ls_head-tdltime = sy-uzeit.
ls_head-tdluser = sy-uname.

CALL FUNCTION 'DOCU_UPDATE'


EXPORTING
* ACTCLASS = ' '
head = ls_head
no_masterlang = lv_no_masterlang
state = 'A'
typ = 'E'
version = l_dokversion
TABLES
line = lt_line.

MESSAGE i666(01) WITH 'Update successful' 'for longtext of message' i_msgid


i_msgno INTO sy-lisel. "#EC *
CALL METHOD log_message.
ENDIF.
gv_translation = 'X'.
REFRESH lt_line.
ENDIF.

ENDMETHOD. "create_mess_docu

METHOD create_other_docu.

STATICS: lt_line TYPE TABLE OF tline.

DATA: ls_head TYPE thead,


lt_line_old LIKE lt_line,
ls_line TYPE tline,
ls_tadir TYPE tadir,
lt_e071k TYPE TABLE OF e071k,
ls_ko200 TYPE ko200,
lv_no_masterlang.

DATA: lt_sfreln TYPE TABLE OF sfreln,


lt_sfreim TYPE TABLE OF sfreim,
lt_sfreac TYPE TABLE OF sfreac,
lt_sfrecou TYPE TABLE OF sfrecou.

IF i_line IS NOT INITIAL.


ls_line = i_line.
SHIFT ls_line-tdline LEFT.
APPEND ls_line TO lt_line.
ELSE.
CALL METHOD set_context
EXPORTING
i_langu = i_langu
i_object = 'DOCU'
i_obj_name = i_docname(2)
i_obj_name2 = i_docname+2.

ls_head-tdobject = 'DOKU'.
ls_head-tdname = i_docname+2.
ls_head-tdid = i_docname(2).
ls_head-tdspras = i_langu.
ls_head-tdform = 'S_DOCU_SHOW'.
ls_head-tdstyle = 'S_DOCUS1'.

CALL FUNCTION 'DOCU_GET'


EXPORTING
id = ls_head-tdid(2)
langu = ls_head-tdspras
object = ls_head-tdname(60)
TABLES
line = lt_line_old
EXCEPTIONS
OTHERS = 0.

IF et_lines IS SUPPLIED.
et_lines[] = lt_line[] = lt_line_old[].
RETURN.
ENDIF.

IF lt_line_old[] EQ lt_line.
"no update necessary
MESSAGE i666(01) WITH 'No update necessary' INTO sy-lisel. "#EC *
CALL METHOD log_message.

REFRESH lt_line.
RETURN.
ENDIF.

IF testrun IS INITIAL.

*DT TEST_UDO R3TR DOCV DTUDO_TEST


*DT /ASU/UDO_TEST R3TR DOCV /ASU/DTUDO_TEST
*UO /AIN/BW R3TR DOCV UO/AIN/BW
*UO A_S_ANLKL R3TR DOCV UOA_S_ANLKL
*MO AAIP0001 R3TR DOCV MOAAIP0001
*MO /ASU/UDO_TEST R3TR DOCV MO/ASU/UDO_TEST
*HY BOOK/NFM/IMG_ALL R3TR DSYS /NFM/BOOKIMG_ALL
*HY BOOKAUDIT_FI R3TR DSYS BOOKAUDIT_FI
*HY SIMGTEST_UDO R3TR DSYS SIMGTEST_UDO
*HY SIMG/ASU/TEST_UDO R3TR DSYS /ASU/SIMGTEST_UDO
*TX /ASU/UDO_TEST R3TR DOCT /ASU/UDO_TEST
*TX UDO_TEST R3TR DOCT UDO_TEST

CALL FUNCTION 'DOCU_TR_OBJECT_CHECK'


EXPORTING
object_id = ls_head-tdid(2)
object_name = ls_head-tdname(60)
TABLES
wt_e071k = lt_e071k
CHANGING
corr_entry = ls_ko200.

* DOCU_FROM_TR_OBJECT_RECEIVE (not in 640)

CALL METHOD add_to_transport "and create TADIR entry


EXPORTING
i_langu = i_langu
i_devclass = i_devclass
i_object = ls_ko200-object
i_obj_name = ls_ko200-obj_name
EXCEPTIONS
OTHERS = 1.
CHECK sy-subrc EQ 0.

MOVE-CORRESPONDING ls_ko200 TO ls_tadir.


CALL FUNCTION akb_get_tadir
EXPORTING
obj_type = ls_tadir-object
obj_name = ls_tadir-obj_name
IMPORTING
tadir = ls_tadir
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE i666(01) WITH 'Error reading' ls_ko200-object ls_ko200-obj_name
INTO sy-lisel. "#EC *
CALL METHOD log_message.
RETURN.
ENDIF.
IF ls_head-tdspras NE ls_tadir-masterlang.
lv_no_masterlang = 'X'.
ENDIF.

"create new version


DATA l_dokversion TYPE dokhl-dokversion.
SELECT MAX( dokversion ) FROM dokhl INTO l_dokversion "#EC *
WHERE id = ls_head-tdid(2)
AND object = ls_head-tdname
AND langu = ls_head-tdspras.
ADD 1 TO l_dokversion.

ls_head-tdfdate = sy-datum.
ls_head-tdftime = sy-uzeit.
ls_head-tdfuser = sy-uname.
ls_head-tdldate = sy-datum.
ls_head-tdltime = sy-uzeit.
ls_head-tdluser = sy-uname.

IF ls_head-tdid EQ 'IN'. "Release note / oder DOCV


IF 1 = 0.
"Nachlesen der Releasenote-Attribute
"und umformen in zus�tzliche Zeilen in lt_line
"vergleiche Aufruf von DOCU_UPDATE, wenn man in der SE61 ein IN RELN
pflegt.
PERFORM index_descriptors IN PROGRAM saplsdoc. "#EC *
ENDIF.
"read current attributes
SELECT * FROM sfreln INTO TABLE lt_sfreln WHERE txtkey = i_docname+6.
"#EC CI_GENBUFF
SELECT * FROM sfreim INTO TABLE lt_sfreim WHERE rel_cla EQ 'RELN' AND
rel_obj EQ i_docname+6. "#EC CI_GENBUFF
SELECT * FROM sfreac INTO TABLE lt_sfreac WHERE rel_cla EQ 'RELN' AND
rel_obj EQ i_docname+6. "#EC CI_GENBUFF
SELECT * FROM sfrecou INTO TABLE lt_sfrecou WHERE rel_cla EQ 'RELN' AND
rel_obj EQ i_docname+6. "#EC CI_GENBUFF
ENDIF.

CALL FUNCTION 'DOCU_UPDATE' "this initializes attributes


EXPORTING
* ACTCLASS = ' '
head = ls_head
no_masterlang = lv_no_masterlang
state = 'A'
typ = i_typ
version = l_dokversion
TABLES
line = lt_line.

"restore those attributes which have been deleted bei DOCU_UPDATE


INSERT sfreln FROM TABLE lt_sfreln ACCEPTING DUPLICATE KEYS.
INSERT sfreim FROM TABLE lt_sfreim ACCEPTING DUPLICATE KEYS.
INSERT sfreac FROM TABLE lt_sfreac ACCEPTING DUPLICATE KEYS.
INSERT sfrecou FROM TABLE lt_sfrecou ACCEPTING DUPLICATE KEYS.

MESSAGE i666(01) WITH 'Update successful' INTO sy-lisel. "#EC *


CALL METHOD log_message.
ENDIF.
gv_translation = 'X'.
REFRESH lt_line.
ENDIF.

ENDMETHOD. "create_other_docu

METHOD create_program_text.

DATA: lt_textpool TYPE TABLE OF textpool,


l_text LIKE i_text.
FIELD-SYMBOLS: <ls_textpool> TYPE textpool.

CALL METHOD set_context


EXPORTING
i_langu = i_langu
i_object = 'REPT'
i_obj_name = i_progname.

CALL FUNCTION 'RPY_PROGRAM_READ'


EXPORTING
language = i_langu
program_name = i_progname
with_includelist = space
only_texts = 'X'
read_latest_version = 'X'
with_lowercase = 'X'
TABLES
textelements = lt_textpool
EXCEPTIONS
cancelled = 1
not_found = 2
permission_error = 3
OTHERS = 4.
IF sy-subrc EQ 2.
READ TEXTPOOL i_progname INTO lt_textpool LANGUAGE i_langu.
ELSEIF sy-subrc NE 0.
MESSAGE e666(01) WITH 'Error while reading program text' 'of program'
i_progname INTO sy-lisel. "#EC *
CALL METHOD log_message.
RETURN.
ENDIF.

l_text = i_text.
IF i_id EQ 'S' AND i_text(8) IS NOT INITIAL AND i_text NE 'D .'.
"if selection text does note begin with 8 space -> insert them
SHIFT l_text LEFT DELETING LEADING space.
SHIFT l_text RIGHT BY 8 PLACES.
ENDIF.

READ TABLE lt_textpool ASSIGNING <ls_textpool>


WITH KEY id = i_id
key = i_key.
IF sy-subrc EQ 0. "already exists
IF l_text EQ <ls_textpool>-entry AND
i_length EQ <ls_textpool>-length.
MESSAGE i666(01) WITH 'No update necessary for program text' i_key INTO sy-
lisel. "#EC *
CALL METHOD log_message.
RETURN. "nothing to do
ELSE.
"update extsing entry
<ls_textpool>-entry = l_text.
IF i_length IS INITIAL OR i_length LT STRLEN( l_text ).
<ls_textpool>-length = STRLEN( l_text ).
ELSE.
<ls_textpool>-length = i_length.
ENDIF.
ENDIF.
ELSE.
"add new entry
APPEND INITIAL LINE TO lt_textpool ASSIGNING <ls_textpool>.
<ls_textpool>-id = i_id.
<ls_textpool>-key = i_key.
<ls_textpool>-entry = l_text.
IF i_length IS INITIAL.
<ls_textpool>-length = STRLEN( l_text ).
ELSE.
<ls_textpool>-length = i_length.
ENDIF.
ENDIF.

CHECK testrun IS INITIAL.

CALL METHOD add_to_transport


EXPORTING
i_devclass = i_devclass
i_langu = i_langu
i_object = 'REPT'
i_obj_name = i_progname
EXCEPTIONS
OTHERS = 1.
CHECK sy-subrc EQ 0.

* CALL FUNCTION 'RV_REPORT_WRITE_LANGU' "not in SAP_BASIS


* EXPORTING
* rw_langu = i_langu
* rw_reportname = i_progname
* TABLES
* rw_docu = lt_docu
* rw_textpool = lt_textpool.

INSERT textpool i_progname FROM lt_textpool LANGUAGE i_langu.


MESSAGE i666(01) WITH 'Update successful for program text' i_key INTO sy-lisel.
"#EC *
CALL METHOD log_message.

ENDMETHOD. "create_program_text

METHOD modify_stcs. "MF

DATA: ls_hdr_old TYPE REF TO data.


DATA: lt_hdt_old TYPE REF TO data.
DATA: lt_tsk_old TYPE REF TO data.
DATA: lt_att_old TYPE REF TO data.
FIELD-SYMBOLS: <l_scenario_id> TYPE c,
<l_user_old> TYPE sy-uname,
<l_date_old> TYPE sy-datum,
<l_user_new> TYPE sy-uname,
<l_date_new> TYPE sy-datum,
<l_doku_id_old> TYPE ANY,
<l_doku_obj_old> TYPE ANY,
<l_buildno_old> TYPE ANY,
<l_obsolete_old> TYPE ANY,
<l_basscnid_old> TYPE ANY,
<l_configcl_old> TYPE ANY,
<l_doku_id_new> TYPE ANY,
<l_doku_obj_new> TYPE ANY,
<l_buildno_new> TYPE ANY,
<l_obsolete_new> TYPE ANY,
<l_basscnid_new> TYPE ANY,
<l_configcl_new> TYPE ANY,
<ls_hdr_old> TYPE ANY,
<lt_hdt_old> TYPE ANY TABLE,
<lt_tsk_old> TYPE ANY TABLE,
<lt_att_old> TYPE ANY TABLE,
<lt_hdt_new> TYPE ANY TABLE,
<lt_tsk_new> TYPE ANY TABLE,
<lt_att_new> TYPE ANY TABLE.
CONSTANTS: c_hdr_table TYPE tabname VALUE 'STC_SCN_HDR',
c_hdt_table TYPE tabname VALUE 'STC_SCN_HDR_T',
c_tsk_table TYPE tabname VALUE 'STC_SCN_TASKS',
c_att_table TYPE tabname VALUE 'STC_SCN_ATTR'.

ASSIGN COMPONENT 'SCENARIO_ID' OF STRUCTURE is_hdr TO <l_scenario_id>.


IF sy-subrc <> 0.
MESSAGE e666(01) WITH 'Object not supported;' 'SAP note 1589145 required'
INTO sy-lisel. "#EC *
CALL METHOD log_message.
RETURN.
ENDIF.

CALL METHOD set_context


EXPORTING
i_langu = i_langu
i_object = 'STCS'
i_obj_name = <l_scenario_id>.

TRY.
CREATE DATA ls_hdr_old TYPE (c_hdr_table).
ASSIGN ls_hdr_old->* TO <ls_hdr_old>.
CREATE DATA lt_hdt_old TYPE TABLE OF (c_hdt_table).
ASSIGN lt_hdt_old->* TO <lt_hdt_old>.
CREATE DATA lt_tsk_old TYPE TABLE OF (c_tsk_table).
ASSIGN lt_tsk_old->* TO <lt_tsk_old>.
ASSIGN it_hdt TO <lt_hdt_new>.
ASSIGN it_tsk TO <lt_tsk_new>.

ASSIGN COMPONENT 'DOKU_ID' OF STRUCTURE <ls_hdr_old> TO <l_doku_id_old>.


ASSIGN COMPONENT 'DOKU_OBJ' OF STRUCTURE <ls_hdr_old> TO <l_doku_obj_old>.
ASSIGN COMPONENT 'BUILD_NO' OF STRUCTURE <ls_hdr_old> TO <l_buildno_old>.
"1810570
ASSIGN COMPONENT 'OBSOLETE' OF STRUCTURE <ls_hdr_old> TO <l_obsolete_old>.
"1810570
ASSIGN COMPONENT 'BASIC_SCEN_ID' OF STRUCTURE <ls_hdr_old> TO
<l_basscnid_old>. "1810570
ASSIGN COMPONENT 'CONFIG_CLASS' OF STRUCTURE <ls_hdr_old> TO
<l_configcl_old>. "1810570

ASSIGN COMPONENT 'DOKU_ID' OF STRUCTURE is_hdr TO <l_doku_id_new>.


ASSIGN COMPONENT 'DOKU_OBJ' OF STRUCTURE is_hdr TO <l_doku_obj_new>.
ASSIGN COMPONENT 'BUILD_NO' OF STRUCTURE is_hdr TO <l_buildno_new>.
"1810570
ASSIGN COMPONENT 'OBSOLETE' OF STRUCTURE is_hdr TO <l_obsolete_new>.
"1810570
ASSIGN COMPONENT 'BASIC_SCEN_ID' OF STRUCTURE is_hdr TO <l_basscnid_new>.
"1810570
ASSIGN COMPONENT 'CONFIG_CLASS' OF STRUCTURE is_hdr TO <l_configcl_new>.
"1810570

SELECT SINGLE * FROM (c_hdr_table) INTO <ls_hdr_old> WHERE scenario_id EQ


<l_scenario_id>.
SELECT * FROM (c_hdt_table) INTO TABLE <lt_hdt_old>[] WHERE scenario_id =
<l_scenario_id>.
* AND langu =
i_langu. "all
SELECT * FROM (c_tsk_table) INTO TABLE <lt_tsk_old>[] WHERE scenario_id =
<l_scenario_id>.

CATCH cx_sy_create_data_error.
MESSAGE e666(01) WITH 'Object not supported;' 'SAP note 1589145 required'
INTO sy-lisel. "#EC *
CALL METHOD log_message.
RETURN.
ENDTRY.
TRY.
CREATE DATA lt_att_old TYPE TABLE OF (c_att_table).
ASSIGN lt_att_old->* TO <lt_att_old>.
ASSIGN it_tsk TO <lt_att_new>.
SELECT * FROM (c_att_table) INTO TABLE <lt_att_old>[] WHERE scenario_id =
<l_scenario_id>.
CATCH cx_sy_create_data_error.
* supported with note 1810570
ENDTRY.

IF ( <l_doku_id_old> IS ASSIGNED AND <l_doku_id_new> IS ASSIGNED AND


<l_doku_id_old> <> <l_doku_id_new> ) OR
( <l_doku_obj_old> IS ASSIGNED AND <l_doku_obj_new> IS ASSIGNED AND
<l_doku_obj_old> <> <l_doku_obj_new> ) OR
( <l_buildno_old> IS ASSIGNED AND <l_buildno_new> IS ASSIGNED AND
<l_buildno_old> <> <l_buildno_new> ) OR
( <l_obsolete_old> IS ASSIGNED AND <l_obsolete_new> IS ASSIGNED AND
<l_obsolete_old> <> <l_obsolete_new> ) OR
( <l_basscnid_old> IS ASSIGNED AND <l_basscnid_new> IS ASSIGNED AND
<l_basscnid_old> <> <l_basscnid_new> ) OR
( <l_configcl_old> IS ASSIGNED AND <l_configcl_new> IS ASSIGNED AND
<l_configcl_old> <> <l_configcl_new> ) OR
( <lt_hdt_old> IS ASSIGNED AND <lt_hdt_new> IS ASSIGNED AND <lt_hdt_old>[]
<> <lt_hdt_new>[] ) OR
( <lt_tsk_old> IS ASSIGNED AND <lt_tsk_new> IS ASSIGNED AND <lt_tsk_old>[]
<> <lt_tsk_new>[] ) OR
( it_att IS SUPPLIED AND <lt_att_old> IS ASSIGNED AND <lt_att_new> IS
ASSIGNED AND <lt_att_old>[] <> <lt_att_new>[] ) OR
( <ls_hdr_old> IS NOT ASSIGNED OR <ls_hdr_old> IS INITIAL ). "new object
* update required
ELSE.
MESSAGE i666(01) WITH 'No update necessary' INTO sy-lisel. "#EC *
CALL METHOD log_message.
RETURN.
ENDIF.

CHECK testrun IS INITIAL.

* handle create/change user and date


IF <ls_hdr_old> IS ASSIGNED AND <ls_hdr_old> IS NOT INITIAL.
ASSIGN COMPONENT 'CREATED_BY' OF STRUCTURE <ls_hdr_old> TO <l_user_old>.
IF sy-subrc = 0.
ASSIGN COMPONENT 'CREATED_BY' OF STRUCTURE is_hdr TO <l_user_new>.
IF sy-subrc = 0. <l_user_new> = <l_user_old>. ENDIF.
ENDIF.
ASSIGN COMPONENT 'CREATED_ON' OF STRUCTURE <ls_hdr_old> TO <l_date_old>.
IF sy-subrc = 0.
ASSIGN COMPONENT 'CREATED_ON' OF STRUCTURE is_hdr TO <l_date_new>.
IF sy-subrc = 0. <l_date_new> = <l_date_old>. ENDIF.
ENDIF.
ELSE.
ASSIGN COMPONENT 'CREATED_BY' OF STRUCTURE is_hdr TO <l_user_new>.
IF sy-subrc = 0. <l_user_new> = sy-uname. ENDIF.
ASSIGN COMPONENT 'CREATED_ON' OF STRUCTURE is_hdr TO <l_date_new>.
IF sy-subrc = 0. <l_date_new> = sy-datum. ENDIF.
ENDIF.
ASSIGN COMPONENT 'CHANGED_BY' OF STRUCTURE is_hdr TO <l_user_new>.
IF sy-subrc = 0. <l_user_new> = sy-uname. ENDIF.
ASSIGN COMPONENT 'CHANGED_ON' OF STRUCTURE is_hdr TO <l_date_new>.
IF sy-subrc = 0. <l_date_new> = sy-datum. ENDIF.

CALL METHOD add_to_transport "and create TADIR


EXPORTING
i_object = 'STCS'
i_obj_name = <l_scenario_id>
i_devclass = i_devclass
i_langu = i_langu
EXCEPTIONS
OTHERS = 1.
IF sy-subrc = 0.
DELETE FROM (c_hdr_table) WHERE scenario_id = <l_scenario_id>.
DELETE FROM (c_hdt_table) WHERE scenario_id = <l_scenario_id>."AND langu =
i_langu.
DELETE FROM (c_tsk_table) WHERE scenario_id = <l_scenario_id>.
IF it_att IS SUPPLIED AND <lt_att_old> IS ASSIGNED.
DELETE FROM (c_att_table) WHERE scenario_id = <l_scenario_id>.
ENDIF.
INSERT (c_hdr_table) FROM is_hdr.
INSERT (c_hdt_table) FROM TABLE it_hdt[].
INSERT (c_tsk_table) FROM TABLE it_tsk[].
IF it_att IS SUPPLIED AND <lt_att_old> IS ASSIGNED.
INSERT (c_att_table) FROM TABLE it_att[].
ENDIF.
MESSAGE i666(01) WITH 'Update successful for task list' <l_scenario_id> INTO
sy-lisel. "#EC *
CALL METHOD log_message.
ENDIF.

ENDMETHOD. "modify_stcs

METHOD log_message.

DATA: ls_msg TYPE bal_s_msg.

IF sy-msgno IS INITIAL OR sy-msgid IS INITIAL.


MESSAGE i666(01) WITH 'unknown error' INTO sy-lisel. "#EC *
ENDIF.
MOVE-CORRESPONDING syst TO ls_msg.

CALL FUNCTION 'BAL_LOG_MSG_ADD'


EXPORTING
i_log_handle = gv_log_handle
i_s_msg = ls_msg
EXCEPTIONS
OTHERS = 0.

IF ls_msg-msgty CA 'EA'.
gv_errors_occured = 'X'.
ENDIF.

ENDMETHOD. "log_message

METHOD display_log.

DATA: lt_log_handle TYPE bal_t_logh,


ls_profile TYPE bal_s_prof,
l_s_fcat TYPE bal_s_fcat,
lt_dfies TYPE TABLE OF dfies,
ls_dfies TYPE dfies.
DATA: lr_filter_client TYPE RANGE OF mandt,
ls_filter_client LIKE LINE OF lr_filter_client,
ls_filter TYPE bal_s_lfil,
lr_filter TYPE bal_s_extn, "range table
lr_extnumber TYPE bal_s_extn,
lt_log_header TYPE balhdr_t.

IF gv_log_handle IS INITIAL.

CLEAR: ls_filter, lr_extnumber.

*- Search only log file of this application


lr_filter-sign = 'I'.
lr_filter-option = 'EQ'.
lr_filter-low = c_bal_object.
APPEND lr_filter TO ls_filter-object.

lr_filter-sign = 'I'.
lr_filter-option = 'EQ'.
lr_filter-low = c_bal_subobj.
APPEND lr_filter TO ls_filter-subobject.

*- Search only log file of this change number


IF sy-repid NE 'SAP_LOCAL_DOWNPORT_ASSISTANT'.
lr_extnumber-low = sy-repid.
lr_extnumber-sign = 'I'.
lr_extnumber-option = 'EQ'.
APPEND lr_extnumber TO ls_filter-extnumber.
ls_filter_client-sign = 'I'.
ls_filter_client-option = 'EQ'.
ls_filter_client-low = sy-mandt.
APPEND ls_filter_client TO lr_filter_client.
ENDIF.

*-- Search for log files on the database


* CALL FUNCTION 'BAL_DB_SEARCH'
* EXPORTING
* i_client = sy-mandt
* i_s_log_filter = ls_filter
* IMPORTING
* e_t_log_header = lt_log_header
* EXCEPTIONS
* log_not_found = 1
* no_filter_criteria = 2
* OTHERS = 3.

SELECT * FROM balhdr CLIENT SPECIFIED


INTO TABLE lt_log_header
WHERE mandant IN lr_filter_client
AND object IN ls_filter-object
AND subobject IN ls_filter-subobject
AND extnumber IN ls_filter-extnumber.
IF sy-subrc EQ 0.
*-- Load log files from database into memory
CALL FUNCTION 'BAL_DB_LOAD'
EXPORTING
i_t_log_header = lt_log_header
IMPORTING
e_t_log_handle = lt_log_handle
EXCEPTIONS
no_logs_specified = 1
log_not_found = 2
log_already_loaded = 3
OTHERS = 4.
ENDIF.
ELSE.
APPEND gv_log_handle TO lt_log_handle.
ENDIF.

IF 1 = 1.
"grid
CALL FUNCTION 'BAL_DSP_PROFILE_SINGLE_LOG_GET'
IMPORTING
e_s_display_profile = ls_profile
EXCEPTIONS
OTHERS = 0.
"Set profile
ls_profile-show_all = abap_on.
ls_profile-use_grid = abap_on.
ls_profile-tree_ontop = abap_on.
ls_profile-exp_level = 1.
ls_profile-mess_mark = abap_on.
ELSE.
"tree
CALL FUNCTION 'BAL_DSP_PROFILE_DETLEVEL_GET'
IMPORTING
e_s_display_profile = ls_profile
EXCEPTIONS
OTHERS = 0.
ENDIF.

"add own fields to field cat


CALL FUNCTION 'DDIF_FIELDINFO_GET'
EXPORTING
tabname = c_bal_context
TABLES
dfies_tab = lt_dfies
EXCEPTIONS
not_found = 1
internal_error = 2
OTHERS = 3.
ASSERT sy-subrc EQ 0.

LOOP AT lt_dfies INTO ls_dfies WHERE fieldname EQ 'OBJECT'


OR fieldname EQ 'OBJ_NAME'.
l_s_fcat-ref_table = c_bal_context.
l_s_fcat-ref_field = ls_dfies-fieldname.
l_s_fcat-outputlen = ls_dfies-outputlen + 1.
* l_s_fcat-col_pos = 100 + sy-tabix. "most rigth columns
APPEND l_s_fcat TO ls_profile-mess_fcat.
ENDLOOP.

"set parameters for saving layout.


ls_profile-disvariant-report = sy-repid.
ls_profile-disvariant-handle = c_bal_subobj.

ls_profile-clbk_ucbf-userexitp = sy-repid.
ls_profile-clbk_ucbf-userexitf = 'BAL_CALLBACK_UCOMM'.
* ls_profile-clbk_ucom-userexitp = sy-repid.
* ls_profile-clbk_ucom-userexitf = 'BAL_CALLBACK_UCOMM'.
* ls_profile-ext_push1-active = 'X'.
* ls_profile-ext_push1-def-text = 'DDIC'.
* ls_profile-ext_push1-def-icon_id = icon_history.
* ls_profile-ext_push1-def-icon_text = 'DDIC'.
* ls_profile-ext_push1-def-quickinfo = 'DDIC Activation log'.

IF testrun IS NOT INITIAL.


ls_profile-title = 'UDO - Simulation log'. "#EC *
ELSEIF update IS NOT INITIAL.
ls_profile-title = 'UDO - Change Log'. "#EC *
ELSEIF genview IS NOT INITIAL.
ls_profile-title = 'UDO - View Generation Log'. "#EC *
ENDIF.

CALL FUNCTION 'BAL_DSP_LOG_DISPLAY'


EXPORTING
i_t_log_handle = lt_log_handle
i_s_display_profile = ls_profile
i_amodal = space
EXCEPTIONS
OTHERS = 0.
CALL FUNCTION 'BAL_DB_SAVE'
EXPORTING
i_t_log_handle = lt_log_handle
EXCEPTIONS
OTHERS = 0.

ENDMETHOD. "display_log

METHOD set_context.

STATICS: BEGIN OF lss_key, "save last key


i_object TYPE e071-object,
i_obj_name TYPE adir_key-obj_name,
i_obj_name2 TYPE adir_key-obj_name,
i_text TYPE string,
i_langu TYPE sylangu,
END OF lss_key.

DATA: ls_msg_defaults TYPE bal_s_mdef,


ls_context TYPE adir_key,
l_text(70),
l_mode TYPE string,
ls_key LIKE lss_key.

DATA: ls_e071 TYPE e071,


ls_tadir TYPE tadir,
ls_tadir_key TYPE tadir.

ls_key-i_object = i_object.
ls_key-i_obj_name = i_obj_name.
ls_key-i_obj_name2 = i_obj_name2.
ls_key-i_text = i_text.
ls_key-i_langu = i_langu.
IF ls_key EQ lss_key. "check last key
"avoid double message like "add field to table"
RETURN.
ELSE.
lss_key = ls_key.
ENDIF.

ls_context-object = i_object.
CONCATENATE i_obj_name i_obj_name2 INTO ls_context-obj_name.
ls_msg_defaults-log_handle = gv_log_handle.
ls_msg_defaults-context-value = ls_context.
ls_msg_defaults-context-tabname = c_bal_context.

CALL FUNCTION 'BAL_GLB_MSG_DEFAULTS_SET'


EXPORTING
i_s_msg_defaults = ls_msg_defaults
EXCEPTIONS
OTHERS = 0.

"try to check if object exists


IF i_object IS NOT INITIAL AND i_obj_name IS NOT INITIAL.
ls_e071-pgmid = 'R3TR'.
ls_e071-object = i_object.
ls_e071-obj_name = i_obj_name.

CALL FUNCTION 'SCWB_GET_TADIR_REM'


EXPORTING
is_e071 = ls_e071
IMPORTING
es_tadir_key = ls_tadir_key
es_tadir = ls_tadir.
IF ls_tadir_key IS INITIAL.
ls_e071-pgmid = 'LIMU'.
CALL FUNCTION 'SCWB_GET_TADIR_REM'
EXPORTING
is_e071 = ls_e071
IMPORTING
es_tadir_key = ls_tadir_key
es_tadir = ls_tadir.
ENDIF.

IF ls_tadir IS INITIAL.
l_mode = 'Create'. "#EC NOTEXT
ELSE.
l_mode = 'Change'. "#EC NOTEXT
"check if object has been manually modified by customer.
SELECT COUNT( * ) FROM adiraccess WHERE pgmid EQ ls_tadir-pgmid
AND object EQ ls_tadir-object
AND obj_name EQ ls_tadir-obj_name.
IF sy-dbcnt NE 0.
MESSAGE w666(01) WITH ls_tadir-object ls_tadir-obj_name 'was manually
changed before.' 'Please adjust manually afterwards' INTO sy-lisel. "#EC *
CALL METHOD log_message.
ENDIF.
ENDIF.
ENDIF.

IF i_text IS INITIAL.
CALL METHOD get_object_text
EXPORTING
i_object = i_object
i_obj_name = i_obj_name
RECEIVING
r_text = l_text.

CONCATENATE l_mode l_text INTO l_text SEPARATED BY space.


ELSE.
l_text = i_text.
ENDIF.

IF l_text IS NOT INITIAL.


IF i_langu IS NOT INITIAL.
MESSAGE s666(01) WITH l_text '( language' i_langu ')' INTO l_text. "#EC
NOTEXT
ENDIF.
CALL FUNCTION 'BAL_LOG_MSG_ADD_FREE_TEXT'
EXPORTING
i_msgty = 'I'
i_text = l_text
EXCEPTIONS
OTHERS = 0.
ENDIF.

ENDMETHOD. "set_context
ENDCLASS. "lcl_wb IMPLEMENTATION

INITIALIZATION.
"Determine proposal for tranportation layer based on existing package
"SELECT SINGLE pdevclass FROM tdevc INTO trnlayer WHERE devclass EQ '....'.
DATA gv_systemtype TYPE sy-sysid.
CALL 'C_SAPGPARAM' ID 'NAME' FIELD 'transport/systemtype'
ID 'VALUE' FIELD gv_systemtype.

START-OF-SELECTION.
PERFORM action.

*&---------------------------------------------------------------------*
FORM action.
DATA lv_subrc TYPE sysubrc.

CALL METHOD lcl_wb=>init "#EC *


EXPORTING
i_note = '1786253'
EXCEPTIONS
stop_processing = 1
OTHERS = 2.

lv_subrc = sy-subrc.

IF lv_subrc EQ 0 AND ( update IS NOT INITIAL OR testrun IS NOT INITIAL ).

CALL METHOD lcl_wb=>create_message "#EC *


EXPORTING
i_msgid = 'STC_SC_TASKS'
i_msgno = '229':
i_langu = 'E'
i_selfdef = '3'
i_text = 'Execution mode not possible; no valid BDLS preparation
task results'.

CALL METHOD lcl_wb=>create_message "#EC *


EXPORTING
i_msgid = 'STC_SC_TASKS'
i_msgno = '230':
i_langu = 'E'
i_selfdef = '3'
i_text = 'Old logical system name &1 already specified'.

CALL METHOD lcl_wb=>create_message "#EC *


EXPORTING
i_msgid = 'STC_SC_TASKS'
i_msgno = '232':
i_langu = 'E'
i_selfdef = '3'
i_text = 'Table name &1 added in exclude table'.

CALL METHOD lcl_wb=>create_program_text "#EC *


EXPORTING
i_progname = 'STC_SC_UI_BDLS'
i_devclass = 'S_LMCFG_SC'
i_langu = 'E':
i_id = 'S'
i_key = 'P_JOB_TN'
i_length = '50 '
i_text = 'Job Mode based on Table Name',

i_id = 'S'
i_key = 'P_JOB_TS'
i_length = '50 '
i_text = 'Job Mode based on Table Entry',

i_id = 'S'
i_key = 'P_PREP'
i_length = '50 '
i_text = ' Prepare Task Run'.

"-- LIMU DOCU TXSTCT_SC_CONV_BDLS (language: EN , source: YI3 )


CALL METHOD lcl_wb=>create_other_docu "#EC *
EXPORTING
i_devclass = 'S_LMCFG_SC_TASKS'
i_docname = 'TXSTCT_SC_CONV_BDLS'
i_langu = 'E'
i_line =:
'/: INCLUDE STCT_SC_DISCLAIMER OBJECT DOKU ID TX', "#EC NOTEXT
'U1 &PURPOSE&', "#EC NOTEXT
'* Use this task to convert a configured logical system name to a new or an',
"#EC NOTEXT
' existing name. Using this task, you have the possibility to define more',
"#EC NOTEXT
' than one conversion pair and it is also possible to execute concurrent', "#EC
NOTEXT
' jobs for performance improvements. This conversion execution is done', "#EC
NOTEXT
' with background jobs.', "#EC NOTEXT
'* This task also provides the possibility to execute conversion in other', "#EC
NOTEXT
' clients.', "#EC NOTEXT
'U1 &PREREQUISITES&', "#EC NOTEXT
'* Use an remote function call (RFC) destination of type 3 for the target', "#EC
NOTEXT
' client with an equivalent administrator user that is used to execute the',
"#EC NOTEXT
' post copy automation tool.', "#EC NOTEXT
'* For more information about detailed authorization objects, see the', "#EC
NOTEXT
' post-copy automation configuration guide at', "#EC NOTEXT
' http://service.sap.com/instlvm.', "#EC NOTEXT
'U1 &DEPENDENCIES&', "#EC NOTEXT
'U1 &CHECK&', "#EC NOTEXT
'U1 &REALIZE&', "#EC NOTEXT
'N1 Specify the logical system names that you want to convert.', "#EC NOTEXT
'N1 To define the conversion pairs, enter an <ZK>Old Logical System Name</>',
"#EC NOTEXT
' and a <ZK>New Logical System Name</> in the <ZK>Logical System Name', "#EC
NOTEXT
' Mapping field</>.', "#EC NOTEXT
'N1 Specify tables for conversion and target specific tables in the', "#EC NOTEXT
' database.', "#EC NOTEXT
'B2 To convert the names for all related tables, leave the <ZK>Tables to be',
"#EC NOTEXT
' Converted</> field empty.', "#EC NOTEXT
'B2 To convert the names for selected tables, choose <ZK>multiple selection',
"#EC NOTEXT
'= </> and enter the required data.', "#EC NOTEXT
'B2 To exclude the names for specific tables, choose <ZK>multiple selection',
"#EC NOTEXT
'= </> and enter the required data.', "#EC NOTEXT
'B2 To deal with special tables (large table exclusion), refer to SAP Note', "#EC
NOTEXT
' 932032.', "#EC NOTEXT
'N1 To improve performance enter a value in the <ZK>Number of Entries per', "#EC
NOTEXT
' Commit </>field. This value should be as large as possible, depending on',
"#EC NOTEXT
' the limits of the database roll area.', "#EC NOTEXT
'N1 Select one of the following job execution modes:', "#EC NOTEXT
'B2 <ZH>Single Job Execution</>', "#EC NOTEXT
'/ <ZH>Note: </>You can select this execution mode only for single pair', "#EC
NOTEXT
' conversion.', "#EC NOTEXT
'/ Executes program <EX>RBDLSMAP</> in a single batch job', "#EC NOTEXT
' <EX>SAP_SCTC_RBDLSMAP</>.', "#EC NOTEXT
'B2 <ZH>Concurrent Jobs Based on Table Name</>', "#EC NOTEXT
'/ <ZH>Note</>: To enable this execution mode, the local server must have', "#EC
NOTEXT
' at least 4 batch processes.', "#EC NOTEXT
'/ Executes concurrent jobs using program <EX>RBBDLS2LS</>.', "#EC NOTEXT
'/ Each job converts tables whose names start with a certain prefix. The', "#EC
NOTEXT
' job names start with prefix <EX>SAP_SCTC_BDLS</>. In addition we start', "#EC
NOTEXT
' the job <EX>SAP_SCTC_BDLS_SYNCH</>. This monitoring job waits until all',
"#EC NOTEXT
' concurrent jobs are finished. Then it executes program <EX>RBDLSMAP</>', "#EC
NOTEXT
' to start job <EX>SAP_SCTC_RBDLSMAP</> for the exceptional objects. Note',
"#EC NOTEXT
' that all tables where you defined an exception are not processed', "#EC
NOTEXT
' concurrently.', "#EC NOTEXT
'B2 <ZH>Concurrent Jobs Based on Table Entry</>', "#EC NOTEXT
'/ <ZH>Note: </>To enable this execution mode, ensure the following:', "#EC
NOTEXT
'/ - The local server has at least 4 batch processes.', "#EC NOTEXT
'/ - You added the BDLS prepare task to your task list. For more', "#EC NOTEXT
' information, see SAP Note 1750330.', "#EC NOTEXT
'/ Executes concurrent jobs using program <EX>RBBDLS2LS</>.', "#EC NOTEXT
'/ The number of created parallel batch jobs is equal to the number of the',
"#EC NOTEXT
' configured batch work process. The distribution of tables among jobs,', "#EC
NOTEXT
' depends on the sorted order of logical system name entry count, based on',
"#EC NOTEXT
' the preparation task result. The table with the highest entry count will',
"#EC NOTEXT
' be processed by the first batch job. Tables with lesser entries are', "#EC
NOTEXT
' processed by the last batch jobs. The job names start with prefix', "#EC
NOTEXT
' <EX>SAP_SCTC_BDLS</>. In addition we start the job', "#EC NOTEXT
' <EX>SAP_SCTC_BDLS_SYNCH</>. This monitoring job only waits until all', "#EC
NOTEXT
' concurrent jobs are finished. Then it executes program <EX>RBDLSMAP</>', "#EC
NOTEXT
' to start job <EX>SAP_SCTC_RBDLSMAP</> for the exceptional objects. Note',
"#EC NOTEXT
' that all tables where you defined an exception are not processed', "#EC
NOTEXT
' concurrently.', "#EC NOTEXT
'B1 To automatically release all scheduled jobs in the configured clients,', "#EC
NOTEXT
' select the <ZK>Release Jobs </>checkbox. If the checkbox is deselected,',
"#EC NOTEXT
' the jobs will be created in status <ZK>planned</> and you have to', "#EC
NOTEXT
' release the jobs manually in transaction <EX>SM37</>.', "#EC NOTEXT
'B1 It is possible to release jobs with the prefix <EX>SAP_SCTC_BDLS<Client>',
"#EC NOTEXT
'= </> in parallel. Ensure to release job <EX>SAP_SCTC_BDLS_SYNCH_<Client></> at
the end.', "#EC NOTEXT
'B1 To set local client conversion, no RFC destination is required.', "#EC NOTEXT
'B1 To set multiple client conversion, maintain RFC destinations.', "#EC NOTEXT
'B1 For the local client, maintain destination <EX>NONE</>.', "#EC NOTEXT
'B1 All destinations are checked against the configured client. The remote', "#EC
NOTEXT
' client execution is only allowed in the local system. The first client', "#EC
NOTEXT
' with assigned RFC destination is always set for client dependent and', "#EC
NOTEXT
' independent table conversion. Additional maintained clients are then set',
"#EC NOTEXT
' only for client dependent table conversion. The conversion takes place', "#EC
NOTEXT
' in one client after another.', "#EC NOTEXT
'U1 &EXAMPLE&', "#EC NOTEXT
space.

ENDIF.

CALL METHOD lcl_wb=>activate.

CALL METHOD lcl_wb=>display_log.

ENDFORM. "action

You might also like