on 2021 Mar 11 11:08 AM
I need to add profit center to the data sent to Concur. I believe that it needs to be configured via the CTE_SETUP transaction Setting Up the Cost Center Export wizard. Then inserting into the data via the BAdI BADI_CTE_FIN_COBJ_FILL_LEVEL.
Unfortunately I do have an example code to compare it against, even for a different kind of data. Does anyone have any examples of using this BAdI, even for other data elements?
Request clarification before answering.
Okay, the documentation from SAP Concur is dire....
In the end we did a lot of debugging, so you create an implementation of the BAdI and then put breakpoints or dummy code for break points in and then run the Concur integration process. When the breakpoint fires you basically have to look at all the data you can see to work out what's going on. It's horribly painful.
In our case we did the following - but it may not apply in all cases - depending on how SAP and Concur are configured...! This code ran with a BADI filter of PC = CUSTOM_FIELD.
METHOD if_badi_cte_fin_cobj_level~get_level_data.
FIELD-SYMBOLS: <ls_object> LIKE LINE OF it_cost_object_api_level.
DATA: ls_csks TYPE csks,
ls_prps TYPE prps,
ls_cepct TYPE cepct,
ls_object LIKE LINE OF et_cost_object_level.
LOOP AT it_cost_object_api_level ASSIGNING <ls_object>.
ls_object-cost_object_api_key = <ls_object>-cost_object_api_key.
* . . . Cost Centre or WBS element?
CASE <ls_object>-cost_object_info-cost_object_type_code.
WHEN 'CC'.
SELECT SINGLE *
FROM csks
INTO ls_csks
WHERE kostl EQ <ls_object>-cost_object_info-cost_object_id
AND datbi EQ <ls_object>-cost_object_info-validity_end_date
AND datab EQ <ls_object>-cost_object_info-validity_start_date.
IF sy-subrc EQ 0.
SELECT SINGLE *
FROM cepct
INTO ls_cepct
WHERE prctr EQ ls_csks-prctr.
ENDIF.
ls_object-level_code = ls_csks-prctr.
ls_object-level_name = ls_cepct-ktext.
WHEN 'PJ'.
SELECT SINGLE *
FROM prps
INTO ls_prps
WHERE poski EQ <ls_object>-cost_object_info-cost_object_id.
IF sy-subrc EQ 0.
SELECT SINGLE *
FROM cepct
INTO ls_cepct
WHERE prctr EQ ls_prps-prctr.
ENDIF.
ls_object-level_code = ls_prps-prctr.
ls_object-level_name = ls_cepct-ktext.
ENDCASE.
CLEAR: ls_csks, ls_cepct, ls_prps.
APPEND ls_object TO et_cost_object_level.
ENDLOOP.
ENDMETHOD.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
91 | |
11 | |
9 | |
6 | |
6 | |
4 | |
4 | |
4 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.