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 extension for BAPI_PO_CREATE1

0 Kudos

I have added 2 fields in EKPO table now i want update the same using bapi BAPI_PO_CREATE1 please guide me with bapi extension or a sample program will be of great help

2 REPLIES 2

former_member196331
Active Contributor
0 Kudos

So information i can give , I did it for Purchase indent, at me51n. Have a look on below code.


DATA : wa_te_meqitem TYPE bapi_te_mereqitem,
wa_te_meqitemx TYPE bapi_te_mereqitemx . " in this structure i was added the custom z fields. so, line level fields , Hope you know in me51 there is header.

wa_te_meqitem-preq_item = '10' "Line number i am passing.

wa_te_meqitem-zz1 = 'value1'.
wa_te_meqitem-zz2 = 'value2.

wa_te_meqitemx-preq_item = 'X'.
wa_te_meqitem-zz1 = 'X'.
wa_te_meqitem-zz2 = 'X.

wa_extensionin-structure = 'BAPI_TE_MEREQITEM'. "In this structure i was added the z fiedls.
wa_extensionin+30 = wa_te_meqitem.
APPEND wa_extensionin TO it_extensionin.

wa_extensionin-structure = 'BAPI_TE_MEREQITEMX'.
wa_extensionin+30 = wa_te_meqitemx.
APPEND wa_extensionin TO it_extensionin.

Passing to Bapi function module. hope You understood.


NTeunckens
Active Contributor

See the following SAP-KBA's on practices, FAQ and Unicode-Issues that might pop up :

  • SAP-KBA 1895028 "Custom fields are not been transferred when using BAPI" : link
  • SAP-KBA 582221 "FAQ: BAPIs for purchase orders" (Question 15) : link
  • SAP-KBA 509898 "BAPI enhancement concept and Unicode : link


A Sample is provided here (.doc) : link or in this SAP-Blog : link