cancel
Showing results for 
Search instead for 
Did you mean: 

implementation of BADI BBP_ECS_PO_OUT_BADI in SRM. and BBP_PO_INBOUND_BADI

Former Member
0 Kudos

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...

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

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

Former Member
0 Kudos

Thank you very much...

I am very confused the way to wrote..because i am new to BADI's.

Can u write exact code to be changed in the SRM and R3 BADIs that i have sent in the first post..

Just make the changes in the code and revert back so that i can copy paste it...

eagerly waiting for ur reply...

Thanks in advance

Former Member
0 Kudos

Please can u send the exact code to pasted ....

i am waiting for your reply...

Former Member
0 Kudos

Hi Ravi,

sorry but I don't have any code to give you.

As already told, I never implemented it.

I just gave you some advices on the way to develop it, after analyzing the R/3 ECS PO inboud function.

So, change your code according to my advices (SRM BADI + R/3 mapping table, and get rid of R/3 BADI), and it should work.

To analyze it by yourself, you should debug the PO transfer, executing BBP_PD_PO_TRANSFER_EXEC from SRM, and continuing into R/3 function.

Rgds

Christophe

Former Member
0 Kudos

Hi christophe,

how to populate

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

so what else i have to do in R3 BADI....

Thanks

Former Member
0 Kudos

Hi Ravi,

in REFVAL1 you must pass the reference to the PO item, that means you must populate with your SRP PO item internal numer: 00001, 00002, 00003...

In R/3 BADI, you can comment all your existing code. If the SRM BADI is correctly populated, the R/3 mapping table also, then the field will be passed to your EKPO-Z field automatically.

Rgds

Christophe

Former Member
0 Kudos

Hi christophe,

can u write code to populating for that i.e, REFFIELD1 and REFVAL1.

how to populate R3 mapping table????

Thanks

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

Hi Christophe,

Thanks for your advice..

But i want to know whether the code i wrote in BADI is really working or not????

Can u give me any advice for code corrections to be made...because it is not working!!!!!

Former Member
0 Kudos

and regarding Debugging can u give me details steps..

Thanks in advance