List of application role + menu role and explanation if we have several applications role with specials rules.
|
List of authorization objects mandatory for the application.
|

For multiprovider MVCOPA01, not all cubes aossciated are used for integrated margin report.
Only the providers vith IM in red are concerned:
There are 3 individual rountines in this transformation to divide the following key figure values that are of currencies Korean Won (KRW) and Japanese Yen (JPY) by 100.
C_AMT_CP
C_AMT_CNP
C_AMT_AMO
Fiscal Variant 0FISCVARNT is fixed to K4.
Cost Component Structure 0CCOMPSTRUC is fixed to Z1.
Fiscal Year/Period required some ABAP codings to convert the incoming data into the correct format to be updated.
For the key figure Variable Amount, abap code is required to take the total amount minus the fixed amount to get just the variable amount. (WRTFW_KPF - WRTFW_KFX).
A select is done on master data global filter in internal table ITB_PLANT_REPLACE_PLANT

A select is done to take all records from ODS_PCP2 into table gt_matrix.
Delete all records where the amount and quantity is equal to zero.
0COSTCOMP (Cost Component):
If source record for 0COSTCOMP is equal to ' ' (space = null / empty), we make a loop on gt_matrix (Else we keep 0COSTCOMP from source).
If gs_matrix-/BIC/C_COSTEL1 <= SOURCE_FIELDS-COSTELMNT and gs_matrix-/BIC/C_COSTEL2 >= SOURCE_FIELDS-COSTELMNT, we take the COSTCOMP from gt_matrix (ODS_PCP2).
In all cases, if 0COSTCOMP from source or from ODS_PCP2 is equal to ' ', the defaul value = 100.
0PLANT_COMP (Issuing Plant):
If C_MATNR = C_COMPNT and PLANT = PLANT_COMP and PCPITEMCAT = 'L' and VENDOR is not empty.
Read table ITB_PLANT_REPLACE_PLANT with help of field VENDOR (VENDOR from source = C_LOW from master data C_GLBFILT).
If something is found, the PLANT_COMP = PLANT from ITB_PLANT_REPLACE_PLANT (field C_HIGH from master data global filter).
Else, keep source PLANT_COMP.
Collect into ITB_REF_DATE value from master data global filter (C_GLBFILT) for STREAM = F_COPC and RULE = ODS_PCP1
![]()
COSTDATE = low value from ITB_REF_DATE.
A select is done to take all records from ODS_PCP2 into table gt_matrix.
Delete all records where the amount and quantity is equal to zero.
Delete records with Valuation variants ( BWVAR ) not equal to ZFO, Z25 and ZEP.
Fields routines
Fiscal Variant 0FISCVARNT is fixed to K4.
Cost Component Structure 0CCOMPSTRUC is fixed to Z1.
Costing Variant (0COSTVAR) is fixed to ZIP.
Fiscal Year/Period required some ABAP codings to convert the incoming data into the correct format to be updated.
For the key figure Variable Amount, abap code is required to take the total amount minus the fixed amount to get just the variable amount. (WRTFW_KPF - WRTFW_KFX).
Load DSO_PCP1 into itself with a look-up at DSO_PCP2 for matching records of the month with the following field value assigments:
Generic Fields:
DSO_PCP1-C_PRODVER = ''.
DSO_PCP1-ACTTYPE = ''.
DSO_PCP1-C_COSTCTR = ''.
DSO_PCP1-PCP_RES = ''.
DSO_PCP1-WORKCENTER = ''.
DSO_PCP1-C_BOMNUM = ''.
DSO_PCP1-C_BOMUSAG = ''.
DSO_PCP1-C_BOMALT = ''.
DSO_PCP1-PLANT_COMP = DSO_PCP2-PLANT.
DSO_PCP1-C_COMPNT = DSO_PCP2-/BIC/C_MATPLNT.
DSO_PCP1-LOTSIZE_IT = DSO_PCP2-LOTSIZE.
DSO_PCP1-CURRENCY = DSO_PCP2-CURRENCY.
DSO_PCP1-UNIT = DSO_PCP2-UNIT.
DSO_PCP1-BASE_UOM = DSO_PCP1-UNIT.
DSO_PCP1-OI_MENGE = DSO_PCP1-LOTSIZE_IT.
DSO_PCP1-PRICE_UNIT = DSO_PCP1-LOTSIZE_IT.
Variable Amount (CP):
DSO_PCP1-C_KAPOSNR = '1'.
DSO_PCP1-AMOUNT = DSO_PCP2-C_AMT_CP.
DSO_PCP1-AMOUNTVR = DSO_PCP1-AMOUNT.
DSO_PCP1-AMOUNTFX = 0.
DSO_PCP1-COSTELMNT = '0098150974'.
DSO_PCP1-COSTCOMP = '100'.
Fixed Amount (CNP):
DSO_PCP1-C_KAPOSNR = '2'.
DSO_PCP1-AMOUNT = DSO_PCP2-C_AMT_CNP.
DSO_PCP1-AMOUNTVR = 0.
DSO_PCP1-AMOUNTFX = DSO_PCP1-AMOUNT.
DSO_PCP1-COSTELMNT = '0099430120'.
DSO_PCP1-COSTCOMP = '220'.
DSO_PCP1-PCPITEMCAT = 'E'.
DSO_PCP1-C_COMPNT = ''.
Depreciation Amount (AMO):
DSO_PCP1-C_KAPOSNR = '3'.
DSO_PCP1-AMOUNT = LV_DSO_PCP2-C_AMT_AMO.
DSO_PCP1-AMOUNTVR = 0.
DSO_PCP1-AMOUNTFX = WA_PCP1_SP-AMOUNT.
DSO_PCP1-COSTELMNT = '0099438000'.
DSO_PCP1-COSTCOMP = '300'.
DSO_PCP1-PCPITEMCAT = 'E'.
DSO_PCP1-C_COMPNT = ''.
Keys figures in summation
Delete records with KLVAR (Costing Variant) not equal to ZFO and ZEP and Z25.
Delete records with CURTYP (Currency Type) not equal to 10.
Fields routines
Costing Variant (COSTVAR) = ZIP.
AMOUNT = WERTF (Fixed value) + WERTV (Variable value)
K_CCR_100 (100 Raw Materials):
IF SOURCE_FIELDS-ELEMT (Cost Component) = '100'.
RESULT = SOURCE_FIELDS-WERTF (Fixed value) + SOURCE_FIELDS-WERTV (Variable value).
K_CCR_110 (110 Toll Manufacturing):
IF SOURCE_FIELDS-ELEMT = '110'.
RESULT = SOURCE_FIELDS-WERTF + SOURCE_FIELDS-WERTV.
K_CCR_120 (120 Utilities - VC):
IF SOURCE_FIELDS-ELEMT = '120'.
RESULT = SOURCE_FIELDS-WERTF + SOURCE_FIELDS-WERTV.
K_CCR_200 (200 Labor Costs):
IF SOURCE_FIELDS-ELEMT = '200'.
RESULT = SOURCE_FIELDS-WERTF + SOURCE_FIELDS-WERTV.
K_CCR_210 (210 Supplies & Misc.):
IF SOURCE_FIELDS-ELEMT = '210'.
RESULT = SOURCE_FIELDS-WERTF + SOURCE_FIELDS-WERTV.
K_CCR_220 (220 Maintenance):
IF SOURCE_FIELDS-ELEMT = '220'.
RESULT = SOURCE_FIELDS-WERTF + SOURCE_FIELDS-WERTV.
K_CCR_230 (230 Overheads):
IF SOURCE_FIELDS-ELEMT = '230'.
RESULT = SOURCE_FIELDS-WERTF + SOURCE_FIELDS-WERTV.
K_CCR_240 (240 Utilities -FC):
IF SOURCE_FIELDS-ELEMT = '240'.
RESULT = SOURCE_FIELDS-WERTF + SOURCE_FIELDS-WERTV.
K_CCR_300 (300 Depreciation):
IF SOURCE_FIELDS-ELEMT = '300'.
RESULT = SOURCE_FIELDS-WERTF + SOURCE_FIELDS-WERTV.
K_CCR_310 (310 N/A):
IF SOURCE_FIELDS-ELEMT = '310'.
RESULT = SOURCE_FIELDS-WERTF + SOURCE_FIELDS-WERTV.
The purpose of this routine is to check if the current incoming record already exists in the DSO_PCP3 from the previous month loading. If it exists, delete the incoming record.
In internal table LV_DSO_PCP2, we take records from ODS_PCP2 in function of PLANT, C_MATNR, FISCPER and FISCVAR.
DSO_PCP3-AMOUNT = LV_DSO_PCP2-C_AMT_CP + LV_DSO_PCP2-C_AMT_CNP + LV_DSO_PCP2-C_AMT_AMO
DSO_PCP3-AMOUNTVR = LV_DSO_PCP2-C_AMT_CP.
DSO_PCP3-AMOUNTFX = LV_DSO_PCP2-C_AMT_CNP + LV_DSO_PCP2-C_AMT_AMO
DSO_PCP3-LOTSIZE = LV_DSO_PCP2-LOTSIZE.
DSO_PCP3-CURRENCY = LV_DSO_PCP2-CURRENCY.
DSO_PCP3-UNIT = LV_DSO_PCP2-UNIT.
DSO_PCP3-K_CCR_100 = DSO_PCP3-AMOUNTVR.
DSO_PCP3-K_CCR_110 = 0.
DSO_PCP3-K_CCR_120 = 0.
DSO_PCP3-K_CCR_200 = 0.
DSO_PCP3-K_CCR_210 = 0.
DSO_PCP3-K_CCR_220 = LV_DSO_PCP2-C_AMT_CNP.
DSO_PCP3-K_CCR_230 = 0.
DSO_PCP3-K_CCR_240 = 0.
DSO_PCP3-K_CCR_300 = LV_DSO_PCP2-C_AMT_AMO.
DSO_PCP3-K_CCR_310 = 0.
DSO_PCP3-LOTSIZE = LV_DSO_PCP2-LOTSIZE.
DSO_PCP3-CURRENCY = LV_DSO_PCP2-CURRENCY.
DSO_PCP3-UNIT = LV_DSO_PCP2-UNIT.
Keys figures in summation
Costing Variant (COSTVAR) = ZIP.
AMOUNT = WERTF (Fixed value) + WERTV (Variable value)
K_CCR_100 (100 Raw Materials):
IF SOURCE_FIELDS-ELEMT (Cost Component) = '100'.
RESULT = SOURCE_FIELDS-WERTF (Fixed value) + SOURCE_FIELDS-WERTV (Variable value).
K_CCR_105 (105 Packagings):
IF SOURCE_FIELDS-ELEMT = '105'.
RESULT = SOURCE_FIELDS-WERTF + SOURCE_FIELDS-WERTV.
K_CCR_110 (110 Toll Manufacturing):
IF SOURCE_FIELDS-ELEMT = '110'.
RESULT = SOURCE_FIELDS-WERTF + SOURCE_FIELDS-WERTV.
K_CCR_120 (120 Utilities - VC):
IF SOURCE_FIELDS-ELEMT = '120'.
RESULT = SOURCE_FIELDS-WERTF + SOURCE_FIELDS-WERTV.
K_CCR_200 (200 Labor Costs):
IF SOURCE_FIELDS-ELEMT = '200'.
RESULT = SOURCE_FIELDS-WERTF + SOURCE_FIELDS-WERTV.
K_CCR_210 (210 Supplies & Misc.):
IF SOURCE_FIELDS-ELEMT = '210'.
RESULT = SOURCE_FIELDS-WERTF + SOURCE_FIELDS-WERTV.
K_CCR_220 (220 Maintenance):
IF SOURCE_FIELDS-ELEMT = '220'.
RESULT = SOURCE_FIELDS-WERTF + SOURCE_FIELDS-WERTV.
K_CCR_230 (230 Overheads):
IF SOURCE_FIELDS-ELEMT = '230'.
RESULT = SOURCE_FIELDS-WERTF + SOURCE_FIELDS-WERTV.
K_CCR_240 (240 Utilities -FC):
IF SOURCE_FIELDS-ELEMT = '240'.
RESULT = SOURCE_FIELDS-WERTF + SOURCE_FIELDS-WERTV.
K_CCR_300 (300 Depreciation):
IF SOURCE_FIELDS-ELEMT = '300'.
RESULT = SOURCE_FIELDS-WERTF + SOURCE_FIELDS-WERTV.
K_CCR_310 (310 N/A):
IF SOURCE_FIELDS-ELEMT = '310'.
RESULT = SOURCE_FIELDS-WERTF + SOURCE_FIELDS-WERTV.
The purpose of this routine is to check if the current incoming record already exists in the DSO_PCP3 from the previous month loading. If it exists, delete the incoming record.
Key figures in summation
In internal tables we collect data from:
master data c_custid where logsys and custid are the same as in source package, and plant is not empty → itb_shipto
master data c_plant → itb_plant
DSO UOMC_MAT → itb_uomc_mat
DSO dbcopa24 → itb_dbcopa24
Matser data c_matnr2 in function of logsys and c_matnr from source → itb_matnr2
Master data c_glbfilt in function of interval defined in master data C_GLBFILT (stream Z_INT_MG, rule VFIELD)→ itb_fieldn

