You are on page 1of 70

*&---------------------------------------------------------------------* *& Report NOTE_1741024 *& *&---------------------------------------------------------------------* *& *& *&---------------------------------------------------------------------* REPORT NOTE_1741024.

TYPE-POOLS: seox, seoc, seok, seex, bcwbn. TYPES: t_switch_id TYPE char30, 40 t_bfunction TYPE char30, "sfw_bfunction does not exist in SAP_BASIS 64 0 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. TYPES: tt_dd17v TYPE TABLE OF dd17v, 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_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. DATA: gr_domname TYPE gr_rollname TYPE gr_tabname TYPE gr_indexes TYPE gr_indxtab TYPE gr_indxname TYPE gr_shlpname TYPE gr_viewname TYPE gr_tabtname TYPE gr_guistatus TYPE gr_switchname TYPE gv_trkorr TYPE gv_translation, gv_log_handle TYPE gv_msgxtra_txt(100) RANGE OF RANGE OF RANGE OF RANGE OF RANGE OF RANGE OF RANGE OF RANGE OF RANGE OF RANGE OF RANGE OF trkorr, domname, rollname, tabname, trobj_name, tabname, indexid, shlpname, viewname, ttypename, progname, t_switch_id, "sfw_switch_id does not exist in SAP_BASIS 6

balloghndl, TYPE c.

CONSTANTS: c_bal_object c_bal_subobj c_bal_context c_include

TYPE TYPE TYPE TYPE

balobj_d balsubobj tabname fieldname

VALUE VALUE VALUE VALUE

'SNOTE', space, 'ADIR_KEY', '.INCLUDE'.

PARAMETERS: testrun RADIOBUTTON GROUP mode DEFAULT 'X' MODIF ID lcl, update RADIOBUTTON GROUP mode MODIF ID lcl, showlogs RADIOBUTTON GROUP mode MODIF ID lcl. *----------------------------------------------------------------------* * CLASS lcl_wb DEFINITION *----------------------------------------------------------------------* CLASS lcl_wb DEFINITION. PUBLIC SECTION. CLASS-METHODS init IMPORTING i_note TYPE clike OPTIONAL "note which indicates that report is not needed anymore i_trkorr_list TYPE string OPTIONAL "list of support packages which i ndicates that report is not needed anymore i_cinst TYPE cwbcialeid OPTIONAL "correction instruction which d escribes the validity of the report i_component TYPE dlvunit OPTIONAL "software component without which report makes no sense 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 as4text i_dlvunit TYPE dlvunit i_parentcl TYPE packparent "super package i_pdevclass TYPE tdevc-pdevclass "transport layer i_comp_posid TYPE akhkompo i_tpclass TYPE tpclass i_srv_check TYPE srv_check EXCEPTIONS package_not_created. CLASS-METHODS create_switch IMPORTING i_switch TYPE t_switch_id i_devclass TYPE devclass i_langu TYPE sylangu DEFAULT 'E' i_text TYPE string OPTIONAL i_bfunction TYPE t_bfunction OPTIONAL. CLASS-METHODS create_doma IMPORTING i_domname TYPE domname i_datatype TYPE dd01v-datatype OPTIONAL "SFW1

i_leng i_outputlen i_convexit i_appendname s i_devclass i_langu i_ddtext i_domvalue i_valpos i_valtext

TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE

dd01v-leng OPTIONAL dd01v-outputlen OPTIONAL dd01v-convexit OPTIONAL domname OPTIONAL "appendname not known in all release devclass sylangu OPTIONAL ddtext OPTIONAL dd07v-domvalue_l OPTIONAL dd07v-valpos OPTIONAL dd07v-ddtext OPTIONAL.

CLASS-METHODS create_dtel IMPORTING i_rollname TYPE rollname i_domname TYPE domname i_datatype TYPE dd04v-domname tial nitial i_leng tial i_devclass i_logflag i_headlen i_scrlen1 i_scrlen2 i_scrlen3 i_langu i_ddtext i_reptext i_scrtext_m i_scrtext_l i_scrtext_s i_shlpname i_shlpfield i_deffdname TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE dd04v-leng

OPTIONAL "only needed if domain is ini

i_decimals TYPE dd04v-decimals OPTIONAL "only needed if rollname is i OPTIONAL "only needed if domain is ini

devclass logflag DEFAULT 'X' dd04v-headlen OPTIONAL "defaulted with fieldlen dd04v-scrlen1 DEFAULT 10 dd04v-scrlen2 DEFAULT 15 dd04v-scrlen3 DEFAULT 20 sylangu ddtext reptext OPTIONAL scrtext_m scrtext_l scrtext_s shlpname OPTIONAL shlpfield OPTIONAL deffdname OPTIONAL.

CLASS-METHODS create_search_help IMPORTING i_shlpname TYPE ddobjname i_langu TYPE sylangu i_ddtext TYPE ddtext i_devclass TYPE devclass i_issimple TYPE dd30v-issimple i_elemexi TYPE dd30v-elemexi i_nofields TYPE dd30v-nofields i_attachexi TYPE dd30v-attachexi i_selmethod TYPE dd30v-selmethod i_selmtype TYPE dd30v-selmtype i_texttab TYPE dd30v-texttab i_selmexit TYPE dd30v-selmexit e i_function_group for new selmexit i_hotkey i_dialogtype it_dd31v it_dd33v it_dd32p TYPE tlibg-area TYPE TYPE TYPE TYPE TYPE

DEFAULT 'E' "Default EN OPTIONAL DEFAULT 'X' OPTIONAL OPTIONAL OPTIONAL DEFAULT 'T' OPTIONAL "name of function modul OPTIONAL "name of function group

dd30v-hotkey OPTIONAL dd30v-dialogtype DEFAULT 'D' tt_dd31v tt_dd33v tt_dd32p.

CLASS-METHODS create_table_type g IMPORTING i_typename i_rowtype i_accessmode i_keydef i_keykind it_dd42v i_langu i_devclass e i_ddtext e TYPE ddtext TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE

"create or change table without sortin

dd40v-typename dd40v-rowtype dd40v-accessmode DEFAULT 'T' dd40v-keydef DEFAULT 'D' dd40v-keykind DEFAULT 'N' tt_dd42v OPTIONAL "only needed for sorted tables sylangu DEFAULT 'E' "Default EN devclass OPTIONAL "only needed for new table typ OPTIONAL. "only needed for new table typ

CLASS-METHODS create_table "or structure or append IMPORTING i_tabname TYPE tabname i_devclass TYPE devclass i_exclass TYPE dd02v-exclass OPTIONAL i_langu TYPE sylangu DEFAULT 'E' "Default EN i_ddtext TYPE ddtext OPTIONAL "can be taken from tabname i_tabclass TYPE tabclass DEFAULT 'INTTAB' i_sqltab TYPE sqlappdtab OPTIONAL. CLASS-METHODS add_field_to_table IMPORTING i_tabname TYPE tabname i_keyflag TYPE keyflag DEFAULT space i_fieldname TYPE fieldname i_rollname TYPE rollname i_datatype TYPE dd03p-datatype OPTIONAL "only needed if rollname is in itial i_decimals TYPE dd03p-decimals OPTIONAL "only needed if rollname is in itial i_leng TYPE dd03p-leng OPTIONAL "only needed if rollname is in itial i_reftable TYPE dd03p-reftable OPTIONAL i_reffield TYPE dd03p-reffield OPTIONAL i_groupname TYPE ddgroup OPTIONAL i_context TYPE fieldname OPTIONAL. "leave blank if field shall be app ended at end CLASS-METHODS add_shlp_to_table IMPORTING i_tabname TYPE tabname i_fieldname TYPE fieldname it_dd36m TYPE tt_dd36m. CLASS-METHODS add_field_to_view IMPORTING i_viewname TYPE viewname i_viewfield TYPE viewfield OPTIONAL "omit if same like fieldname i_tabname TYPE tabname i_fieldname TYPE fieldname i_rollname TYPE rollname OPTIONAL "can be taken from tabfield i_context TYPE fieldname OPTIONAL. "leave blank if field shall be appe nded at end

CLASS-METHODS regenerate_maint_view IMPORTING i_viewname TYPE viewname. CLASS-METHODS create_message_class IMPORTING i_devclass TYPE devclass i_msgid TYPE msgid i_langu TYPE sylangu DEFAULT 'E' i_text TYPE natxt.

"SE54

"Default EN

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_dtel_docu IMPORTING i_rollname TYPE rollname i_langu TYPE sylangu DEFAULT 'E' "Default EN i_line TYPE string OPTIONAL. "all lines get collected until i_line is omitted 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 CLASS-METHODS create_other_docu IMPORTING i_docname TYPE doku_obj "e.g. TXCDESK_PARAM, where TX represent s general text i_langu TYPE sylangu DEFAULT 'E' "Default EN i_line TYPE string OPTIONAL. "all lines get collected until i_line is omitted CLASS-METHODS create_function_group IMPORTING i_area TYPE tlibg-area i_devclass TYPE devclass i_langu TYPE sylangu DEFAULT 'E' i_text TYPE tlibt-areat OPTIONAL. CLASS-METHODS create_program_text IMPORTING i_progname TYPE progname i_langu TYPE sylangu DEFAULT 'E' "Default EN i_id TYPE textpool-id DEFAULT 'I' "I = Text element, S = S election 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 lengt h of text

CLASS-METHODS create_user_interface IMPORTING i_progname TYPE program i_devclass TYPE devclass OPTIONAL it_sta TYPE tt_sta it_men TYPE tt_men it_act TYPE tt_act it_but TYPE tt_but it_pfk TYPE tt_pfk it_biv TYPE tt_biv it_set TYPE tt_set i_langu TYPE sylangu DEFAULT 'E' it_fun TYPE tt_fun it_mtx TYPE tt_mtx it_doc TYPE tt_doc it_tit TYPE tt_tit. CLASS-METHODS create_index IMPORTING i_devclass TYPE devclass i_tabname TYPE tabname i_indexname TYPE indexid i_text TYPE ddtext OPTIONAL i_langu TYPE sylangu DEFAULT 'E' i_isextind TYPE xfeld OPTIONAL it_fields TYPE tt_dd17v. CLASS-METHODS modify_stcs IMPORTING i_devclass TYPE devclass i_langu TYPE sylangu DEFAULT 'E' VALUE(is_hdr) TYPE any it_hdt TYPE ANY TABLE it_tsk TYPE ANY TABLE.

"Default EN

CLASS-METHODS add_to_transport IMPORTING i_object TYPE e071-object "TABD i_obj_name TYPE c i_devclass TYPE devclass OPTIONAL i_langu TYPE sylangu OPTIONAL EXCEPTIONS error simulation. CLASS-METHODS activate IMPORTING i_result_auth_check TYPE sysubrc OPTIONAL. CLASS-METHODS log_message. CLASS-METHODS display_log. CLASS-METHODS set_context IMPORTING i_object TYPE i_obj_name TYPE i_obj_name2 TYPE i_text TYPE e071-object c c OPTIONAL c OPTIONAL.

CLASS-METHODS support_pack_applied IMPORTING i_trkorr_list TYPE string RETURNING VALUE(r_applied) TYPE xfeld.

CLASS-METHODS software_comp_applied IMPORTING i_component TYPE dlvunit EXPORTING e_cvers TYPE cvers EXCEPTIONS not_applied. CLASS-METHODS write_msg_to_log IMPORTING i_object TYPE i_obj_name TYPE i_mode TYPE i_tkorr TYPE i_langu TYPE i_extra TYPE e071-object "TABD c c "added, not added, exist already trkorr OPTIONAL sylangu OPTIONAL c OPTIONAL.

ENDCLASS. "lcl_dcm_to_po_bridge DEFINITION *----------------------------------------------------------------------* * CLASS lcl_dcm_to_po_bridge IMPLEMENTATION *----------------------------------------------------------------------* CLASS lcl_wb IMPLEMENTATION. METHOD init. 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-repid. 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. CALL METHOD set_context EXPORTING i_object = space i_obj_name = space. "check software component and SP level DATA: ls_cvers TYPE cvers, l_applied TYPE xfeld, l_line(255). IF i_component IS SUPPLIED.

CALL METHOD software_comp_applied "#EC * EXPORTING i_component = i_component IMPORTING e_cvers = ls_cvers EXCEPTIONS not_applied = 1 OTHERS = 2. IF sy-subrc IS NOT INITIAL. MESSAGE e319(01) WITH 'Software Component' i_component 'not installed! E xecution stopped!' INTO sy-lisel. "#EC * CALL METHOD lcl_wb=>log_message. CALL METHOD lcl_wb=>display_log. RAISE stop_processing. ELSE. "further check if possible IF i_trkorr_list IS SUPPLIED. CALL METHOD support_pack_applied EXPORTING i_trkorr_list = i_trkorr_list RECEIVING r_applied = l_applied. IF l_applied EQ 'X'. CONCATENATE i_component '/' ls_cvers-extrelease INTO l_line. MESSAGE e319(01) WITH 'The system contains software component/suppor t pack level' l_line '. Report execution not required anymore.' INTO sy-lisel. "#EC * CALL METHOD lcl_wb=>log_message. CALL METHOD lcl_wb=>display_log. RAISE stop_processing. ENDIF. ENDIF. ENDIF. ENDIF. " i_component IS SUPPLIED. IF i_note IS NOT INITIAL. that that note is not already implemented 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 e319(01) WITH 'SAP Note' i_note 'completely implemented;' 'Rep ort execution not required anymore.' INTO sy-lisel. "#EC * CALL METHOD lcl_wb=>log_message. CALL METHOD lcl_wb=>display_log. RAISE stop_processing. WHEN 'O'. MESSAGE e319(01) WITH 'SAP Note' i_note 'is obsolete;' 'Report executi on not required anymore.' INTO sy-lisel. "#EC * CALL METHOD lcl_wb=>log_message. *

