Application Development 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: 

BAPI_PO_CREATE1 user fields not saving on EKPO

Former Member
0 Kudos

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

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

4 REPLIES 4

former_member181962
Active Contributor
0 Kudos

Hi JOn,

PLease refer the code in the FM :IDOC_INPUT_PORDCR1

Regards,

Ravi

Former Member
0 Kudos

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 Kudos

Problem solved, Thanks.

I hadn't extended CI_EKPODBX

Jon

0 Kudos

Hi Jon,

How did you solve it ?

Kind regards,

Yann