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: 

Update Z-Field in EKPO with BAPI_PO_CHANGE

Private_Member_19084
Active Contributor
0 Kudos

Hello!

I need to update my field - called ZSERNR - in the table EKPO.

I found the FM BAPI_PO_CHANGE, but I do not know how it works.

I tried it so, but I just get the message (table RETURN), that no datas got changed.

I found some threads but I didn't understand them.

-


DATA: s_item TYPE bapimepoitem,

s_itemx TYPE bapimepoitemx,

i_return TYPE bapiret2 OCCURS 0 WITH HEADER LINE,

i_extension TYPE bapiparex OCCURS 0 WITH HEADER LINE,

s_bapi_te_mepoitem TYPE bapi_te_mepoitem,

s_bapi_te_mepoitemx TYPE bapi_te_mepoitemx.

s_bapi_te_mepoitemx-po_item = ls_data_new-ebelp.

s_bapi_te_mepoitemx-zsernr = 'X'.

s_bapi_te_mepoitem-po_item = ls_data_new-ebelp.

s_bapi_te_mepoitem-zsernr = '123123'.

i_extension-structure = 'BAPI_TE_MEPOITEM'.

i_extension-valuepart1 = s_bapi_te_mepoitem.

APPEND i_extension.

i_extension-structure = 'BAPI_TE_MEPOITEMX'.

i_extension-valuepart1 = s_bapi_te_mepoitemx.

APPEND i_extension.

s_item-po_item = ls_data_new-ebeln.

CALL FUNCTION 'BAPI_PO_CHANGE'

EXPORTING

purchaseorder = ls_data_new-ebeln

TABLES

return = i_return

extensionin = i_extension.

-


I hope somebody can help me.

Thx

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi

After calling this BAPI 'BAPI_PO_CHANGE'

are you doing BAPI_TRANSACTION_COMMIT

Regards

MD

2 REPLIES 2

Former Member
0 Kudos

Hi

After calling this BAPI 'BAPI_PO_CHANGE'

are you doing BAPI_TRANSACTION_COMMIT

Regards

MD

0 Kudos

Thank you for your fast answear

I didn't solved the problem till now, but I know that I can't use this FM in my BADI.

Because the table EKPO is locked at the time I am using the FM.

(BADI also writes into the table EKPO)