CALL METHOD lcl_wb=>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 e319(01) WITH 'SAP Note' i_note 'cannot be read;' 'Ensure co rrect download of note first.' INTO sy-lisel. "#EC * CALL METHOD lcl_wb=>log_message. CALL METHOD lcl_wb=>display_log. RAISE stop_processing. ENDIF. FIELD-SYMBOLS: <ls_corr> TYPE bcwbn_corr_instruction. LOOP AT ls_note-corr_instructions ASSIGNING <ls_corr> WHERE key-aleid = i_cinst. DATA: l_valid TYPE bcwbn_bool. 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 INITIAL. MESSAGE e319(01) WITH 'Manual changes cannot be applied;' 'Correct ion instruction invalid' 'for current patch level' '' INTO sy-lisel. "#EC * CALL METHOD lcl_wb=>log_message. CALL METHOD lcl_wb=>display_log. RAISE stop_processing. ENDIF. ENDLOOP. ENDCASE. ENDIF. "no SSCR keys are necessary for a note implementation CALL FUNCTION 'SCWG_TOOLFLAG_SET'. "Reset will happen at leave of program IF testrun IS INITIAL.

MESSAGE i319(01) WITH 'Running in Update Mode' INTO sy-lisel. "#EC * ELSE. MESSAGE i319(01) WITH 'Running in Test Mode' INTO sy-lisel. "#EC * ENDIF. CALL METHOD log_message. ENDMETHOD. 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. r_text = ls_doktype-ddtext. 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. METHOD create_package. DATA: lo_package ls_package_data TYPE REF TO if_package, TYPE scompkdtln. "get_object_text "init

CALL METHOD set_context EXPORTING i_object = 'DEVC' i_obj_name = i_devclass. SELECT SINGLE * FROM tdevc INTO CORRESPONDING FIELDS OF ls_package_data

WHERE devclass EQ i_devclass. IF sy-subrc EQ 0 AND * ls_package_data-ctext EQ i_ctext AND "ctext in TDEVC leer! 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 "COMP_POSID kommt nicht i n TDEVC vor! ls_package_data-tpclass EQ i_tpclass AND ls_package_data-srv_check EQ i_srv_check. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'DEVC' i_obj_name = i_devclass i_mode = 'exist' i_langu = i_langu. RETURN. ENDIF. CHECK testrun IS INITIAL. ls_package_data-devclass ls_package_data-ctext ls_package_data-masterlang ls_package_data-dlvunit ls_package_data-parentcl ls_package_data-comp_posid ls_package_data-pdevclass ls_package_data-tpclass ls_package_data-srv_check ls_package_data-as4user = = = = = = = = = = i_devclass. i_ctext. i_langu. i_dlvunit. i_parentcl. i_comp_posid. i_pdevclass. i_tpclass. i_srv_check. sy-uname.

CALL METHOD cl_package=>create_new_package IMPORTING e_package = lo_package CHANGING c_package_data = ls_package_data EXCEPTIONS object_already_existing = 1 object_just_created = 2 not_authorized = 3 wrong_name_prefix = 4 undefined_name = 5 reserved_local_name = 6 invalid_package_name = 7 short_text_missing = 8 software_component_invalid = 9 layer_invalid = 10 author_not_existing = 11 component_not_existing = 12 component_missing = 13 prefix_in_use = 14 unexpected_error = 15 intern_err = 16 OTHERS = 17. IF sy-subrc EQ 1. "already exists RETURN. ELSEIF sy-subrc NE 0. CALL METHOD log_message.

CALL METHOD display_log. RAISE package_not_created. ENDIF. "save package CALL METHOD lo_package->save IMPORTING e_transport_request = gv_trkorr EXCEPTIONS object_invalid = 1 object_not_changeable = 2 cancelled_in_corr = 3 permission_failure = 4 unexpected_error = 5 intern_err = 6. IF sy-subrc NE 0. CALL METHOD log_message. CALL METHOD display_log. RAISE package_not_created. ENDIF. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'DEVC' i_obj_name = i_devclass i_mode = 'add' i_tkorr = gv_trkorr i_langu = i_langu. ENDMETHOD. "create_package

METHOD create_switch. "create switch via batch in put in SFW1 "assumptions: "- no conflict switch "limitations: "Only ONE business function per switch (must be createted via same call) DATA: lt_bdc ls_bdc ls_bdcp ls_radio ls_opt ls_dwinactiv ls_switchname ls_sfw_bf_sw ls_tadir TYPE TYPE TYPE LIKE TYPE TYPE LIKE TYPE TYPE TABLE OF bdcdata, bdcdata, bdcdata, ls_bdc-fnam, ctu_params, dwinactiv, LINE OF gr_switchname VALUE 'IEQ', t_bf_sw, tadir.

CALL METHOD set_context EXPORTING i_object = 'SFSW' i_obj_name = i_switch. ls_switchname-low = i_switch. COLLECT ls_switchname INTO gr_switchname. SELECT COUNT( * ) FROM ('SFW_SWITCH') WHERE switch_id = i_switch. IF sy-subrc NE 0. "not found CHECK testrun IS INITIAL.

ls_opt-dismode = 'E'. "------------------------------------------ls_bdcp-program = 'SAPLSFW_TOOL'. ls_bdcp-dynpro = '0050'. ls_bdcp-dynbegin = 'X'. APPEND ls_bdcp TO lt_bdc. ls_bdc-fnam = 'BDC_CURSOR'. ls_bdc-fval = 'SFW_SWITCH-SWITCH_ID'. APPEND ls_bdc TO lt_bdc. ls_bdc-fnam = 'SFW_SWITCH-SWITCH_ID'. ls_bdc-fval = i_switch. APPEND ls_bdc TO lt_bdc. ls_bdc-fnam = 'BDC_OKCODE'. ls_bdc-fval = '=WB_CREATE'. APPEND ls_bdc TO lt_bdc. "------------------------------------------ls_bdcp-dynpro = '0550'. ls_bdcp-dynbegin = 'X'. APPEND ls_bdcp TO lt_bdc. ls_bdc-fnam = 'BDC_CURSOR'. ls_bdc-fval = 'HEADER_DATA-NAME32'. APPEND ls_bdc TO lt_bdc. ls_bdc-fnam = 'HEADER_DATA-NAME32'. IF i_text IS INITIAL. ls_bdc-fval = i_switch. ELSE. ls_bdc-fval = i_text. ENDIF. APPEND ls_bdc TO lt_bdc. ls_bdc-fnam = 'BDC_OKCODE'. ls_bdc-fval = '=GO35'. APPEND ls_bdc TO lt_bdc. "------------------------------------------CALL TRANSACTION 'SFW1' USING lt_bdc OPTIONS FROM ls_opt. ask for transport request CALL METHOD log_message. IF i_langu NE sy-langu. "align redundant field DTELMASTER with TADIR-MASTERLANG SELECT SINGLE * FROM tadir INTO ls_tadir WHERE pgmid EQ 'R3TR' AND object EQ 'SFSW' AND obj_name EQ i_switch. IF sy-subrc IS INITIAL AND i_langu NE ls_tadir-masterlang. ls_tadir-masterlang = i_langu. UPDATE tadir FROM ls_tadir. ENDIF. ENDIF. IF i_bfunction IS NOT INITIAL. "automatcially

SELECT SINGLE * FROM ('SFW_BF_SW') INTO ls_sfw_bf_sw WHERE switch_id = i_switch AND bfunction = i_bfunction. IF sy-subrc NE 0. CLEAR: ls_sfw_bf_sw. ls_sfw_bf_sw-switch_id = i_switch. ls_sfw_bf_sw-version = 'I'. ls_sfw_bf_sw-bfunction = i_bfunction. INSERT ('SFW_BF_SW') FROM ls_sfw_bf_sw. ENDIF. ENDIF. ls_dwinactiv-object = 'SFSW'. ls_dwinactiv-obj_name = i_switch. ls_dwinactiv-uname = sy-uname. INSERT dwinactiv FROM ls_dwinactiv. ELSE. "exist CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'SFSW' i_obj_name = i_switch i_mode = 'exist' i_langu = i_langu. ENDIF. ENDMETHOD. "create_switch

METHOD create_doma. DATA: ls_dd01v TYPE dd01v, lt_dd07v TYPE TABLE OF dd07v, ls_dd07v TYPE dd07v, l_update, ls_dwinactiv TYPE dwinactiv, ls_domname LIKE LINE OF gr_domname VALUE 'IEQ'. FIELD-SYMBOLS: <l_appendname> TYPE c, <ls_dd07v> LIKE LINE OF lt_dd07v. CALL METHOD set_context EXPORTING i_object = 'DOMA' i_obj_name = i_domname. ls_domname-low = i_domname. COLLECT ls_domname INTO gr_domname. CALL FUNCTION 'DDIF_DOMA_GET' EXPORTING name = i_domname langu = i_langu "reads all values, returns value without langua ge/text if text does not exist in i_langu state = 'M' "newest version (e.g. inactive) IMPORTING dd01v_wa = ls_dd01v TABLES dd07v_tab = lt_dd07v EXCEPTIONS OTHERS = 0.

IF ls_dd01v IS INITIAL OR ls_dd01v-ddtext NE i_ddtext. l_update = 'X'. ENDIF. ls_dd01v-domname = i_domname. ls_dd01v-datatype = i_datatype. ls_dd01v-leng = i_leng. IF i_outputlen IS INITIAL. ls_dd01v-outputlen = i_leng. ELSE. ls_dd01v-outputlen = i_outputlen. ENDIF. ls_dd01v-convexit = i_convexit. ASSIGN ('LS_DD01V-APPENDNAME') TO <l_appendname>. IF sy-subrc EQ 0. <l_appendname> = i_appendname. ENDIF. ls_dd01v-ddlanguage = i_langu. ls_dd01v-ddtext = i_ddtext. IF i_domvalue IS SUPPLIED. "INITIAL value shall be possible fix value READ TABLE lt_dd07v ASSIGNING <ls_dd07v> WITH KEY domvalue_l = i_domvalue. IF sy-subrc EQ 0. "value exists -> compare text IF <ls_dd07v>-ddtext NE i_valtext. <ls_dd07v>-ddlanguage = i_langu. <ls_dd07v>-ddtext = i_valtext. l_update = 'X'. ENDIF. ELSE. "value does not exist -> insert READ TABLE lt_dd07v TRANSPORTING NO FIELDS WITH KEY valpos = i_valpos. IF sy-subrc EQ 0. "insert new value and increase valpos of exiting entries LOOP AT lt_dd07v ASSIGNING <ls_dd07v> WHERE valpos GE i_valpos. ADD 1 TO <ls_dd07v>-valpos. ENDLOOP. ENDIF. CLEAR ls_dd07v. ls_dd07v-domname = i_domname. ls_dd07v-domvalue_l = i_domvalue. IF i_valpos IS INITIAL. DESCRIBE TABLE lt_dd07v. ls_dd07v-valpos = sy-tfill + 1. ELSE. ls_dd07v-valpos = i_valpos. ENDIF. ls_dd07v-ddlanguage = i_langu. ls_dd07v-ddtext = i_valtext. APPEND ls_dd07v TO lt_dd07v. SORT lt_dd07v BY valpos. l_update = 'X'. ENDIF. IF lt_dd07v[] IS NOT INITIAL. ls_dd01v-valexi = 'X'. ENDIF. ENDIF. IF l_update = 'X'. CHECK testrun IS INITIAL.

CALL METHOD add_to_transport EXPORTING i_object = 'DOMA' i_obj_name = i_domname i_devclass = i_devclass i_langu = i_langu EXCEPTIONS OTHERS = 1. CHECK sy-subrc EQ 0. "align redundant field DOMMASTER with TADIR-MASTERLANG SELECT SINGLE masterlang FROM tadir INTO ls_dd01v-dommaster WHERE pgmid EQ 'R3TR' AND object EQ 'DOMA' AND obj_name EQ i_domname. CALL FUNCTION 'DDIF_DOMA_PUT' EXPORTING name = i_domname dd01v_wa = ls_dd01v TABLES dd07v_tab = lt_dd07v EXCEPTIONS doma_not_found = 1 name_inconsistent = 2 doma_inconsistent = 3 put_failure = 4 put_refused = 5 OTHERS = 6. IF sy-subrc <> 0. MESSAGE e010(c_) WITH 'WRITE' INTO sy-lisel. CALL METHOD log_message. RETURN. ENDIF. ls_dwinactiv-object = 'DOMA'. ls_dwinactiv-obj_name = i_domname. ls_dwinactiv-uname = sy-uname. INSERT dwinactiv FROM ls_dwinactiv. ELSE. "exist CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'DOMA' i_obj_name = i_domname i_mode = 'exist' i_langu = i_langu. ENDIF. ENDMETHOD. "create_doma

