Beruflich Dokumente
Kultur Dokumente
How-To Guide
How To... Create BAdI Implementation for additional SAP BPC Solution
Systems Applications and Products (SAP)
SAP BusinessObjects Planning and Consolidation 7.5, version for SAP
Net Weaver, SP00 and higher.
IT Practice / Topic Area:
Development SAP Business Add-Ins
Version 1.0
June 2012
Author
Hans Raj Prajapati (SAP ABAP Consultant: PricewaterhouseCoopers Ltd.)
Document History
Document Version Description
1.0 First release of this guide
Table of Contents
1. Business Planning and Consolidation
(BPC).................................................................................................................................
1
2. Business Add Ins
(BAdI).........................................................................................................................................
..................... 1
3. Background
Information.................................................................................................................................
............................ 1
4. Prerequisites...............................................................................................................................
................................................
1
5. BPC Script /
Scope..........................................................................................................................................
............................ 1
6. Business
Scenario......................................................................................................................................
.................................
1
6.1 Business Scenario
1........................................................................................................................................................................
.. 2
6.2 Business Scenario
2........................................................................................................................................................................
.. 8
7. Step-by-Step
Procedure...................................................................................................................................
...........................
1
7.1 Create a BAdI
Implementation................. ...............................................................................................................................
........
25
7.2 Understand / write BAdI Implementation
code............................................................................................................................... 5
7.3 Test the BAdI
Implementation.................................................................................................................................................
.........
1
8.
Appendix.....................................................................................................................................
............................................... 1
8.1 Source Code for BAdI
Implementation............................................................................................................................................. 23
3. Background Information
This How-To guide provides a solution to this in the form of a class that can be included in all BAdi implementations. It checks
the source of data submitted to the BAdi, and depending upon requirement output data is send back using same table.
4. Prerequisites
5. BPC Scope
6. Business Scenario
Sap BusinessObjects Planning and Consolidation, version for Netweaver (hereafter referred to as BPC) provides a BAdi
(UJ_CUSTOM_LOGIC) that can be used to extend the functionality of script logic packages. Due to the way Input Schedule
initiated script logic operations (i.e. included in default logic) differ from data manager initiated script logic operations you get
consistent results with the same logic depending on where it was executed from.
And this scenario is used for distributing AMC total cost with respect to respective vertical percentage and process wise
employee.
If there are 5 GLs and their total sum is Rs. 100 cost and their vertical wise percentage are
10 % for ABU vertical ,
40% for BFSI &
50% for TM and
Respective Processes are as follows
10001 with employee ALLOCATEDSEATS
10002 with employee ALLOCATED SEATS
10003 with employee UNALLOCATED SEATS
10004 with employee ALLOCATED SEATS
10005 with employee UNALLOCATED SEATS
10006 with employee ALLOCATED SEATS
10
15
5
5
5
5
falling
falling
falling
falling
falling
falling
under
under
under
under
under
under
ABU,
ABU,
ABU,
BFSI,
BFSI,
TM,
Then
ABU cost will be
BFSI cost will be
TM cost will be
i.e.
i.e.
i.e.
100 * 10 / 100
100 * 40 / 100
100 * 50 / 100
= 10
= 40
= 50
So after allocation respective vertical cost (10 + 40 + 50) will be equals to total cost i.e. 100 always.
Now allocating these cost to respective processes as per number of employee.
So for a process cost will be equals to (process respective vertical cost / total respective vertical employee) * current
process employee.
Therefore
Total ABU employees will be
Total FBSI employees will be
Total TM employees will be
10 + 15 + 5 +
5+5
5
=5
= 30
= 10
10002 with employee ALLOCATED SEATS 15 falling under ABU = [10 (ABU cost) / 30 (total ABU employee)] * 15 (10002
employee) = 5.0000
10003 with employee UNALLOCATED SEATS 5 falling under ABU = [10 (ABU cost) / 30 (total ABU employee)] * 5 (10003
employee) = 1.6666
10004 with employee ALLOCATED SEATS 5 falling under BFSI = [40 (ABU cost) / 10 (total BFSI employee)] * 5 (10004
employee) = 20.0000
10005 with employee UNALLOCATED SEATS 5 falling under BFSI = [40 (ABU cost) / 10 (total BFSI employee)] * 5 (10005
employee) = 20.0000
10006 with employee ALLOCATED SEATS 5 falling under TM = [10 (ABU cost) / 5 (total TM employee)] * 5 (10006 employee) =
10.0000
After all calculation allocating these values to respective dimensions and passing back to BPC
7. Business Scenario 2
This scenario covers actual dimensions name, their property, input, calculation as well
as final output
INPUT 1:
It gives ACCOUNT Dimensions for Cost in SIGNEDDATA (Amount) field
i.e. FACIT_AMC and two GL account Code i.e. 44113001 and 44117152.
CALCULATION 1:
For value in dimension ACCOUNTS and value in dimension COSTCENTER , Add all the cost as per COMPANY_CODE and
TIME , value of other dimension like PROCESS , BUSAREA will be same as shown below
INTERMEDIATE OUTPUT 1:
INPUT 2:
It gives ACCOUNT Dimension i.e. PER_ALLOC_FACIT_AMC for vertical wise percentage distribution of cost (got from previous
calculation i.e. INPUT 1)
INTERMEDIATE OUTPUT 2:
INPUT 1 calculation
Calculate vertical wise cost i.e. Multiplication of vertical wise cost % and total cost from
INPUT 3:
It gives ACCOUNT Dimension i.e. ALLOCATED_SEATS / UNALLOCATED_SEATS and respective processes number of employee
and each process have vertical value in last column i.e. ABU / TM / BFSI .
Continued
INTERMEDIATE OUTPUT 3:
It gives ACCOUNT Dimension i.e. ALLOCATED_SEATS / UNALLOCATED_SEATS and respective processes number of employee
Calculate vertical wise total no of employee using processes vertical property
FINAL OUTPUT:
Output for its each process as per vertical Dimension ACCOUNT will have value ALLOC_FACTAMC_COSTS and AMOUNT or
SIGNEDDATA will have value equals to (Vertical wise total cost / Vertical wise total employee) * Process employee number
Continued
Continued
9.Step-by-step Procedures
9.1
STEP 1:
Enter /nSE19 and Enter Enhancement Spot i.e. UJ_CUSTOM_LOGIC and Press Create Impl. Button
STEP 2: Enter Enhancement Implementation Name and its description say ZBPC_AC_FACIT_AMC_EI
STEP 6: Create BAdI Implementations: Enter Name say ZBPC_AC_FACIT_AMC_BI & its Implementing Class name say
ZBPC_AC_FACIT_AMC_CL
STEP 8: Enter Package Name say ZBW or last entered package will be displayed here automatically and Press OK or Enter.
STEP 9: Select Request Name or last entered or created request will be displayed here automatically and Press OK or Enter.
STEP 10: It will display a screen showing Inactive Enhancement Implementation and Under Tab Enh. Implementation Elements
it is showing BAdi Implementations highlighted in yellow color.Expand it using Left Arrow button under BAdi Implementations
STEP 11: It will display a screen showing Inactive Enhancement Implementation and Under Tab Enh. Implementation Elements
it is showing BAdi Implementations highlighted in yellow color and its element ie Implementing Class and Filter Val. Double Click
on Filter Val.
STEP 12: It will display a Filter Values screen and Click on Combination button it add a row under Combination 1 with Value 1
equals to ????
Double Click on this value.
STEP 13: Enter Value 1 say AC_FACIT_AMC and press Enter or ok.
STEP 14: It will display this screen back with filter value
STEP 15: Double Click on Implementing Class highlighted in yellow color under BAdi Implementations and it will display
method
STEP 21: Press Pretty Printer whenever required for making code good looking / pretty
STEP 22: Press Activate Button or Control F3 and then press Enter button or OK.
STEP 24: Again to change Code Enter /nSE19 and Enter New BAdi Enhancement Implementation as ZBPC_AC_FACIT_AMC_EI as
created previously and Press Change button .
STEP 25: Expand BAdI Implementations highlighted in yellow color by clicking on arrow button
STEP 27: Double Click on Method IF_UJ_CUSTOM_LOGIC~EXECUTE highlighted in light blue color.
STEP 29: Method IF_UJ_CUSTOM_LOGIC~EXECUTE have following Parameters in custom class ZBPC_AC_FACIT_AMC_IC.
Parameter I_APPSET_ID contain value selected by user from transaction UJKT or defined in BPC package e.g. APPSET_BP.
Parameter I_APPL_ID contain value selected by user from transaction UJKT or defined in BPC package e.g. BI_Test as per
appset id.
9.2
Important Points
1. Firstly understand parameters of method IF_UJ_CUSTOM_LOGIC~EXECUTE i.e.
1.1I_APPSET_ID TYPE UJ_APPSET_ID
BPC:
1.2I_APPL_ID
TYPE UJ_APPL_ID
BPC:
1.3IT_PARAM
TYPE UJK_T_SCRIPT_LOGIC_HASHTABLE OPTIONAL
1.4IT_CV
TYPE UJK_T_CV
dimensions and its value
1.5ET_MESSAGE
TYPE UJ0_T_MESSAGE
1.6CT_DATA
TYPE STANDARD TABLE OPTIONAL
output
1.7CX_UJ_CUSTOM_LOGIC
AppSet ID
: it gives selected appset id
Application ID : it gives selected application id
script logic hash table
Script Logic Current View : it is hashed table gives
BPC: Messages: it is used to trigger message
it gives dimension wise selected input and to pass
BPC Exception: Custom Logic Exception
2. CT_DATA table is a dynamic internal table and its dimensions / fields depends upon BPC / BI configuration
Example: CT_DATA table have fields or called DIMENSION_A that depends upon SAP BPC configuration and
This table will be required to get input as well as to send output data back to BPC
In this example it has 13 fields given below
1. account_a type c length 50
2. busarea type c length 20
3. comp_code type c length 20
4. process_p type c length 20
5. time
type c length 20
6. category type c length 20
7. costcenter type c length 20
8. currency type c length 20
9. datasrc type c length 20
10.department type c length 20
11.flow
type c length 20
12.measures type c length 20
13. signeddata type /b28/oisdata
3.
4.
5.
6.
CT_DATA
CT_DATA
CT_DATA
CT_DATA
used
7. Required types for internal table , work area , variables , constants will be used
8. SIGNEDDATA field will always contain positive or negative value and will have specific types e.g.
signeddata type /b28/oisdata .
9. To write code in BAdI Implementation important points are
9.1.Delete duplicate record from table CT_DATA before reading data if exists.
9.2.READ dynamic table CT_DATA records and prepare table as per required logic i.e.
9.2.1. Cost
9.2.2. Cost Percentage
9.2.3. Head counts / Seats
9.2.4. Processes detail
9.3.Also get required dimensions property as per logic i.e.
9.3.1. Process dimension Property or
9.3.2. Company Code dimension property or
9.3.3. Account dimension Property or
9.3.4. Business area dimension property or
9.3.5. Other dimension property as per logic .
9.4.Depending upon required logic either delete input data from CT_DATA or
9.5.Before sending new value of the required combination output to the ct_data table , delete one by one old value data
that exists in ct_data table due to first time run of BADI logic or last run of BADI for the same new combination
9.6.Put required validation i.e. Company code currency check with ct_data values , process property validation , zero
signeddata is required or not , divide by zero and mainly respective dimensions ids.
9.7.Rread Dimensions property : lets take code to understand it
)* Get the current context details using below code
call method cl_uj_context=>get_cur_context
receiving
ro_context = context_ro.
context_ro->switch_to_srvadmin( ).
* Assign the user details
and
* wa_user is of type uj0_s_user.
* i_appset_id are application id e.g. APPSET_BP
wa_user = context_ro->ds_user.
try.
call method cl_uj_context=>set_cur_context
exporting
i_appset_id = i_appset_id
is_user
= wa_user
i_appl_id = i_appset_id."c_application.
catch cx_uj_obj_not_found .
endtry.
**
Below code will read dimensions used in ct_data property and v_dimensions is the field used to pass dimension
**
Its value PROCESS_P is used here to read process property similarly other can be used by passing dimensions
name
try.
create object lo_dim_reader
exporting
i_appset_id = i_appset_id
i_dimension = v_dimension.
catch cx_uja_admin_error .
endtry.
**
**
BELOW CODE WILL GIVE REFERENCE OF PROCESS_P DIMENSIONS DATA i.e. rf_data_pp type ref to data,
using this reference pass data to field symbols
<fs_it_pp> type standard table. Now it contains process
property
**
Its value PROCESS_P is used here to read process property similarly other dimension can be used
**
So <fs_it_pp> is dynamic table and dynamic concept will be used to read data & to populate normal internal table
from this
try.
call method lo_dim_reader->read_mbr_data
importing
er_data = rf_data_pp.
catch cx_uja_admin_error .
endtry.
"<~~~ moving data
assign rf_data_pp->* to <fs_it_pp>.
<fs_ba>
to wa_npp-ba
,
<fs_vertical>
to wa_npp-vertical,
<fs_id>
to wa_npp-id
,
<fs_calc>
to wa_npp-calc ,
<fs_cocode>
to wa_npp-cocode .
else.
move : <fs_id> to wa_pp-id
,
<fs_ba> to wa_pp-ba
,
<fs_vertical> to wa_pp-vertical,
<fs_calc> to wa_pp-calc ,
<fs_cocode> to wa_pp-cocode .
check wa_pp-ba is not initial or wa_pp-vertical is not initial.
append wa_pp to it_pp.
clear : wa_pp.
endif.
endloop.
unassign : <fs_value>,<fs_id>,<fs_ba>, <fs_calc>,<fs_cocode>,<fs_vertical>.
9.3
10.
10.1
Appendix
Source Code for BAdI Implementation
method if_uj_custom_logic~execute.
*$----- 'Start Code : Addition : PwC : Hans : Dt : 06.06.2012 '-----$
*$----- 'Add Code Here'-----$
check ct_data is not initial .
*&---- TYPE Declaration
types: begin of ty_pp,
id
type c length 20,
ba
type c length 20,
vertical
type c length 20,
calc
type c length 20,
cocode
type c length 10,
parenth1
type c length 20,
end of ty_pp,
begin of ty_ap,
group
type c length 20,
id
type c length 20,
calc
type c length 20,
parenth1
type c length 20,
end of ty_ap,
begin of ty_npp,
parenth1
type c length 50,
calc
type c length 20,
cocode
type c length 10,
id
type c length 20,
ba
type c length 20,
vertical
type c length 20,
end of ty_npp,
begin of ty_ba,
parenth
type c length 20,
parenth1
type c length 20,
id
type c length 20,
calc
type c length 20,
category
type c length 5,
dedicated
type c length 10,
It_ctd_i
wa_ctd_i
it_ctd_s
wa_ctd_s
it_ctd_c
wa_ctd_c
it_ctd_cf
wa_ctd_cf
it_ctd_c_cm
type standard table of ty_ctdata,
wa_ctd_c_cm type ty_ctdata,
it_ctd_cp_vrt type standard table of ty_ctdata,
wa_ctd_cp_vrt
type ty_ctdata,
it_pp
wa_pp
it_bap
wa_bap
it_bavp
wa_bavp
it_npp
wa_npp
it_ccp
wa_ccp
data : v_signeddata_c
v_signeddata_vrt
v_signeddata_ba
v_signeddata_cm
v_signeddata_cf
v_signeddata_p
type
type
type
type
type
type
/b28/oisdata,
/b28/oisdata,
/b28/oisdata,
/b28/oisdata,
/b28/oisdata,
/b28/oisdata,
v_flag,
v_low
type string ,
c_parent
type string ,
v_index
type sy-tabix,
v_loop
type sy-tabix,
v_busarea
type c length 20,
v_process_p
type c length 20,
v_busarea_f
type c length 20,
v_account_vrt
type c length 50,
v_account_a
type c length 50,
v_account_c
type c length 50,
v_account_s
type c length 50,
v_vertical
type c length 10,
v_department
type c length 10,
v_dimension
type uj_appl_id value 'PROCESS_P'.
data : rf_ctd
type ref to data,
rf_ba_cs
type ref to data,
lo_dim_reader
type ref to cl_uja_dim,
rf_data_pp
type ref to data,
rf_data_bap
type ref to data,
rf_data_ccp
type ref to data,
context_ro
type ref to if_uj_context,
wa_user
type uj0_s_user.
constants: c_application type uj_appl_id value 'APPSET_BP',
c_account_a
type string value 'ACCOUNT_A',
c_busarea
type string value 'BUSAREA',
c_category
type string value 'CATEGORY',
c_comp_code
type string value 'COMP_CODE',
c_cost_center
type string value 'COSTCENTER',
c_currency
type string value 'CURRENCY',
c_datasrc
type string value 'DATASRC',
c_department
type string value 'DEPARTMENT',
c_flow
type string value 'FLOW',
c_measures
type string value 'MEASURES',
c_process_p
type string value 'PROCESS_P',
c_time
type string value 'TIME',
c_signeddata
type string value 'SIGNEDDATA',
c_parenth1
type string value 'PARENTH1',
c_group
c_id
c_ba
c_cocode
c_hier
c_vertical
c_ps
c_us
c_csc
c_as
c_uas
c_te
c_nb
c_ni
c_pafa
c_ssb
c_chc
c_rd
c_ri
c_ndo
c_nin
c_db
c_ib
c_swb
c_rpc
c_cb
c_hc
c_empgrade
c_nc
c_fa
c_avc
c_afc
c_sign
c_option
field-symbols :
type any,
type any,
type any,
type any,
type any,
<fs_account_a>
type any,
<fs_signeddata> type any,
<fs_department> type any,
<fs_value>
type any,
<fs_vertical>
type any,
<fs_ba>
type any,
<fs_calc>
type any,
<fs_cocode>
type any,
<fs_group>
type any,
<fs_parenth1> type any,
<fs_wa_ctd_a> type any,
<fs_it_ctd_a> type standard table,
<fs_it_ctd_h> type standard table,
<fs_it_pp>
type standard table,
<fs_wa_pp>
type any,
<fs_it_ap>
type standard table,
<fs_wa_ap>
type any,
<fs_it_bap>
type standard table,
<fs_wa_bap>
type any,
<fs_it_ccp>
type standard table,
<fs_wa_ccp>
type any .
data:
it_parent
wa_parent
it_dpt_ba
wa_dpt_ba
it_dpt_e1
wa_dpt_e1
it_ba
wa_ba
it_dpt_vrt
wa_dpt_vrt
type
type
type
type
type
type
type
table of ty_parent,
ty_parent,
table of ty_parent,
ty_parent,
table of ty_parent,
ty_parent,
table of ty_parent,
type
ty_parent,
type table of ty_parent,
type
ty_parent.
"<~~ this will give all business area and verticals as per hierarchy
loop at it_bap into wa_bap where parenth1 eq 'ALL_BA' or parenth1 eq 'VERTICALS'.
if wa_bap-parenth1 eq 'VERTICALS'.
wa_bap-parenth = 'VERTICALS'.
append wa_bap to it_bavp.
elseif wa_bap-parenth1 eq 'ALL_BA '.
loop at it_bap into wa_bavp where parenth1 eq wa_bap-id.
wa_bavp-parenth = 'ALL_BA '.
append wa_bavp to it_bavp.
endloop.
endif.
endloop.
"'''
"<~~~ it will give COMP_CODE wise property
v_dimension = 'COMP_CODE'.
try.
create object lo_dim_reader
exporting
i_appset_id = i_appset_id
i_dimension = v_dimension.
catch cx_uja_admin_error .
endtry.
try.
call method lo_dim_reader->read_mbr_data
importing
er_data = rf_data_ccp.
catch cx_uja_admin_error .
endtry.
assign rf_data_ccp->* to <fs_it_ccp>.
loop at <fs_it_ccp> assigning <fs_wa_ccp>.
unassign <fs_value>.
assign component 'ID' of structure <fs_wa_ccp> to <fs_value>.
check sy-subrc is initial.
move <fs_value> to wa_ccp-comp_code.
unassign <fs_value>.
assign component 'CURRENCY' of structure <fs_wa_ccp> to <fs_value>.
check sy-subrc is initial.
move <fs_value> to wa_ccp-currency.
append wa_ccp to it_ccp.
clear : wa_ccp.
endloop.
"
"(1)<~~
"(2)<~~
"(3)<~~
"(4)<~~
this
this
this
this
will
will
will
will
give
give
give
give
sort ct_data.
*$---- In input duplicate record may come -----$
delete adjacent duplicates from ct_data comparing all fields .
loop at ct_data assigning <fs_wa_ctd_a>.
clear : wa_ctd_h.
v_index = sy-tabix.
***'COMP_CODE'
unassign <fs_value>.
endif.
enddo.
***'Process_P
"<~~~ prepare header table
"<~~~ prepare sum at company code , ba , time level of all account
if wa_ctd_h-costcenter ne c_nc
and
wa_ctd_h-process_p eq wa_npp-id and
( wa_ctd_h-account_a eq c_fa
or
wa_ctd_h-account_a eq '44113001' or
wa_ctd_h-account_a eq '44117152' ).
move wa_ctd_h to wa_ctd_c.
clear :wa_ctd_c-account_a,
wa_ctd_c-costcenter,
wa_ctd_c-busarea .
move : c_afc to wa_ctd_c-account_a,
c_nc to wa_ctd_c-costcenter,
c_nb to wa_ctd_c-busarea.
"<~~ it will give common cost as per vertical and department
collect wa_ctd_c into it_ctd_c.
"<~~~ for vertical level
elseif wa_ctd_h-account_a eq c_pafa.
split: wa_ctd_h-process_p at '_' into wa_ctd_h-pp1 wa_ctd_h-pp2.
clear : wa_ctd_cp_vrt.
move wa_ctd_h to wa_ctd_cp_vrt.
"<~~ it will give cost percentage vertical wise
append wa_ctd_cp_vrt to it_ctd_cp_vrt.
"<~~~ we can not pass data back to cube / ct_data that have ID for Total bcoz
*
it will give exception as total is calculated at BPC level using its child in hierarchy
loop at ct_data assigning <fs_wa_ctd_a>.
v_loop = sy-tabix.
unassign <fs_value>.
assign component 1 of structure <fs_wa_ctd_a> to <fs_value>.
check sy-subrc is initial.
if <fs_value> eq c_fa.
delete ct_data index v_loop.
endif.
endloop.
unassign <fs_wa_ctd_a>.
"<~~ this will give verticla wise total cost
loop at it_ctd_c into wa_ctd_c .
"<~~~ passing final account id for cost
if wa_ctd_c-account_a eq c_afc.
move : c_pafa to v_account_a.
endif.
"<~~~ calculate cost % vertical wise
loop at it_ctd_cp_vrt into wa_ctd_cp_vrt where account_a = v_account_a
busarea = wa_ctd_c-busarea and
comp_code = wa_ctd_c-comp_code and
time
= wa_ctd_c-time
and
category = wa_ctd_c-category and
costcenter = wa_ctd_c-costcenter and
datasrc = wa_ctd_c-datasrc and
department = wa_ctd_c-department and
flow
= wa_ctd_c-flow .
move : wa_ctd_cp_vrt
to wa_ctd_cf,
c_afc
to wa_ctd_cf-account_a.
and
clear wa_ctd_c.
read table it_ctd_cf into wa_ctd_c with key account_a = v_account_c
busarea = wa_ctd_i-busarea
comp_code = wa_ctd_i-comp_code
time
= wa_ctd_i-time
category = wa_ctd_i-category
costcenter = wa_ctd_i-costcenter
datasrc = wa_ctd_i-datasrc
department = wa_ctd_i-department
flow
= wa_ctd_i-flow
pp1
= wa_ctd_i-vrt.
if sy-subrc is initial and wa_ctd_c-signeddata is not initial.
multiply wa_ctd_i-signeddata by wa_ctd_c-signeddata.
else.
clear wa_ctd_i-signeddata .
endif.
clear wa_ctd_c.
read table it_ctd_s into wa_ctd_s with key account_a = v_account_s
busarea = wa_ctd_s-busarea
comp_code = wa_ctd_s-comp_code
time
= wa_ctd_s-time
category = wa_ctd_s-category
costcenter = wa_ctd_s-costcenter
datasrc = wa_ctd_s-datasrc
department = wa_ctd_s-department
flow
= wa_ctd_s-flow
vrt
= wa_ctd_i-vrt.
if sy-subrc is initial and wa_ctd_s-signeddata is not initial.
divide wa_ctd_i-signeddata by wa_ctd_s-signeddata.
else.
clear :wa_ctd_i-signeddata.
endif.
elseif v_loop eq 2.
move wa_ctd_i-busarea to <fs_value>.
elseif v_loop eq 3.
move wa_ctd_i-category to <fs_value>.
elseif v_loop eq 4.
move wa_ctd_i-comp_code to <fs_value>.
elseif v_loop eq 5.
move wa_ctd_i-costcenter to <fs_value> .
elseif v_loop eq 6.
move wa_ctd_i-currency to <fs_value> .
elseif v_loop eq 7.
move wa_ctd_i-datasrc to <fs_value> .
elseif v_loop eq 8.
move wa_ctd_i-department to <fs_value>.
elseif v_loop eq 9.
move wa_ctd_i-flow to <fs_value>.
elseif v_loop eq 10.
move wa_ctd_i-measures to <fs_value>.
elseif v_loop eq 11.
move wa_ctd_i-process_p to <fs_value> .
if <fs_p> is assigned .
clear <fs_p>.
endif.
read table ct_data assigning <fs_p> with key (c_account_a) = v_account_c
(c_busarea)
= wa_ctd_i-busarea
(c_category) = wa_ctd_i-category
(c_comp_code) = wa_ctd_i-comp_code
(c_cost_center) = wa_ctd_i-costcenter
(c_currency) = wa_ctd_i-currency
(c_datasrc)
= wa_ctd_i-datasrc
(c_department) = wa_ctd_i-department
(c_flow)
= wa_ctd_i-flow
(c_measures) = wa_ctd_i-measures
(c_process_p) = wa_ctd_i-process_p
(c_time)
= wa_ctd_i-time.
if sy-subrc is initial.
clear v_index.
v_index = sy-tabix.
delete ct_data[] index v_index.
endif.
if <fs_p> is assigned.
unassign <fs_p>.
endif.
append <fs_wa_ctd_a> to ct_data.
endif.
if <fs_value> is assigned .
unassign <fs_value>.
endif.
enddo.
endloop.
sort ct_data by (c_process_p).
unassign <fs_wa_ctd_a>.
try.
catch cx_uj_custom_logic .
endtry.