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_PO_CHANGE not changing the item data

Former Member
0 Kudos

Hi All,

I am facing an issue with bapi_po_change......though the return message says that the po is changed but then also i am not able to see the changes via me22n/me23n . Below is the code Can anyone please let me know how to resolve this issue .

REPORT ztest111.

DATA: git_po_items TYPE STANDARD TABLE OF bapiekpo ,

git_bapimepoitem TYPE STANDARD TABLE OF bapimepoitem,

git_bapimepoitemx TYPE STANDARD TABLE OF bapimepoitem,

git_bapimepoheader TYPE bapiekkol ,

git_bapimepoheader1 TYPE bapimepoheader ,

gwa_bapimepoitem TYPE bapimepoitem,

gwa_bapimepoitemx TYPE bapimepoitem,

gwa_po_items TYPE bapiekpo.

DATA lv_pur_ord TYPE bapiekko-po_number VALUE '4500000201'.

DATA lv_return TYPE TABLE OF bapiret2 .

CALL FUNCTION 'BAPI_PO_GETDETAIL'

EXPORTING

purchaseorder = lv_pur_ord

items = 'X'

TABLES

po_items = git_po_items.

LOOP AT git_po_items INTO gwa_po_items.

gwa_po_items-short_text = 'Text changed'.

MOVE-CORRESPONDING gwa_po_items TO gwa_bapimepoitem.

gwa_bapimepoitemx-po_item = gwa_po_items-po_item.

gwa_bapimepoitemx-short_text = 'X'.

APPEND gwa_bapimepoitem TO git_bapimepoitem.

APPEND gwa_bapimepoitemx TO git_bapimepoitemx.

ENDLOOP.

CALL FUNCTION 'BAPI_PO_CHANGE'

EXPORTING

purchaseorder = lv_pur_ord

TABLES

return = lv_return

poitem = git_bapimepoitem

poitemx = git_bapimepoitemx.

CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.

2 REPLIES 2

Former Member
0 Kudos

HI,

Check this link

[Sample Abap code on BAPI_PO_CHANGE |http://www.sap-img.com/abap/sample-abap-code-on-bapi-po-change.htm]

[bapi_po_change |]

Edited by: Avinash Kodarapu on Mar 2, 2009 11:33 PM

Former Member
0 Kudos

sorry problem solved i declared gwa_bapimepoitemx TYPE bapimepoitemx, in correctly it was a typo mistake 😞