METHOD create_dtel. DATA: ls_dd04v TYPE dd04v, ls_dwinactiv TYPE dwinactiv, ls_rollname LIKE LINE OF gr_domname VALUE 'IEQ'. CALL METHOD set_context EXPORTING i_object = 'DTEL'

i_obj_name = i_rollname. ls_rollname-low = i_rollname. COLLECT ls_rollname INTO gr_rollname. CALL FUNCTION 'DDIF_DTEL_GET' EXPORTING name = i_rollname langu = i_langu state = 'M' "newest version (e.g. inactive) IMPORTING dd04v_wa = ls_dd04v EXCEPTIONS OTHERS = 1. IF sy-subrc EQ 0 AND ls_dd04v-rollname = i_rollname AND ls_dd04v-domname = i_domname AND ls_dd04v-datatype = i_datatype AND ls_dd04v-leng = i_leng AND ls_dd04v-logflag = i_logflag AND ls_dd04v-ddlanguage = i_langu AND ls_dd04v-ddtext = i_ddtext AND ls_dd04v-shlpname = i_shlpname AND ls_dd04v-shlpfield = i_shlpfield AND ls_dd04v-deffdname = i_deffdname. "data element already exists with that properties CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'DTEL' i_obj_name = i_rollname i_mode = 'exist' i_langu = i_langu. RETURN. ENDIF. CHECK testrun IS INITIAL. ls_dd04v-rollname = i_rollname. ls_dd04v-domname = i_domname. IF ls_dd04v-domname IS INITIAL. ls_dd04v-datatype = i_datatype. ls_dd04v-decimals = i_decimals. ls_dd04v-leng = i_leng. ENDIF. ls_dd04v-logflag = i_logflag. ls_dd04v-ddlanguage = i_langu. ls_dd04v-ddtext = i_ddtext. ls_dd04v-scrtext_s = i_scrtext_s. ls_dd04v-scrlen1 = i_scrlen1. ls_dd04v-scrtext_m = i_scrtext_m. ls_dd04v-scrlen2 = i_scrlen2. ls_dd04v-scrtext_l = i_scrtext_l. ls_dd04v-scrlen3 = i_scrlen3. ls_dd04v-shlpname = i_shlpname. ls_dd04v-shlpfield = i_shlpfield. ls_dd04v-deffdname = i_deffdname. IF i_reptext IS NOT INITIAL. ls_dd04v-reptext = i_reptext. IF i_headlen IS INITIAL. ls_dd04v-headlen = strlen( i_reptext ).

ELSE. ls_dd04v-headlen = i_headlen. ENDIF. ENDIF. CALL METHOD add_to_transport EXPORTING i_object = 'DTEL' i_obj_name = i_rollname i_devclass = i_devclass i_langu = i_langu "masterlanguage (only relevant during first call) EXCEPTIONS OTHERS = 1. CHECK sy-subrc EQ 0. "align redundant field DTELMASTER with TADIR-MASTERLANG SELECT SINGLE masterlang FROM tadir INTO ls_dd04v-dtelmaster WHERE pgmid EQ 'R3TR' AND object EQ 'DTEL' AND obj_name EQ i_rollname. CALL FUNCTION 'DDIF_DTEL_PUT' EXPORTING name = i_rollname dd04v_wa = ls_dd04v EXCEPTIONS dtel_not_found = 1 name_inconsistent = 2 dtel_inconsistent = 3 put_failure = 4 put_refused = 5 OTHERS = 6. IF sy-subrc <> 0. CALL METHOD log_message. RETURN. ENDIF. ls_dwinactiv-object ls_dwinactiv-obj_name ls_dwinactiv-uname INSERT dwinactiv FROM ENDMETHOD. METHOD create_table_type. DATA: ls_dd40v TYPE dd40v, lt_dd42v TYPE tt_dd42v, l_rowkind TYPE dd40v-rowkind VALUE 'S', l_datatype TYPE dd40v-datatype VALUE 'STRU', ls_dwinactiv TYPE dwinactiv, ls_tabtname LIKE LINE OF gr_tabtname VALUE 'IEQ'. CALL METHOD set_context EXPORTING i_object = 'TTYP' i_obj_name = i_typename. ls_tabtname-low = i_typename. COLLECT ls_tabtname INTO gr_tabtname. = 'DTEL'. = i_rollname. = sy-uname. ls_dwinactiv. "create_dtel

CALL FUNCTION 'DDIF_TTYP_GET' EXPORTING name = i_typename state = 'M' IMPORTING dd40v_wa = ls_dd40v TABLES dd42v_tab = lt_dd42v EXCEPTIONS illegal_input = 1 OTHERS = 2. IF sy-subrc EQ 0 AND "exists ls_dd40v-rowtype = i_rowtype AND ls_dd40v-rowkind = l_rowkind AND ls_dd40v-datatype = l_datatype AND ls_dd40v-accessmode = i_accessmode AND ls_dd40v-keydef = i_keydef AND ls_dd40v-keykind = i_keykind AND lt_dd42v = it_dd42v. "exist CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'TTYP' i_obj_name = i_typename i_mode = 'exist'. RETURN. ENDIF. CHECK testrun IS INITIAL. ls_dd40v-typename = i_typename. ls_dd40v-rowtype = i_rowtype. ls_dd40v-rowkind = l_rowkind. ls_dd40v-datatype = l_datatype. ls_dd40v-accessmode = i_accessmode. ls_dd40v-keydef = i_keydef. ls_dd40v-keykind = i_keykind. IF i_ddtext IS NOT INITIAL. ls_dd40v-ddtext = i_ddtext. ls_dd40v-ddlanguage = sy-langu. ENDIF. CALL METHOD add_to_transport EXPORTING i_object = 'TTYP' i_langu = i_langu i_obj_name = i_typename i_devclass = i_devclass EXCEPTIONS OTHERS = 1. CHECK sy-subrc EQ 0. CALL FUNCTION 'DDIF_TTYP_PUT' EXPORTING name = i_typename dd40v_wa = ls_dd40v TABLES dd42v_tab = it_dd42v EXCEPTIONS

ttyp_not_found = 1 name_inconsistent = 2 ttyp_inconsistent = 3 put_failure = 4 put_refused = 5 OTHERS = 6. IF sy-subrc <> 0. CALL METHOD log_message. RETURN. ENDIF. ls_dwinactiv-object ls_dwinactiv-obj_name ls_dwinactiv-uname INSERT dwinactiv FROM ENDMETHOD. METHOD create_search_help. DATA: ls_shlpname ls_dwinactiv ls_dd30v ls_dd30tv ls_dd32v ls_dd33v lt_dd30v lt_dd30tv lt_dd31v lt_dd32v lt_dd33v lt_dd32p ls_dd32p l_text l_namespace l_area l_object_name LIKE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE LINE OF gr_shlpname VALUE 'IEQ', dwinactiv, dd30v, dd30tv, dd32v, dd33v, tt_dd30v, tt_dd30tv, tt_dd31v, tt_dd32v, tt_dd33v, tt_dd32p, dd32p, tftit-stext, rs38l-namespace, tlibg-area, vrsd-objname. = 'TTYP'. = i_typename. = sy-uname. ls_dwinactiv. "create_table_type

CALL METHOD set_context EXPORTING i_object = 'SHLP' i_obj_name = i_shlpname. ls_shlpname-low = i_shlpname. COLLECT ls_shlpname INTO gr_shlpname. "CALL FUNCTION 'DDIF_SHLP_GET' has different result l_object_name = i_shlpname. CALL FUNCTION 'SVRS_GET_VERSION_SHLD_40' EXPORTING object_name = l_object_name versno = 0 TABLES dd30tv_tab = lt_dd30tv dd30v_tab = lt_dd30v dd31v_tab = lt_dd31v dd32v_tab = lt_dd32v dd33v_tab = lt_dd33v EXCEPTIONS no_version = 1

system_failure = 2 communication_failure = 3 OTHERS = 4. IF sy-subrc EQ 0 AND lt_dd30v[] IS NOT INITIAL. " search help exist LOOP AT lt_dd32v INTO ls_dd32v. MOVE-CORRESPONDING ls_dd32v TO ls_dd32p. APPEND ls_dd32p TO lt_dd32p. ENDLOOP. READ TABLE lt_dd30v INTO ls_dd30v INDEX 1. READ TABLE lt_dd30tv INTO ls_dd30tv WITH KEY ddlanguage = i_langu. IF lt_dd31v EQ it_dd31v AND lt_dd32p EQ it_dd32p AND lt_dd33v EQ it_dd33v AND ls_dd30v-elemexi EQ i_elemexi AND ls_dd30v-nofields EQ i_nofields AND ls_dd30v-attachexi EQ i_attachexi AND ls_dd30v-selmethod EQ i_selmethod AND ls_dd30v-selmtype EQ i_selmtype AND ls_dd30v-texttab EQ i_texttab AND ls_dd30v-selmexit EQ i_selmexit AND ls_dd30v-hotkey EQ i_hotkey AND ls_dd30v-issimple EQ i_issimple AND ls_dd30v-dialogtype EQ i_dialogtype AND ls_dd30tv-ddtext EQ i_ddtext. "exist CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'SHLP' i_obj_name = i_shlpname i_mode = 'exist' i_langu = i_langu. RETURN. ENDIF. ENDIF. CHECK testrun IS INITIAL. ls_dd30v-shlpname ls_dd30v-ddlanguage ls_dd30v-elemexi ls_dd30v-nofields ls_dd30v-attachexi ls_dd30v-selmethod ls_dd30v-selmtype ls_dd30v-texttab ls_dd30v-selmexit ls_dd30v-hotkey ls_dd30v-issimple ls_dd30v-dialogtype = = = = = = = = = = = = i_shlpname. i_langu. i_elemexi. i_nofields. i_attachexi. i_selmethod. i_selmtype. i_texttab. i_selmexit. i_hotkey. i_issimple. i_dialogtype.

IF i_ddtext IS INITIAL. ls_dd30v-ddtext = i_shlpname. ELSE. ls_dd30v-ddtext = i_ddtext. ENDIF. IF i_selmexit IS NOT INITIAL. "check if function module exists. CALL FUNCTION 'FUNCTION_EXISTS'

EXPORTING funcname = i_selmexit EXCEPTIONS function_not_exist = 1 OTHERS = 0. IF sy-subrc EQ 1. "create empty function module on the fly CALL METHOD add_to_transport EXPORTING i_object = 'FUNC' i_obj_name = i_selmexit EXCEPTIONS OTHERS = 1. CHECK sy-subrc EQ 0. l_text = i_selmexit. IF i_function_group+1 CA '/'. ADD 2 TO sy-fdpos. l_namespace = i_function_group(sy-fdpos). l_area = i_function_group+sy-fdpos. ELSE. l_area = i_function_group. ENDIF. DATA: lt_tables ls_tables lt_changing ls_changing TYPE TYPE TYPE TYPE TABLE OF rstbl, rstbl, TABLE OF rscha, rscha.

CLEAR ls_tables. ls_tables-parameter ls_tables-typ APPEND ls_tables TO CLEAR ls_tables. ls_tables-parameter ls_tables-dbstruct APPEND ls_tables TO

= 'SHLP_TAB'. = 'SHLP_DESCT'. lt_tables. = 'RECORD_TAB'. = 'SEAHLPRES'. lt_tables. = 'SHLP'. = 'SHLP_DESCR'. = 'X'. = 'X'. lt_changing. = 'CALLCONTROL'. = 'DDSHF4CTRL'. = 'X'. = 'X'. lt_changing.

CLEAR ls_changing. ls_changing-parameter ls_changing-typ ls_changing-types ls_changing-reference APPEND ls_changing TO CLEAR ls_changing. ls_changing-parameter ls_changing-typ ls_changing-types ls_changing-reference APPEND ls_changing TO

CALL FUNCTION 'RS_FUNCTIONMODULE_INSERT' EXPORTING funcname = i_selmexit function_pool = l_area namespace = l_namespace short_text = l_text suppress_corr_check = ' ' suppress_language_check = 'X' authority_check = 'X'

suppress_upgrade_check TABLES tables_parameter changing_parameter EXCEPTIONS OTHERS IF sy-subrc NE 0. CALL METHOD log_message. RETURN. ENDIF. ENDIF. ENDIF. CALL METHOD add_to_transport EXPORTING i_object = 'SHLP' i_langu = i_langu i_obj_name = i_shlpname i_devclass = i_devclass EXCEPTIONS OTHERS = 1. CHECK sy-subrc EQ 0.

