Tuesday, April 29, 2025

DeCouple Framework - ABP HR - Terminating Employee

 Terminating an employee is considering IT0 and IT 1
Hence inserting an entry in both infotype (while IT 0 will have inactive status and Temination Action type and Reason), works

DATA li_iread TYPE REF TO if_hrpa_plain_infotype_access.

cl_hrpa_masterdata_factory=>get_plain_infotype_access(

  IMPORTING plain_infotype_access = li_iread     ).

" * Message handler

DATA lo_mhand TYPE REF TO if_hrpa_message_handler.

DATA lo_mlist TYPE REF TO cl_hrpa_message_list.

FREE lo_mlist.


CREATE OBJECT lo_mlist.

lo_mhand = lo_mlist.


DATA: ls_p0000 TYPE p0000, s_p0001 TYPE p0001.

li_iread->read_single(

  EXPORTING tclas           = cl_hrpa_tclas=>tclas_employee

            pernr           = '00050002'

            infty           = '0000'

            subty           = ''

            objps           = '*' "lc_objps_all

            sprps           = if_hrpa_read_infotype=>unlocked

            begda           = '19000101'

            endda           = '99991231'

            mode            = if_hrpa_read_infotype=>last_intersecting_record

            no_auth_check   = if_hrpa_boole_d=>true

            message_handler = lo_mhand

  IMPORTING pnnnn           = ls_p0000  ).


ls_p0000-begda = sy-datum.

ls_p0000-massn = '06'.

ls_p0000-massg = '06'.

ls_p0000-stat2 = '0'.

li_iread->insert( EXPORTING tclas = cl_hrpa_tclas=>tclas_employee

                            no_auth_check   = if_hrpa_boole_d=>true

                            message_handler = lo_mhand

                  CHANGING  pnnnn           = ls_p0000    ).

li_iread->read_single(

  EXPORTING tclas           = cl_hrpa_tclas=>tclas_employee

            pernr           = '00050002'

            infty           = '0001'

            subty           = ''

            objps           = '*' "lc_objps_all

            sprps           = if_hrpa_read_infotype=>unlocked

            begda           = '19000101'

            endda           = '99991231'

            mode            = if_hrpa_read_infotype=>last_intersecting_record

            no_auth_check   = if_hrpa_boole_d=>true

            message_handler = lo_mhand

  IMPORTING pnnnn           = ls_p0001  ).

ls_p0001-begda = sy-datum.

li_iread->insert( EXPORTING tclas = cl_hrpa_tclas=>tclas_employee

                            no_auth_check   = if_hrpa_boole_d=>true

                            message_handler = lo_mhand

                  CHANGING  pnnnn           = ls_p0001    ).

li_iread->if_hrpa_buffer_control~flush( no_commit = abap_false ).

DATA lt_mlist TYPE hrpad_message_tab.

lo_mlist->get_message_list(

  IMPORTING messages = lt_mlist ).

Monday, April 28, 2025

DeCouple Framework - ABAP HR - OOPS - Insert/update

 Call the Utility method

          CALL METHOD ZCL_DATA_LOAD_UTILITY=>infotype_operation

            EXPORTING

              ip_infty      = <wa>-infty

              ip_action     = ls_taskdata-importing-gv_action

              no_auth_check = abap_true

              iv_test_run   = ls_taskdata-importing-cb_test

              iv_no_retro   = ls_taskdata-importing-gv_noretro

            IMPORTING

*             ev_ok         =

              ev_return     = lv_return

            CHANGING

              pnnnn         = <wa>.

------------------------------------------------------------------------------------------------------

SIGNATURE:

IP_INFTY TYPE INFTY OPTIONAL Infotype

IP_ACTION TYPE PSPAR-ACTIO Infotype operation

NO_AUTH_CHECK TYPE BOOLE_D OPTIONAL Data element for domain BOOLE: TRUE (='X') and FALSE (=' ')

IV_TEST_RUN TYPE XFELD Checkbox

IV_NO_RETRO TYPE BOOLE_D OPTIONAL Data element for domain BOOLE: TRUE (='X') and FALSE (=' ')

PRELP TYPE PRELP_TAB OPTIONAL Table of Generic Infotypes

EV_OK TYPE XFELD Checkbox

EV_RETURN TYPE BAPIRET2 Return Parameter

PNNNN TYPE ANY OPTIONAL

PREF TYPE PREF OPTIONAL Assignment Values for HR Objects

