03-02-2009 5:57 PM
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'.
03-02-2009 6:01 PM
03-02-2009 6:08 PM
sorry problem solved i declared gwa_bapimepoitemx TYPE bapimepoitemx, in correctly it was a typo mistake 😞