= 'X' = lt_tables = lt_changing = 1.

CALL FUNCTION 'DDIF_SHLP_PUT' EXPORTING name = i_shlpname dd30v_wa = ls_dd30v TABLES dd31v_tab = it_dd31v dd32p_tab = it_dd32p dd33v_tab = it_dd33v EXCEPTIONS shlp_not_found = 1 name_inconsistent = 2 shlp_inconsistent = 3 put_failure = 4 put_refused = 5 OTHERS = 6. IF sy-subrc <> 0. CALL METHOD log_message. RETURN. ENDIF. ls_dwinactiv-object ls_dwinactiv-obj_name ls_dwinactiv-uname INSERT dwinactiv FROM ENDMETHOD. METHOD create_table. DATA: ls_dd02v TYPE ls_dd09l TYPE lt_dd03p TYPE lt_dd05m TYPE lt_dd08v TYPE lt_dd12v TYPE lt_dd17v TYPE lt_dd35v TYPE lt_dd36m TYPE dd02v, dd09l, TABLE OF TABLE OF TABLE OF TABLE OF TABLE OF TABLE OF TABLE OF = 'SHLP'. = i_shlpname. = sy-uname. ls_dwinactiv. "create_search_help

dd03p, dd05m, dd08v, dd12v, dd17v, dd35v, dd36m,

l_tabix TYPE sytabix, ls_dwinactiv TYPE dwinactiv, ls_tabname LIKE LINE OF gr_tabname VALUE 'IEQ'. FIELD-SYMBOLS: <ls_dd03p> TYPE dd03p. CALL METHOD set_context EXPORTING i_object = 'TABD' i_obj_name = i_tabname. ls_tabname-low = i_tabname. COLLECT ls_tabname INTO gr_tabname. CALL FUNCTION 'DDIF_TABL_GET' EXPORTING name = i_tabname state = 'M' "newest version (e.g. inactive) langu = i_langu IMPORTING GOTSTATE = GOTSTATE dd02v_wa = ls_dd02v dd09l_wa = ls_dd09l TABLES dd03p_tab = lt_dd03p dd05m_tab = lt_dd05m dd08v_tab = lt_dd08v dd12v_tab = lt_dd12v dd17v_tab = lt_dd17v dd35v_tab = lt_dd35v dd36m_tab = lt_dd36m EXCEPTIONS illegal_input = 1 OTHERS = 2. IF sy-subrc EQ 0 AND ls_dd02v-tabname IS NOT INITIAL "existing. AND ( ls_dd02v-ddtext EQ i_ddtext ). "Text not changed "exist CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'TABD' i_obj_name = i_tabname i_mode = 'exist' i_langu = i_langu. RETURN. ENDIF. CHECK testrun IS INITIAL. "new table ls_dd02v-tabname ls_dd02v-ddlanguage ls_dd02v-exclass ls_dd02v-tabclass ls_dd02v-sqltab = = = = = i_tabname. i_langu. i_exclass. i_tabclass. i_sqltab.

IF i_ddtext IS INITIAL. ls_dd02v-ddtext = i_tabname. ELSE.

ls_dd02v-ddtext ENDIF.

= i_ddtext.

CALL METHOD add_to_transport EXPORTING i_object = 'TABD' i_langu = i_langu i_obj_name = i_tabname i_devclass = i_devclass EXCEPTIONS OTHERS = 1. CHECK sy-subrc EQ 0. CALL FUNCTION 'DDIF_TABL_PUT' EXPORTING name = i_tabname dd02v_wa = ls_dd02v dd09l_wa = ls_dd09l TABLES dd03p_tab = lt_dd03p dd05m_tab = lt_dd05m dd08v_tab = lt_dd08v dd35v_tab = lt_dd35v dd36m_tab = lt_dd36m EXCEPTIONS tabl_not_found = 1 name_inconsistent = 2 tabl_inconsistent = 3 put_failure = 4 put_refused = 5 OTHERS = 6. IF sy-subrc <> 0. CALL METHOD log_message. RETURN. ENDIF. ls_dwinactiv-object ls_dwinactiv-obj_name ls_dwinactiv-uname INSERT dwinactiv FROM ENDMETHOD. METHOD add_field_to_table. DATA: ls_dd02v TYPE dd02v, ls_dd09l TYPE dd09l, lt_dd03p TYPE TABLE OF dd03p, lt_dd05m TYPE TABLE OF dd05m, lt_dd08v TYPE TABLE OF dd08v, lt_dd12v TYPE TABLE OF dd12v, lt_dd17v TYPE TABLE OF dd17v, lt_dd35v TYPE TABLE OF dd35v, lt_dd36m TYPE TABLE OF dd36m, lt_dd32p TYPE tt_dd32p, ls_dd32p TYPE dd32p, l_tabix TYPE sytabix, ls_dwinactiv TYPE dwinactiv, ls_tabname LIKE LINE OF gr_tabname VALUE 'IEQ'. = 'TABL'. = i_tabname. = sy-uname. ls_dwinactiv. "create_table

FIELD-SYMBOLS: <ls_dd03p> TYPE dd03p. CALL METHOD set_context EXPORTING i_text = 'Add field to table' i_object = 'TABD' i_obj_name = i_tabname. ls_tabname-low = i_tabname. COLLECT ls_tabname INTO gr_tabname. CALL FUNCTION 'DDIF_TABL_GET' EXPORTING name = i_tabname state = 'M' "newest version (e.g. inactive) IMPORTING GOTSTATE = GOTSTATE dd02v_wa = ls_dd02v dd09l_wa = ls_dd09l TABLES dd03p_tab = lt_dd03p dd05m_tab = lt_dd05m dd08v_tab = lt_dd08v dd12v_tab = lt_dd12v dd17v_tab = lt_dd17v dd35v_tab = lt_dd35v dd36m_tab = lt_dd36m EXCEPTIONS illegal_input = 1 OTHERS = 2. IF sy-subrc NE 0 OR ls_dd02v-tabname IS INITIAL. "not existing. CONCATENATE 'Error while reading' 'table information from DDIC' INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'TABD' i_obj_name = i_tabname i_mode = 'extra' i_extra = gv_msgxtra_txt. RETURN. ENDIF. "Find field to insert/change IF i_fieldname EQ c_include. READ TABLE lt_dd03p ASSIGNING <ls_dd03p> WITH KEY fieldname = i_fieldname precfield = i_rollname groupname = i_groupname. IF sy-subrc EQ 0. "INCLUDE already exists CONCATENATE 'Include' i_rollname 'already exists' INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'TABD' i_obj_name = i_tabname i_mode = 'extra' i_extra = gv_msgxtra_txt.

"#EC NOTEXT

RETURN. ENDIF. ELSE. READ TABLE lt_dd03p ASSIGNING <ls_dd03p> WITH KEY fieldname = i_fieldname. IF sy-subrc EQ 0. "Check if fields already has data element IF <ls_dd03p>-rollname EQ i_rollname. "field already has correct data element CONCATENATE 'Field' i_fieldname 'already exists' INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'TABD' i_obj_name = i_tabname i_mode = 'extra' i_extra = gv_msgxtra_txt. RETURN. ELSE. "change data element <ls_dd03p>-rollname = i_rollname. CONCATENATE 'Data element of field' i_fieldname 'will be changed to' i _rollname INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'TABD' i_obj_name = i_tabname i_mode = 'extra' i_extra = gv_msgxtra_txt. ENDIF. ENDIF. ENDIF. IF sy-subrc NE 0. "new field "Find context (one field is enough since fieldname is unique) IF i_context IS NOT INITIAL. READ TABLE lt_dd03p TRANSPORTING NO FIELDS WITH KEY fieldname = i_context. IF sy-subrc NE 0 AND sy-tfill NE 0. MESSAGE i319(01) WITH 'Context' i_context 'not found in TABD' i_tabnam e. "#EC NOTEXT RETURN. ENDIF. "insert new field after context l_tabix = sy-tabix + 1. ELSE. "no context -> insert field at end l_tabix = lines( lt_dd03p ) + 1. ENDIF. INSERT INITIAL LINE INTO lt_dd03p INDEX l_tabix ASSIGNING <ls_dd03p>. <ls_dd03p>-tabname = i_tabname. <ls_dd03p>-fieldname = i_fieldname. <ls_dd03p>-groupname = i_groupname. <ls_dd03p>-keyflag = i_keyflag. IF i_fieldname EQ c_include. <ls_dd03p>-precfield = i_rollname.

<ls_dd03p>-comptype = 'S'. ELSEIF i_rollname IS INITIAL. <ls_dd03p>-datatype = i_datatype. <ls_dd03p>-decimals = i_decimals. <ls_dd03p>-leng = i_leng. ELSE. <ls_dd03p>-rollname = i_rollname. ENDIF. <ls_dd03p>-reftable = i_reftable. <ls_dd03p>-reffield = i_reffield. LOOP AT lt_dd03p ASSIGNING <ls_dd03p> FROM l_tabix. <ls_dd03p>-position = sy-tabix. ENDLOOP. "field will be added CONCATENATE 'Field:' i_fieldname 'will be added to table' i_tabname INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'TABD' i_obj_name = i_tabname i_mode = 'extra' i_extra = gv_msgxtra_txt. ENDIF. CHECK testrun IS INITIAL. CALL METHOD add_to_transport EXPORTING i_object = 'TABL' i_obj_name = i_tabname EXCEPTIONS OTHERS = 1. CHECK sy-subrc EQ 0. CALL FUNCTION 'DDIF_TABL_PUT' EXPORTING name = i_tabname dd02v_wa = ls_dd02v dd09l_wa = ls_dd09l TABLES dd03p_tab = lt_dd03p dd05m_tab = lt_dd05m dd08v_tab = lt_dd08v dd35v_tab = lt_dd35v dd36m_tab = lt_dd36m EXCEPTIONS tabl_not_found = 1 name_inconsistent = 2 tabl_inconsistent = 3 put_failure = 4 put_refused = 5 OTHERS = 6. IF sy-subrc <> 0. CALL METHOD log_message. RETURN. ENDIF. ls_dwinactiv-object = 'TABL'. ls_dwinactiv-obj_name = i_tabname.

ls_dwinactiv-uname = sy-uname. INSERT dwinactiv FROM ls_dwinactiv. ENDMETHOD. METHOD add_shlp_to_table. DATA: ls_dd02v TYPE dd02v, ls_dd09l TYPE dd09l, lt_dd03p TYPE TABLE OF dd03p, lt_dd05m TYPE TABLE OF dd05m, lt_dd08v TYPE TABLE OF dd08v, lt_dd12v TYPE TABLE OF dd12v, lt_dd17v TYPE TABLE OF dd17v, lt_dd35v TYPE TABLE OF dd35v, ls_dd35v TYPE dd35v, lt_dd36m TYPE TABLE OF dd36m, ls_dd36m TYPE dd36m, lt_dd36m_comp TYPE TABLE OF dd36m, lt_dd32p TYPE tt_dd32p, ls_dd32p TYPE dd32p, l_tabix TYPE sytabix, ls_dwinactiv TYPE dwinactiv, ls_tabname LIKE LINE OF gr_tabname VALUE 'IEQ'. FIELD-SYMBOLS <ls_dd35v> TYPE dd35v. CALL METHOD set_context EXPORTING i_text = 'Assign Search Help to Table' i_object = 'TABD' i_obj_name = i_tabname. ls_tabname-low = i_tabname. COLLECT ls_tabname INTO gr_tabname. CALL FUNCTION 'DDIF_TABL_GET' EXPORTING name = i_tabname state = 'M' "newest version (e.g. inactive) IMPORTING GOTSTATE = GOTSTATE dd02v_wa = ls_dd02v dd09l_wa = ls_dd09l TABLES dd03p_tab = lt_dd03p dd05m_tab = lt_dd05m dd08v_tab = lt_dd08v dd12v_tab = lt_dd12v dd17v_tab = lt_dd17v dd35v_tab = lt_dd35v dd36m_tab = lt_dd36m EXCEPTIONS illegal_input = 1 OTHERS = 2. IF sy-subrc NE 0 OR ls_dd02v-tabname IS INITIAL. "not existing. CONCATENATE 'Error while reading' 'table information from DDIC' INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log "add_field_to_table

"#EC NOTEXT

EXPORTING i_object i_obj_name i_mode i_extra RETURN. ENDIF.

= = = =

'TABD' i_tabname 'extra' gv_msgxtra_txt.

