Skip to Content
0
Former Member
Nov 14, 2012 at 10:40 AM

Problem to update the Version details using BAPI_PO_CHANGE.

295 Views

Hi,

I'm facing an issue with using FM:BAPI_PO_CHANGE.

Actually My requirement is ,i need to update the po items with Delete Indicator as 'L' for PO items.when i update these items ,bapi will create a new version and same version would be saved in EREV table.Suppose if Poitems are assignind to Delete indicator as 'L'.these items will be displayed with delete icon(Status) at ME23N T.code.If i undelete the same PO Items(at ME23N) then i click on save button it will ask for updating the version details again.for this i was using the below code.

w_poitem-po_item = w_final-ebelp.

w_poitem-delete_ind = 'L'.
APPEND w_poitem TO t_poitem.

* Itemx table to update
w_poitemx-po_item = w_final-ebelp.
w_poitemx-po_itemx = 'X'.
w_poitemx-delete_ind = 'X'.

APPEND w_poitemx TO t_poitemx.

w_versions-post_date = sy-datum.

w_versions-completed = 'X'.
w_versions-reason = '0009'.
w_versions-description = 'Auto'.
w_versions-req_by = p_werks."w_ekpo-werks.

CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
purchaseorder = v_po
versions = w_versions
TABLES
return = t_bapiret2
poitem = t_poitem
poitemx = t_poitemx
allversions = t_all_versions.

I Can able to update the version for some of the PO's.in few cases only i'm not getting updated the version.Bapi is not throwing any error messages.can any body help me what could be the reason?

Thanks

Satya.N