Master data c_glbfilt in function of interval defined in master data C_GLBFILT (stream Z_INT_MG, rule CALMONTH)→ itb_fieldn

Then, if source of data are not in ITB_FIELDN or ITB_CALMONTH or ITB_SHIPTO we delete the data.
0LOTSIZE_IT = 1000
CPFCTR1_2 = CPFCTR1_2 from master data C_MATPNT2 in function of /BIC/C_PLANT & LOGSYS & /BIC/C_MATPNT2 from source of data.
K_CSTUNIT = empty.
C_DSPLANT = c_plant from itb_shipto.
C_PLANT = c_plant from itb_shipto.
In function of records in result package. If a correspondance is found in ITB_MATNR2 and unit in ITB_UOMC_MAT:
k_lotsze = k_lotsze * ITB_UOMC_MAT-uomz1d (Quantity - Nominator) / ITB_UOMC_MAT-uomn1d (Quantity -Denominator).
unit = itb_matnr2-base_uom.
In function of records in result package. If a correspondance is found in ITB_PLANT and if the source currency is defferent from currency in ITB_PLANT:
Module function " Z_CONVERT_CURRENCY " is used to convert k_intdut ( Integrated Duty unit cost ) in plant currency.
K_INTDUT = SUM OF K_INDUT * 1000 / SUM OF LOT_SIZE
In function of records in result package (fields calmonth, logsys, c_dpplant, c_dsplant, c_matnr2) if a correcpondance is found in itb_dbcopa24, k_lotsze = 1000 else k_lotsze = 0.
( LOT_SIZE = 1000 ONLY IF KEY DOESN'T ALREADY EXIST)
In function of records in result package, if a correcpondance is NOT found in itb_matnr2, C_PFCTR1_2 is empty.
Delete data with C_PFCTR1_2 empty.
Delete data with k_intdut = 0.
ODS_PCP6 is loaded by programs Z_M_INT and Z_M_INT_IP in process chain PC_INT_MARGIN.
Programs Z_M_INT & Z_M_INT_P
These program is used to calculate the IM key figures (CP, CNP, AMO, Duty and Freight).
To have more explanations about Z_M_INT (Z_M_INT_IP has same logic) with code associated, check this document:
If the unit is different from "KG", module function Z_MD_CONVERT_MATERIAL_UNIT_F is used to convert the k_lotsize in KG.
Sort source package by c_pabelnr, c_paposnr, co_area, c_versn2, vtype, c_fieldn and record.
In internal table itb_hashed_pcp4 we collect the data from source package where calmonth, c_prodpla, c_matnrc and c_goodiss are not empty. We used c_goodiss + 01 or calmonth + 01 to create the costing date.
In w_lastmth we store the last month (the biggest) in source package.
In internal table itb_collect_pcp5 we collect the data from source package where pstng_date, c_prodpla and c_plant are not empty.
Select in internal table itb_c_keyfigr fields c_keyfigr, c_plelmnt, c_bfsign from master data c_keyfigr where c_keyfigr is not empty.
Select in internal table itb_plant data from master data c_plant in function of logsys in source and if C_SORT2 = 'NDIR'.
Select costdate, costvar, plant, c_matnr, base_uom, UNIT, CURRENCY, c_amt_cp, c_amt_cnp, c_amt_amo, k_intdut, k_intfrg, lotsize_it, c_amt_pck, c_amt_raw, c_amt_tol, c_amt_uti INTO TABLE itb_pcp4 in function of data present in itb_hashed_pcp4 and if c_kkzma <> 'X' and if costvers = '001'.
In internal table ibt_pcp4 we delete the record if costvar = ZIP. If cost_var = ZFO the record is copied in internal table itb_pcp4_zfo.
Select destplant, depplant, datefrom, dateto, currency, k_intdut, amount, lotsize, unit, into internal table itb_pcp5 in function of data present in itb_collect_pcp5.
For each line of source package, LER rules are applied:
Determine w_costdate → first day of copa delivery month (6 firsts numbers of c_goodiss + 01 or if c_goodiss is empty, 6 firsts numbers of pstng_date + 01).
Determine w_lcostdate → last day of copa delivery month (with function module SLS_MISC_GET_LAST_DAY_OF_MONTH + field w_costdate).
Search key fidures from ods_pcp4 (itb_pcp4_zfo) with costvar 'ZFO' in function of source package data.
If no record found in ods_pcp4 (itb_pcp4) with zfo, try without 'ZFO' and 'ZIP'.
If something is found in ods_pcp4:
If the currency from ods_pcp4 is not the same of currency from source package:
We multply the key figures from ods_pcp4 (C_AMT_CP, C_AMT_CNP, C_AMT_AMO, K_INTFRG, K_INTDUT, C_AMT_RAW, C_AMT_PCK, C_AMT_TOL, C_AMT_UTI) by 100 to avoid decimals issues.
Used function module Z_CONVERT_CURRENCY with exchange rate CAR3 to convert each key figures (target currency = currency from source package).
We divide the key figures by 100.
Same principle for unit key figure (lotsize) with function module Z_BW_CONVERT_QTY.
If currencies or units are not different, we take it from ods_pcp4 without change.
Search key fidures from ods_pcp5 (itb_pcp5) in function of source package data.
If the currency from ods_pcp5 is not the same of currency from source package:
We multply the key figures from ods_pcp5 (k_intfrg and k_intdut) by 100 to avoid decimals issues.
Used function module Z_CONVERT_CURRENCY with exchange rate CAR3 to convert each key figures (target currency = currency from source package).
We divide the key figures by 100.
Same principle for unit key figure (lotsize) with function module Z_BW_CONVERT_QTY.
If currencies or units are not different, we take it from ods_pcp5 without change.
If C_AMT_RAW from ODS_PCP4 is not equal to 0, fields (from source package) c_fieldn, c_fieldn2 and c_plelmn2 = 'VVD0C'.
source package amount = -1 * (source package g_qvva01 * DSO_PCP4 w_c_amt_raw ) / DSO_PCP4 w_lotsize
If C_AMT_PCK from ODS_PCP4 is not equal to 0, fields (from source package) c_fieldn, c_fieldn2 and c_plelmn2 = 'VPD0C'.
source package amount = -1 * (source package g_qvva01 * DSO_PCP4 w_c_amt_pck ) / DSO_PCP4 w_lotsize
If C_AMT_UTI from ODS_PCP4 is not equal to 0, fields (from source package) c_fieldn, c_fieldn2 and c_plelmn2 = 'VUD0C'.
source package amount = -1 * (source package g_qvva01 * DSO_PCP4 w_c_amt_uti ) / DSO_PCP4 w_lotsize
If K_INTFRG from ODS_PCP4 is not equal to 0, fields (from source package) c_fieldn, c_fieldn2 and c_plelmn2 = 'VVC2C'.
source package amount = -1 * (source package g_qvva01 * DSO_PCP4 k_intfrg ) / DSO_PCP4 w_lotsize
If K_INTFRG from ODS_PCP5 is not equal to 0, fields (from source package) c_fieldn, c_fieldn2 and c_plelmn2 = 'ZZC2C'.
source package amount = -1 * (source package g_qvva01 * DSO_PCP5 k_intfrg ) / DSO_PCP5 w_lotsize
If K_INTDUT from ODS_PCP4 is not equal to 0, fields (from source package) c_fieldn, c_fieldn2 and c_plelmn2 = 'VVC3C'.
source package amount = -1 * (source package g_qvva01 * DSO_PCP4 k_intdut ) / DSO_PCP4 w_lotsize
If K_INTDUT from ODS_PCP5 is not equal to 0, fields (from source package) c_fieldn, c_fieldn2 and c_plelmn2 = 'ZZC3C'.
source package amount = -1 * (source package g_qvva01 * DSO_PCP5 k_intdut ) / DSO_PCP5 w_lotsize
If C_AMT_CNP from ODS_PCP4 is not equal to 0, fields (from source package) c_fieldn, c_fieldn2 and c_plelmn2 = 'VVE0C'.
source package amount = -1 * (source package g_qvva01 * DSO_PCP4 c amt_cp ) / DSO_PCP4 w_lotsize
If C_AMT_AMO from ODS_PCP4 is not equal to 0, fields (from source package) c_fieldn, c_fieldn2 and c_plelmn2 = 'VVF0C'.
source package amount = -1 * (source package g_qvva01 * DSO_PCP4 c amt_amo ) / DSO_PCP4 w_lotsize
Add new records with new key figures in source package.
c_bfsign comes from matser data c_keyfigr.
ntergrated margin rules, need to be analysed.
→ Intergrated margin rules, need to be analysed.
C_VERSN2 = 000
0COUNTRY comes from master data C_SHIPID.
C_REST_BA (restated business area) comes from C_TECPCT2 (Technical Profit Center (compounded with c_busarea).
CPFCTR1_2 (gbu) comes from C_TECPCT2 (Technical Profit Center (compounded with c_busarea).
C_TECHPAC (Technical Part Activity) is equal to c_compcde (is pcompany is not empty).
Data is deleted if g_qvva04 (Qty unit base) = 0 AND if cpfctr1_2 (gbu) is NOT present in master data global filter ( c_glbfilt ) for stream = PL_ELEMENT AND rule = IM_IL_GBU.
c_fieldn = c_fieldn
c_fieldn2 = c_fieldn
c_plelmn2 = c_fieldn
K_PERCENT (P&L-IM-Assignment Percentage) comes from DSO dbcopa13.
If K_PERCENT is equal to 0, data is deleted.
amount = ( g_qvva04 * k_percent ) / 100.
g_qvva04 = 0.
g_qvva01 = 0.
We should have the information where the application is sending or receiving information (e.g. APD open hub)
Detail of process chain, list + link between or special event done for the loading
| Main Process Chain | Final Provider Loading | Frequency | Time start | Duration |
|---|---|---|---|---|
| RSP_COPCP_MONTHLY | DSO_PCP2 DSO_PCP1 / ODS_PCP1 | |||
| RPC_CCR_PCP1_MTHLY_CHAIN | DSO_PCP3 / ODS PCP3 / CUB_PCP1 / | |||
| PC_COPA_PL_46 | ODS_PCP5 | |||
| PC_COPA_PL_21 | DBCOPA24 | |||
| PC_INT_MARGIN | ODS_PCP6 / ODS_PCP4 | |||