lt_dd36m_comp = lt_dd36m. DELETE lt_dd36m_comp WHERE fieldname NE i_fieldname. IF lt_dd36m_comp EQ it_dd36m. "shlp assignment already like requested CONCATENATE 'Search help assignment' 'already ok' INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'TABD' i_obj_name = i_tabname i_mode = 'extra' i_extra = gv_msgxtra_txt. RETURN. ENDIF. DELETE lt_dd35v WHERE fieldname EQ i_fieldname. READ TABLE it_dd36m INDEX 1 INTO ls_dd36m. IF sy-subrc EQ 0. CLEAR ls_dd35v. ls_dd35v-tabname = i_tabname. ls_dd35v-fieldname = i_fieldname. ls_dd35v-shlpname = ls_dd36m-shlpname. APPEND ls_dd35v TO lt_dd35v. ELSE. "shlp assignment will be removed CONCATENATE 'Search help assignment' 'removed' INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'TABD' i_obj_name = i_tabname i_mode = 'extra' i_extra = gv_msgxtra_txt. ENDIF. CHECK testrun IS INITIAL. DELETE lt_dd36m WHERE fieldname EQ i_fieldname. APPEND LINES OF it_dd36m TO lt_dd36m. CALL FUNCTION 'DDIF_TABL_PUT' EXPORTING name = i_tabname dd02v_wa = ls_dd02v dd09l_wa = ls_dd09l TABLES dd03p_tab = lt_dd03p dd05m_tab = lt_dd05m dd08v_tab = lt_dd08v

dd35v_tab = lt_dd35v dd36m_tab = lt_dd36m EXCEPTIONS tabl_not_found = 1 name_inconsistent = 2 tabl_inconsistent = 3 put_failure = 4 put_refused = 5 OTHERS = 6. IF sy-subrc <> 0. CALL METHOD log_message. RETURN. ELSE. CONCATENATE 'Search help assignment' 'successfully updated' INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'TABD' i_obj_name = i_tabname i_mode = 'extra' i_extra = gv_msgxtra_txt. ENDIF. ls_dwinactiv-object ls_dwinactiv-obj_name ls_dwinactiv-uname INSERT dwinactiv FROM ENDMETHOD. = 'TABL'. = i_tabname. = sy-uname. ls_dwinactiv. "add_shlp_to_table

METHOD add_field_to_view. DATA: ls_dd25v TYPE dd25v, ls_dd09l TYPE dd09l, lt_dd26v TYPE TABLE OF dd26v, lt_dd27p TYPE TABLE OF dd27p, lt_dd28j TYPE TABLE OF dd28j, lt_dd28v TYPE TABLE OF dd28v, ls_dwinactiv TYPE dwinactiv. FIELD-SYMBOLS: <ls_dd27p> LIKE LINE OF lt_dd27p. DATA: l_viewfield l_rollname l_tabix ls_viewname LIKE LIKE TYPE LIKE i_viewfield, i_rollname, sytabix, LINE OF gr_viewname VALUE 'IEQ'.

CALL METHOD set_context EXPORTING i_text = 'Add Field to View' i_object = 'VIEW' i_obj_name = i_viewname. ls_viewname-low = i_viewname. COLLECT ls_viewname INTO gr_viewname. CALL FUNCTION 'DDIF_VIEW_GET' EXPORTING name = i_viewname state = 'M' "most recent, e.g. inactive IMPORTING

"#EC NOTEXT

dd25v_wa = ls_dd25v dd09l_wa = ls_dd09l TABLES dd26v_tab = lt_dd26v dd27p_tab = lt_dd27p dd28j_tab = lt_dd28j dd28v_tab = lt_dd28v EXCEPTIONS illegal_input = 1 OTHERS = 2. IF sy-subrc <> 0. CONCATENATE 'Error while reading' 'table information from DDIC' INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'VIEW' i_obj_name = i_viewname i_mode = 'extra' i_extra = gv_msgxtra_txt. RETURN. ENDIF. IF i_viewfield IS INITIAL. l_viewfield = i_fieldname. ELSE. l_viewfield = i_viewfield. ENDIF. IF i_rollname IS INITIAL. SELECT SINGLE rollname FROM dd03l INTO l_rollname WHERE tabname EQ i_tabname AND fieldname EQ i_fieldname. IF sy-subrc NE 0. MESSAGE i319(01) WITH 'Field' i_fieldname 'not found in ' i_tabname INTO sy-lisel. "#EC NOTEXT CALL METHOD log_message. RETURN. ENDIF. ELSE. l_rollname = i_rollname. ENDIF. "Check if fields already exists READ TABLE lt_dd27p TRANSPORTING NO FIELDS WITH KEY viewfield = l_viewfield. IF sy-subrc EQ 0. "field already exists CONCATENATE 'Field already exists' 'in view' INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'VIEW' i_obj_name = i_viewname i_mode = 'extra' i_extra = gv_msgxtra_txt. RETURN. ENDIF. "Find context (one field is enough since fieldname is unique) READ TABLE lt_dd27p TRANSPORTING NO FIELDS

WITH KEY viewfield = i_context. IF sy-subrc NE 0. MESSAGE i319(01) WITH 'Context' i_context 'not found in VIED' i_viewname I NTO sy-lisel. "#EC NOTEXT CALL METHOD log_message. RETURN. ENDIF. CHECK testrun IS INITIAL. "insert new field after context l_tabix = sy-tabix + 1. INSERT INITIAL LINE INTO lt_dd27p INDEX l_tabix ASSIGNING <ls_dd27p>. <ls_dd27p>-viewname <ls_dd27p>-viewfield <ls_dd27p>-tabname <ls_dd27p>-fieldname <ls_dd27p>-rollnamevi = = = = = i_viewname. l_viewfield. i_tabname. i_fieldname. l_rollname.

LOOP AT lt_dd27p ASSIGNING <ls_dd27p> FROM l_tabix. <ls_dd27p>-objpos = sy-tabix. ENDLOOP. CALL METHOD add_to_transport EXPORTING i_object = 'VIEW' i_obj_name = i_viewname EXCEPTIONS OTHERS = 1. CHECK sy-subrc EQ 0. CALL FUNCTION 'DDIF_VIEW_PUT' EXPORTING name = i_viewname dd25v_wa = ls_dd25v dd09l_wa = ls_dd09l TABLES dd26v_tab = lt_dd26v dd27p_tab = lt_dd27p dd28j_tab = lt_dd28j dd28v_tab = lt_dd28v EXCEPTIONS view_not_found = 1 name_inconsistent = 2 view_inconsistent = 3 put_failure = 4 put_refused = 5 OTHERS = 6. IF sy-subrc <> 0. CALL METHOD log_message. RETURN. ENDIF. ls_dwinactiv-object ls_dwinactiv-obj_name ls_dwinactiv-uname INSERT dwinactiv FROM = 'VIEW'. = i_viewname. = sy-uname. ls_dwinactiv.

ENDMETHOD. METHOD regenerate_maint_view.

"add_field_to_view

"regenerate maintaince view vua barch input of SE54 "assumptions: "- maint view dialog is based on view (not table) "- new fields have been added "- no screen changes needed or done via separate corr instruction DATA: lt_bdc ls_bdc ls_bdcp ls_radio ls_opt TYPE TABLE OF bdcdata, TYPE bdcdata, TYPE bdcdata, LIKE ls_bdc-fnam, TYPE ctu_params.

CALL METHOD set_context EXPORTING i_text = 'Regenerate Maintainance View' i_object = 'VIEW' i_obj_name = i_viewname. CHECK testrun IS INITIAL. ls_opt-dismode = 'E'. "------------------------------------------ls_bdcp-program = 'SAPMSVIM'. ls_bdcp-dynpro = '0050'. ls_bdcp-dynbegin = 'X'. APPEND ls_bdcp TO lt_bdc. ls_bdc-fnam = 'VIMDYNFLDS-VIEWNAME'. ls_bdc-fval = i_viewname. APPEND ls_bdc TO lt_bdc. ls_bdc-fnam = 'BDC_CURSOR'. ls_bdc-fval = 'VIMDYNFLDS-ELEM_GEN'. APPEND ls_bdc TO lt_bdc. ls_bdc-fnam = 'VIMDYNFLDS-ELEM_GEN'. ls_bdc-fval = 'X'. APPEND ls_bdc TO lt_bdc. ls_bdc-fnam = 'BDC_OKCODE'. ls_bdc-fval = '=CRMO'. APPEND ls_bdc TO lt_bdc. "------------------------------------------ls_bdcp-dynpro = '0120'. ls_bdcp-dynbegin = 'X'. APPEND ls_bdcp TO lt_bdc. ls_bdc-fnam = 'BDC_OKCODE'. ls_bdc-fval = '=RESE'. APPEND ls_bdc TO lt_bdc. "------------------------------------------ls_bdcp-dynpro = '1240'. ls_bdcp-dynbegin = 'X'.

"#EC NOTEXT

APPEND ls_bdcp TO lt_bdc. ls_bdc-fnam = 'BDC_CURSOR'. ls_bdc-fval = 'VIMDYNFLDS-NEW_FIELD'. APPEND ls_bdc TO lt_bdc. ls_bdc-fnam = 'VIMDYNFLDS-NEW_FIELD'. ls_bdc-fval = 'X'. APPEND ls_bdc TO lt_bdc. ls_bdc-fnam = 'BDC_OKCODE'. ls_bdc-fval = '=O.K.'. APPEND ls_bdc TO lt_bdc. "------------------------------------------ls_bdcp-dynpro = '1243'. ls_bdcp-dynbegin = 'X'. APPEND ls_bdcp TO lt_bdc. ls_bdc-fnam = 'BDC_CURSOR'. ls_bdc-fval = 'VIMDYNFLDS-FIELD_NORM'. APPEND ls_bdc TO lt_bdc. ls_bdc-fnam = 'VIMDYNFLDS-FIELD_NORM'. ls_bdc-fval = 'X'. APPEND ls_bdc TO lt_bdc. ls_bdc-fnam = 'BDC_OKCODE'. ls_bdc-fval = '=O.K.'. APPEND ls_bdc TO lt_bdc. ls_opt-dismode = 'E'. ls_opt-racommit = 'X'. ls_opt-nobinpt = 'X'. ls_opt-nobiend = 'X'. "------------------------------------------ls_bdcp-dynpro = '0120'. ls_bdcp-dynbegin = 'X'. APPEND ls_bdcp TO lt_bdc. ls_bdc-fnam = 'BDC_OKCODE'. ls_bdc-fval = '=BACK'. APPEND ls_bdc TO lt_bdc. "------------------------------------------ls_bdcp-dynpro = '0050'. ls_bdcp-dynbegin = 'X'. APPEND ls_bdcp TO lt_bdc. ls_bdc-fnam = 'BDC_OKCODE'. ls_bdc-fval = '=BACK'. APPEND ls_bdc TO lt_bdc. "------------------------------------------CALL TRANSACTION 'SE54' USING lt_bdc OPTIONS FROM ls_opt. CALL METHOD log_message. ENDMETHOD. "regenerate_maint_view

METHOD activate. DATA: lt_dwinactiv TYPE TABLE OF dwinactiv, lv_answer, l_request TYPE trkorr, l_logname TYPE string, ls_job TYPE tbtcjob, lv_rc TYPE sysubrc. FIELD-SYMBOLS: <ls_dwinactiv> LIKE LINE OF lt_dwinactiv. CALL METHOD set_context EXPORTING i_object = space i_obj_name = space. "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_domname, gr_rollname, gr_tabname, gr_shlpname, gr_viewname, gr_tabtname, 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_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_tabtname OR obj_name IN gr_guistatus

OR obj_name IN gr_indexes ). IF lt_dwinactiv[] IS INITIAL. MESSAGE i319(01) WITH 'No repository changes made' '' '' '' INTO sy-lisel. "#EC NOTEXT CALL METHOD log_message. IF gv_translation EQ 'X'. MESSAGE i319(01) WITH 'Translation has been updated' '' '' '' INTO sy-li sel. "#EC NOTEXT CALL METHOD log_message. ENDIF. ELSE. "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. IF i_result_auth_check IS INITIAL. CALL FUNCTION 'POPUP_TO_CONFIRM' EXPORTING titlebar = 'Activation' "#EC NOTEXT text_question = 'How do you want to activate DDIC?' "#EC NOT EXT 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. IF lv_answer = '2'. "DDIC via RADMASG0 "remove DDIC objects from worklist DELETE lt_dwinactiv WHERE object = 'DOMA' OR object = 'DTEL' OR object = 'TABL' OR object = 'INDX' OR object = 'VIEW' OR object = 'TTYP' OR object = 'SHLP'. ENDIF. IF lv_answer NE 'A' AND lt_dwinactiv[] IS NOT INITIAL. "1) activate non DDIC objects online MESSAGE s357(scwn). CALL FUNCTION 'RS_WORKING_OBJECT_ACTIVATE' EXPORTING dictionary_only = 'X' TABLES objects = lt_dwinactiv EXCEPTIONS OTHERS = 5.

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. MESSAGE s357(scwn). CALL FUNCTION 'RS_WORKING_OBJECT_ACTIVATE' EXPORTING dictionary_only = ' ' TABLES objects = lt_dwinactiv EXCEPTIONS OTHERS = 5. IF sy-subrc <> 0. 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 lv_answer = '2'. "2) activate DDIC objects online 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. CALL METHOD log_message. ELSE. CONCATENATE sy-repid '_&DATE&&TIME&' INTO l_logname. SUBMIT radmasg0 WITH domname IN gr_domname 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 tabtname IN gr_tabtname WITH shlpname IN gr_shlpname WITH logname EQ l_logname VIA JOB ls_job-jobname NUMBER ls_job-jobcount AND RETURN. CALL FUNCTION EXPORTING jobcount jobname strtimmed 'JOB_CLOSE' = ls_job-jobcount = ls_job-jobname = 'X'

