Skip to Content
avatar image
Former Member

implementation of BADI BBP_ECS_PO_OUT_BADI in SRM. and BBP_PO_INBOUND_BADI

Hi All,

Facing a problem in BADI can u please help me out...

I am implementing sourcing dashboard.

I am facing problem while implementing the badi BBP_ECS_PO_OUT_BADI in SRM. and BBP_PO_INBOUND_BADI in R3.

i have written following code in BBP_ECS_PO_OUT_BADI in SRM

method IF_EX_BBP_ECS_PO_OUT_BADI~BBP_B46B_PO_OUTBOUND.

data : ls_item type BBP_PDS_PO_ITEM_D.

data : w_customer_fields type BBPS_IF_CUSTOMER_FIELDS_PI.

move 'POITEM' to w_customer_fields-refobject.

move 'CATALOGID' to w_customer_fields-fieldname.

move ls_item-catalogid to w_customer_fields-container.

append w_customer_fields to ct_bapi_customer_fields.

endmethod.

i have created field zsrmcatalogid field in R3 in EKPO table.and i am now implementing the Badi in R3 for BBP_PO_INBOUND_BADI .....in extended classic scenario.

i have written following code in R3 BADI

method IF_EX_BBP_PO_INBOUND_BADI~BBP_MAP_BEFORE_BAPI.

data : wa_customer_fields type bbps_if_customer_fields,

wa_bapi_te_mepoitem type bapi_te_mepoitem,

wa_bapi_te_mepoitemx type bapi_te_mepoitemx,

wa_extensionin type bapiparex.

data : txt_960(960) type c.

read table bbp_customer_fields into wa_customer_fields with key

refobject = 'POITEM' fieldname = 'CATALOGID'.

if sy-subrc eq 0.

move wa_customer_fields-container TO

wa_bapi_te_mepoitem-zsrmcatalogid.

wa_bapi_te_mepoitemx-zsrmcatalogid = 'X'.

endif.

clear txt_960.

clear wa_extensionin.

write wa_bapi_te_mepoitem to txt_960 left-justified.

wa_extensionin-structure = 'BAPI_TE_MEPOITEM'.

wa_extensionin-valuepart1 = txt_960(240).

wa_extensionin-valuepart2 = txt_960+240(240).

wa_extensionin-valuepart3 = txt_960+480(240).

wa_extensionin-valuepart4 = txt_960+720(240).

append wa_extensionin to bapi_extensionin.

clear txt_960.

clear wa_extensionin.

write wa_bapi_te_mepoitemx to txt_960 left-justified.

wa_extensionin-structure = 'BAPI_TE_MEPOITEMX'.

wa_extensionin-valuepart1 = txt_960(240).

wa_extensionin-valuepart2 = txt_960+240(240).

wa_extensionin-valuepart3 = txt_960+480(240).

wa_extensionin-valuepart4 = txt_960+720(240).

append wa_extensionin to bapi_extensionin.

endmethod.

But its not working...

The PO details are not passed from SRM to R3.......

Can anybody help me regarding how to debug the BADI in R3.

Thanks in Advance...

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    May 23, 2006 at 09:09 AM

    Hello Ravi,

    to debug the BADI on R/3, you must use a dialog user in your R/3 RFC destination:

    - assign your user to existing RFC destination or create a new one with your user in logon parameters

    - you must start from SRM ECS PO

    - execute BBP_PD_PO_TRANSFER_EXEC with the GUID of the PO

    - set a break point just before calling R/3 (SPOOL_DPO_TRANSFER --> META_DPO_TRANSFER --> etc... --> B**_DPO_TRANSFER), i.e. just before calling BBP_PO_SAVE in R/3

    - change the RFC destination to new one if needed

    - continue the debug in R/3 with F5

    Rgds

    Christophe

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    May 23, 2006 at 11:11 AM

    Hi Ravi,

    I never tried those BADIs to pass CUF fields.

    But here an attempt to understand it.

    First, have you maintained the mandatory R/3 CUF mapping table BBP_CUFMAP ?

    Your SRM BADI is not correct, because you don't populate enough data.

    There is a particular logic for ct_bapi_customer_fields (look at R/3 mapping in LBBP_BAPI_POF04, called before the R/3 BADI).

    Following fields must be populated:

    - REFOBJECT: ok with POITEM

    - FIELDNAME: dummy name (CATALOGID) or real R/3 field (zsrmcatalogid)? --> used in mapping table BBP_CUFMAP to get the R/3 field

    - REFFIELD1: missing: put PO_ITEM ?

    - REFVAL1 : missing: put the PO item number (numc 5)

    - CONTAINER: ok with final value we want to pass

    I think that if SRM BADI and the R/3 mapping table are populated correctly, the fields are transfered to R/3 PO item without additionnal coding on R/3 BADI side.

    The R/3 BADI goal is not to create BAPI_EXTENSIONIN. This is done by the Form MAPPING_CUSTOMER_FIELDS of include LBBP_BAPI_POF04.

    Later on, the custom fields of BAPI_EXTENSIONIN are transfered automatically to EKPO fields via a move-corresponding.

    In the way you coded R/3 BADI, you by-pass the Form MAPPING_CUSTOMER_FIELDS, to populate the BAPI_EXTENSIONIN by yourself.

    This could work like this, but you missed one info: the PO item number (missing in SRM BADI) !!!

    For debugging, what additional details do yo need ?

    Rgds

    Christophe

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi christophe,

      In REFFIELD1 u told to give as po_item..it is giving error ?

      and for REFVAL1 we pass 00001 directly

      i.e, ...REFVAL1 = '0001'.

      ...REFFIELD1 = PO_ITEM.

      IS it true?

      it is giving error.

      Thanks in advance