Header Data: Symptom
Header Data: Symptom
Header Data: Symptom
Header Data
Released On 16.05.2012 23:35:36
Release Status Released for Customer
Component
BW-WHM-DST-TRF Transformation
Priority
Correction with low priority
Category
Program error
Symptom
This note contains Programm RSDG_TRFN_ACTIVATE for checks and regenerate transformation objects in
case of technical incompleteness or inconsistency of metadata without creating a transport.
Other Terms
Reason and Prerequisites
Solution
The programm has the following parameters:
Transformation ID (TRAN_ID) Selection via ID of transformation,
optional.
Object status (OBJSTAT) default = 'INA', should not be changed
Type of sourceoptional
Source nameoptional
Type of targetoptional
Target nameoptional
In case of no input for field Transpormation ID, all transformation objects will be regenerated for
specified Tape of Source/target or Target/source name. If the programm will be run without any
selections, all objects of transformation type (table RSTRAN) will checked and re-generated. DTP's
containing transformation of source - / target type 'InfoSource' also will be re-activated.
In case you need to reactivate an already active transformation you need to put the parameter Object
status (OBJSTAT) as 'ACT' for the that particular Transformation (TRAN_ID).
l
NW7.20 BI SP03", which describes this Support Package in more detail, is released for customers.
g_r_tranidTYPE
tlogorstlogoTYPE
sourcetypeTYPE
sourcenameTYPE
targettypeTYPE
targetnameTYPE
tranidTYPE
iobjnmTYPE
objst TYPE
objvers TYPE
objvrsTYPE
rstranid.
rstlogo.
rstlogo.
sobj_name.
rstlogo.
sobj_name.
rstranid.
sobj_name.
rsobjstat.
rsobjvers.
rsobjvers.
* selection screen
* main screen
SELECTION-SCREEN BEGIN OF BLOCK act WITH FRAME TITLE text-001.
SELECT-OPTIONStran_idFOR tranid.
PARAMETERSobjstat LIKE objst DEFAULT rs_c_objstat-active.
SELECT-OPTIONSsrc_type FOR sourcetype.
SELECT-OPTIONSsrc_name FOR sourcename.
SELECT-OPTIONStrg_type FOR targettype.
SELECT-OPTIONStrg_name FOR targetname.
PARAMETERS: activate RADIOBUTTON GROUP r1 DEFAULT 'X'.
PARAMETERS: check RADIOBUTTON GROUP r1.
* objvers FOR objversDEFAULT 'A'.
SELECTION-SCREEN END OF BLOCK act.
* data
TYPES:
BEGIN OF ts_text,
tranidTYPE rstranid,
textTYPE string,
type(8) TYPE c,
status(20)TYPE c,
level TYPE c,
END OF ts_text,
tt_text TYPE TABLE OF ts_text.
DATA:
gs_textTYPE ts_text,
gt_textTYPE tt_text,
gt_text_allTYPE tt_text.
l_text TYPE
l_detlevel TYPE
l_string TYPE
l_string_1 TYPE
l_string_2 TYPE
lt_textTYPE
lt_text_allTYPE
c LENGTH 150.
ballevel.
string.
string.
string.
TABLE OF string.
TABLE OF string.
>>> Correction contains additional changes that are NOT shown here <<<
>>> Display all changes by Note Assistant Note display functionality <<<
*&--------------------------------------------------------------------*
*& ObjectREPS RSTRAN_MIGRATION_CHECK
*& Object Header PROG RSTRAN_MIGRATION_CHECK
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
*&---------------------------------------------------------------------*
*& ReportRSTRAN_MIGRATION_CHECK
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*& REPORT RSTRAN_MIGRATION_CHECK
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
REPORTrstran_migration_check.
TYPE-POOLS: rstr, rsaa, rsau.
TYPES: BEGIN OF ty_s_text,
tranid TYPE rstran-tranid,
string TYPE string,
END OF ty_s_text.
TYPESty_t_text TYPE STANDARD TABLE OF ty_s_text.
DATA: objvrsTYPE rsobjvers.
DATA: tran_id TYPE rstranid,
objstat_TYPE rsobjstat,
scname_ TYPE sobj_name,
tgname_ TYPE sobj_name.
*DATA: l_inconsistent TYPE rs_bool.
*DATA: l_inconsistent_stepTYPE rs_bool.
*DATA: l_inconsistent_formula TYPE rs_bool.
*DATA: l_routine_existTYPE rs_bool.
DATAl_tranid_on_change TYPE rstran-tranid.
DATA: l_coding_found TYPE rs_bool.
DATA: l_migrate_status TYPE rs_bool.
DATA: l_t_or_u TYPE rs_bool.
DATA: l_t_or_u_textTYPE string.
DATA: l_text TYPE c LENGTH 150.
DATA: l_detlevel TYPE ballevel.
DATA: l_msgtyTYPE c.
DATA: l_string TYPE string.
DATA: l_string_1 TYPE string.
DATA: l_string_2 TYPE string.
DATA: l_string_3 TYPE string.
*DATA: lt_textTYPE TABLE OF string.
DATA: ls_textTYPE ty_s_text.
DATA: lt_text_allTYPE ty_t_text.
DATA: lt_text_step TYPE TABLE OF string.
DATA: lt_text_step_all TYPE TABLE OF string.
DATA: l_extnumberTYPE bal_s_log-extnumber.
DATA: ls_tranTYPE rstran.
DATA: lt_tranTYPE STANDARD TABLE OF rstran WITH NON-UNIQUE DEF
AULT KEY.
DATA: lt_tran_selTYPE SORTED TABLE OF rstran
WITH UNIQUE KEY tranid objvers.
DATA: ls_tranruleTYPE rstranrule.
DATA: lt_tranruleTYPE SORTED TABLE OF rstranrule
WITH UNIQUE KEY tranid ruleid objvers.
DATA: lt_tranrule_grpid TYPE STANDARD TABLE OF rstranrule.
DATA: ls_steproutTYPE rstransteprout.
DATA: lt_steproutTYPE SORTED TABLE OF rstransteprout
WITH UNIQUE KEY tranid objvers ruleid stepid.
DATA:
lv_counter_routines TYPE
lv_counter_groupidTYPE
lv_groupidTYPE
lv_counter_transTYPE
i,
i,
rstran_groupid,
i.
SELECT-OPTIONS:
tranid FORtran_id ,
objstatFORobjstat_,
scname FORscname_ NO-DISPLAY,
tgname FORtgname_ NO-DISPLAY.
PARAMETERS:
objversTYPE
only_cst TYPE
transfer TYPE
updTYPE
un_def TYPE
rsobjvers
rs_bool AS CHECKBOX
rs_bool AS CHECKBOX
rs_bool AS CHECKBOX
rs_bool AS CHECKBOX
DEFAULT
DEFAULT
DEFAULT
DEFAULT
DEFAULT
'M',
'X',
'X',
'X',
'X'.
*&--------------------------------------------------------------------*
*& START-OF-SELECTION
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
START-OF-SELECTION.
IF cl_rso_application_log=>appl_log_get_log_handle( ) IS INITIAL.
l_extnumber = 'RSTRAN_MIGRATION_CHECK'.
CALL METHOD cl_rso_application_log=>appl_log_create
EXPORTING
i_object= rstr_c_appl_log_trfn
i_subobject = rstr_c_appl_log_trfn_content
i_extnumber = l_extnumber.
ENDIF.
*-- process all transformations due to availablibilty of global routines
IF objvers = rs_c_objvers-delivery.
*-- source system dependent ones
SELECT * FROM rstran APPENDING TABLE lt_tran_sel
WHERE objvers = rs_c_objvers-delivery
AND sourcetype = 'RSDS'
AND is_shadow= rs_c_true
AND tranidIN tranid
AND objstat IN objstat.
*-- delete outdated releases
DELETE lt_tran_sel
WHERE sourcename+30(10) = 'R/345B'
ORsourcename+30(10) = 'R/346B'.
*-- rest
SELECT * FROM rstran APPENDING TABLE lt_tran_sel
WHERE objvers = rs_c_objvers-delivery
AND sourcetype <> 'RSDS'
AND tranidIN tranid
AND objstat IN objstat.
ELSE.
IF only_cst IS INITIAL.
SELECT * FROM rstran INTO TABLE lt_tran_sel
WHERE objvers = objvers
AND tranid IN tranid
AND objstat IN objstat.
ELSE.
scname-sign= 'I'.
scname-option= 'CP'.
scname-low = 'Z*'.
APPEND scname TO scname.
scname-low = 'Y*'.
APPEND scname TO scname.
tgname-sign=
tgname-option=
tgname-low =
APPEND tgname TO
tgname-low =
APPEND tgname TO
'I'.
'CP'.
'Z*'.
tgname.
'Y*'.
tgname.
ls_codeidTYPE rsaa_s_codeid.
lt_codeidTYPE rsaa_t_codeid.
lt_arout TYPErsaa_t_arout.
lt_arfieldsTYPErsaa_t_arfields.
lt_aabap TYPErsaa_t_aabap.
lt_aabapinvTYPErsaa_t_aabap.
lt_arouttTYPErsaa_t_aroutt.
DATA:
ls_tokesTYPE
lt_tokesTYPE
lt_stmntTYPE
l_tabix_tokes TYPE
stokes,
STANDARD TABLE OF stokes,
STANDARD TABLE OF sstmnt,
sytabix.
DATA:
lv_last_posTYPE i,
lv_counter TYPE i,
lc_char_allowed(62) TYPE c
VALUE 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0987654
321'.
*-- check if any code created by migration exist in global part 2
CLEAR: c_coding_found.
ls_codeid-sign = 'I'.
ls_codeid-option = 'EQ'.
ls_codeid-low = p_codeid .
APPEND ls_codeid TO lt_codeid.
CALL FUNCTION 'RSAA_ROUTINE_MULTI_GET'
EXPORTING
i_objvers= p_objvers
i_t_codeid = lt_codeid
IMPORTING
e_t_arout= lt_arout
e_t_aabap= lt_aabap.
LOOP AT lt_aabap ASSIGNING <ls_aabap>.
ls_abapsource = <ls_aabap>-line.
APPEND ls_abapsource TO lt_abapsource.
ENDLOOP.
SCAN ABAP-SOURCE lt_abapsource
TOKENS INTO lt_tokes
STATEMENTS INTO lt_stmnt
WITHOUT TRMAC.
LOOP AT lt_tokes ASSIGNING <ls_tokes>
WHERE str CP 'FORM'.
l_tabix_tokes = sy-tabix + 1.
READ TABLE lt_tokes ASSIGNING <ls_tokes_2>INDEX l_tabix_tokes.
ASSERT sy-subrc = 0.
IF <ls_tokes_2>-str CS 'ROUTINE_9998' OR
<ls_tokes_2>-str CS 'ROUTINE_' OR
<ls_tokes_2>-str CS 'STARTROUTINE' OR
<ls_tokes_2>-str CS 'COMPUTE_'.
c_coding_found = rs_c_true.
EXIT.
ENDIF.
ENDLOOP.
ENDFORM." check_for_code
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*& FORM FORMULA_CHECK
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
*&---------------------------------------------------------------------*
*&FormFORMULA_CHECK
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
*-->P_LS_STEPROUTtext
*-->P_L_DOES_NOT_EXISTtext
*----------------------------------------------------------------------*
FORM formula_check
USINGp_formulaidTYPE rstransteprout-codeid
p_objversTYPE rstransteprout-objvers
CHANGING p_does_not_exist TYPE rs_bool
p_inconsistent TYPE rs_bool.
DATA:
DATA:
DATA:
DATA:
DATA:
DATA:
DATA:
DATA:
DATA:
l_missing_sfobu
ls_formmap TYPE
ls_formTYPE
l_sfbeid TYPE
ls_rsev000 TYPE
ls_sev000TYPE
lt_rsev001 TYPE
lt_sev001TYPE
l_stop TYPE
TYPE rs_bool.
rsaformmap.
rsaform.
sfbeid.
rsfobuev000.
sfobuev000.
STANDARD TABLE OF rsfobuev001.
STANDARD TABLE OF sfobuev001.
rs_bool.
p_does_not_exist = rs_c_true.
l_stop = rs_c_true.
SELECT SINGLE * FROM rsaform INTO ls_form
WHERE formula_id = p_formulaid
AND objvers= p_objvers.
IF sy-subrc = 0.
*-- header without mapping
p_inconsistent = rs_c_true.
l_stop = rs_c_true.
ENDIF.
ELSE.
SELECT SINGLE * FROM rsaform INTO ls_form
WHERE formula_id = ls_formmap-formin
AND objvers = ls_formmap-objvers.
IF sy-subrc <> 0.
p_inconsistent = rs_c_true.
l_stop = rs_c_true.
ENDIF.
ENDIF.
*-- check next level on BI formula object
CHECK l_stop = space.
SELECT SINGLE * FROM rsfobuev000 INTO ls_rsev000
WHERE formid= ls_formmap-formin
AND objvers = ls_formmap-objvers.
IF sy-subrc <> 0.
l_missing_sfobu = rs_c_true.
l_stop = rs_c_true.
ENDIF.
SELECT * FROM rsfobuev001 INTO TABLE lt_rsev001
WHERE formid= ls_formmap-formin
AND objvers = ls_formmap-objvers.
IF sy-subrc <> 0.
p_inconsistent = rs_c_true.
l_stop = rs_c_true.
ENDIF.
*-- only for a-version technically a basic formula is necessary
CHECK l_stop IS INITIAL.
*-- convert to char32 string
* Convert 25-digit unique-ID to 32-digit unique-ID
CALL FUNCTION 'RSS_UNIQUE_CONVERT_TO_HEX'
EXPORTING
i_uni_idc25 = ls_formmap-formin
IMPORTING
e_uni_idc = l_sfbeid
EXCEPTIONS
invalid_unique_id = 1.
SELECT SINGLE * FROM sfobuev000 INTO ls_sev000
WHERE id= l_sfbeid.
IF sy-subrc <> 0.
l_missing_sfobu = rs_c_true.
l_stop = rs_c_true.
ENDIF.
SELECT * FROM sfobuev001 INTO TABLE lt_sev001
WHERE id = l_sfbeid.
IF sy-subrc <> 0.
l_missing_sfobu = rs_c_true.
l_stop = rs_c_true.
ENDIF.
IF p_objvers = rs_c_objvers-modified.
IF p_inconsistent= rs_c_false AND
l_missing_sfobu = rs_c_true.
*-- try to recreate missint internal formula from rsfobuev*
CALL METHOD cl_rsar_formulas=>copy_fobu_to_extern
EXPORTING
i_formex = p_formulaid
i_objvers= p_objvers
*i_write_log=
*IMPORTING
*e_t_msg=
EXCEPTIONS
rsfo_invalid_unique_id = 1
OTHERS = 2
.
IF sy-subrc = 0.
CLEAR p_inconsistent.
ELSE.
p_inconsistent = rs_c_true.
ENDIF.
ENDIF.
ENDIF.
ENDFORM." FORMULA_CHECK
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*& FORM CHECK_T_OR_U
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
*&---------------------------------------------------------------------*
*&FormCHECK_T_OR_U
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
*-->P_LS_TRAN_GLBCODE2text
*-->P_LS_TRAN_OBJVERStext
*<--P_L_T_OR_Utext
*----------------------------------------------------------------------*
FORM check_t_or_uUSINGp_codeidTYPE rsaabap-codeid
p_objvers TYPE rsaabap-objvers
CHANGINGc_t_or_uTYPE rs_bool.
DATA:
DATA:
DATA:
DATA:
DATA:
DATA:
DATA:
ls_codeidTYPE rsaa_s_codeid.
lt_codeidTYPE rsaa_t_codeid.
lt_arout TYPErsaa_t_arout.
lt_arfieldsTYPErsaa_t_arfields.
lt_aabap TYPErsaa_t_aabap.
lt_aabapinvTYPErsaa_t_aabap.
lt_arouttTYPErsaa_t_aroutt.
FIELD-SYMBOLS:
<ls_aabap>TYPErsaa_s_aabap.
ls_codeid-sign = 'I'.
ls_codeid-option = 'EQ'.
ls_codeid-low = p_codeid .
APPEND ls_codeid TO lt_codeid.
CALL FUNCTION 'RSAA_ROUTINE_MULTI_GET'
EXPORTING
i_objvers= p_objvers
i_t_codeid = lt_codeid
IMPORTING
e_t_arout= lt_arout
e_t_aabap= lt_aabap.
* version 3.
TYPE-POOLS: rstr, rsaa, abap, rsau.
TYPES:
BEGIN OF ts_text,
tranidTYPE
textTYPE
type(8) TYPE
status(20)TYPE
level TYPE
END OF ts_text.
rstran-tranid,
string,
c,
c,
c,
TYPES:
tt_text TYPE TABLE OF ts_text,
tt_tokesTYPE STANDARD TABLE OFstokes
WITH NON-UNIQUE DEFAULT KEY.
DATA:
gv_extnumber TYPE bal_s_log-extnumber,
gs_tranTYPE rstran,
gt_tranTYPE SORTED TABLE OF rstran
WITH UNIQUE KEY tranid objvers,
gt_aabap TYPE rsaa_t_aabap,
gt_abapsourceTYPE rsau_t_abapsource,
gt_arout TYPE rsaa_t_arout,
gs_tranruleTYPE rstranrule,
gt_tranruleTYPE SORTED TABLE OF rstranrule
WITH UNIQUE KEY tranid ruleid objvers,
gs_steproutTYPE rstransteprout,
gt_steproutTYPE SORTED TABLE OF rstransteprout
WITH UNIQUE KEYtranid objvers ruleid st
epid,
gr_data_refTYPE REF TOdata,
gs_textTYPE
gt_textTYPE
gt_text_allTYPE
gv_stringTYPE
gv_coding_foundTYPE
gv_check_t_or_uTYPE
gv_t_or_uTYPE
gv_migratedTYPE
gv_errors_foundTYPE
ts_text,
tt_text,
tt_text,
string,
rs_bool,
rs_bool,
c,
rs_bool,
rs_bool,
gt_tr_object TYPErs_t_tr_object,
g_context_not_found TYPE rs_bool,
objvrs TYPE rsobjvers,
objstat_ TYPE rsobjstat,
tran_idTYPE rstranid.
FIELD-SYMBOLS:
<gs_text>TYPE ts_text.
CONSTANTS:
gc_error(20)TYPE c VALUE 'ERROR'
,
gc_migrated(20) TYPE c VALUE 'MIGRAT
E',
gc_already_migrated(20) TYPE c VALUE 'ALREAD
Y_MIGRATED'.
SELECT-OPTIONS:
tranid FORtran_idOBLIGATORY,
objstatFORobjstat_.
PARAMETERS:
objversTYPE rsobjversOBLIGATORYDEFAULT 'M',
forceatv TYPE cAS CHECKBOX, "forces activation
even it Transformations are already migrated
simulate TYPE cAS CHECKBOX DEFAULT 'X',"does not save ch
anges to coding
requestTYPE trkorr NO-DISPLAY.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*& START-OF-SELECTION
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
START-OF-SELECTION.
CHECK objvers = 'M'
ORobjvers = 'D'.
*--------------------------------------------------------------------*
IF cl_rso_application_log=>appl_log_get_log_handle( ) IS INITIAL.
gv_extnumber = 'RSTRAN_MIGRATION_REPAIR'.
CALL METHOD cl_rso_application_log=>appl_log_create
EXPORTING
i_object= rstr_c_appl_log_trfn
i_subobject = rstr_c_appl_log_trfn_content
i_extnumber = gv_extnumber.
ENDIF.
*--------------------------------------------------------------------*
IF objvers = rs_c_objvers-delivery.
*-- source system dependent ones
SELECT * FROM rstran APPENDING TABLE gt_tran
WHERE objvers = rs_c_objvers-delivery
AND sourcetype = 'RSDS'
AND is_shadow= rs_c_true
AND tranidIN tranid
AND objstat IN objstat.
*-- rest
SELECT * FROM rstran APPENDING TABLE gt_tran
WHERE objvers = rs_c_objvers-delivery
AND sourcetype <> 'RSDS'
AND tranidIN tranid
AND objstat IN objstat.
ELSE.
*-- process all transformations due to availablibilty of global routines
SELECT * FROM rstran INTO TABLE gt_tran
WHERE objvers = objvers
AND tranidIN tranid
AND objstat IN objstat.
ENDIF.
*-- only that ones with global part 2 could be created by migration
DELETE gt_tran WHERE glbcode2 IS INITIAL.
SELECT * FROM rstranrule INTO TABLE gt_tranrule
FOR ALL ENTRIES IN gt_tran
WHERE objvers = gt_tran-objvers
AND tranid= gt_tran-tranid.
*-- process all transformation including formulas or routines
SELECT * FROM rstransteprout INTO TABLE gt_steprout
FOR ALL ENTRIES IN gt_tran
WHERE objvers = gt_tran-objvers
AND tranid= gt_tran-tranid
AND kind <> 'FORMULA'.
CLEAR: gt_text[].
LOOP AT gt_tran INTO gs_tran.
CLEAR: gv_migrated,
g_context_not_found.
*--------------------------------------------------------------------*
*-- Check if it was already migrated
*-- second global part contains additional comments to check this
IF gs_tran-glbcode2 IS NOT INITIAL.
PERFORMget_migrate_status
USINGgs_tran-glbcode2
gs_tran-objvers
CHANGINGgv_migrated.
ENDIF.
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
IF gv_migrated IS INITIAL.
CLEAR gs_text.
gs_text-tranid = gs_tran-tranid.
CONCATENATE 'TRANID:' gs_text-tranid
INTO gs_text-text
SEPARATED BY space.
gs_text-status= gc_migrated.
gs_text-level = 2.
APPEND gs_text TO gt_text.
*--------------------------------------------------------------------*
*-- Start Methode
IF gs_tran-startroutine IS NOT INITIAL.
CLEAR: gv_t_or_u, gt_aabap, gt_arout, gt_abapsource, gv_coding_f
ound.
PERFORMget_code
USINGgs_tran-startroutine
gs_tran-objvers
'1'"gv_check_t_or_u
'PERFORM'
CHANGINGgv_coding_found
gt_aabap
gt_arout
gv_t_or_u
gv_migrated.
IF gv_coding_found IS NOT INITIAL.
IF gv_t_or_u = 'U'.
PERFORMfix_code
USINGgt_aabap
'UPDATE_START_ROUTINE'
CHANGING gt_abapsource
g_context_not_found.
IF g_context_not_found IS INITIAL.
PERFORMput_code
USINGgs_tran-startroutine
gs_tran-objvers
gt_abapsource
gt_arout
''
simulate .
ENDIF.
*--------------------------------------------------------------------*
CLEAR gs_text.
gs_text-tranid = gs_tran-tranid.
CONCATENATE 'Update Start Routine' gs_tran-startroutine 'mig
rated'
INTO gs_text-text
SEPARATED BY space.
gs_text-status= gc_migrated.
gs_text-level = 4.
APPEND gs_text TO gt_text.
*--------------------------------------------------------------------*
ELSEIF gv_t_or_u = 'T'.
*nothing to do:-)
ENDIF.
ELSE.
IF gv_t_or_u IS NOT INITIAL.
g_context_not_found = rs_c_true.
ENDIF.
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
*--single routines
LOOP AT gt_steprout
INTOgs_steprout
WHERE tranid = gs_tran-tranid
AND codeid <> space.
CLEAR: gv_t_or_u, gt_aabap, gt_arout, gt_abapsource.
PERFORMget_code
USINGgs_steprout-codeid
gs_tran-objvers
'1'"gv_check_t_or_u
'PERFORM'
CHANGINGgv_coding_found
gt_aabap
gt_arout
gv_t_or_u
gv_migrated.
IF gv_coding_found IS NOT INITIAL.
IF gv_t_or_u = 'U'.
PERFORMfix_code
USINGgt_aabap
'UPDATE_RULE'
CHANGING gt_abapsource
g_context_not_found.
IF g_context_not_found IS INITIAL.
PERFORMput_code
USINGgs_steprout-codeid
gs_tran-objvers
gt_abapsource
gt_arout
''
simulate .
*--------------------------------------------------------------------*
CLEAR gs_text.
gs_text-tranid = gs_tran-tranid.
CONCATENATE 'Update Rule' gs_steprout-codeid 'migrated'
INTO gs_text-text
SEPARATED BY space.
gs_text-status= gc_migrated.
gs_text-level = 4.
APPEND gs_text TO gt_text.
ENDIF.
*--------------------------------------------------------------------*
ELSEIF gv_t_or_u = 'T'.
PERFORMfix_code
USINGgt_aabap
'TRANSFER_RULE'
CHANGING gt_abapsource
g_context_not_found.
IF g_context_not_found IS INITIAL.
PERFORMput_code
USINGgs_steprout-codeid
gs_tran-objvers
gt_abapsource
gt_arout
''
simulate .
*--------------------------------------------------------------------*
CLEAR gs_text.
gs_text-tranid = gs_tran-tranid.
CONCATENATE 'Transfer Rule' gs_steprout-codeid 'migrated'
INTO gs_text-text
SEPARATED BY space.
gs_text-status= gc_migrated.
gs_text-level = 4.
APPEND gs_text TO gt_text.
*--------------------------------------------------------------------*
ENDIF.
ENDIF.
ENDIF.
ENDLOOP.
*--------------------------------------------------------------------*
*--------------------------------------------------------------------*
*-- second global part - new mirgrated coding, with Start and all other
Update or Transfer routines
IF gs_tran-glbcode2 IS NOT INITIAL.
*CLEAR gv_t_or_u. --> this is derived from the routines above
CLEAR: gt_aabap, gt_arout, gt_abapsource.
PERFORMget_code
USINGgs_tran-glbcode2
gs_tran-objvers
''"gv_check_t_or_u --> this is derive
d from the routines above
'FORM'
CHANGINGgv_coding_found
gt_aabap
gt_arout
gv_t_or_u
gv_migrated.
IF gv_coding_found IS NOT INITIAL.
IF gv_t_or_u = 'U'.
PERFORMfix_code
USINGgt_aabap
'UPDATE_ROUTINE'
CHANGING gt_abapsource
g_context_not_found.
IF g_context_not_found IS INITIAL.
PERFORMput_code
USINGgs_tran-glbcode2
gs_tran-objvers
gt_abapsource
gt_arout
'1'
simulate .
*--------------------------------------------------------------------*
CLEAR gs_text.
gs_text-tranid = gs_tran-tranid.
CONCATENATE 'Update Global Part 2' gs_tran-glbcode2 'migra
ted'
INTO gs_text-text
SEPARATED BY space.
gs_text-status= gc_migrated.
gs_text-level = 4.
APPEND gs_text TO gt_text.
*--------------------------------------------------------------------*
ENDIF.
ELSEIF gv_t_or_u = 'T'.
*this only adds comment to show that it has been migrated
PERFORMfix_code
USINGgt_aabap
'TRANSFER_ROUTINE'
CHANGING gt_abapsource
g_context_not_found.
IF g_context_not_found IS INITIAL.
PERFORMput_code
USINGgs_tran-glbcode2
gs_tran-objvers
gt_abapsource
gt_arout
'1'
simulate .
*--------------------------------------------------------------------*
CLEAR gs_text.
gs_text-tranid = gs_tran-tranid.
CONCATENATE 'Transfer Global Part 2' gs_tran-glbcode2 'mig
rated'
INTO gs_text-text
SEPARATED BY space.
gs_text-status= gc_migrated.
gs_text-level = 4.
APPEND gs_text TO gt_text.
*--------------------------------------------------------------------*
ENDIF.
ENDIF.
ENDIF.
ENDIF.
*--------------------------------------------------------------------*
IF gv_t_or_u IS NOT INITIAL.
*only commit if we could determine is it was a Transfer or and Update Ru
le
*if this was not determined, then it has to be manually checked
IF simulate IS INITIAL AND g_context_not_found IS INITIAL.
CALL FUNCTION 'DB_COMMIT'.
PERFORM activate
USING gs_tran-tranid
gs_tran-objvers
rs_c_true
rs_c_false
rs_c_true"with transport
CHANGING gt_text.
ELSEIF simulate IS INITIAL AND g_context_not_found IS NOT INITIA
L.
ROLLBACK WORK.
ENDIF.
IF g_context_not_found IS NOT INITIAL.
CLEAR gs_text.
gs_text-tranid = gs_tran-tranid.
CONCATENATE 'Context block not found' 'check manually'
INTO gs_text-text
SEPARATED BY space.
gs_text-status= gc_error.
gs_text-level = 3.
APPEND gs_text TO gt_text.
ENDIF.
CLEAR: gs_text, gv_string.
CASE gv_t_or_u .
WHEN 'T'.
gs_text-type = 'TRANSFER:'.
WHEN 'U'.
gs_text-type = 'UPDATE:'.
ENDCASE.
gs_text-tranid = gs_tran-tranid.
CONCATENATE gs_text-type 'TRANID =' gs_tran-tranid 'OBJVERS ='
gs_tran-objvers
INTOgs_text-text
SEPARATED BYspace.
READ TABLE gt_text
WITH KEY status = 'ERROR'
TRANSPORTING NO FIELDS.
IF sy-subrc = 0.
gs_text-status= gc_error.
*if there was one error, set them all to "error"
LOOP AT gt_text ASSIGNING <gs_text>.
<gs_text>-status= gc_error.
ENDLOOP.
ELSE.
gs_text-status= gc_migrated.
ENDIF.
gs_text-level= 3.
INSERTgs_text
INTOgt_text
INDEX 1.
PERFORMlog_handle
CHANGING gt_text.
ELSE.
*Errors where found, this will have to be migrated manually
CLEAR: gs_text, gv_string.
gs_text-tranid = gs_tran-tranid.
CONCATENATE 'Error:' 'TRANID =' gs_tran-tranid 'OBJVERS =' gs_
tran-objvers
INTOgs_text-text
SEPARATED BYspace.
gs_text-status = gc_error.
gs_text-level= 3.
INSERT gs_text
INTO gt_text
INDEX1.
gs_text-tranid = gs_tran-tranid.
gs_text-text= 'could not be determine if it is a Transfer or
Update Transformation'.
gs_text-status = gc_error.
gs_text-level= 3.
INSERT gs_text
INTO gt_text
INDEX2.
ENDIF.
PERFORMlog_handle
CHANGING gt_text.
ELSE.
*Transformation was already migrated
gs_text-tranid = gs_tran-tranid.
CONCATENATE 'Already Migrated:' 'TRANID =' gs_tran-tranid 'OBJVE
RS =' gs_tran-objvers
INTOgs_text-text
SEPARATED BYspace.
gs_text-status = gc_already_migrated.
gs_text-level= 3.
INSERT gs_text
INTO gt_text
INDEX1.
PERFORMlog_handle
CHANGING gt_text.
IF forceatv IS NOT INITIAL.
PERFORM activate
USING gs_tran-tranid
gs_tran-objvers
rs_c_false
rs_c_false
rs_c_true"with transport
CHANGING gt_text_all.
ENDIF.
ENDIF.
APPEND LINES OF gt_text TO gt_text_all.
CLEAR gt_text.
ENDLOOP.
PERFORM add_to_transport
USING gt_tr_object.
PERFORM log_call
USING gt_text_all.
INCLUDE rstran_migration_repair_f01.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
>>> A T T E N T I O N: P L E A S E N O T E:<<<
>>> Correction contains additional changes that are NOT shown here <<<
>>> Display all changes by Note Assistant Note display functionality <<<
*&--------------------------------------------------------------------*
*& ObjectREPS RSTRAN_MIGRATION_REPAIR_F01
*& Object Header PROG RSTRAN_MIGRATION_REPAIR_F01
*&--------------------------------------------------------------------*
*& FORM GET_CODE
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
*&---------------------------------------------------------------------*
*&Include Z_RSTRAN_FIX_BICONTENT_1_F01
*&---------------------------------------------------------------------*
*----------------------------------------------------------------------*
***INCLUDE Z_RSTRAN_FIX_BICONTENT_F01 .
*----------------------------------------------------------------------*
*&---------------------------------------------------------------------*
*&Formget_code
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
*-->P_LS_TRAN_GLBCODE2text
*-->P_LS_TRAN_OBJVERStext
*<--P_L_CODING_FOUNDtext
*----------------------------------------------------------------------*
form get_code
usingp_codeidtype rsaabap-codeid
p_objvers type rsaabap-objvers
pv_check_t_or_u type rs_bool
p_search_string type string
changing c_coding_foundtype rs_bool
ct_aabaptype rsaa_t_aabap
ct_arouttype rsaa_t_arout
cv_t_or_u type c
cv_migrated type rs_bool.
data: ls_abapsource type rsau_s_abapsource.
data: lt_abapsource type rsau_t_abapsource.
data:
ls_tokestype
lt_tokestype
lt_stmnttype
l_tabix_tokes type
stokes,
standard table of stokes,
standard table of sstmnt,
sytabix.
if <ls_aabap>-line(1) = '*'
or <ls_aabap>-line(1) = '"'.
*this is only a comment, so we skip it.
continue.
endif.
*get the position of the last character
lv_last_pos = strlen( <ls_aabap>-line ) - 1.
lv_counter = 0.
while lv_counter <= lv_last_pos.
*loop through the character variable checking each character
assign <ls_aabap>-line+lv_counter(1) to <c>.
if <c> is assigned.
if <c> ca lc_char_allowed.
*character found
c_coding_found = abap_true.
exit.
endif.
elseif <c> = '"'.
*this is only a comment, so we skip it.
exit.
endif.
add 1 to lv_counter.
endwhile.
if c_coding_foundis not initial
andpv_check_t_or_u is initial.
exit.
elseif c_coding_foundis not initial
andpv_check_t_or_u is not initial
andcv_t_or_u is not initial.
exit.
endif.
endif.
endloop.
if cv_t_or_u is initial.
clear c_coding_found.
*-- any perform exist ?
loop at ct_aabap assigning <ls_aabap>.
ls_abapsource = <ls_aabap>-line.
append ls_abapsource to lt_abapsource.
endloop.
scan abap-source lt_abapsource
tokens into lt_tokes
statements into lt_stmnt
without trmac.
loop at lt_tokes assigning <ls_tokes>
where str = p_search_string. "FORM or PERFORM
l_tabix_tokes = sy-tabix + 1.
read table lt_tokes assigning <ls_tokes_2>index l_tabix_tokes.
assert sy-subrc = 0.
if <ls_tokes_2>-str cs 'ROUTINE_9998' or
<ls_tokes_2>-str cs 'ROUTINE_'.
cv_t_or_u = 'U'.
if pv_check_t_or_u is initial.
c_coding_found = rs_c_true.
endif.
exit.
elseif
<ls_tokes_2>-str cs 'STARTROUTINE' or
<ls_tokes_2>-str cs 'COMPUTE_'.
cv_t_or_u = 'T'.
if pv_check_t_or_u is initial.
c_coding_found = rs_c_true.
endif.
exit.
endif.
endloop.
endif.
endform." get_code
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*& FORM LOG_HANDLE
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
*&---------------------------------------------------------------------*
*&Formhandle_log
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
*-->P_LT_TEXTtext
*----------------------------------------------------------------------*
data:
lv_mess type string,
lv_lintype i,
lv_wrdtype string.
field-symbols:
<ls_aabap>typersaa_s_aabap,
<ls_tokes>typestokes,
<ls_abapsource> typersau_s_abapsource.
loop at ut_aabap assigning <ls_aabap>.
ls_abapsource = <ls_aabap>-line.
assert sy-subrc = 0.
*-- consider already inserted rows for row calculation
if ls_tokes_context-str = 'TABLES'.
*-- insert line after "TABLES"
*-- consider already inserted rows for row calculation
lv_row_insert = lv_row_offset_stokes + ls_tokes_context-row + 1.
clear ls_insertlines.
ls_insertlines = 'p_monitor STRUCTURE rsmonitor'.
"-> insert'.
append ls_insertlines to lt_insertlines.
lv_row_offset_stokes = lv_row_offset_stokes + 1.
clear ls_insertlines.
ls_insertlines = 'p_monitor_recno STRUCTURE rsmonitors'.
"-> insert'.
append ls_insertlines to lt_insertlines.
lv_row_offset_stokes = lv_row_offset_stokes + 1.
insert lines of lt_insertlines into ct_abapsource index lv_row_i
nsert.
clear lt_insertlines.
*-- get ENDFORM of current FORM from stokes
loop at pt_tokes
from l_tabix_context
into ls_tokes_context
where str = 'ENDFORM'.
exit.
endloop.
if sy-subrc <> 0.
c_context_not_found = rs_c_true.
exit.
endif.
lv_row_insert = lv_row_offset_stokes + ls_tokes_context-row. "be
fore endform
clear ls_insertlines.
ls_insertlines = 'p_monitor[] = monitor[].'. "-> i
nsert'.
append ls_insertlines to lt_insertlines.
lv_row_offset_stokes = lv_row_offset_stokes + 1.
clear ls_insertlines.
ls_insertlines = 'p_monitor_recno[] = monitor_recno[].'. "-> i
nsert'.
append ls_insertlines to lt_insertlines.
lv_row_offset_stokes = lv_row_offset_stokes + 1.
clear ls_insertlines.
ls_insertlines = 'CLEAR: monitor[],'."-> i
nsert'.
append ls_insertlines to lt_insertlines.
lv_row_offset_stokes = lv_row_offset_stokes + 1.
clear ls_insertlines.
ls_insertlines = ' monitor_recno[].'."-> i
nsert'.
append ls_insertlines to lt_insertlines.
lv_row_offset_stokes = lv_row_offset_stokes + 1.
*--blank row
clear ls_insertlines.
append ls_insertlines to lt_insertlines.
lv_row_offset_stokes = lv_row_offset_stokes + 1.
insert lines of lt_insertlines into ct_abapsource index lv_row_i
nsert.
clear lt_insertlines.
else.
* -- context not found
c_context_not_found = rs_c_true.
exit.
endif.
elseif ls_tokes_routnm-str cs 'ROUTINE_'.
*insert line after "FORM routine_*"
*-- consider already inserted rows for row calculation
lv_row_insert = lv_row_offset_stokes + ls_tokes_routnm-row + 1.
clear ls_insertlines.
ls_insertlines = 'TABLES'."->ins
ert'.
append ls_insertlines to lt_insertlines.
lv_row_offset_stokes = lv_row_offset_stokes + 1.
clear ls_insertlines.
ls_insertlines = 'p_monitorSTRUCTURE rsmonitor'."->ins
ert'.
append ls_insertlines to lt_insertlines.
lv_row_offset_stokes = lv_row_offset_stokes + 1.
*&FormRULE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
*-->P_LT_TOKES_SORTtext
*<--P_LT_ABAPSOURCEtext
*----------------------------------------------------------------------*
form fix_update_rule usingpt_tokestype tt_tokes
changingct_abapsource type rsau_t_abapsource
c_context_not_found type rs_bool.
data:
ls_abapsource type rsau_s_abapsource,
ls_insertlinestype rsau_s_abapsource,
lt_insertlinestype rsau_t_abapsource.
data:
ls_tokestype stokes,
lv_rowtype int4,
lv_rows_insertedtype int4.
field-symbols:
<ls_tokes>typestokes,
<ls_abapsource> typersau_s_abapsource.
endif.
endloop.
endloop.
*-endform." RULE
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*& FORM PUT_CODE
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
*&---------------------------------------------------------------------*
*&FormPUT_CODE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
*-->P_GS_TRAN_STARTROUTINEtext
*-->P_GS_TRAN_OBJVERStext
*-->P_GT_ABAPSOURCEtext
*----------------------------------------------------------------------*
form put_codeusingp_codeidtypersaabap-codeid
p_objvers typersaabap-objvers
pt_abapsource typersau_t_abapsource
pt_arouttypersaa_t_arout
pv_set_migrate_status typers_bool
pv_simulate typec.
data: lt_aabaptypersaa_t_aabap,
ls_aabaptypersaa_s_aabap,
ls_codeid typersaa_s_codeid,
lt_codeid typersaa_t_codeid,
lt_arouttypersaa_t_arout,
ls_abapsource type rsau_s_abapsource.
field-symbols:
<ls_abapsource> type rsau_s_abapsource.
*--------------------------------------------------------------------*
*insert comment to show that it was migrated into Global Part 2
ifpv_set_migrate_status is not initial.
ls_abapsource = '*$*$ begin of version'.
insert ls_abapsource into pt_abapsourceindex 1.
ls_abapsource = '*-- migration tool version 19.02.2009'.
insert ls_abapsource into pt_abapsourceindex 2.
ls_abapsource = '*$*$ end of version'.
insert ls_abapsource into pt_abapsourceindex 3.
endif.
*--------------------------------------------------------------------*
check pv_simulate is initial.
loop at pt_abapsource assigning <ls_abapsource>.
ls_aabap-codeid =
ls_aabap-objvers=
ls_aabap-line_no=
ls_aabap-line =
p_codeid.
p_objvers.
sy-tabix.
<ls_abapsource>.
'I'.
'EQ'.
p_codeid.
lt_codeid.
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
*-->P_GS_TRAN_TRANIDtext
*-->P_GS_TRAN_OBJVERStext
*----------------------------------------------------------------------*
form activateusingpv_tranid type rstranid
pv_objverstype rsobjvers
pv_with_savetype rs_bool
pv_with_compare type rs_bool
pv_with_cto type rs_bool
changing ct_text type tt_text.
data: lr_rstran_trfntype ref to cl_rstran_trfn,
lv_subrctypesysubrc,
lr_messages type ref to cl_rso_msg,
lt_messages typers_t_msg,
ls_messages typers_s_msg,
lt_obj_existentialtyperso_t_tlogo_asc,
ls_obj_existentialtyperso_s_tlogo_asc,
lr_collection type ref to cl_rstran_trfn_collection,
lv_objnmtypesobj_name,
ls_text typets_text,
lv_not_modifyable typers_bool,
lt_tlogotyperso_th_tlogo,
ls_tr_objecttypers_s_tr_object,
lt_msgtypers_t_msg,
lv_requesttypetrkorr,
lv_as4pos typeddposition.
*--------------------------------------------------------------------*
*check transformation
try.
call method cl_rstran_trfn=>factory
exporting
i_tranid = pv_tranid
receiving
r_r_tran = lr_rstran_trfn.
catch cx_rstran_not_found .
catch cx_rstran_input_invalid .
endtry.
call method lr_rstran_trfn->get_info_vers
exporting
i_objvers = pv_objvers.
try.
call method lr_rstran_trfn->set_current_version
exporting
i_objvers = pv_objvers.
catch cx_rstran_version_not_found .
endtry.
create object lr_messages.
call method lr_rstran_trfn->check_me
importing
e_subrc = lv_subrc
changing
c_r_msg = lr_messages.
call method lr_messages->get_all_msg
receiving
r_t_msg = lt_messages.
clear gv_errors_found.
loop at lt_messages into ls_messages
wheremsgty = 'E'
or msgty = 'A'
or msgty = 'X'.
gv_errors_found = 'X'.
message idls_messages-msgid
typels_messages-msgty
numberls_messages-msgno
intols_text-text
withls_messages-msgv1 ls_messages-msgv2 ls_messages-msgv3 ls
_messages-msgv4.
ls_text-level = 3.
ls_text-status = gc_error.
append ls_text to ct_text.
clear ls_text.
endloop.
If pv_with_compare is not initial.
if rs_c_false = lr_rstran_trfn->compare_am( ).
*ls_text-level = 3.
ls_text-status = gc_error.
ls_text-text = 'Version M and A is not equal, processing skipped'.
append ls_text to ct_text.
endif.
endif.
if gv_errors_found is initial.
create object lr_collection.
*--------------------------------------------------------------------*
*activate transformation
lv_objnm = pv_tranid.
try.
call method lr_collection->add_tlogo
exporting
i_objnm= lv_objnm
i_with_cto = pv_with_cto
importing
e_not_modifyable = lv_not_modifyable.
catch cx_rs_existing .
catch cx_rs_not_found .
endtry.
if lv_not_modifyable is not initial.
concatenate 'TRANID' pv_tranid 'not modifiyable'
intols_text-text
separated byspace.
ls_text-status = gc_error.
ls_text-level = 3.
append ls_text to ct_text.
clear ls_text.
else.
if pv_with_save is not initial.
try.
call method lr_collection->save
exporting
i_with_cto= pv_with_cto
*i_suppress_i_messages = RS_C_TRUE
*i_detlevel= '1'
importing
e_th_tlogo_error= lt_tlogo.
catch cx_rs_cancelled .
exit.
endtry.
endif.
if lt_tlogo[] is initial.
try.
call method lr_collection->activate
exporting
i_with_cto= pv_with_cto
i_force_activation= 'X'
i_show_check_protocol = ''
importing
e_th_tlogo_error= lt_tlogo.
catch cx_rs_cancelled .
exit.
endtry.
endif.
*--------------------------------------------------------------------*
*add transformation to list for the transport
check 1 = 2.
*if lt_tlogo is initial.
*
*If 1 = 2.
*add 1 to lv_as4pos.
*
*ls_tr_object-pgmid= 'R3TR'.
*ls_tr_object-object = 'DRFN'.
*ls_tr_object-trkorr = pv_request.
*ls_tr_object-as4pos = lv_as4pos.
*ls_tr_object-obj_name = pv_tranid.
*ls_tr_object-lockflag = 3.
*
*append ls_tr_objectto ct_tr_object.
*endif.
*
*
**--------------------------------------------------------------------*
**get the dependent routines and add them to the list for the transport
*try.
*call method lr_rstran_trfn->if_rso_tlogo_general~get_relate
d
*importing
*e_t_obj_existential = lt_obj_existential.
*
*catch cx_rs_version_not_found .
*catch cx_rs_msg .
*endtry.
*
*loop at lt_obj_existential into ls_obj_existential.
*
*add 1 to lv_as4pos.
*
*ls_tr_object-pgmid= 'R3TR'.
*ls_tr_object-object = ls_obj_existential-tlogo.
*ls_tr_object-trkorr = pv_request.
*ls_tr_object-as4pos = lv_as4pos.
*ls_tr_object-obj_name = ls_obj_existential-objnm.
*ls_tr_object-lockflag = 3.
*
*append ls_tr_objectto ct_tr_object.
*endloop.
**--------------------------------------------------------------------*
*endif.
endif.
endif.
endform." ACTIVATE
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*& FORM ADD_TO_TRANSPORT
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
*&---------------------------------------------------------------------*
*&FormADD_TO_TRANSPORT
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
*-->P_GT_TR_OBJECTtext
*----------------------------------------------------------------------*
form add_to_transportusingpt_tr_object typers_t_tr_object
.
data:
lv_subrctypesysubrc,
lt_msgtypers_t_msg,
lv_requesttypetrkorr.
if pt_tr_object is not initial.
call function 'RS_TR_WRITE_OBJECTS_TO_REQUEST'
exporting
i_t_tr_object = pt_tr_object
importing
e_t_msg = lt_msg
e_subrc = lv_subrc
e_request = lv_request.
endif.
endform." ADD_TO_TRANSPORT
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*& FORM FIX_TRANSFER_RULE
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
*&---------------------------------------------------------------------*
*&FormFIX_TRANSFER_ROUTINES
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
*-->P_LT_TOKES_SORTtext
*<--P_CT_ABAPSOURCEtext
*----------------------------------------------------------------------*
form fix_transfer_ruleusingpt_tokestype tt_tokes
changingct_abapsource type rsau_t_abapsourc
e
c_context_not_found type rs_bool.
data:
ls_abapsource type rsau_s_abapsource,
ls_insertlinestype rsau_s_abapsource,
lt_insertlinestype rsau_t_abapsource.
data:
ls_tokestype stokes,
lv_rowtype int4.
field-symbols:
<ls_tokes>typestokes,
<ls_abapsource> typersau_s_abapsource.
clear: lv_row.
*-loop atpt_tokes
assigning<ls_tokes>
where str = 'LOOP'.
*account for insterted lines
lv_row = <ls_tokes>-row.
read table ct_abapsource
into ls_abapsource
indexlv_row.
ifls_abapsource-line = 'LOOP AT G_T_ERRORLOG INTO l_s_error_lo
g.'
and sy-subrc = 0.
*insert line after the ENDLOOP
add 4 to lv_row.
*blank row
ls_insertlines = ''.
append ls_insertlines to lt_insertlines.
clear ls_insertlines.
ls_insertlines = '* clear global message container used in trans
fer rules'."> insert'.
append ls_insertlines to lt_insertlines.
clear ls_insertlines.
ls_insertlines = 'CLEAR g_t_errorlog[].'.
"> insert'.
append ls_insertlines to lt_insertlines.
insert lines of lt_insertlines into ct_abapsource index lv_row.
clear lt_insertlines.
*leave loop
exit.
endif.
endloop.
endform." FIX_TRANSFER_ROUTINES
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*& FORM GET_MIGRATE_STATUS
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
*&---------------------------------------------------------------------*
*&FormGET_MIGRATE_STATUS
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
*-->P_GS_TRAN_GLBCODE2text
*-->P_GS_TRAN_OBJVERStext
*-->P_0224 text
*<--P_GV_MIGRATEDtext
*----------------------------------------------------------------------*
form get_migrate_status
usingp_codeidtype rsaabap-codeid
p_objvers type rsaabap-objvers
changing cv_migrated type rs_bool.
data: ls_codeidtype
lt_codeidtype
lt_arout type
lt_aabap type
rsaa_s_codeid,
rsaa_t_codeid,
rsaa_t_arout,
rsaa_t_aabap.
field-symbols:
<ls_aabap>typersaa_s_aabap,
<c> typec.
ls_codeid-sign = 'I'.
ls_codeid-option = 'EQ'.
ls_codeid-low= p_codeid.
append ls_codeid to lt_codeid.
call function 'RSAA_ROUTINE_MULTI_GET'
exporting
i_objvers= p_objvers
i_t_codeid = lt_codeid
importing
e_t_arout= lt_arout
e_t_aabap= lt_aabap.
*--------------------------------------------------------------------*
*Check if the code was already migrated
check lt_aabap[] is not initial.
ts_text,
tt_text,
tt_text.
rs_t_tr_object.
sy-msgty.
tadir.
IF objvers[] IS INITIAL.
*-- process all transformation including formulas or routines
SELECT * FROM rstransteprout INTO TABLE lt_steprout
WHERE ( objvers = rs_c_objvers-modified
OR objvers = rs_c_objvers-active )
AND tranid IN tranid.
ELSE.
SELECT * FROM rstransteprout INTO TABLE lt_steprout
WHERE objvers IN objvers
AND tranidIN tranid.
ENDIF.
lt_tran = lt_tran_sel.
SORT lt_tran BY sourcetype sourcename.
LOOP AT lt_tran INTO ls_tran.
*-CLEARl_routine_exist.
CLEAR: lt_text[],
lt_text_all[],
lt_text_step_all[].
CLEARlt_formula[].
CLEARl_inconsistent.
CONCATENATE 'TRANID =' ls_tran-tranid 'OBJVERS =' ls_tran-objvers
INTO l_string SEPARATED BY space.
APPEND l_string TO lt_text.
*-CONCATENATE ls_tran-sourcetype
ls_tran-sourcename
'->'
ls_tran-targettype
ls_tran-targetname
INTO l_string SEPARATED BY space.
APPEND l_string TO lt_text.
*-- global part
IF ls_tran-glbcode IS NOT INITIAL.
PERFORM routine_check
USINGls_tran-glbcode
ls_tran-objvers
CHANGING l_does_not_exist
l_code_without_header
l_header_without_code.
IF l_does_not_exist IS NOT INITIAL.
CONCATENATE 'Global with ID =' ls_tran-glbcode 'is missing'
INTO l_string SEPARATED BY space.
APPEND l_string TO lt_text.
l_inconsistent = rs_c_true.
ENDIF.
IF l_code_without_header IS NOT INITIAL.
CONCATENATE 'Global with ID =' ls_tran-glbcode 'no RSAROUT Entry
'
INTO l_string SEPARATED BY space.
APPEND l_string TO lt_text.
l_inconsistent = rs_c_true.
ENDIF.
IF l_header_without_code IS NOT INITIAL.
*-- no error in case of global part
IF 1 = 2.
CONCATENATE 'Global with ID =' ls_tran-glbcode 'no RSAABAP Ent
ries'
INTO l_string SEPARATED BY space.
APPEND l_string TO lt_text.
l_inconsistent = rs_c_true.
ENDIF.
ENDIF.
ENDIF.
*-- second global part
IF ls_tran-glbcode2 IS NOT INITIAL.
PERFORM routine_check
USINGls_tran-glbcode2
ls_tran-objvers
CHANGING l_does_not_exist
l_code_without_header
l_header_without_code.
IF l_does_not_exist IS NOT INITIAL.
CONCATENATE 'Global2 with ID =' ls_tran-glbcode2 'is missing'
INTO l_string SEPARATED BY space.
APPEND l_string TO lt_text.
l_inconsistent = rs_c_true.
ENDIF.
IF l_code_without_header IS NOT INITIAL.
CONCATENATE 'Global2 with ID =' ls_tran-glbcode2 'no RSAROUT Ent
ry'
INTO l_string SEPARATED BY space.
ls_tran-objvers
CHANGING l_does_not_exist
l_code_without_header
l_header_without_code.
IF l_does_not_exist IS NOT INITIAL.
CONCATENATE 'End routine with ID =' ls_tran-endroutine 'is missi
ng'
INTO l_string SEPARATED BY space.
APPEND l_string TO lt_text.
l_inconsistent = rs_c_true.
ENDIF.
IF l_code_without_header IS NOT INITIAL.
CONCATENATE ' End routine with ID =' ls_tran-endroutine 'no RSAR
OUT Entry'
INTO l_string SEPARATED BY space.
APPEND l_string TO lt_text.
l_inconsistent = rs_c_true.
ENDIF.
IF l_header_without_code IS NOT INITIAL.
IF 1 = 2.
*-- empty routines are possible
CONCATENATE ' End routine with ID =' ls_tran-endroutine 'no RS
AABAP Entries'
INTO l_string SEPARATED BY space.
APPEND l_string TO lt_text.
l_inconsistent = rs_c_true.
ENDIF.
ENDIF.
ENDIF.
*-- process
LOOP AT
WHERE
AND
CLEAR
CLEAR
CLEAR
CLEAR
l_wrong_type.
ls_formtp.
l_inconsistent_step.
lt_text_step[].
ls_formula-tranid= ls_tran-tranid.
ls_formula-objvers= ls_tran-objvers.
ls_formula-codeid_step = ls_steprout-codeid.
ls_formula-formula_id= ls_formtp-formula_id.
APPEND ls_formula TO lt_formula.
l_inconsistent_step = rs_c_true.
ENDIF.
WHEN OTHERS.
l_routine_exist = rs_c_true.
PERFORM routine_check
USINGls_steprout-codeid
ls_steprout-objvers
CHANGING l_does_not_exist
l_code_without_header
l_header_without_code."
IF l_does_not_exist IS NOT INITIAL.
CONCATENATE 'Routine with ID =' ls_steprout-codeid 'is mis
sing'
INTO l_string SEPARATED BY space.
APPEND l_string TO lt_text_step.
l_inconsistent_step = rs_c_true.
ENDIF.
IF l_code_without_header IS NOT INITIAL.
CONCATENATE 'Routine with ID =' ls_steprout-codeid 'no RSA
ROUT Entry'
INTO l_string SEPARATED BY space.
APPEND l_string TO lt_text_step.
l_inconsistent_step = rs_c_true.
ENDIF.
IF l_header_without_code IS NOT INITIAL.
CONCATENATE 'Routine with ID =' ls_steprout-codeid 'no RSA
ABAP Entries'
INTO l_string SEPARATED BY space.
APPEND l_string TO lt_text_step.
l_inconsistent_step = rs_c_true.
ENDIF.
ENDCASE.
ELSE.
CONCATENATE 'orphaned entry in table RSTRANSTEPROUT, Kind =' ls_
steprout-kind
INTO l_string SEPARATED BY space.
APPEND l_string TO lt_text_step.
l_inconsistent_step = rs_c_true.
ENDIF.
IF l_inconsistent_step IS NOT INITIAL.
APPEND LINES OF lt_text_step TO lt_text_step_all.
l_inconsistent = rs_c_true.
ENDIF.
ENDLOOP.
IF l_routine_exist = rs_c_true AND l_inconsistent = rs_c_true.
APPEND LINES OF lt_text TO lt_text_all.
APPEND LINES OF lt_text_step_all TO lt_text_all.
ELSEIF l_inconsistent = rs_c_true AND NOT lt_text_step_all[] IS INIT
IAL.
READ TABLE lt_text INTO l_string INDEX 1.
IF sy-subrc = 0.
APPEND l_string TO lt_text_all.
APPEND LINES OF lt_text_step_all TO lt_text_all.
ENDIF.
ELSEIF l_inconsistent = rs_c_true.
*-- no real error only the id are provided technically.
CLEAR l_inconsistent.
ENDIF.
*-- add error per tranid
IF l_inconsistent = rs_c_true.
*-- put collected message to log.
*-- check tadir package
*IF ls_tran-objvers = rs_c_objvers-modified.
IF ls_tran-sourcetype = 'RSDS'.
IF ls_tran-shadow_tranid IS INITIAL.
l_string = 'Shadow tranid could not be determined'.
l_msgty = rs_c_error.
INSERT l_string INTO lt_text_all INDEX 2.
ELSE.
l_tranid_tadir = ls_tran-shadow_tranid.
ENDIF.
ELSE.
l_tranid_tadir = ls_tran-tranid.
ENDIF.
IFl_tranid_tadir IS NOT INITIAL.
IF ls_tran-objvers = rs_c_objvers-delivery.
*<--P_L_HEADER_WITHOUT_CODEtext
*----------------------------------------------------------------------*
FORM routine_check
USINGp_codeidTYPE rsaabap-codeid
p_objvers TYPE rsaabap-objvers
CHANGING p_does_not_existTYPE rs_bool
p_code_without_header TYPE rs_bool
p_header_without_code TYPE rs_bool.
DATA:
DATA:
DATA:
DATA:
DATA:
DATA:
DATA:
ls_codeidTYPE rsaa_s_codeid.
lt_codeidTYPE rsaa_t_codeid.
lt_arout TYPErsaa_t_arout.
lt_arfieldsTYPErsaa_t_arfields.
lt_aabap TYPErsaa_t_aabap.
lt_aabapinvTYPErsaa_t_aabap.
lt_arouttTYPErsaa_t_aroutt.
CLEAR: p_does_not_exist,
p_code_without_header,
p_header_without_code.
ls_codeid-sign = 'I'.
ls_codeid-option = 'EQ'.
ls_codeid-low = p_codeid .
APPEND ls_codeid TO lt_codeid.
CALL FUNCTION 'RSAA_ROUTINE_MULTI_GET'
EXPORTING
i_objvers= p_objvers
* I_CODETP =
i_t_codeid = lt_codeid
* I_ALL_LANGUAGES=
IMPORTING
e_t_arout= lt_arout
* E_T_ARFIELDS =
e_t_aabap= lt_aabap.
* E_T_AABAPINV =
* E_T_AROUTT =
* E_TEXTS_COPIED =
* E_NONE_FOUND =
* E_NOT_ALL_FOUND=
* EXCEPTIONS " no longer in use
* NO_CODE_PRESENT= 1
* WRONG_IMPORT_PARAMETER = 2
* OTHERS = 3
.
IF lt_arout[] IS INITIAL.
IF lt_aabap[] IS INITIAL.
p_does_not_exist = rs_c_true.
ELSE.
*-- code without header exists
p_code_without_header = rs_c_true.
ENDIF.
ELSEIF lt_aabap[] IS INITIAL.
*-- code header without code exists
p_header_without_code = rs_c_true.
ENDIF.
ENDFORM." ROUTINE_CHECK
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*& FORM FORMULA_CHECK
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
*&---------------------------------------------------------------------*
*&FormFORMULA_CHECK
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
*-->P_LS_STEPROUTtext
*-->P_L_DOES_NOT_EXISTtext
*----------------------------------------------------------------------*
FORM formula_check
USINGp_formulaidTYPE rstransteprout-codeid
p_objversTYPE rstransteprout-objvers
CHANGING p_does_not_exist TYPE rs_bool
p_inconsistent TYPE rs_bool
p_wrong_type TYPE rs_bool
ps_formtpTYPE ty_s_tp.
DATA:
DATA:
DATA:
DATA:
DATA:
DATA:
DATA:
DATA:
DATA:
l_missing_sfobu
ls_formmap TYPE
ls_formTYPE
l_sfbeid TYPE
ls_rsev000 TYPE
ls_sev000TYPE
lt_rsev001 TYPE
lt_sev001TYPE
l_stop TYPE
TYPE rs_bool.
rsaformmap.
rsaform.
sfbeid.
rsfobuev000.
sfobuev000.
STANDARD TABLE OF rsfobuev001.
STANDARD TABLE OF sfobuev001.
rs_bool.
CLEAR: p_does_not_exist,
p_inconsistent.
IF sy-subrc <> 0.
p_does_not_exist = rs_c_true.
l_stop = rs_c_true.
SELECT SINGLE * FROM rsaform INTO ls_form
WHERE formula_id = p_formulaid
AND objvers= p_objvers.
IF sy-subrc = 0.
*-- header without mapping
p_inconsistent = rs_c_true.
l_stop = rs_c_true.
ENDIF.
ELSE.
SELECT SINGLE * FROM rsaform INTO ls_form
WHERE formula_id = ls_formmap-formin
AND objvers = ls_formmap-objvers.
IF sy-subrc <> 0.
p_inconsistent = rs_c_true.
l_stop = rs_c_true.
ELSE.
*-- check for right application
IF ls_form-formtp NE rsfo_c_formtp-transformation.
p_wrong_type = rs_c_true.
ps_formtp-objvers= ls_form-objvers.
ps_formtp-formula_id = ls_form-formula_id.
ps_formtp-formtp = ls_form-formtp.
ENDIF.
ENDIF.
ENDIF.
*-- check next level on BI formula object
CHECK l_stop = space.
SELECT SINGLE * FROM rsfobuev000 INTO ls_rsev000
WHERE formid= ls_formmap-formin
AND objvers = ls_formmap-objvers.
IF sy-subrc <> 0.
l_missing_sfobu = rs_c_true.
l_stop = rs_c_true.
ENDIF.
SELECT * FROM rsfobuev001 INTO TABLE lt_rsev001
WHERE formid= ls_formmap-formin
AND objvers = ls_formmap-objvers.
IF sy-subrc <> 0.
p_inconsistent = rs_c_true.
l_stop = rs_c_true.
ENDIF.
*-- only for a-version technically a basic formula is necessary
CHECK l_stop IS INITIAL.
*-- convert to char32 string
* Convert 25-digit unique-ID to 32-digit unique-ID
CALL FUNCTION 'RSS_UNIQUE_CONVERT_TO_HEX'
EXPORTING
i_uni_idc25 = ls_formmap-formin
IMPORTING
e_uni_idc = l_sfbeid
EXCEPTIONS
invalid_unique_id = 1.
SELECT SINGLE * FROM sfobuev000 INTO ls_sev000
WHERE id= l_sfbeid.
IF sy-subrc <> 0.
l_missing_sfobu = rs_c_true.
l_stop = rs_c_true.
ENDIF.
SELECT * FROM sfobuev001 INTO TABLE lt_sev001
WHERE id = l_sfbeid.
IF sy-subrc <> 0.
l_missing_sfobu = rs_c_true.
l_stop = rs_c_true.
ENDIF.
IF p_objvers = rs_c_objvers-modified.
IF p_inconsistent= rs_c_false AND
l_missing_sfobu = rs_c_true.
*-- try to recreate missing internal formula from rsfobuev*
CALL METHOD cl_rsar_formulas=>copy_fobu_to_extern
EXPORTING
i_formex = p_formulaid
i_objvers= p_objvers
*i_write_log=
*IMPORTING
*e_t_msg=
EXCEPTIONS
rsfo_invalid_unique_id = 1
OTHERS = 2
.
IF sy-subrc = 0.
CLEAR p_inconsistent.
ELSE.
p_inconsistent = rs_c_true.
ENDIF.
ENDIF.
ELSE.
IF l_missing_sfobu = rs_c_true.
p_inconsistent = l_missing_sfobu.
ENDIF.
ENDIF.
ENDFORM."formula_check
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
>>> A T T E N T I O N: P L E A S E N O T E:<<<
>>> Correction contains additional changes that are NOT shown here <<<
>>> Display all changes by Note Assistant Note display functionality <<<
*$*$----------------------------------------------------------------$*$*
*$ Correction Inst. 0120031469 0001096709 $*
*$ Req. Corr. Instructions0120031469 0001096704 Note 0001408161 $*
*$--------------------------------------------------------------------$*
*$ Valid for :$*
*$ Software Component SAP_BW Business Information Warehouse $*
*$Release 711SAPKW71104 - SAPKW71104$*
*$*$----------------------------------------------------------------$*$*
*&--------------------------------------------------------------------*
*& ObjectREPS RSDG_TRFN_ACTIVATE
*& Object Header PROG RSDG_TRFN_ACTIVATE
*&--------------------------------------------------------------------*
*& REPORT RSDG_TRFN_ACTIVATE
*&--------------------------------------------------------------------*
...
REPORTrsdg_trfn_activate.
END OF ts_text,
tt_text TYPE TABLE OF ts_text.
DATA:
gs_textTYPE ts_text,
gt_textTYPE tt_text,
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
DATA:
gs_textTYPE ts_text,
*>>>> END OF INSERTION <<<<<<
...
DATA: lt_text_allTYPE TABLE OF string.
DATA: l_extnumberTYPE bal_s_log-extnumber.
*>>>> START OF DELETION <<<<<
DATA: ls_tranTYPE rstran.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
DATA: l_subrcTYPE sy-subrc.
DATA: ls_tranTYPE rstran.
*>>>> END OF INSERTION <<<<<<
...
DATA: lt_tranTYPE STANDARD TABLE OF rstran WITH NON-UNIQUE DEF
AULT KEY.
DATA: lt_tran_selTYPE SORTED TABLE OF rstran
WITH UNIQUE KEY tranid objvers.
*>>>> START OF DELETION <<<<<
IF cl_rso_application_log=>appl_log_get_log_handle( ) IS INITIAL.
CALL METHOD cl_rso_application_log=>appl_log_create
EXPORTING
i_object= rstr_c_appl_log_trfn
i_subobject = rstr_c_appl_log_trfn_content
i_extnumber = l_extnumber.
ENDIF.
SELECT * FROMrstran INTO TABLE lt_tran_sel
WHEREobjvers= rs_c_objvers-active
ANDobjstat= objstat
ANDtranid IN tran_id
ANDsourcetype IN src_type
ANDsourcename IN src_name
ANDtargettype IN trg_type
ANDtargetname IN trg_name
ANDis_shadow= space.
lt_tran = lt_tran_sel.
LOOP AT lt_tran INTO ls_tran.
* -CLEAR: lt_text[],
lt_text_all[].
CLEARl_inconsistent.
CONCATENATE 'TRANID =' ls_tran-tranid 'OBJVERS =' ls_tran-objvers
INTO l_string SEPARATED BY space.
APPEND l_string TO lt_text.
*-CONCATENATE ls_tran-sourcetype
ls_tran-sourcename
'->'
ls_tran-targettype
ls_tran-targetname
INTO l_string SEPARATED BY space.
APPEND l_string TO lt_text.
LOOP AT lt_text_all INTO l_string.
IF sy-tabix = 1.
l_detlevel = 2.
ELSE.
l_detlevel = 3.
ENDIF.
l_text = l_string.
CALL METHOD cl_rso_application_log=>if_rso_application_log~add_text
EXPORTING
i_text = l_text
i_msgty= l_msgty
i_detlevel = l_detlevel.
ENDLOOP.
PERFORM activate IN PROGRAMrstran_migration_repair
USING ls_tran-tranid
ls_tran-objvers
rs_c_false"without save
rs_c_true "with a-m version compare
rs_c_false"without transport
CHANGING gt_text.
ENDLOOP.
CALL METHOD cl_rso_application_log=>if_rso_application_log~appl_log_save
.
cl_rso_application_log=>appl_log_show_as_popup( ).
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
DATA: ls_dtp TYPE rsbkdtp.
DATA: lt_dtp_all TYPE STANDARD TABLE OF rsbkdtp WITH NON-UNIQUE DE
FAULT KEY.
DATA: l_tgtTYPE rsbktgtnm.
DATA: l_srcTYPE rsbksrcnm.
DATA: l_tgttpTYPE rsbktgttp.
DATA: l_srctpTYPE rsbksrctp.
*DATA: l_r_dtpTYPE REF TO cl_rsbk_dtp.
*DATA: l_r_dtp_nTYPE REF TO cl_rsbk_dtp_n.
DATA: l_subrc_nTYPE numc1.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*& END-OF-SELECTION
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
END-OF-SELECTION.
IF cl_rso_application_log=>appl_log_get_log_handle( ) IS INITIAL.
l_extnumber = 'RSDG_TRFN_ACTIVATE'.
CALL METHOD cl_rso_application_log=>appl_log_create
EXPORTING
i_object= rstr_c_appl_log_trfn
i_subobject = rstr_c_appl_log_trfn_content
i_extnumber = l_extnumber.
ENDIF.
SELECT * FROMrstran INTO TABLE lt_tran_sel
WHEREobjvers= rs_c_objvers-active
ANDobjstat= objstat
ANDtranid IN tran_id
ANDsourcetype IN src_type
ANDsourcename IN src_name
ANDtargettype IN trg_type
ANDtargetname IN trg_name
ANDis_shadow= space.
lt_tran = lt_tran_sel.
*-- Transformations
CLEAR gt_text_all.
LOOP AT lt_tran INTO ls_tran.
* -CLEAR: lt_text[],
lt_text_all[].
CLEARl_inconsistent.
CONCATENATE 'TRANID =' ls_tran-tranid 'OBJVERS =' ls_tran-objvers
INTO l_string SEPARATED BY space.
APPEND l_string TO lt_text.
*-CONCATENATE ls_tran-sourcetype
ls_tran-sourcename
'->'
ls_tran-targettype
ls_tran-targetname
INTO l_string SEPARATED BY space.
APPEND l_string TO lt_text.
LOOP AT lt_text INTO l_string.
l_msgty = rs_c_info.
IF sy-tabix = 1.
l_detlevel = 2.
ELSE.
l_detlevel = 3.
ENDIF.
l_text = l_string.
CALL METHOD cl_rso_application_log=>if_rso_application_log~add_tex
t
EXPORTING
i_text = l_text
i_msgty= l_msgty
i_detlevel = l_detlevel.
ENDLOOP.
PERFORM activate_trfn
USING ls_tran-tranid
ls_tran-objvers
rs_c_false"without save
rs_c_true "with a-m version compare
rs_c_false"without transport
rs_c_true "with check
CHANGING gt_text_all
l_subrc.
IF l_subrc = 0.
*-- register DTP for processing later
l_src = ls_tran-sourcename.
CASE ls_tran-sourcetype.
WHEN 'RSDS'.
l_srctp = 'DTASRC'.
WHEN 'IOBJ'.
IF ls_tran-sourcesubtype = 'TEXT'.
l_srctp = 'IOBJT'.
ELSE.
l_srctp = 'IOBJA'.
ENDIF.
WHEN 'RSCS'. " InfoSource non persistent doesn't exist in DTP
CLEAR l_src.
WHEN OTHERS.
l_srctp = ls_tran-sourcetype.
ENDCASE.
l_tgt = ls_tran-targetname.
CASE ls_tran-targettype.
WHEN 'IOBJ'.
IF ls_tran-targetsubtype = 'TEXT'.
l_tgttp = 'IOBJT'.
ELSE.
l_tgttp = 'IOBJA'.
ENDIF.
WHEN 'RSCS'. " InfoSource non persistent doesn't exist in DTP
CLEAR l_tgt.
WHEN OTHERS.
l_tgttp = ls_tran-targettype.
ENDCASE.
IF l_src IS NOT INITIAL AND l_tgt IS NOT INITIAL.
SELECT * FROM rsbkdtp AS t APPENDING TABLE lt_dtp_all WHERE
objvers = rs_c_objvers-active AND
src = l_src AND
srctp = l_srctp AND
tgt = l_tgt AND
tgttp = l_tgttp AND
EXISTS ( SELECT * FROM rsbkdtpstat WHERE
dtp = t~dtp AND
objstat = rs_c_objstat-inactive ).
ELSEIF l_src IS NOT INITIAL.
SELECT * FROM rsbkdtp AS t APPENDING TABLE lt_dtp_all WHERE
objvers = rs_c_objvers-active AND
src = l_src AND
srctp = l_srctp AND
EXISTS ( SELECT * FROM rsbkdtpstat WHERE
dtp = t~dtp AND
objstat = rs_c_objstat-inactive ).
ELSEIF l_tgt IS NOT INITIAL.
SELECT * FROM rsbkdtp AS t APPENDING TABLE lt_dtp_all WHERE
objvers = rs_c_objvers-active AND
tgt = l_tgt AND
tgttp = l_tgttp AND
EXISTS ( SELECT * FROM rsbkdtpstat WHERE
dtp = t~dtp AND
objstat = rs_c_objstat-inactive ).
ENDIF.
ELSE.
l_text = 'error / warning occurred, activate manually with TRFN UI
'.
CALL METHOD cl_rso_application_log=>if_rso_application_log~add_tex
t
EXPORTING
i_text = l_text
i_msgty= rs_c_error
i_detlevel = '3'.
ENDIF.
PERFORM write_to_log
CHANGING gt_text_all.
ENDLOOP.
*-- DTPs
CLEAR gt_text_all.
SORT lt_dtp_all BY dtp objvers.
DELETE ADJACENT DUPLICATES FROM lt_dtp_all COMPARING dtp.
LOOP AT lt_dtp_all INTO ls_dtp.
l_msgty = rs_c_info.
l_detlevel = '2'.
l_string = ls_dtp-dtp.
CONCATENATE 'DTP: ' l_string INTO l_text.
CALL METHOD cl_rso_application_log=>if_rso_application_log~add_text
EXPORTING
i_text = l_text
i_msgty= l_msgty
i_detlevel = l_detlevel.
PERFORM activate_dtp
USINGls_dtp-dtp
ls_dtp-objvers
CHANGING gt_text_all
l_subrc.
IF l_subrc <> 0.
l_text = 'error / warning occurred, activate manually with DTP U
I'.
CALL METHOD cl_rso_application_log=>if_rso_application_log~add_t
ext
EXPORTING
i_text = l_text
i_msgty= rs_c_error
i_detlevel = '3'.
ENDIF.
PERFORM write_to_log
CHANGING gt_text_all.
ENDLOOP.
CALL METHOD cl_rso_application_log=>if_rso_application_log~appl_log_sa
ve.
cl_rso_application_log=>appl_log_show_as_popup( ).
cl_rso_application_log=>appl_log_delete( ).
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*& FORM ACTIVATE_DTP
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
*&---------------------------------------------------------------------*
*&FormACTIVATE_DTP
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
*-->P_LS_DTP_DTPtext
*-->P_LS_DTP_OBJVERStext
*<--P_GT_TEXT_ALLtext
*<--P_L_SUBRCtext
*----------------------------------------------------------------------*
FORM activate_dtp
USINGp_dtpTYPE rsbkdtp-dtp
p_objversTYPE rsobjvers
CHANGING ct_textTYPE tt_text
cv_subrc TYPE sysubrc.
DATA: l_errors_foundTYPErs_bool,
lv_subrcTYPEsysubrc,
lr_messages TYPE REF TO cl_rso_msg,
lt_messages TYPErs_t_msg,
ls_messages TYPErs_s_msg,
lr_collection TYPE REF TO cl_rsbk_dtp_collection,
lv_objnmTYPEsobj_name,
ls_text TYPEts_text,
lv_not_modifyable TYPErs_bool,
lt_tlogoTYPErso_th_tlogo.
CREATE OBJECT lr_collection.
*--------------------------------------------------------------------*
*activate DTP
lv_objnm = p_dtp.
TRY.
CALL METHOD lr_collection->add_tlogo
EXPORTING
i_objnm= lv_objnm
i_with_cto = rs_c_false
IMPORTING
e_not_modifyable = lv_not_modifyable.
CATCH cx_rs_existing .
CATCH cx_rs_not_found .
ENDTRY.
IF lv_not_modifyable IS NOT INITIAL.
CONCATENATE 'DTP' p_dtp 'not modifiyable'
INTOls_text-text
SEPARATED BYspace.
ls_text-status = gc_error.
ls_text-level = 3.
APPEND ls_text TO ct_text.
CLEAR ls_text.
ELSE.
TRY.
CALL METHOD lr_collection->activate
EXPORTING
i_with_cto=
i_force_activation=
i_show_check_protocol =
i_detlevel=
IMPORTING
e_th_tlogo_error=
CATCH cx_rs_cancelled .
EXIT.
ENDTRY.
IF lt_tlogo IS NOT INITIAL.
cv_subrc = 99.
ENDIF.
rs_c_false
'X'
''
'3'
lt_tlogo.
ENDIF.
ENDFORM." ACTIVATE_DTP
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& ObjectREPS RSTRAN_MIGRATION_REPAIR
*& Object Header PROG RSTRAN_MIGRATION_REPAIR
*&--------------------------------------------------------------------*
*& REPORT RSTRAN_MIGRATION_REPAIR
*&--------------------------------------------------------------------*
...
REPORTrstran_migration_repair.
* version 3.
TYPE-POOLS: rstr, rsaa, abap, rsau.
*>>>> START OF DELETION <<<<<
TYPES:
BEGIN OF ts_text,
tranidTYPE
textTYPE
type(8) TYPE
status(20)TYPE
level TYPE
END OF ts_text.
rstran-tranid,
string,
c,
c,
c,
TYPES:
tt_text TYPE TABLE OF ts_text,
tt_tokesTYPE STANDARD TABLE OFstokes
WITH NON-UNIQUE DEFAULT KEY.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
INCLUDE rstran_migration_repair_f01.
*>>>> END OF INSERTION <<<<<<
...
gt_tr_object TYPErs_t_tr_object,
g_context_not_found TYPE rs_bool,
*>>>> START OF DELETION <<<<<
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
g_subrcTYPE sysubrc,
*>>>> END OF INSERTION <<<<<<
...
FIELD-SYMBOLS:
<gs_text>TYPE ts_text.
*>>>> START OF DELETION <<<<<
CONSTANTS:
gc_error(20)TYPE c VALUE 'ERROR'
,
gc_migrated(20) TYPE c VALUE 'MIGRAT
E',
gc_already_migrated(20) TYPE c VALUE 'ALREAD
Y_MIGRATED'.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*& START-OF-SELECTION
*&--------------------------------------------------------------------*
...
IF gv_migrated IS INITIAL.
CLEAR gs_text.
*>>>> START OF DELETION <<<<<
gs_text-tranid = gs_tran-tranid.
CONCATENATE 'TRANID:' gs_text-tranid
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
gs_text-id = gs_tran-tranid.
CONCATENATE 'TRANID:' gs_text-id
gs_text-id = gs_tran-tranid.
*>>>> END OF INSERTION <<<<<<
...
ELSE.
*Errors where found, this will have to be migrated manually
CLEAR: gs_text, gv_string.
*>>>> START OF DELETION <<<<<
gs_text-tranid = gs_tran-tranid.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
gs_text-id = gs_tran-tranid.
*>>>> END OF INSERTION <<<<<<
...
INSERT gs_text
INTO gt_text
INDEX1.
*>>>> START OF DELETION <<<<<
gs_text-tranid = gs_tran-tranid.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
gs_text-id = gs_tran-tranid.
*>>>> END OF INSERTION <<<<<<
...
PERFORMlog_handle
CHANGING gt_text.
ELSE.
*Transformation was already migrated
*>>>> START OF DELETION <<<<<
gs_text-tranid = gs_tran-tranid.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
gs_text-id = gs_tran-tranid.
*>>>> END OF INSERTION <<<<<<
...
PERFORMlog_handle
CHANGING gt_text.
IF forceatv IS NOT INITIAL.
*>>>> START OF DELETION <<<<<
PERFORM activate
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
PERFORM activate_trfn
*>>>> END OF INSERTION <<<<<<
...
USING gs_tran-tranid
gs_tran-objvers
rs_c_false
rs_c_false
rs_c_true"with transport
*>>>> START OF DELETION <<<<<
CHANGING gt_text_all.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
rs_c_true"with check
CHANGING gt_text_all
g_subrc.
*>>>> END OF INSERTION <<<<<<
...
PERFORM add_to_transport
USING gt_tr_object.
PERFORM log_call
USING gt_text_all.
*>>>> START OF DELETION <<<<<
INCLUDE rstran_migration_repair_f01.
*>>>> END OF DELETION <<<<<<<
...
*&--------------------------------------------------------------------*
*&--------------------------------------------------------------------*
*& ObjectREPS RSTRAN_MIGRATION_REPAIR_F01
*& Object Header PROG RSTRAN_MIGRATION_REPAIR_F01
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
*&---------------------------------------------------------------------*
*&Include Z_RSTRAN_FIX_BICONTENT_1_F01
*&---------------------------------------------------------------------*
CONSTANTS:
gc_error(20)TYPE c VALUE 'ERROR'
,
gc_info(20) TYPE c VALUE 'INFO',
gc_warning(20)TYPE c VALUE 'WARNIN
G',
gc_migrated(20) TYPE c VALUE 'MIGRAT
E',
gc_already_migrated(20) TYPE c VALUE 'ALREAD
Y_MIGRATED'.
TYPES:
BEGIN OF ts_text,
id(40)TYPE
textTYPE
type(8) TYPE
status(20)TYPE
level TYPE
END OF ts_text.
c,
string,
c,
c,
c,
TYPES:
tt_text TYPE TABLE OF ts_text.
TYPES:
tt_tokesTYPE STANDARD TABLE OFstokes
WITH NON-UNIQUE DEFAULT KEY.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*& FORM GET_CODE
*&--------------------------------------------------------------------*
*>>>> START OF DELETION <<<<<
*&---------------------------------------------------------------------*
*&Include Z_RSTRAN_FIX_BICONTENT_1_F01
*&---------------------------------------------------------------------*
*----------------------------------------------------------------------*
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
*----------------------------------------------------------------------*
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*& FORM ACTIVATE
*&--------------------------------------------------------------------*
*>>>> START OF DELETION <<<<<
*&---------------------------------------------------------------------*
*&FormACTIVATE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
*-->P_GS_TRAN_TRANIDtext
*-->P_GS_TRAN_OBJVERStext
*----------------------------------------------------------------------*
form activateusingpv_tranid type rstranid
pv_objverstype rsobjvers
pv_with_savetype rs_bool
pv_with_compare type rs_bool
pv_with_cto type rs_bool
changing ct_text type tt_text.
data: lr_rstran_trfntype ref to cl_rstran_trfn,
lv_subrctypesysubrc,
lr_messages type ref to cl_rso_msg,
lt_messages typers_t_msg,
ls_messages typers_s_msg,
lt_obj_existentialtyperso_t_tlogo_asc,
ls_obj_existentialtyperso_s_tlogo_asc,
lr_collection type ref to cl_rstran_trfn_collection,
lv_objnmtypesobj_name,
ls_text typets_text,
lv_not_modifyable typers_bool,
lt_tlogotyperso_th_tlogo,
ls_tr_objecttypers_s_tr_object,
lt_msgtypers_t_msg,
lv_requesttypetrkorr,
lv_as4pos typeddposition.
*--------------------------------------------------------------------*
*check transformation
try.
call method cl_rstran_trfn=>factory
exporting
i_tranid = pv_tranid
receiving
r_r_tran = lr_rstran_trfn.
catch cx_rstran_not_found .
catch cx_rstran_input_invalid .
endtry.
call method lr_rstran_trfn->get_info_vers
exporting
i_objvers = pv_objvers.
try.
call method lr_rstran_trfn->set_current_version
exporting
i_objvers = pv_objvers.
catch cx_rstran_version_not_found .
endtry.
create object lr_messages.
call method lr_rstran_trfn->check_me
importing
e_subrc = lv_subrc
changing
c_r_msg = lr_messages.
call method lr_messages->get_all_msg
receiving
r_t_msg = lt_messages.
clear gv_errors_found.
loop at lt_messages into ls_messages
wheremsgty = 'E'
or msgty = 'A'
or msgty = 'X'.
gv_errors_found = 'X'.
message idls_messages-msgid
typels_messages-msgty
numberls_messages-msgno
intols_text-text
withls_messages-msgv1 ls_messages-msgv2 ls_messages-msgv3 ls
_messages-msgv4.
ls_text-level = 3.
ls_text-status = gc_error.
append ls_text to ct_text.
clear ls_text.
endloop.
If pv_with_compare is not initial.
if rs_c_false = lr_rstran_trfn->compare_am( ).
*ls_text-level = 3.
ls_text-status = gc_error.
ls_text-text = 'Version M and A is not equal, processing skipped'.
append ls_text to ct_text.
endif.
endif.
if gv_errors_found is initial.
create object lr_collection.
*--------------------------------------------------------------------*
*activate transformation
lv_objnm = pv_tranid.
try.
call method lr_collection->add_tlogo
exporting
i_objnm= lv_objnm
i_with_cto = pv_with_cto
importing
e_not_modifyable = lv_not_modifyable.
catch cx_rs_existing .
catch cx_rs_not_found .
endtry.
if lv_not_modifyable is not initial.
concatenate 'TRANID' pv_tranid 'not modifiyable'
intols_text-text
separated byspace.
ls_text-status = gc_error.
ls_text-level = 3.
append ls_text to ct_text.
clear ls_text.
else.
if pv_with_save is not initial.
try.
call method lr_collection->save
exporting
i_with_cto= pv_with_cto
*i_suppress_i_messages = RS_C_TRUE
*i_detlevel= '1'
importing
e_th_tlogo_error= lt_tlogo.
catch cx_rs_cancelled .
exit.
endtry.
endif.
if lt_tlogo[] is initial.
try.
call method lr_collection->activate
exporting
i_with_cto= pv_with_cto
i_force_activation= 'X'
i_show_check_protocol = ''
importing
e_th_tlogo_error= lt_tlogo.
catch cx_rs_cancelled .
exit.
endtry.
endif.
*--------------------------------------------------------------------*
*add transformation to list for the transport
check 1 = 2.
*if lt_tlogo is initial.
*
*If 1 = 2.
*add 1 to lv_as4pos.
*
*ls_tr_object-pgmid= 'R3TR'.
*ls_tr_object-object = 'DRFN'.
*ls_tr_object-trkorr = pv_request.
*ls_tr_object-as4pos = lv_as4pos.
*ls_tr_object-obj_name = pv_tranid.
*ls_tr_object-lockflag = 3.
*
*append ls_tr_objectto ct_tr_object.
*endif.
*
*
**--------------------------------------------------------------------*
**get the dependent routines and add them to the list for the transport
*try.
*call method lr_rstran_trfn->if_rso_tlogo_general~get_relate
d
*importing
*e_t_obj_existential = lt_obj_existential.
*
*catch cx_rs_version_not_found .
*catch cx_rs_msg .
*endtry.
*
*loop at lt_obj_existential into ls_obj_existential.
*
*add 1 to lv_as4pos.
*
*ls_tr_object-pgmid= 'R3TR'.
*ls_tr_object-object = ls_obj_existential-tlogo.
*ls_tr_object-trkorr = pv_request.
*ls_tr_object-as4pos = lv_as4pos.
*ls_tr_object-obj_name = ls_obj_existential-objnm.
*ls_tr_object-lockflag = 3.
*
*append ls_tr_objectto ct_tr_object.
*endloop.
**--------------------------------------------------------------------*
*endif.
endif.
endif.
endform." ACTIVATE
*>>>> END OF DELETION <<<<<<<
...
*&--------------------------------------------------------------------*
*& FORM LOG_CALL
*&--------------------------------------------------------------------*
...
*----------------------------------------------------------------------*
form log_callusingpt_text type tt_text.
*>>>> START OF DELETION <<<<<
data:
ls_text type ts_text,
lv_text typec length 150,
lv_msgtytypec.
loop at pt_text into ls_text.
case ls_text-status.
when gc_error.
lv_msgty = rs_c_error.
when gc_migrated.
lv_msgty = rs_c_success.
when gc_already_migrated.
lv_msgty = rs_c_warning.
endcase.
lv_text = ls_text-text.
call method cl_rso_application_log=>if_rso_application_log~add_text
exporting
i_text = lv_text
i_msgty= lv_msgty
i_detlevel = ls_text-level.
endloop.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
PERFORM write_to_log
CHANGING pt_text.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*& FORM ACTIVATE_TRFN
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
*&---------------------------------------------------------------------*
*&FormACTIVATE
*&---------------------------------------------------------------------*
* text
*----------------------------------------------------------------------*
*-->P_GS_TRAN_TRANIDtext
*-->P_GS_TRAN_OBJVERStext
*----------------------------------------------------------------------*
FORM activate_trfnUSINGpv_tranid TYPE rstranid
pv_objversTYPE rsobjvers
pv_with_saveTYPE c " X = save, F =
forced save
pv_with_compare TYPE rs_bool
pv_with_cto TYPE rs_bool
pv_with_check TYPE rs_bool
CHANGING ct_text TYPE tt_text
cv_subrcTYPE sysubrc.
DATA: l_errors_foundTYPE rs_bool.
DATA: lr_rstran_trfnTYPE REF TO cl_rstran_trfn,
lv_subrcTYPEsysubrc,
lr_messages TYPE REF TO cl_rso_msg,
lt_messages TYPErs_t_msg,
ls_messages TYPErs_s_msg,
lt_obj_existentialTYPErso_t_tlogo_asc,
ls_obj_existentialTYPErso_s_tlogo_asc,
lr_collection TYPE REF TO cl_rstran_trfn_collection,
lv_objnmTYPEsobj_name,
ls_text TYPEts_text,
lv_not_modifyable TYPErs_bool,
lt_tlogoTYPErso_th_tlogo,
ls_tr_objectTYPErs_s_tr_object,
lt_msgTYPErs_t_msg,
lv_requestTYPEtrkorr,
lv_as4pos TYPEddposition.
*--------------------------------------------------------------------*
*check transformation
TRY.
CALL METHOD cl_rstran_trfn=>factory
EXPORTING
i_tranid = pv_tranid
RECEIVING
r_r_tran = lr_rstran_trfn.
CATCH cx_rstran_not_found .
CATCH cx_rstran_input_invalid .
ENDTRY.
CALL METHOD lr_rstran_trfn->get_info_vers
EXPORTING
i_objvers = pv_objvers.
TRY.
CALL METHOD lr_rstran_trfn->set_current_version
EXPORTING
i_objvers = pv_objvers.
CATCH cx_rstran_version_not_found .
ENDTRY.
IF pv_with_check IS NOT INITIAL.
CREATE OBJECT lr_messages.
CALL METHOD lr_rstran_trfn->check_me
IMPORTING
e_subrc = lv_subrc
CHANGING
c_r_msg = lr_messages.
CALL METHOD lr_messages->get_all_msg
RECEIVING
r_t_msg = lt_messages.
LOOP AT lt_messages INTO ls_messages
WHEREmsgty = 'E'
OR msgty = 'A'
OR msgty = 'X'.
l_errors_found = 'X'.
MESSAGE IDls_messages-msgid
TYPEls_messages-msgty
NUMBERls_messages-msgno
INTOls_text-text
WITHls_messages-msgv1 ls_messages-msgv2 ls_messages-msgv3
ls_messages-msgv4.
ls_text-level = 3.
ls_text-status = gc_error.
APPEND ls_text TO ct_text.
CLEAR ls_text.
ENDLOOP.
ENDIF.
IF pv_with_compare IS NOT INITIAL.
IF rs_c_false = lr_rstran_trfn->compare_am( ).
*ls_text-level = 3.
ls_text-status = gc_warning.
ls_text-text = 'Version M and A is not equal, processing skipped'.
APPEND ls_text TO ct_text.
cv_subrc = 66.
EXIT.
ENDIF.
ENDIF.
IF l_errors_found IS INITIAL.
CREATE OBJECT lr_collection.
*--------------------------------------------------------------------*
*activate transformation
lv_objnm = pv_tranid.
TRY.
CALL METHOD lr_collection->add_tlogo
EXPORTING
i_objnm= lv_objnm
i_with_cto = pv_with_cto
IMPORTING
e_not_modifyable = lv_not_modifyable.
CATCH cx_rs_existing .
CATCH cx_rs_not_found .
ENDTRY.
IF lv_not_modifyable IS NOT INITIAL.
CONCATENATE 'TRANID' pv_tranid 'not modifiyable'
INTOls_text-text
SEPARATED BYspace.
ls_text-status = gc_error.
ls_text-level = 3.
APPEND ls_text TO ct_text.
CLEAR ls_text.
ELSE.
IF pv_with_save = 'F'.
CALL METHOD lr_rstran_trfn->forced_save.
ENDIF.
*if pv_with_save is not initial.
*try.
*call method lr_collection->save
*exporting
*i_with_cto= pv_with_cto
**i_suppress_i_messages = RS_C_TRUE
*i_detlevel= '2'
*importing
*e_th_tlogo_error= lt_tlogo.
*
*catch cx_rs_cancelled .
*exit.
*endtry.
*endif.
IF lt_tlogo[] IS INITIAL.
TRY.
CALL METHOD lr_collection->activate
EXPORTING
i_with_cto=
i_force_activation=
i_show_check_protocol =
i_detlevel=
IMPORTING
e_th_tlogo_error=
CATCH cx_rs_cancelled .
EXIT.
ENDTRY.
ENDIF.
pv_with_cto
'X'
''
'3'
lt_tlogo.
DATA:
DATA:
*>>>>
DATA:
*>>>>
*>>>>
DATA:
DATA:
*>>>>
...
DATA:
DATA:
DATA:
*>>>>
DATA:
*>>>>
*>>>>
DATA:
ENDIF.
*>>>> END OF INSERTION <<<<<<
...
ROLLBACK WORK.
MESSAGE x051(rstran) WITH 'invalid processing'.
EXIT.
*>>>> START OF DELETION <<<<<
ENDIF.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
ELSE.
CONCATENATE 'Type of formula' ls_formula-formula_id 'correct
ed'
INTO l_string.
l_text = l_string.
l_save_mode = 'F'.
l_detlevel = 3.
CALL METHOD cl_rso_application_log=>if_rso_application_log~a
dd_text
EXPORTING
i_text= l_text
i_msgty= l_msgty
i_detlevel = l_detlevel.
ENDIF.
*>>>> END OF INSERTION <<<<<<
...
ENDLOOP.
*>>>> START OF DELETION <<<<<
*-- activate
PERFORMactivate IN PROGRAM rstran_migration_repair
USING ls_tran-tranid
ls_tran-objvers
rs_c_true
rs_c_false
rs_c_true"with transport
CHANGING gt_text_all.
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
IF l_save_mode = 'F'.
l_auto_repair = rs_c_true.
ENDIF.
*-- activate
IF l_auto_repair = rs_c_true.
PERFORMactivate_trfn IN PROGRAM rstran_migration_repair
USING ls_tran-tranid
ls_tran-objvers
l_save_mode" 'F' = forced save
rs_c_false
rs_c_true"with transport
rs_c_true"with check
CHANGING gt_text_all
g_subrc.
ENDIF.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*$*$----------------------------------------------------------------$*$*
*$ Correction Inst. 0120031469 0001120799 $*
*$ Req. Corr. Instructions0120031469 0001096704 Note 0001408161 $*
*$0120031469 0001120796 Note 0001408161 $*
*$--------------------------------------------------------------------$*
*$ Valid for :$*
*$ Software Component SAP_BW Business Information Warehouse $*
*$Release 711SAPKW71104 - SAPKW71104$*
*$*$----------------------------------------------------------------$*$*
*&--------------------------------------------------------------------*
*& ObjectREPS RSTRAN_ROUT_RSFO_CHECK
*& Object Header PROG RSTRAN_ROUT_RSFO_CHECK
*&--------------------------------------------------------------------*
*& REPORT RSTRAN_ROUT_RSFO_CHECK
*&--------------------------------------------------------------------*
...
TYPE-POOLS: rstr, rsaa, rsfo.
TYPES:
BEGIN OF ts_text,
*>>>> START OF DELETION <<<<<
tranidTYPE rstranid,
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
id(40)TYPE c,
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*$*$----------------------------------------------------------------$*$*
*$ Correction Inst. 0120031469 0001120800 $*
*$ Req. Corr. Instructions0120031469 0001096704 Note 0001408161 $*
*$0120031469 0001120796 Note 0001408161 $*
*$0120031469 0001120799 Note 0001408161 $*
*$--------------------------------------------------------------------$*
g_r_tranidTYPE
tlogorstlogoTYPE
sourcetypeTYPE
sourcenameTYPE
targettypeTYPE
targetnameTYPE
tranidTYPE
iobjnmTYPE
objst TYPE
objvers TYPE
objvrsTYPE
rstranid.
rstlogo.
rstlogo.
sobj_name.
rstlogo.
sobj_name.
rstranid.
sobj_name.
rsobjstat.
rsobjvers.
rsobjvers.
* selection screen
* main screen
SELECTION-SCREEN BEGIN OF BLOCK act WITH FRAME TITLE text-001.
SELECT-OPTIONStran_idFOR tranid.
PARAMETERSobjstat LIKE objst DEFAULT rs_c_objstat-active.
SELECT-OPTIONSsrc_type FOR sourcetype.
SELECT-OPTIONSsrc_name FOR sourcename.
SELECT-OPTIONStrg_type FOR targettype.
SELECT-OPTIONStrg_name FOR targetname.
PARAMETERS: activate RADIOBUTTON GROUP r1 DEFAULT 'X'.
PARAMETERS: check RADIOBUTTON GROUP r1.
* objvers FOR objversDEFAULT 'A'.
SELECTION-SCREEN END OF BLOCK act.
* data
*DATA: g_s_msg TYPE rs_s_msg.
*DATA: g_t_msg TYPE rs_t_msg.
TYPES:
BEGIN OF ts_text,
tranidTYPE rstranid,
textTYPE string,
type(8) TYPE c,
status(20)TYPE c,
level TYPE c,
END OF ts_text,
tt_text TYPE TABLE OF ts_text.
* SELECT-OPTIONS:
*objvers FOR objvrsDEFAULT 'M'.
* tranidFOR tran_id.
* PARAMETERS:
* simulate TYPE cAS CHECKBOX DEFAULT 'X',"does not save
changes to coding
*repair_w TYPE rs_boolAS CHECKBOX,
*requestTYPE trkorr NO-DISPLAY.
DATA:
gs_textTYPE ts_text,
gt_textTYPE tt_text,
gt_text_allTYPE tt_text.
DATA: gt_tr_object TYPE rs_t_tr_object.
DATA: l_msgtyTYPE sy-msgty.
*DATA: l_objvrs LIKE LINE OF objvers.
DATA: l_inconsistent TYPE rs_bool.
DATA:
DATA:
DATA:
DATA:
DATA:
DATA:
DATA:
l_text TYPE
l_detlevel TYPE
l_string TYPE
l_string_1 TYPE
l_string_2 TYPE
lt_textTYPE
lt_text_allTYPE
c LENGTH 150.
ballevel.
string.
string.
string.
TABLE OF string.
TABLE OF string.
rs_c_false"without transport
CHANGING gt_text.
*ELSEIF icon_simulate IS INITIAL AND g_context_not_found IS NOT
INITIAL.
*ROLLBACK WORK.
* ENDIF.
* ENDIF.
*
ENDLOOP.
CALL METHOD cl_rso_application_log=>if_rso_application_log~appl_log_save
.
cl_rso_application_log=>appl_log_show_as_popup( ).
*>>>> END OF DELETION <<<<<<<
*>>>> START OF INSERTION <<<<
DATA: ls_dtp TYPE rsbkdtp.
DATA: lt_dtp_all TYPE STANDARD TABLE OF rsbkdtp WITH NON-UNIQUE DE
FAULT KEY.
DATA: l_tgtTYPE rsbktgtnm.
DATA: l_srcTYPE rsbksrcnm.
DATA: l_tgttpTYPE rsbktgttp.
DATA: l_srctpTYPE rsbksrctp.
*DATA: l_r_dtpTYPE REF TO cl_rsbk_dtp.
*DATA: l_r_dtp_nTYPE REF TO cl_rsbk_dtp_n.
DATA: l_subrc_nTYPE numc1.
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
*& END-OF-SELECTION
*&--------------------------------------------------------------------*
*>>>> START OF INSERTION <<<<
END-OF-SELECTION.
IF cl_rso_application_log=>appl_log_get_log_handle( ) IS INITIAL.
l_extnumber = 'RSDG_TRFN_ACTIVATE'.
CALL METHOD cl_rso_application_log=>appl_log_create
EXPORTING
i_object= rstr_c_appl_log_trfn
i_subobject = rstr_c_appl_log_trfn_content
i_extnumber = l_extnumber.
ENDIF.
SELECT * FROMrstran INTO TABLE lt_tran_sel
WHEREobjvers= rs_c_objvers-active
ANDobjstat= objstat
ANDtranid IN tran_id
ANDsourcetype IN src_type
ANDsourcename IN src_name
ANDtargettype IN trg_type
ANDtargetname IN trg_name
ANDis_shadow= space.
lt_tran = lt_tran_sel.
*-- Transformations
CLEAR gt_text_all.
LOOP AT lt_tran INTO ls_tran.
* -CLEAR: lt_text[],
lt_text_all[].
CLEARl_inconsistent.
CONCATENATE 'TRANID =' ls_tran-tranid 'OBJVERS =' ls_tran-objvers
INTO l_string SEPARATED BY space.
APPEND l_string TO lt_text.
*-CONCATENATE ls_tran-sourcetype
ls_tran-sourcename
'->'
ls_tran-targettype
ls_tran-targetname
INTO l_string SEPARATED BY space.
APPEND l_string TO lt_text.
LOOP AT lt_text INTO l_string.
l_msgty = rs_c_info.
IF sy-tabix = 1.
l_detlevel = 2.
ELSE.
l_detlevel = 3.
ENDIF.
l_text = l_string.
CALL METHOD cl_rso_application_log=>if_rso_application_log~add_tex
t
EXPORTING
i_text = l_text
i_msgty= l_msgty
i_detlevel = l_detlevel.
ENDLOOP.
PERFORM activate_trfn
USING ls_tran-tranid
ls_tran-objvers
rs_c_false"without save
rs_c_true "with a-m version compare
rs_c_false"without transport
rs_c_true "with check
CHANGING gt_text_all
l_subrc.
IF l_subrc = 0.
*-- register DTP for processing later
l_src = ls_tran-sourcename.
CASE ls_tran-sourcetype.
WHEN 'RSDS'.
l_srctp = 'DTASRC'.
WHEN 'IOBJ'.
IF ls_tran-sourcesubtype = 'TEXT'.
l_srctp = 'IOBJT'.
ELSE.
l_srctp = 'IOBJA'.
ENDIF.
WHEN 'RSCS'. " InfoSource non persistent doesn't exist in DTP
CLEAR l_src.
WHEN OTHERS.
l_srctp = ls_tran-sourcetype.
ENDCASE.
l_tgt = ls_tran-targetname.
CASE ls_tran-targettype.
WHEN 'IOBJ'.
IF ls_tran-targetsubtype = 'TEXT'.
l_tgttp = 'IOBJT'.
ELSE.
l_tgttp = 'IOBJA'.
ENDIF.
WHEN 'RSCS'. " InfoSource non persistent doesn't exist in DTP
CLEAR l_tgt.
WHEN OTHERS.
l_tgttp = ls_tran-targettype.
ENDCASE.
IF l_src IS NOT INITIAL AND l_tgt IS NOT INITIAL.
SELECT * FROM rsbkdtp AS t APPENDING TABLE lt_dtp_all WHERE
objvers = rs_c_objvers-active AND
src = l_src AND
srctp = l_srctp AND
tgt = l_tgt AND
tgttp = l_tgttp AND
EXISTS ( SELECT * FROM rsbkdtpstat WHERE
dtp = t~dtp AND
objstat = rs_c_objstat-inactive ).
ELSEIF l_src IS NOT INITIAL.
SELECT * FROM rsbkdtp AS t APPENDING TABLE lt_dtp_all WHERE
objvers = rs_c_objvers-active AND
src = l_src AND
srctp = l_srctp AND
EXISTS ( SELECT * FROM rsbkdtpstat WHERE
dtp = t~dtp AND
objstat = rs_c_objstat-inactive ).
ELSEIF l_tgt IS NOT INITIAL.
SELECT * FROM rsbkdtp AS t APPENDING TABLE lt_dtp_all WHERE
objvers = rs_c_objvers-active AND
tgt = l_tgt AND
tgttp = l_tgttp AND
EXISTS ( SELECT * FROM rsbkdtpstat WHERE
dtp = t~dtp AND
objstat = rs_c_objstat-inactive ).
ENDIF.
ELSE.
l_text = 'error / warning occurred, activate manually with TRFN UI
'.
CALL METHOD cl_rso_application_log=>if_rso_application_log~add_tex
t
EXPORTING
i_text = l_text
i_msgty= rs_c_error
i_detlevel = '3'.
ENDIF.
PERFORM write_to_log
CHANGING gt_text_all.
ENDLOOP.
*-- DTPs
CLEAR gt_text_all.
SORT lt_dtp_all BY dtp objvers.
DELETE ADJACENT DUPLICATES FROM lt_dtp_all COMPARING dtp.
LOOP AT lt_dtp_all INTO ls_dtp.
l_msgty = rs_c_info.
l_detlevel = '2'.
l_string = ls_dtp-dtp.
ls_text-level = 3.
APPEND ls_text TO ct_text.
CLEAR ls_text.
ELSE.
TRY.
CALL METHOD lr_collection->activate
EXPORTING
i_with_cto= rs_c_false
i_force_activation= 'X'
i_show_check_protocol = ''
i_detlevel= '3'
IMPORTING
e_th_tlogo_error= lt_tlogo.
CATCH cx_rs_cancelled .
EXIT.
ENDTRY.
IF lt_tlogo IS NOT INITIAL.
cv_subrc = 99.
ENDIF.
ENDIF.
ENDFORM." ACTIVATE_DTP
*>>>> END OF INSERTION <<<<<<
...
*&--------------------------------------------------------------------*
Validity
Software Component
SAP_BW
From Rel.
700
710
SAP_BW_VIRTUAL_COMP 701
711
720
701
711
Correction Instructions
Correction Instructions
Software Component
SAP_BW
SAP_BW
SAP_BW
SAP_BW
SAP_BW
SAP_BW
SAP_BW
Valid from
700
700
711
711
711
711
711
Valid to
701
701
711
711
711
711
711
Number
1160531
1181402
1096704
1096709
1120796
1120799
1120800
Software Component
Release Support Package
SAP_BW_VIRTUAL_COMP 701
SAPK-70114INVCBWTECH
SAP_BW
700
SAPKW70024
701
SAPKW70107
702
SAPKW70203
711
SAPKW71105
720
SAPKW72003
References
This document refers to:
SAP Notes
1493850 Consulting: Transformations inactive after system copy
1471117 SP25:RSDG_TRFN_ACTIVATE skips if M version has OBJSTAT 'INA'
1407600 SAPBWNews NW BW 7.02 ABAP SP03
1407599 Preliminary Version SAPBWNews NW BW 7.20 ABAP SP03
1407598 SAPBWNews NW BW 7.0 ABAP SP 24
1392372 Vorabversion SAPBWNews NW BW 7.11 ABAP SP04