EXCEPTIONS OTHERS = 1. IF sy-subrc EQ 0. MESSAGE s305(ut) WITH ls_job-jobname INTO sy-lisel. CALL METHOD log_message. MESSAGE s319(01) WITH 'Use Report RADPROTB to view activation log' 'after job has finished' 'in transaction SMX.' ''. "#EC NOTEXT CALL METHOD log_message. ELSE. MESSAGE e026(bt) WITH ls_job-jobname INTO sy-lisel. CALL METHOD log_message. ENDIF. ENDIF. ENDIF. ELSE. MESSAGE i319(01) WITH 'No authorization to activate the DDIC changes.' 'Call transaction SU53 for details' '' ''. "#EC NO TEXT sy-msgty = 'E'. CALL METHOD log_message. ENDIF. ENDIF. CALL METHOD display_log. ENDMETHOD. 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, lv_msgty TYPE symsgty. 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 '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'. 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'. "activate

l_object_name = i_obj_name. WHEN 'CLAS' OR 'FUGR'. l_object_class = i_object. l_object_name = i_obj_name. l_tadir_name = i_obj_name. l_global_lock = 'X'. WHEN OTHERS. l_object_class = 'DICT'. CONCATENATE i_object i_obj_name INTO l_object_name. l_tadir_name = i_obj_name. ENDCASE. "create TADIR entry in advance avoid popup IF l_tadir_name IS NOT INITIAL. 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 FREE 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 NEW_EXTEND EXCEPTIONS cancelled permission_failure unknown_objectclass OTHERS s_subrc = sy-subrc. ENDIF.

= ls_trkey = = = = = 1 2 3 4.

IF s_subrc IS INITIAL. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = i_object i_obj_name = i_obj_name i_mode = 'add' i_tkorr = gv_trkorr i_langu = i_langu. ELSE. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = i_object i_obj_name = i_obj_name i_mode = 'notadd' i_tkorr = gv_trkorr i_langu = i_langu. RAISE error. ENDIF. ENDMETHOD. METHOD create_message_class. DATA: ls_t100a ls_t100t l_obj_name "add_to_transport "will be activated immediately

TYPE t100a, TYPE t100t, TYPE e071-obj_name.

CALL METHOD set_context EXPORTING i_object = 'MSAG' i_obj_name = i_msgid. "check if message class exists SELECT SINGLE * FROM t100a INTO ls_t100a WHERE arbgb = i_msgid. IF sy-subrc NE 0. CHECK testrun IS INITIAL. CALL METHOD add_to_transport EXPORTING i_object = 'MSAG' i_obj_name = i_msgid i_devclass = i_devclass i_langu = i_langu EXCEPTIONS OTHERS = 1. CHECK sy-subrc EQ 0. ls_t100a-lastuser ls_t100a-ldate = sy-uname. = sy-datum. "and create TADIR

ls_t100a-ltime = sy-uzeit. ls_t100a-masterlang = i_langu. ls_t100a-arbgb = i_msgid. MODIFY t100a FROM ls_t100a. "no activation needed ls_t100t-sprsl = ls_t100a-masterlang. ls_t100t-arbgb = ls_t100a-arbgb. ls_t100t-stext = i_msgid. "take any text MODIFY t100t FROM ls_t100t. ELSE. CONCATENATE 'Message Class' 'already exists' INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'MSAG' i_obj_name = i_msgid i_langu = i_langu i_mode = 'extra' i_extra = gv_msgxtra_txt. ENDIF. ENDMETHOD. METHOD create_message. DATA: lt_bdc TYPE TABLE OF bdcdata, ls_bdc TYPE bdcdata, ls_bdcp TYPE bdcdata, ls_radio LIKE ls_bdc-fnam, ls_opt TYPE ctu_params. DATA: ls_t100 TYPE t100, ls_t100u TYPE t100u, l_obj_name TYPE dokil-object. CALL METHOD set_context EXPORTING i_object = 'MESS' i_obj_name = i_msgid i_obj_name2 = i_msgno. SELECT SINGLE * FROM WHERE AND AND t100 INTO ls_t100 sprsl EQ i_langu arbgb EQ i_msgid msgnr EQ i_msgno. "create_message_class

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. CONCATENATE 'Message' i_msgno 'already exists' INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'MESS' i_obj_name = i_msgid i_langu = i_langu i_mode = 'extra'

i_extra RETURN. ENDIF. ENDIF.

= gv_msgxtra_txt.

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 sy-langu. "create or change message and write into transport request "------------------------------------------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 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'.

0101SUB'.

"------------------------------------------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. INSERT t100 FROM ls_t100. "no activation needed ENDIF. gv_translation = 'X'. ENDMETHOD. METHOD create_mess_docu. STATICS: lt_line TYPE TABLE OF tline. "create_message

DATA: ls_head TYPE thead, lt_line_old LIKE lt_line, ls_line TYPE tline, ls_tadir TYPE tadir, ls_dd04v TYPE dd04v, 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_object = 'MESS' i_obj_name = i_msgid i_obj_name2 = i_msgno i_text = 'Message Longtext'. 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 lt_line_old[] EQ lt_line. "no update neccessary CONCATENATE 'Long text of message' i_msgno 'already exists' INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'MESS' i_obj_name = i_msgid i_langu = i_langu i_mode = 'extra' i_extra = gv_msgxtra_txt. REFRESH lt_line. RETURN. ENDIF. CHECK 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

"#EC NOTEXT

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 WHERE id = ls_head-tdid(2) AND object = ls_head-tdname AND langu = ls_head-tdspras. ADD 1 TO l_dokversion. ls_head-tdfdate ls_head-tdftime ls_head-tdfuser ls_head-tdldate ls_head-tdltime ls_head-tdluser = = = = = = sy-datum. sy-uzeit. sy-uname. sy-datum. sy-uzeit. 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. gv_translation = 'X'. REFRESH lt_line. ENDIF. ENDMETHOD. METHOD create_dtel_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, ls_dd04v TYPE dd04v, 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 "create_mess_docu

EXPORTING i_object = 'DTEL' i_obj_name = i_rollname i_text = 'Data Element Lontext'. ls_head-tdobject ls_head-tdname ls_head-tdid ls_head-tdspras ls_head-tdform ls_head-tdstyle = = = = = = 'DOKU'. i_rollname. 'DE'. "Data element i_langu. 'S_DOCU_SHOW'. 'S_DOCUS1'.

"#EC NOTEXT

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 lt_line_old[] EQ lt_line. "no update neccessary CONCATENATE 'Long text of data element' 'already exists' INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'DTEL' i_obj_name = i_rollname i_langu = i_langu i_mode = 'extra' i_extra = gv_msgxtra_txt. REFRESH lt_line. RETURN. ENDIF. CHECK 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 = 1. CHECK sy-subrc EQ 0. SELECT SINGLE * FROM tadir INTO ls_tadir WHERE pgmid EQ 'R3TR' AND object EQ 'DTEL' AND obj_name EQ i_rollname. 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 WHERE id = ls_head-tdid(2) AND object = ls_head-tdname AND langu = ls_head-tdspras. ADD 1 TO l_dokversion. ls_head-tdfdate ls_head-tdftime ls_head-tdfuser ls_head-tdldate ls_head-tdltime ls_head-tdluser = = = = = = sy-datum. sy-uzeit. sy-uname. sy-datum. sy-uzeit. 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. gv_translation = 'X'. REFRESH lt_line. ENDIF. ENDMETHOD. 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, ls_dd04v TYPE dd04v, 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_object = 'DOCU' i_obj_name = i_docname(2) i_obj_name2 = i_docname+2. ls_head-tdobject ls_head-tdname ls_head-tdid ls_head-tdspras ls_head-tdform ls_head-tdstyle = = = = = = 'DOKU'. i_docname+2. i_docname(2). i_langu. 'S_DOCU_SHOW'. 'S_DOCUS1'. "create_dtel_docu

CALL FUNCTION 'DOCU_GET'

EXPORTING id = langu = object = TABLES line = EXCEPTIONS OTHERS =

ls_head-tdid(2) ls_head-tdspras ls_head-tdname(60) lt_line_old 0.

IF lt_line_old[] EQ lt_line. "no update neccessary CONCATENATE 'Documentation' i_docname+2 'already exists' INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'DOCU' i_obj_name = i_docname(2) i_langu = i_langu i_mode = 'extra' i_extra = gv_msgxtra_txt. REFRESH lt_line. RETURN. ELSE. IF lt_line_old[] IS INITIAL. CONCATENATE 'Documentation' i_docname+2 INTO gv_msgxtra_txt SEPARATED ELSE. CONCATENATE 'Documentation' i_docname+2 INTO gv_msgxtra_txt SEPARATED ENDIF. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'DOCU' i_obj_name = i_docname(2) i_langu = i_langu i_mode = 'extra' i_extra = gv_msgxtra_txt. ENDIF. CHECK testrun IS INITIAL. CASE ls_head-tdid. WHEN 'TX'. ls_tadir-object = 'DOCT'. ls_tadir-obj_name = ls_head-tdname. WHEN 'HY'. ls_tadir-object = 'DSYS'. ls_tadir-obj_name = ls_head-tdname. WHEN OTHERS. ls_tadir-object = 'DOCU'. CONCATENATE ls_head-tdid ls_head-tdname INTO ls_tadir-obj_name. ENDCASE. CALL METHOD add_to_transport "and create TADIR entry EXPORTING i_object = ls_tadir-object i_obj_name = ls_tadir-obj_name EXCEPTIONS OTHERS = 1.

'will be created' BY space. 'will be changed' BY space.

CHECK sy-subrc EQ 0. 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 i319(01) WITH 'Error reading' ls_tadir-object ls_tadir-obj_name '.' . "#EC NOTEXT 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 WHERE id = ls_head-tdid(2) AND object = ls_head-tdname AND langu = ls_head-tdspras. ADD 1 TO l_dokversion. ls_head-tdfdate ls_head-tdftime ls_head-tdfuser ls_head-tdldate ls_head-tdltime ls_head-tdluser = = = = = = sy-datum. sy-uzeit. sy-uname. sy-datum. sy-uzeit. 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. gv_translation = 'X'. REFRESH lt_line. ENDIF. ENDMETHOD. METHOD create_function_group. DATA: l_text LIKE i_text, l_tadir_name TYPE tadir-obj_name. CALL METHOD set_context EXPORTING i_object = 'FUGR' i_obj_name = i_area. "create_other_docu

CALL FUNCTION 'RPY_EXISTENCE_CHECK_FUGR' EXPORTING name = i_area LIMU_KEY = EXCEPTIONS not_exist = 1 OTHERS = 2. IF sy-subrc EQ 0. "no update neccessary CONCATENATE 'Function group' 'already exists' INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'FUGR' i_obj_name = i_area i_langu = i_langu i_mode = 'extra' i_extra = gv_msgxtra_txt. RETURN. ENDIF. CHECK testrun IS INITIAL. IF i_text IS INITIAL. l_text = i_area. ELSE. l_text = i_text. ENDIF.

* * * * * * * * *

CALL METHOD add_to_transport EXPORTING i_object = 'FUGR' i_obj_name = i_area i_devclass = i_devclass i_langu = i_langu "masterlanguage (only relevant during first call) EXCEPTIONS OTHERS = 1. CHECK sy-subrc EQ 0. "create TADIR entry in advance avoid popup IF i_langu CA 'ED'. "set correct language and package on first call per object "skip this for other languages than EN/DE. l_tadir_name = i_area. CALL FUNCTION 'TR_TADIR_INTERFACE' EXPORTING WI_DELETE_TADIR_ENTRY = ' ' wi_test_modus = space wi_tadir_pgmid = 'R3TR' wi_tadir_object = 'FUGR' 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 FREE MEMORY ID 'EUK'. SET PARAMETER ID 'EUK' FIELD i_devclass. ENDIF. "SELECT SINGLE FROM tlibg. "SELECT SINGLE FROM tlibt. CALL FUNCTION 'RS_FUNCTION_POOL_ADD' EXPORTING aktion = 'INSR' "UPDA area = i_area corrnum = gv_trkorr text = l_text uname = sy-uname WITH_MONITOR = ' ' with_korr = ' ' "pass ' ' if add_to_transport has happe save_active WB_FB_MANAGER IMPORTING NEW_NAME EXCEPTIONS canceled_in_corr enqueue_system_failure function_pool_exist not_executed no_modify_permission no_show_permission permission_failure OTHERS IF sy-subrc <> 0. CALL METHOD log_message. ENDIF. UPDATE tadir SET WHERE AND AND AND ENDMETHOD. METHOD create_program_text. DATA: lt_docu TYPE TABLE OF tline, lt_textpool TYPE TABLE OF textpool, l_text LIKE i_text. FIELD-SYMBOLS: <ls_textpool> TYPE textpool. CALL METHOD set_context EXPORTING i_object = 'REPT' i_obj_name = i_progname i_obj_name2 = i_key. CALL FUNCTION 'RPY_PROGRAM_READ' EXPORTING language = i_langu program_name = i_progname masterlang pgmid object obj_name masterlang = 'X' = = = = = = = = = = 1 2 3 4 5 6 7 8.