------------------------------------------------------------------------------------------------------

    METHOD infotype_operation.

      DATA: lo_hrpa_infotype_access TYPE REF TO if_hrpa_plain_infotype_access,

            lo_ref_wdata            TYPE REF TO data,

            lo_message_handler      TYPE REF TO cl_hrpa_message_list,

            lo_magic_cookie         TYPE REF TO if_hrpa_token,

            lo_ex                   TYPE REF TO cx_root,

            lr_pnnnn_t              TYPE REF TO data.


      DATA: lv_is_ok       TYPE boole_d,

            lv_error_text  TYPE string,

            lv_message     TYPE bapi_msg,

            lv_return_new  TYPE bapiret2,

            lv_ok          TYPE xfeld,

            lv_tabname     TYPE tabname,

            lv_pernr       TYPE pernr_d,

            lt_return      TYPE hrpad_message_tab,

            ls_return      TYPE hrpad_message,

            ls_update_mode TYPE hrpad_update_mode,

            ls_pskey       TYPE pskey,

            ls_prelp       TYPE prelp,

            lt_prelp       TYPE prelp_tab.


      CONSTANTS: lc_tclas_a  TYPE tclas VALUE 'A'.

      FIELD-SYMBOLS: <l_field> TYPE any.



      ls_update_mode-no_ale           = abap_true.

      ls_update_mode-no_workflow      = abap_true.

      IF iv_no_retro IS SUPPLIED.

        ls_update_mode-no_retroactivity = iv_no_retro.

      ENDIF.

      CREATE OBJECT lo_message_handler.


      CLEAR: ls_return, lv_return_new, ev_ok, lv_pernr, ls_pskey, ls_prelp,lt_prelp[].


      IF ip_infty IS NOT INITIAL.

        CONCATENATE 'P' ip_infty INTO lv_tabname.

        CREATE DATA  lo_ref_wdata  TYPE (lv_tabname).

        ASSIGN lo_ref_wdata->* TO FIELD-SYMBOL(<fs_pnnnn>).

        <fs_pnnnn> = pnnnn.

        cl_hr_pnnnn_type_cast=>pnnnn_to_prelp( EXPORTING pnnnn = <fs_pnnnn> IMPORTING prelp = ls_prelp ).

        APPEND ls_prelp TO lt_prelp.

        CLEAR ls_prelp.

        UNASSIGN <fs_pnnnn>.

      ENDIF.


      IF prelp IS NOT INITIAL.

        APPEND LINES OF prelp TO lt_prelp.

      ENDIF.


      LOOP AT lt_prelp INTO ls_prelp.

**********************************************************

        "Create Infotype STructure

