Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Save custom fields in BAPI_PR_CREATE

Former Member
0 Likes
4,192

Dear experts,

I have two custom fields in EBAN and I want to create one PR by BAPI_PR_CREATE.

I pass the values in structure EXTENSIONIN but the custom fields don't save.


    CLEAR: wa_extensionin, wa_mereqitem.
    wa_mereqitem-preq_item = w_preq_item.
    wa_mereqitem-zossd_banfn = w_banfn.
    wa_mereqitem-zossd_bnfpo = w_bnfpo.
    wa_extensionin-structure = 'BAPI_TE_MEREQITEM'.
    wa_extensionin+30(960) = wa_mereqitem.
    APPEND wa_extensionin TO gt_extensionin.

    CLEAR: wa_extensionin, wa_mereqitemx.
    wa_mereqitemx-preq_item = w_preq_item.
    wa_mereqitemx-zossd_banfn = 'X'.
    wa_mereqitemx-zossd_bnfpo = 'X'.
    wa_extensionin-structure = 'BAPI_TE_MEREQITEMX'.
    wa_extensionin+30(960) = wa_mereqitemx.
    APPEND wa_extensionin TO gt_extensionin.

  CALL FUNCTION 'BAPI_PR_CREATE'
    EXPORTING
      prheader    = wa_header
      prheaderx   = wa_headerx
    IMPORTING
      number      = w_number
    TABLES
      return      = gt_return
      pritem      = gt_item
      pritemx     = gt_itemx
      praccount   = gt_account
      praccountx  = gt_accountx
      extensionin = gt_extensionin.

Can someone help me?

8 REPLIES 8
Read only

Former Member
0 Likes
2,245

Solved problem implementing the ME_BAPI_PR_CUST badi, using the method MAP2I_EXTENSIONIN and putting following code:

ch_struc = im_container.

The customer fields have to be in the append structure CI_EBANDB for the table EBAN.

Read only

0 Likes
2,245

Hi Alvaro,

I did the same thing which you had done inside the BADI, but my BAPI isnt calling the imlplentation extension. Did you encounter the same issue.

Rgds

Raj

Read only

0 Likes
2,245

Did you add the customers fields into the append structure CI_EBANDB for the table EBAN???

Read only

0 Likes
2,245

Hi,

Yes i did add the fields to the table. Now it is going inside the code but still not populating. Do I need to change the below code ??

ch_struc = im_container.

Rgds

Raj

Read only

0 Likes
2,245

Hi Alavaro,

To add to that message, I debugged and I could see the custom value getting passed but gets lost somewhere in between. I am wondering where. Should I need to code anywhere else too ?

Regards

Raj

Read only

0 Likes
2,245

Hi.

I didn't do any more.

Did you add the customers field's of type BAPIUPDATE into the append structure BAPI_TE_MEREQITEMX?

Read only

0 Likes
2,245

Yup thanks Alavaro..I got it. Some tinkering here and there

Rgds

Raj

Read only

0 Likes
2,245

Hi Alvaro Achin,

*How to implement ME_BAPI_PR_CUST badi, using the method MAP2I_EXTENSIONIN?..Can you please send step by step screen shot to implement this scenario?..we are in ECC 6.0.Your help much appreciated...

Regards

Dinesh. A