* * nd! * * *

= i_langu EQ 'R3TR' EQ 'FUGR' EQ i_area NE i_langu. "create_function_group

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. CONCATENATE 'Error while reading' 'Program text' INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'REPT' i_obj_name = i_progname i_langu = i_langu i_mode = 'extra' i_extra = gv_msgxtra_txt. 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. CONCATENATE 'Program text' 'already exists' INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'REPT' i_obj_name = i_progname i_langu = i_langu i_mode = 'extra' i_extra = gv_msgxtra_txt. 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_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. ENDMETHOD. METHOD create_user_interface. DATA: lt_sta TYPE TABLE OF rsmpe_stat, lt_fun TYPE TABLE OF rsmpe_funt, lt_men TYPE TABLE OF rsmpe_men, lt_mtx TYPE TABLE OF rsmpe_mnlt, lt_act TYPE TABLE OF rsmpe_act, lt_but TYPE TABLE OF rsmpe_but, lt_pfk TYPE TABLE OF rsmpe_pfk, lt_set TYPE TABLE OF rsmpe_staf, lt_doc TYPE TABLE OF rsmpe_atrt, lt_tit TYPE TABLE OF rsmpe_titt, lt_biv TYPE TABLE OF rsmpe_buts, ls_tr_key TYPE trkey, ls_adm TYPE rsmpe_adm, ls_guistatus LIKE LINE OF gr_guistatus VALUE 'IEQ'. CALL METHOD set_context EXPORTING i_object = 'CUAD' i_obj_name = i_progname. ls_guistatus-low = i_progname. COLLECT ls_guistatus INTO gr_guistatus. "create_program_text

CALL FUNCTION 'RS_CUA_INTERNAL_FETCH' EXPORTING program = i_progname language = i_langu state = 'A' TABLES sta = lt_sta fun = lt_fun men = lt_men mtx = lt_mtx act = lt_act but = lt_but pfk = lt_pfk set = lt_set doc = lt_doc tit = lt_tit biv = lt_biv EXCEPTIONS not_found = 1 OTHERS = 99. IF lt_sta EQ it_sta AND lt_fun EQ it_fun AND lt_men EQ it_men AND lt_mtx EQ it_mtx AND lt_act EQ it_act AND lt_but EQ it_but AND lt_pfk EQ it_pfk AND lt_set EQ it_set AND lt_doc EQ it_doc AND lt_tit EQ it_tit AND lt_biv EQ it_biv. CONCATENATE 'CUA-Definition' 'already exists' INTO gv_msgxtra_txt SEPARATED BY space. CALL METHOD lcl_wb=>write_msg_to_log EXPORTING i_object = 'CUAD' i_obj_name = i_progname i_mode = 'extra' i_extra = gv_msgxtra_txt. RETURN. ENDIF. CHECK testrun IS INITIAL. CALL METHOD add_to_transport EXPORTING i_object = 'CUAD' i_obj_name = i_progname i_langu = i_langu EXCEPTIONS OTHERS = 1. CHECK sy-subrc EQ 0. ls_tr_key-obj_type ls_tr_key-obj_name ls_tr_key-sub_type ls_tr_key-sub_name = = = = 'PROG'. i_progname. 'CUAD'. i_progname.

CALL FUNCTION 'RS_CUA_INTERNAL_WRITE' EXPORTING program = i_progname language = i_langu tr_key = ls_tr_key adm = ls_adm state = 'I' "I = inactive A = activ TABLES sta = it_sta fun = it_fun men = it_men mtx = it_mtx act = it_act but = it_but pfk = it_pfk set = it_set doc = it_doc tit = it_tit biv = it_biv EXCEPTIONS not_found = 1 OTHERS = 2. IF sy-subrc <> 0. MESSAGE ID sy-msgid TYPE 'E' NUMBER sy-msgno WITH sy-msgv1 sy-msgv2 sy-msg v3 sy-msgv4. ENDIF. IF sy-subrc <> 0. CALL METHOD log_message. RETURN. ENDIF. ENDMETHOD. METHOD create_index. DATA: l_obj_name ls_dwinactiv ls_indexes ls_indxtab ls_indxname TYPE TYPE LIKE LIKE LIKE trobj_name, dwinactiv, LINE OF gr_indexes VALUE 'IEQ', LINE OF gr_indxtab VALUE 'IEQ', LINE OF gr_indxname VALUE 'IEQ'. "create_user_interface

"CONCATENATE i_table i_indexname INTO l_obj_name RESPECTING BLANKS. l_obj_name = i_tabname. l_obj_name+30 = i_indexname. ls_indexes-low = l_obj_name. ls_indxtab-low = i_tabname. ls_indxname-low = i_indexname. CALL METHOD set_context EXPORTING i_object = 'INDX' i_obj_name = l_obj_name. * check object exists DATA: l_index_state TYPE ddgotstate. CALL FUNCTION 'DDIF_INDX_GET' EXPORTING name = i_tabname id = i_indexname

IMPORTING gotstate = l_index_state EXCEPTIONS illegal_input = 1 OTHERS = 2. IF sy-subrc <> 0. CALL METHOD log_message. EXIT. ENDIF. CHECK testrun IS INITIAL. CALL METHOD add_to_transport EXPORTING i_object = 'INDX' i_obj_name = l_obj_name i_devclass = i_devclass i_langu = i_langu "masterlanguage (only relevant during first call) EXCEPTIONS OTHERS = 1. CHECK sy-subrc EQ 0. DATA: ls_index TYPE dd12v. ls_index-sqltab = i_tabname. ls_index-indexname = i_indexname. ls_index-ddtext = i_text. ls_index-ddlanguage = i_langu. FIELD-SYMBOLS: <l_isextind> TYPE any. ASSIGN ('LS_INDEX-ISEXTIND') TO <l_isextind>. IF sy-subrc EQ 0. <l_isextind> = i_isextind. ENDIF. CALL FUNCTION 'DDIF_INDX_PUT' EXPORTING name = i_tabname id = i_indexname dd12v_wa = ls_index TABLES dd17v_tab = it_fields EXCEPTIONS indx_not_found = 1 name_inconsistent = 2 indx_inconsistent = 3 put_failure = 4 put_refused = 5 OTHERS = 6. IF sy-subrc <> 0. CALL METHOD log_message. EXIT. ENDIF. ls_dwinactiv-object ls_dwinactiv-obj_name ls_dwinactiv-uname INSERT dwinactiv FROM = 'INDX'. = l_obj_name. = sy-uname. ls_dwinactiv.

COLLECT ls_indexes INTO gr_indexes. COLLECT ls_indxtab INTO gr_indxtab. COLLECT ls_indxname INTO gr_indxname.

ENDMETHOD. METHOD modify_stcs. "MF

"create_index

