‎2010 Mar 30 6:12 AM
Hello,
I am trying to update/cancel the Sales order by giving the reason of rejection . I m using bapi_salesorder_change for this .
Before that i need to delete respective po item . I am using BBP_PO_Delete for this . But as a whole this transaction wont be complete .
BBP_PO_Delete will directly set deletion indicatior in po item and then i can change So for reaon of rejection. But in case of error, still po item remaind deleted . I tried to set an indicatior through BAPI_PO_Change and then use bapi_salesorder_change . But its still saying that delete po item first .
what may be the correct approch . i am passing deletion indication as L in bapi_po_change .
how can i set delete indicator to po item and then update so item .
Thanks
‎2010 Mar 30 6:15 AM
Hi
Deletion Indicator should be D not L. Please pass the indicator as D in BAPI_PO_CHANGE and try the sales order change.
This will work fine. Let me know still you face any problem.
‎2010 Mar 30 6:47 AM
still not working . please check my inputs . for pO
POITEM-PO_ITEM = PO_INPUT-PO_ITEM.
POITEM-DELETE_IND = 'D'.
APPEND POITEM.
CLEAR POITEM.
POITEMX-PO_ITEM = PO_INPUT-PO_ITEM.
POITEMX-PO_ITEMX = 'X'.
POITEMX-DELETE_IND = 'X'.
APPEND POITEMX.
CLEAR POITEMX.
For So its , ORDER_ITEM-ITM_NUMBER = SO_INPUT-SALES_ORDER_ITEM_NO.
ORDER_ITEM-REASON_REJ = SO_INPUT-REJ_REASON .
APPEND ORDER_ITEM.
CLEAR ORDER_ITEM.
ORDER_ITEMX-ITM_NUMBER = SO_INPUT-SALES_ORDER_ITEM_NO.
ORDER_ITEMX-UPDATEFLAG = 'U'.
ORDER_ITEMX-REASON_REJ ='X' .
APPEND ORDER_ITEMX.
CLEAR ORDER_ITEMX.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
PURCHASEORDER = PO_INPUT-PO_NUMBER
POHEADER =
POHEADERX =
TABLES
RETURN = IT_RETURN
POITEM = POITEM
POITEMX = POITEMX .
CALL FUNCTION 'BAPI_SALESORDER_CHANGE'
EXPORTING
SALESDOCUMENT = IT_REL-VBELN
ORDER_HEADER_IN = ORDER_HEADER_IN
ORDER_HEADER_INX = ORDER_HEADER_INX
TABLES
RETURN = IT_RETURN
ORDER_ITEM_IN = ORDER_ITEM
ORDER_ITEM_INX = ORDER_ITEMX.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
please let me know if its correct . getting error as Delete purchase order 4500001321, item 00010
‎2010 Mar 30 7:01 AM
Hi
Give the BAPI_TRANSACTION_COMMIT after BAPI_PO_CHANGE and try.
‎2010 Mar 30 7:23 AM
‎2010 Mar 30 6:18 AM
Hi
Use FMs BAPI_TRANSACTION_COMMIT and BAPI_TRANSACTION_ROLLBACK in your program.
This will remove your transaction problem.
If you still have any doubts then revert back.
Regards
Krathi
‎2010 Mar 30 6:50 AM
BBP_PO_Delete is already have its internal commit, and so saving it .
if i put rollback after so updation is failed, still Po will be saved and marked for deletion .