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

issue in BAPI_PO_CREATE1

Former Member
0 Likes
892

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
846

Hi,

You need to extend your BAPI using the extension parameters and write your code

Regards,

siva chalasani .

5 REPLIES 5
Read only

Former Member
0 Likes
847

Hi,

You need to extend your BAPI using the extension parameters and write your code

Regards,

siva chalasani .

Read only

0 Likes
846

can u explain how to do that

Read only

0 Likes
846

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

Read only

0 Likes
846

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.

Read only

0 Likes
846

Thanks a lot Elango Masilamany and Christine Evans. this helps me a lot to solve the problem..

aswin.