DATA: ls_hdr_old TYPE REF TO data, ls_where TYPE rfc_db_opt, lt_where TYPE TABLE OF rfc_db_opt. 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, <ls_hdr_old> TYPE any. 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'. ASSIGN COMPONENT 'SCENARIO_ID' OF STRUCTURE is_hdr TO <l_scenario_id>. IF sy-subrc <> 0. RETURN. ENDIF. CALL METHOD set_context EXPORTING i_object = 'STCS' i_obj_name = <l_scenario_id>. CHECK testrun IS INITIAL. * handle create/change user and date CREATE DATA ls_hdr_old TYPE (c_hdr_table). ASSIGN ls_hdr_old->* TO <ls_hdr_old>. REFRESH lt_where. ls_where = 'scenario_id EQ ''&1'''. REPLACE '&1' IN ls_where WITH <l_scenario_id>. APPEND ls_where TO lt_where[]. SELECT SINGLE * FROM (c_hdr_table) INTO <ls_hdr_old> WHERE (lt_where). IF sy-subrc = 0. 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>. DELETE FROM (c_tsk_table) WHERE scenario_id = <l_scenario_id>. INSERT (c_hdr_table) FROM is_hdr. INSERT (c_hdt_table) FROM TABLE it_hdt[]. INSERT (c_tsk_table) FROM TABLE it_tsk[]. ENDIF. ENDMETHOD. METHOD log_message. DATA: ls_msg TYPE bal_s_msg. "modify_stcs

MOVE-CORRESPONDING syst TO ls_msg. CALL FUNCTION 'BAL_LOG_MSG_ADD' EXPORTING i_log_handle = gv_log_handle i_s_msg = ls_msg. ENDMETHOD. METHOD display_log. DATA: lt_log_handle ls_profile l_s_fcat lt_dfies ls_dfies DATA: ls_filter lr_filter lr_extnumber ls_s_log lt_log_header lr_handle TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE TYPE bal_t_logh, bal_s_prof, bal_s_fcat, TABLE OF dfies, dfies. bal_s_lfil, bal_s_extn, "range table bal_s_extn, "range table bal_s_log, balhdr_t, bal_s_logh. "range table "log_message

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 lr_filter-option lr_filter-low APPEND lr_filter = 'I'. = 'EQ'. = c_bal_subobj. TO ls_filter-subobject.

*- Search only log file of this change number lr_extnumber-low = sy-repid. lr_extnumber-sign = 'I'. lr_extnumber-option = 'EQ'. APPEND lr_extnumber TO ls_filter-extnumber. *-- Search for log files on the database CALL FUNCTION 'BAL_DB_SEARCH' EXPORTING 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. 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 EXCEPTIONS not_found internal_error OTHERS ASSERT sy-subrc EQ

= lt_dfies = 1 = 2 = 3. 0.

LOOP AT lt_dfies INTO ls_dfies WHERE fieldname NE 'PGMID'. l_s_fcat-ref_table = c_bal_context. l_s_fcat-ref_field = ls_dfies-fieldname. 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. 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. METHOD set_context. STATICS: BEGIN OF lss_key, i_object TYPE i_obj_name TYPE i_obj_name2 TYPE i_text TYPE END OF lss_key. "display_log "save last key e071-object, adir_key-obj_name, adir_key-obj_name, string,

DATA: ls_msg_defaults TYPE bal_s_mdef, ls_context TYPE adir_key, ls_object_text TYPE ko100, ls_doktype TYPE dd07v, l_text(70), ls_key LIKE lss_key. 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. IF ls_key EQ lss_key. "check last key / avoid double message in log 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. IF i_text IS INITIAL. l_text = get_object_text( i_object = i_object i_obj_name = i_obj_name ). ELSE. l_text = i_text. ENDIF. IF l_text IS NOT INITIAL. CALL FUNCTION 'BAL_LOG_MSG_ADD_FREE_TEXT' EXPORTING i_msgty = ' ' i_text = l_text EXCEPTIONS OTHERS = 0. ENDIF. ENDMETHOD. METHOD support_pack_applied. DATA: lt_trkorr TYPE TABLE OF trkorr. SPLIT i_trkorr_list AT space INTO SELECT COUNT( * ) FROM e070 UP TO FOR ALL ENTRIES WHERE trkorr EQ IF sy-subrc EQ 0. r_applied = 'X'. ENDIF. ENDMETHOD. TABLE lt_trkorr. 1 ROWS IN lt_trkorr lt_trkorr-table_line. "set_context

"support_pack_applied

METHOD software_comp_applied. CLEAR e_cvers. SELECT SINGLE * FROM cvers INTO e_cvers WHERE component = i_component. IF sy-subrc IS NOT INITIAL. RAISE not_applied. ENDIF. ENDMETHOD. "software_comp_applied METHOD write_msg_to_log. DATA: lv_mode TYPE string, l_text(70) TYPE c, l_text_added(70) VALUE 'was added to transport request', l_text_not_added(70) VALUE 'was not added to transport request', l_text_exist(70) VALUE 'already exists', lv_msgty TYPE symsgty,

l_langu(2) TYPE c. l_text = get_object_text( i_object = i_object i_obj_name = i_obj_name ). lv_mode = i_mode. TRANSLATE lv_mode TO UPPER CASE. CASE lv_mode. WHEN 'ADD'. CONCATENATE l_text l_text_added i_tkorr INTO l_text SEPARATED BY space. lv_msgty = 'S'. WHEN 'NOTADD'. CONCATENATE l_text l_text_not_added i_tkorr INTO l_text SEPARATED BY spa ce. lv_msgty = 'E'. WHEN 'EXIST'. CONCATENATE l_text l_text_exist INTO l_text SEPARATED BY space. WHEN 'EXTRA'. WHEN OTHERS. l_text = 'Undefined Message!'. lv_msgty = 'E'. ENDCASE. IF i_extra IS NOT INITIAL. l_text = i_extra. ENDIF. IF i_langu IS NOT INITIAL. WRITE: i_langu TO l_langu NO-GAP. CONCATENATE l_text 'in original language' l_langu INTO l_text SEPARATED BY space. ENDIF. CALL FUNCTION EXPORTING i_msgty = i_text = EXCEPTIONS OTHERS = ENDMETHOD. ENDCLASS. START-OF-SELECTION. CALL METHOD lcl_wb=>init "#EC * * EXPORTING * i_note = '<note which presuppose this report>' * i_component = '<software comp. of objects to be created by this report>' * i_trkorr_list = '<list of supportpacks which delivers the objects anyway. Take from CSS note tab support packages>' EXCEPTIONS stop_processing = 1 others = 2. CHECK sy-subrc EQ 0. "- FUGR ------------------------------------------------------------------------- Function Group 'BAL_LOG_MSG_ADD_FREE_TEXT' lv_msgty l_text 0. "write_msg_to_log "lcl_wb IMPLEMENTATION

CALL METHOD lcl_wb=>create_function_group "#EC * EXPORTING i_devclass = 'QL' i_area = 'QPLDOC' i_langu = 'D' i_text = 'Dokumentenanbindung fr Prflos'. "- DTEL DTED --------------------------------------------------------------------- Data elements CALL METHOD lcl_wb=>create_dtel "#EC * EXPORTING i_rollname = 'QM_SWITCH_QALS_DOC' i_devclass = 'QL' i_domname = 'QM_SWITCH' i_logflag = '' i_headlen = '08' i_scrlen1 = '10' i_scrlen2 = '15' i_scrlen3 = '27' : i_langu i_ddtext i_reptext i_scrtext_s i_scrtext_m i_scrtext_l i_langu i_ddtext i_reptext i_scrtext_s i_scrtext_m i_scrtext_l = = = = = = = = = = = = 'D' 'Dokumentenanbindung zum Prflos' 'Dokumanb' 'Dokumanb' 'DokumanbPrflos' 'Dokumentenanbindung Prflos', 'E' 'Document Link to Inspection Lot' 'Doc.Link' 'Doc.Link' 'DocLink InspLot' 'Document Link to Insp. Lot'.

"- TABL TABD ---------------------------------------------------------------------------- Tables DATA: lt_dd36 TYPE TABLE OF dd36m, ls_dd36 TYPE dd36m. CALL METHOD lcl_wb=>create_table "#EC * EXPORTING i_tabname = 'QPLDOC_INSPLOT' i_devclass = 'QL' i_exclass = '2' i_langu = 'D' i_ddtext = 'Dokumentenverknpfung zum Prflos'. CALL METHOD lcl_wb=>add_field_to_table EXPORTING i_tabname = 'QPLDOC_INSPLOT': i_fieldname = 'PRUEFLOS' i_rollname = 'QPLOS' i_context = '', i_fieldname = 'KTEXTLOS' i_rollname = 'QKURZTEXT' i_context = '', i_fieldname = 'MARK' i_rollname = 'XFELD' i_context = ''. "- REPT ------------------------------------------------------------------------

--- Program Texts CALL METHOD lcl_wb=>create_program_text "#EC * EXPORTING i_progname = 'CL_IM_QM_CLIENT_SETTINGS_03===CP' i_langu = 'D': i_id = 'M' i_key = 'CLASS' i_length = '0 ' i_text = 'GC_DATAELEMENT Datenelement (semantische D omne)', i_id = 'M' i_key = 'CLASS' i_length = '0 ' i_text = 'GC_PROCESS d Solution Manager'.

Geschftsprozesse entsprechen

CALL METHOD lcl_wb=>create_program_text "#EC * EXPORTING i_progname = 'CL_IM_QM_CLIENT_SETTINGS_03===CP' i_langu = 'E': i_id = 'M' i_key = 'CLASS' i_length = '0 ' i_text = 'GC_DATAELEMENT Data Element (Semantic Doma in)', i_id = 'M' i_key = 'CLASS' i_length = '0 ' i_text = 'GC_PROCESS g to Solution Manager'.

Business Processes Accordin

CALL METHOD lcl_wb=>create_program_text "#EC * EXPORTING i_progname = 'SAPLQPLDOC' i_langu = 'D': i_id = 'I' i_key = '001' i_length = '80 ' i_text = 'Lschen der Objektverknpfung zum Prflos', i_id i_key i_length i_text i_id i_key i_length i_text = = = = = = = = 'I' '002' '80 ' 'Wollen Sie die Objektverknpfung zum Prflos lschen?', 'I' '003' '46 ' 'Das Objekt ist in einem anderen Modus gesperrt'.

CALL METHOD lcl_wb=>create_program_text "#EC * EXPORTING i_progname = 'SAPLQPLDOC' i_langu = 'E': i_id = 'I' i_key = '001' i_length = '80 ' i_text = 'Deletion of Object Link to Inspection Lot',

i_id i_key i_length i_text ?', i_id i_key i_length i_text

= = = = = = = =

'I' '002' '80 ' 'Do you want to delete the object link to the inspection lot 'I' '003' '46 ' 'The object is locked in another mode'.

"- MSAG ------------------------------------------------------------------------ Message Classes CALL METHOD lcl_wb=>create_message "#EC * EXPORTING i_msgid = 'QA' i_msgno = '085': i_langu = 'D' i_selfdef = '' i_text = 'Objektverknpfungen werden nicht gelscht aber nicht mehr angez eigt', i_langu = 'E' i_selfdef = '' i_text = 'Object links are not deleted but are no longer displayed'. CALL METHOD lcl_wb=>create_message "#EC * EXPORTING i_msgid = 'QA' i_msgno = '086': i_langu = 'D' i_selfdef = '' i_text = 'Customizing verbietet nderung oder Anlage von Verknpfungen zu Prflosen', i_langu = 'E' i_selfdef = '' i_text = 'Customizing prevents changing or creation of links to inspe ction lots'. CALL METHOD lcl_wb=>create_message "#EC * EXPORTING i_msgid = 'QA' i_msgno = '087': i_langu = 'D' i_selfdef = '3' i_text = 'Es existiert bereits eine Verknpfung zu Prflos &1', i_langu = 'E' i_selfdef = '3' i_text = 'A link to inspection lot &1 already exists'. CALL METHOD lcl_wb=>create_message EXPORTING i_msgid = 'QA' i_msgno = '325': i_langu = 'D' i_selfdef = '3' i_text = '', i_langu = 'E' i_selfdef = '3' i_text = ''. "#EC *

"- DOCU DOCT DOCV ------------------------------------------------------------------------- Docu CALL METHOD lcl_wb=>create_dtel_docu "#EC * EXPORTING i_rollname = 'QM_SWITCH_QALS_DOC' i_langu = 'D' i_line =:'U1 &DEFINITION& ', 'AS Mit diesem Kennzeichen steuern Sie die Anbindung des ', ' Dokumentenverwaltungssystems (DMS) an das Prflos. ', 'U1 &USE& ', 'AS ', 'U1 &DEPENDENCIES& ', 'AS Sobald das Kennzeichen aktiv ist, knnen Sie in der Prflosb earbeitung ', ' und im Verwendungsentscheid dem Prflos Dokumente zuordnen . ', 'AS Die Dokumente knnen auch in der Ergebniserfassung angezei gt werden. ', 'AS Wenn Sie das Kennzeichen deaktivieren, werden bestehende ', ' Dokumentenzuordnungen nicht gelscht, sondern im Prflos nic ht mehr ', ' angezeigt. Im Dokument selbst knnen dann keine neuen Zuor dnungen zum ', ' Prflos mehr angelegt werden. ', 'AL <ZH>Hinweis </> ', 'AL Wenn Sie die Prflose ber das Customizing bearbeiten, beach ten Sie, ', ' dass die Zuordnung von Dokumenten keine Customizingeinst ellung ist und ', ' keinen Customizing-Transportanschluss besitzt. ', 'U1 &PRECONDITIONS& ', 'AS Fr die Zuordnung von Dokumenten mssen Sie im Customizing d er ', ' Dokumentenverwaltung unter <LS>Steuerungdaten -> ', ' Dokumentarten definieren</> mindestens eine Dokumentenar t gepflegt ', ' haben, die eine Zuordnung von Prflosen (Objekt QALS fr ', ' Objektverknpfung) erlaubt. ', 'AS Auerdem mssen Sie bei der Objektverknpfung das Dynpro 500 a ngeben. ', 'U1 &EXAMPLE& ', 'AS ', space.

CALL METHOD lcl_wb=>create_dtel_docu "#EC * EXPORTING i_rollname = 'QM_SWITCH_QALS_DOC' i_langu = 'E' i_line =:'U1 &DEFINITION& ', 'AS You use this indicator to control the link between Docum ent Management ', ' (DMS) and the inspection lot. ', 'U1 &USE& ', 'AS ', 'U1 &DEPENDENCIES& ', 'AS When the indicator is active, you can assign documents t o the inspection ', ' lot in inspection lot processing and in the usage decisi on. ', 'AS The documents can also be displayed in results recording . ', 'AS When you deactivate the indicator, existing document ass ignments are not ', ' deleted, but they are no longer displayed in the inspect ion lot. In the ', ' document itself, no new assignments to the inspection lo t can then be ', ' created. ', 'AL <ZH>Note: </> ', 'AL If you edit the inspection lots via Customizing, note th at the ', ' assignment of documents is not a Customizing setting and does not have a ', ' Customizing transport link. ', 'U1 &PRECONDITIONS& ', 'AS To be able to assign documents, you must have entered at least one ', ' document type in Customizing for Document Management und er <LS>Control ', ' Data -> Define Document Types</> that allows the assignm ent of ', ' inspection lots (object QALS for object link). ', 'AS For the object link, you also have to enter the screen n umber 500. ', 'U1 &EXAMPLE& ', 'AS ', space. CALL METHOD lcl_wb=>create_mess_docu EXPORTING i_msgid = 'QA' "#EC *

i_msgno i_langu i_line

= '085' = 'D' =:'U1 &CAUSE& ', 'AS Sie deaktivieren die Dokumentenverknpfung im Customizing. ', 'U1 &SYSTEM_RESPONSE& ', 'AS Das System lscht keine bestehende Dokumentenverknpfungen. ', ' werden diese in der Anwendung nicht mehr angezeigt. Ledi ', ' Dokument selbst knnen Sie die obsolete Verknpfung noch seh ', 'U1 &WHAT_TO_DO& ', 'AS berprfen Sie, ob eine Deaktivierung wirklich sinnvoll ist. ', 'U1 &SYS_ADMIN& ', 'AS ', space. "#EC *

Allerdings glich im en.

CALL METHOD lcl_wb=>create_mess_docu EXPORTING i_msgid = 'QA' i_msgno = '085' i_langu = 'E' i_line = "no text found space.

CALL METHOD lcl_wb=>create_mess_docu "#EC * EXPORTING i_msgid = 'QA' i_msgno = '086' i_langu = 'D' i_line =:'U1 &CAUSE& ', 'AS Der Schalter zur Aktivierung der Dokumentenzuordnung wur de im ', ' Customizing nicht gesetzt. ', 'U1 &SYSTEM_RESPONSE& ', '* Setzen Sie im Customizing des Qualittsmanagements unter ', ' <LS>Grundeinstellungen -> </> ', '= <DS:SIMG.SIMG_CFMENUOLQSOQSS>Voreinstellungen auf Mandan tenebene pflegen ', '= </> entsprechendes Kennzeichen zur Aktivierung der Dokum entenzuordnung. ', ' Markieren Sie dort unter <ZK>Weitere Einstellungen</> fr den ', ' gewnschten Geschftsproze das Kennzeichen. ', 'U1 &WHAT_TO_DO& ', 'AS

', 'U1 &SYS_ADMIN& ', 'AS ', space. CALL METHOD lcl_wb=>create_mess_docu "#EC * EXPORTING i_msgid = 'QA' i_msgno = '086' i_langu = 'E' i_line =:'U1 &CAUSE& ', 'AS The switch for activating the document link was not set in Customizing. ', 'U1 &SYSTEM_RESPONSE& ', '* In Customizing for Quality Management under <LS>Basic Se ttings</> -> ', ' <DS:SIMG.SIMG_CFMENUOLQSOQSS>Maintain Settings at Client Level</>, set ', ' the relevant indicator to activate the document link. Th ere, under <ZK> ', '= Further Settings</>, set the indicator for the required business ', ' process. ', 'U1 &WHAT_TO_DO& ', 'AS ', 'U1 &SYS_ADMIN& ', 'AS ', space. "----------------------------------------------------------------------------------------------"- Changes which might be part of manual instruction ---------------------- Not supported Objects "----------------------------------------------------------------------------------------------" AVAS BDC102509359E649E10000000A428CE7 " AVAS BFC102509359E649E10000000A428CE7 " AVAS C0C102509359E649E10000000A428CE7 " CDAT VC_DVS10 " SFRN ERP_QM_CC_607_DOC " SXCI IMPL_QM_DOC_INSPLOT " VDAT V_T185 " VDAT V_TCLO CALL METHOD lcl_wb=>activate.

* Use menu path "System - List - Save - Local File - Clipboard" to copy this c oding into clipboard