START END Routines
START END Routines
FIELD-SYMBOLS:
<RESULT_FIELDS> TYPE _ty_s_TG_1.
**** begin of routine - insert your code only below this line ****
<result_fields>-calmonth2 = <result_fields>-fiscper3+1(2).
CONCATENATE <result_fields>-calyear <result_fields>-calmonth2 INTO
<result_fields>-calmonth.
ENDLOOP.
**** end of routine - insert your code only before this line ****
ENDMETHOD.
METHOD GLOBAL_START.
FIELD-SYMBOLS:
<SOURCE_FIELDS> TYPE _ty_s_SC_1.
**** begin of routine - insert your code only below this line ****
***********************************************************************
DATA: len_prefix_a type i,
len_prefix_b type i,
len_sf_cc type i,
b4_cc(15) type c,
source_cc_prefix(15) type c.
**** Checking if the cost centers from the source ADSO PEHSADU01
**** have a prefix from the mapping ADSO PAMSPDP01 - sf_cc_prefix_a or
sf_cc_prefix_b.
IF len_prefix_a > 0.
b4_cc = LS_PREFIX-b4_cc_prefix &&
WA_SOURCE_PACKAGE-cost_center+len_prefix_a(len_sf_cc).
ELSE.
b4_cc = LS_PREFIX-b4_cc_prefix && WA_SOURCE_PACKAGE-
cost_center.
ENDIF.
replace all occurrences of '-' in b4_cc with ''.
WA_SOURCE_PACKAGE-cost_center = b4_cc.
APPEND WA_SOURCE_PACKAGE TO IT_SOURCE_PACKAGE.
ELSE.
IF ( len_prefix_b < strlen( WA_SOURCE_PACKAGE-cost_center ) and
LS_PREFIX-sf_cc_prefix_b <> 'n/a' ).
IF len_prefix_b = 0.
source_cc_prefix = ''.
ELSE.
source_cc_prefix = WA_SOURCE_PACKAGE-
cost_center(len_prefix_b).
ENDIF.
IF source_cc_prefix = LS_PREFIX-sf_cc_prefix_b.
len_sf_cc = strlen( WA_SOURCE_PACKAGE-cost_center ) -
len_prefix_b.
IF len_prefix_b > 0.
b4_cc = LS_PREFIX-b4_cc_prefix &&
WA_SOURCE_PACKAGE-
cost_center+len_prefix_b(len_sf_cc).
ELSE.
b4_cc = LS_PREFIX-b4_cc_prefix && WA_SOURCE_PACKAGE-
cost_center.
ENDIF.
replace all occurrences of '-' in b4_cc with ''.
WA_SOURCE_PACKAGE-cost_center = b4_cc.
APPEND WA_SOURCE_PACKAGE TO IT_SOURCE_PACKAGE.
ELSE.
DELETE SOURCE_PACKAGE.
ENDIF.
ELSE.
DELETE SOURCE_PACKAGE.
ENDIF.
ENDIF.
ELSE.
DELETE SOURCE_PACKAGE.
ENDIF.
ELSE.
DELETE SOURCE_PACKAGE.
ENDIF.
ENDLOOP.
REFRESH SOURCE_PACKAGE.
SOURCE_PACKAGE = IT_SOURCE_PACKAGE.
**** end of routine - insert your code only before this line ****
ENDMETHOD.