‎2008 Jun 02 4:12 PM
hi all,
i need to create PO using BAPI_PO_CREATE1. But the problem is, in me21n we added user defined screen using BADI in the header and made some fields in that screen as mandatory. When i try to test the BAPI to create PO it is not creating - since in BAPI, it has no provision to get those newly added fields. So please suggest me how to accommodate those fields in to BAPI and create PO.
Thanks in advance,
aswin.
‎2008 Jun 02 4:21 PM
Hi,
You need to extend your BAPI using the extension parameters and write your code
Regards,
siva chalasani .
‎2008 Jun 02 4:21 PM
Hi,
You need to extend your BAPI using the extension parameters and write your code
Regards,
siva chalasani .
‎2008 Jun 02 4:57 PM
‎2008 Jun 02 5:22 PM
Check out the documentation for the BAPI and click on the following Import structures for more details.
EXTENSIONIN
EXTENSIONOUT
~~~~~~~~~~~~~~~~~~~~~~~~
Customer's Own Fields (Import Parameters)
This table allows you to add to the import parameters of the BAPI without modifying it.
The customer enhancement SAPL2012 allows you to add to or modify the PurchaseOrder.Change and PurchaseOrder.CreateFromData1BAPIs by:
Adapting existing SAP database tables
Adding customer-specific fields to SAP tables
Including existing database fields
Including additional customer-specific database tables
The following BAPI Table Extensions are available:
BAPI_TE_MEPOHEADER
BAPI_TE_MEPOHEADERX
BAPI_TE_MEPOITEM
BAPI_TE_MEPOITEMX
BAPI_TE_MEPOACCOUNTING
BAPI_TE_MEPOACCOUNTINGX
‎2008 Jun 02 5:24 PM
You need to use the EXTENSIONIN parameter of the BAPI. The BAPI help is not that helpful here but there is other information around if you search for it. The following might help you get started.
* Extensions ie values for the extra fields that have
* been added to EKKO as a custom include.
* BAPI customer extensions
DATA:
gt_extn TYPE TABLE OF bapiparex,
gw_extn TYPE bapiparex,
gw_data TYPE bapi_te_mepoheader,
gw_datax TYPE bapi_te_mepoheaderx,
gt_extns TYPE TABLE OF bapiparex,
gw_extns TYPE bapiparex.
gw_data-po_number = w_ponum.
gw_data-zzattachment = gw_header-attachment_flag.
gw_extn-structure = 'BAPI_TE_MEPOHEADER'.
gw_extn-valuepart1 = gw_data.
APPEND gw_extn TO gt_extn.
gw_datax-po_number = w_ponum.
gw_datax-zzattachment = 'X'.
gw_extn-structure = 'BAPI_TE_MEPOHEADERX'.
gw_extn-valuepart1 = gw_datax.
APPEND gw_extn TO gt_extn.
‎2008 Jun 03 8:29 AM
Thanks a lot Elango Masilamany and Christine Evans. this helps me a lot to solve the problem..
aswin.