05-16-2006 5:33 PM
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
05-16-2006 8:28 PM
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.
05-16-2006 5:36 PM
Hi JOn,
PLease refer the code in the FM :IDOC_INPUT_PORDCR1
Regards,
Ravi
05-16-2006 8:28 PM
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.
05-17-2006 10:46 AM
04-20-2007 11:32 AM