**********************************************************

        CONCATENATE 'P' ls_prelp-infty INTO lv_tabname.

        CREATE DATA  lo_ref_wdata  TYPE (lv_tabname).

        ASSIGN lo_ref_wdata->* TO <fs_pnnnn>.

        cl_hr_pnnnn_type_cast=>prelp_to_pnnnn( EXPORTING prelp = ls_prelp IMPORTING pnnnn = <fs_pnnnn> ).

        ASSIGN COMPONENT 'PERNR' OF STRUCTURE <fs_pnnnn> TO <l_field>.

        IF <l_field> IS ASSIGNED .

          lv_pernr = <l_field>.

        ENDIF.

        MOVE-CORRESPONDING <fs_pnnnn> TO ls_pskey.


        CALL METHOD cl_hrpa_masterdata_enq_deq=>enqueue_by_pernr

          EXPORTING

            tclas           = lc_tclas_a

            pernr           = lv_pernr

            message_handler = lo_message_handler

          IMPORTING

            is_ok           = lv_ok.

        IF lv_ok IS NOT INITIAL.

          cl_hrpa_masterdata_factory=>get_plain_infotype_access( IMPORTING plain_infotype_access = lo_hrpa_infotype_access ).

          TRY.

              lo_hrpa_infotype_access->if_hrpa_buffer_control~start_trial( IMPORTING magic_cookie = lo_magic_cookie ).

              CASE ip_action.

                WHEN 'INS'.

                  lo_hrpa_infotype_access->insert(

                      EXPORTING

                        tclas           = cl_hrpa_tclas=>tclas_employee

                        update_mode     = ls_update_mode

                        no_auth_check   = abap_true

                        message_handler = lo_message_handler

                      IMPORTING

                        is_ok           = lv_is_ok

                      CHANGING

                        pnnnn           = <fs_pnnnn>

                        pref            =  pref ).

                WHEN 'MOD'.

                  lo_hrpa_infotype_access->modify(

                     EXPORTING

                       tclas           = cl_hrpa_tclas=>tclas_employee

                       old_pskey       = ls_pskey

                       update_mode     = ls_update_mode

                       no_auth_check   = abap_true

                       message_handler = lo_message_handler

                     IMPORTING

                       is_ok           = lv_is_ok

                     CHANGING

                       pnnnn           = <fs_pnnnn> ).

                WHEN 'DEL'.

                  lo_hrpa_infotype_access->delete(

                      EXPORTING

                        tclas           = cl_hrpa_tclas=>tclas_employee

                        pskey           = ls_pskey

                        update_mode     = ls_update_mode

                        no_auth_check   = abap_true

                        message_handler = lo_message_handler

                      IMPORTING

                        is_ok           = lv_is_ok ).

                  TRY.

                      CALL METHOD lo_message_handler->get_error_list

                        IMPORTING

                          messages = lt_return.

                    CATCH cx_hrpa_violated_assertion.

                  ENDTRY.


                  IF lt_return IS NOT INITIAL.

                    lv_is_ok = abap_false.

                    REFRESH: lt_return[].

                  ENDIF.

                WHEN OTHERS.

              ENDCASE.


              ev_ok = lv_is_ok.

              IF lv_is_ok IS INITIAL.   "error handling

                EXIT.

              ENDIF.


            CATCH cx_root INTO lo_ex.

              lv_error_text = lo_ex->get_text( ).

              lv_message = |Exception { lv_error_text }|.

              ev_return-type =  'E'.

              ev_return-message = lv_message.

              TRY.

                  lo_hrpa_infotype_access->if_hrpa_buffer_control~discard_trial( magic_cookie = lo_magic_cookie ).

                CATCH cx_root INTO lo_ex.

              ENDTRY.

          ENDTRY.

        ELSE.

          EXIT.

        ENDIF.

        CLEAR ls_prelp.

      ENDLOOP.

      CALL METHOD cl_hrpa_masterdata_enq_deq=>dequeue_by_pernr

        EXPORTING

          tclas = lc_tclas_a

          pernr = lv_pernr.


      IF lv_is_ok EQ abap_false.

        TRY.

            CALL METHOD lo_message_handler->get_error_list

              IMPORTING

                messages = lt_return.

          CATCH cx_hrpa_violated_assertion.

        ENDTRY.

        IF lt_return IS NOT INITIAL.

          READ TABLE lt_return INTO ls_return WITH KEY msgty = gc_error.

          IF sy-subrc EQ 0.

            CALL FUNCTION 'BALW_BAPIRETURN_GET2'

              EXPORTING

                type   = ls_return-msgty

                cl     = ls_return-msgid

                number = ls_return-msgno

                par1   = ls_return-msgv1

                par2   = ls_return-msgv2

                par3   = ls_return-msgv3

                par4   = ls_return-msgv4

              IMPORTING

                return = lv_return_new.


            IF lv_return_new IS NOT INITIAL.

              ev_return-type    = gc_error.

              ev_return-message = lv_return_new-message.

            ENDIF.

          ENDIF.

        ENDIF.

      ELSE.

*******no commit handling

*     Save database when Live run

        IF iv_test_run EQ abap_false.

          lo_hrpa_infotype_access->if_hrpa_buffer_control~approve_trial( magic_cookie = lo_magic_cookie ).

          lo_hrpa_infotype_access->if_hrpa_buffer_control~flush( no_commit = abap_false ).

          ev_return-type    = gc_success.

          ev_return-message = TEXT-e04.

        ELSE.

          ev_return-type    = gc_success.

          ev_return-message = TEXT-e03.

          lo_hrpa_infotype_access->if_hrpa_buffer_control~discard_trial( magic_cookie = lo_magic_cookie ).

        ENDIF.

      ENDIF.

      TRY.

          lo_hrpa_infotype_access->if_hrpa_buffer_control~initialize( ).

        CATCH cx_root.

      ENDTRY.

  ENDMETHOD.

Friday, April 25, 2025

DeCouple Framework - ABAP HR - OOPS - Employee Data Hire (New)

Hire and Employee Data using OOABAP HR in SAP HCM (Decouple Framework) 

REPORT ztest_123.

