cancel
Showing results for 
Search instead for 
Did you mean: 

How to add a level in Concur via BADI_CTE_FIN_COBJ_FILL_LEVEL

dr_ajt
Participant
1,002

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?

rfsky
Discoverer
0 Kudos

Hi Adam,

I know you posted the question on BADI_CTE_FIN_COBJ_FILL_LEVEL a while ago but did you ever figure out how to use this badi to populate codes and values for a customer-specific list level within the Concur list ?

Any details or examples much appreciated.

Thanks,

Richard

dr_ajt
Participant
0 Kudos

rfraser,

Yes I think I was able to solve my problem in the end. I will find the code I used and post here, if not I'll confirm I was never able to solve the problem...

dr_ajt

rfsky
Discoverer

Ok. Thanks. Much appreciated.

rfsky
Discoverer

Thanks Adam. Very useful, so appreciate your input.

View Entire Topic
dr_ajt
Participant

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.
jb4444
Explorer
0 Kudos
Thank you for sharing your solution; it was a tremendous help. I was dealing with the exact same situation, needing to add profit center to my Concur export.