Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

BAPI_PO_CREATE1 user fields not saving on EKPO

Hi.

I have created a shopping cart on SRM which has created a purchase requisition on R/3 with a couple of custom fields on EBAN.

I then want to create a purchase order from the PR passing across the custom fields. I have added the fields to include CI_EKPODB on EKPO.

I'm calling bapi BAPI_PO_CREATE1 and passing parameter EXTENSIONIN with the relevant field values.

The PO creates but my user fields are blank.

I'm obviously missing the point here so any help will be greatly appreciated.

Jon

Tags:
replied

Jon,

You have to extend CI_EKPODBX with the same fieldnames with type BAPIUPDATE (in SE11), and then while passing the EXTENSIONIN to the bapi, you have to flag those. Like the following:

DATA: wa_extensionin TYPE BAPIPAREX,

wa_BAPIPAREX TYPE BAPIPAREX,

wa_BAPI_TE_MEPOITEM TYPE BAPI_TE_MEPOITEM,

wa_BAPI_TE_MEPOITEMX TYPE BAPI_TE_MEPOITEMX.

wa_BAPI_TE_MEPOITEM-po_item = <PO Line No.>.

wa_BAPI_TE_MEPOITEM-ZZZ_FIELD1 = <z-field value>.

wa_BAPIPAREX-STRUCTURE = 'BAPI_TE_MEPOITEM'.

wa_BAPIPAREX-VALUEPART1 = wa_BAPI_TE_MEPOITEM.

APPEND wa_BAPIPAREX TO extensionin.

wa_BAPI_TE_MEPOITEMX-po_item = <PO Line No.>.

wa_BAPI_TE_MEPOITEMX-ZZZ_FIELD1 = 'X'.

wa_BAPIPAREX-STRUCTURE = 'BAPI_TE_MEPOITEMX'.

wa_BAPIPAREX-VALUEPART1 = wa_BAPI_TE_MEPOITEMX.

APPEND wa_BAPIPAREX TO extensionin.

This will work. Please let me know if it doesnot.

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question