DATA li_iread TYPE REF TO if_hrpa_plain_infotype_access.

cl_hrpa_masterdata_factory=>get_plain_infotype_access(

  IMPORTING plain_infotype_access = li_iread     ).

" * Message handler

DATA lo_mhand TYPE REF TO if_hrpa_message_handler.

DATA lo_mlist TYPE REF TO cl_hrpa_message_list.

FREE lo_mlist.

CREATE OBJECT lo_mlist.

lo_mhand = lo_mlist.

DATA: ls_p0000             TYPE p0000,

      ls_p0001             TYPE p0001,

      ls_p0002             TYPE p0002,

      ls_p0003             TYPE p0003,

      ls_pnnnn_00          TYPE prelp,

      ls_pnnnn_01          TYPE prelp,

      ls_pnnnn_02          TYPE prelp,

      lt_pnnnn             TYPE prelp_tab,


      lt_return_tab        TYPE  hrpad_return_tab,

      lt_bapipakey_tab     TYPE  hrpad_bapipakey_tab,

      lv_is_ok             TYPE  boole_d,

      lt_modified_keys_tab TYPE  hrpad_pskey_tab,

      ls_bapipakey         TYPE bapipakey.


CLASS lcl_test123 DEFINITION.

  PUBLIC SECTION.

    METHODS:

      build_p0000 EXPORTING ex_pnnnn TYPE hrift_tt_data,

      build_p0001 EXPORTING ex_pnnnn TYPE hrift_tt_data,

      build_p0002 EXPORTING ex_pnnnn TYPE hrift_tt_data.

ENDCLASS.


CLASS lcl_test123 IMPLEMENTATION.

  METHOD build_p0000.

    DATA: ls_p0001 TYPE p0000,

          ls_pnnnn TYPE prelp.

    DATA: lt_p0000 TYPE STANDARD TABLE OF p0000 INITIAL SIZE 0.

    ls_p0000-pernr = '00050002'.

    ls_p0000-endda = '99991231'.

    ls_p0000-begda = sy-datum.

    ls_p0000-infty = '0000'.

    ls_p0000-massn = '01'.

    ls_p0000-massg = '01'.

    ls_p0000-stat2 = '3'.

    CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp

      EXPORTING

        pnnnn = ls_p0000

      IMPORTING

        prelp = ls_pnnnn.

    APPEND ls_pnnnn TO ex_pnnnn.

  ENDMETHOD.

  METHOD build_p0001.

    DATA: ls_p0001 TYPE p0001,

          ls_pnnnn TYPE prelp.

    DATA: lt_p0001 TYPE STANDARD TABLE OF p0001 INITIAL SIZE 0.

    ls_p0001-pernr = '00050002'.

    ls_p0001-endda = '99991231'.

    ls_p0001-begda = sy-datum.

    ls_p0001-infty = '0001'.

    ls_p0001-bukrs = '1000' ."'4181'.

    ls_p0001-werks = '3010'. "ls_p0001-vdsk1 = 'AR01'.

    ls_p0001-btrtl = '1001'. "'0001'.

    ls_p0001-persg = '1'.

    ls_p0001-persk = '01'. "'A0'.

    ls_p0001-abkrs = '01'. "'99'.

    ls_p0001-orgeh = '00000000'.

    ls_p0001-plans = '99999999'.

    ls_p0001-stell = '00000000'.

    CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp

      EXPORTING

        pnnnn = ls_p0001

      IMPORTING

        prelp = ls_pnnnn.

    APPEND ls_pnnnn TO ex_pnnnn.

  ENDMETHOD.


  METHOD build_p0002.

    DATA: ls_p0002 TYPE p0002,

          ls_pnnnn TYPE prelp.

    DATA: lt_p0002 TYPE STANDARD TABLE OF p0001 INITIAL SIZE 0.

    ls_p0002-pernr = '00050002'.

    ls_p0002-endda = '99991231'.

    ls_p0002-begda = '19850101'.

    ls_p0002-infty = '0002'.

    ls_p0002-vorna = 'Samchand'.

    ls_p0002-nachn = 'Browns'.

    ls_p0002-begda = ls_p0002-gbdat = '19850101'.

    ls_p0002-natio = 'AR'.

    ls_p0002-sprsl = 'EN'.

    ls_p0002-gesch = '1'.

    ls_p0002-perid = '999999999'.

    CALL METHOD cl_hr_pnnnn_type_cast=>pnnnn_to_prelp

      EXPORTING

        pnnnn = ls_p0002

      IMPORTING

        prelp = ls_pnnnn.

    APPEND ls_pnnnn TO ex_pnnnn.

  ENDMETHOD.


ENDCLASS.


START-OF-SELECTION.

  DATA: lo_test123 TYPE REF TO lcl_test123.

  CREATE OBJECT lo_test123.

  lo_test123->build_p0000( IMPORTING ex_pnnnn = lt_pnnnn ).

  lo_test123->build_p0001( IMPORTING ex_pnnnn = lt_pnnnn ).

  lo_test123->build_p0002( IMPORTING ex_pnnnn = lt_pnnnn ).


  TRY.

      CALL FUNCTION 'HR_PAD_HIRE_EMPLOYEE'

        EXPORTING

          employeenumber    = '00050002'

*         REFERENCEPERNR    =

          hiringdate        = sy-datum

          actiontype        = '01'

          reasonforaction   = '01'

          pnnnn_tab         = lt_pnnnn

*         PREF_TAB          =

          nocommit          = space

*         IT_HIRE_FIELDNAMES       =

        IMPORTING

          return_tab        = lt_return_tab

          bapipakey_tab     = lt_bapipakey_tab

          is_ok             = lv_is_ok

          modified_keys_tab = lt_modified_keys_tab.

    CATCH cx_root.

  ENDTRY.


      COMMIT WORK.

Thursday, April 24, 2025

DeCouple Framework - ABAP HR - OOPS - Employee Data Creation Update

Create (insert) and Modify(Update) Employee Data using OOABAP HR in SAP HCM (Decouple Framework) 

Logic

 Read the SAP ECC/S4 Data (table) for the employee

If no record found then trigger - INSERT method 
(this will create the record that is coming from WD)

 Else, if record is found, check the field wise validation

Example (for Address): 
workday-postal_code = Existing_S4-postal_code
workday-city = Existing_S4-City
workday-Country = Existing S4-Country

 

If all fields are same, then no need to modify
If any data is changed then trigger MODIFY method


DATA li_iread TYPE REF TO if_hrpa_plain_infotype_access.
cl_hrpa_masterdata_factory=>get_plain_infotype_access(
  IMPORTING plain_infotype_access = li_iread     ).
" * Message handler
DATA lo_mhand TYPE REF TO if_hrpa_message_handler.
DATA lo_mlist TYPE REF TO cl_hrpa_message_list.
FREE lo_mlist.

CREATE OBJECT lo_mlist.
lo_mhand = lo_mlist.

DATA ls_p0006 TYPE p0006.
li_iread->read_single(
  EXPORTING tclas           = cl_hrpa_tclas=>tclas_employee
            pernr           = '00000100'
            infty           = '0006'
            subty           = '1'
            objps           = '*' "lc_objps_all
            sprps           = if_hrpa_read_infotype=>unlocked
            begda           = '19000101'
            endda           = '99991231'
            mode            = if_hrpa_read_infotype=>last_intersecting_record
            no_auth_check   = if_hrpa_boole_d=>true
            message_handler = lo_mhand
  IMPORTING pnnnn           = ls_p0006  ).

li_iread->insert( EXPORTING tclas = cl_hrpa_tclas=>tclas_employee
                            no_auth_check   = if_hrpa_boole_d=>true
                            message_handler = lo_mhand
                  CHANGING  pnnnn           = ls_p0006    ).

" * Modify record

DATA ls_pskey TYPE pskey.

MOVE-CORRESPONDING ls_p0006 TO ls_pskey.
li_iread->modify( EXPORTING tclas           = cl_hrpa_tclas=>tclas_employee
            old_pskey       = ls_pskey
            no_auth_check   = if_hrpa_boole_d=>true
            message_handler = lo_mhand
  CHANGING  pnnnn           = ls_p0006    ).

li_iread->if_hrpa_buffer_control~flush( no_commit = abap_false ).
DATA lt_mlist TYPE hrpad_message_tab.
lo_mlist->get_message_list(
  IMPORTING messages = lt_mlist

Monday, February 03, 2025

SAP BIB: Business Integration Builder

 Courtesy: LINK1

SAP Cost center Integration (S4/ECC to EC)

 The steps for Cost center integration from S4/ECC to EC

1) Check Segment details: ODTF_CCTR01

Transaction = WE30 à  ODTF_CCTR01à Display

Double click in the E101ODTF_S_COST_CENTER_NAME > Segment editor

In the below screen you can see the lengths of the fields. This is the standard configuration and the same length should be kept in the SF side (Admin center > Configure Object Definitions > Cost Center > config is reflected in the FOCostCenter OData entity)

This part is not required to change, you can keep the standard values, but in case your company need to change length or add fields, please return back here.

2) Create RFC Connections (SM59)

Transaction SM59 à Connection type G à Create:

Host is the CPI tenant URL of the step 1. One common mistake is to add https:// here (this is not required).

Port is BLANK here

Path Prefix is the address defined the “Sender” tab configuration of your CPI.

Under Logon & Security, we typed the CPI username and password and we also selected the SSL Certificate Active and SSL Client (Standard).

We did not add the CPI certificates under STRUST this time, because this was already done inside the BIB implementation (step 3 of this other 
blog posting).

Important. In this blog posting, we did not enable the Change pointers, because we will manually sync Cost centers. In one customer real life scenario, please enable the Change pointers according the chapter 6.2 Enabling

3) Create Distribution model (SALE)

Transaction SALE à Basic Settings à Logical Systems à  Define Logical Systems à  created the S4ACLNT200 and CPI_BR Logical Systems. These names are the suggestions from our test system. In your side, you can create something according your landscape like PP1CLNT700 and CPI_US, etc.

Create Maintain Distribution Model and Distribute Views (SALE)

Transaction code: SALE

à Modelling and Implementing Business Processes

à  Maintain Distribution Model and Distribute Views

Create a New Model View

Switch to the edit mode à Create Model view with the technical name EC_CC_REPL

Create a new Message Type (under the Model View)

Add Message Type ODTF_CCTR with the Model view EC_CC_REPL

Created Sender and Receiver:

Sender: CLNT120

Receiver: SCI

4) Create PORT in IDOC Processing (WE21)

Transaction WE21 à XML HTTP à Create :

Port: CC_CPI

Description: Replicate S4 Cost center to EC

RFC Destination: S4_CC_to_EC (from Transaction SM59)
Content Type: Application/x-sap.idoc
HTTP Version: 1.0

SOAP Protocol: Enabled

5) Create Partner Profile (WE21)

Transaction WE20 à Partner Type LS à Create:

Partner Type LS: HSSCI (available from SALE transaction)

Added Outbound Message Type: Clicked in the plus button of the Outbound tab.

Included the message Type ODTF-CCTR
Receiver Port CC_CPI
Basic Type ODFT_CCTR01

Completed the settings like above and Saved.

6) Now let’s test.

Transaction SE38 > run the report named ODTF_REPL_CC.
For this sample purpose, we selected just one cost center (code "REM") and we flagged some options according below.
Logical System (value previously created)
Receiver Partner No. (value previously created)
Send IDOC.

After you execute, you can see the ID of the IDOC created.

This internal system is not sending IDOCs automatically because like I explained, the change pointers were not configured.

To push this to CPI and SuccessFactors, please use the transaction:

Access the transaction BD87
à type the IDOC ID and run.

7) Badi to be implemented: ODTF_CO_REPL_IDOC_COST_CENTERS

Badi will help for mapping, implement the badi with following tech details:

Using Badi, please find tech details:

Badi name: ODTF_CO_REPL_IDOC_COST_CENTERS

Interface: IF_ODTF_CO_REPL_IDOC_COST_CENT

Method: MODIFY_COST_CENTER_EXTRACTOR

step1: create a custom table Z_MAP_TABLE

step2: in method IF_ODTF_CO_REPL_IDOC_COST_CENT~MODIFY_COST_CENTER_EXTRACTOR()

step3: read the record from importing parameter:  IT_SEL_COST_CENTER[ ]-KOSTL (CC)

step4: create a table for mapping (old CC vs CC); Get the new company code comparing old company code same as system returning in step1

step5: Parameters where data to be saved in code(badi) for each corresponding cost center 

step6: Changing - CS_COST_CENTERS_IDOC->COST_CENTRE[ ]->COST_CENTRE[ ]->REMOTE_EXTERNAL_OBJECT_ID

step7: update the new value to step6

Curtesy: Link1; Link2; PDF; BOOK1; CPI Configuration

Friday, January 31, 2025

Regular Expression/ REGEX in SAP BIB

 The below are the pattern and example of regular expression in SAP BIB