07-11-2005 12:29 PM
Hi,
I would like to delete a PO service using the BAPI BAPI_PO_CHANGE. I think that I have to set the flag DELETE_IND in the table POSERVICES. I did it and, even if in the return table it's written "Order modified correctly", the BAPI doesn't modify the po service of the purchase order.
Any suggestion?
Thank you very much.
The ABAP code is the following:
REPORT ZPO.
DATA: POITEM TYPE BAPIMEPOITEM OCCURS 0
WITH HEADER LINE,
POITEMX TYPE BAPIMEPOITEMX OCCURS 0
WITH HEADER LINE,
RETURN TYPE BAPIRET2 OCCURS 0
WITH HEADER LINE,
POSERVICES TYPE BAPIESLLC OCCURS 0
WITH HEADER LINE.
START-OF-SELECTION.
CLEAR: POITEM,
POITEMX,
RETURN,
POSERVICES.
REFRESH: POITEM,
POITEMX,
RETURN,
POSERVICES.
POITEM-po_item = '10'.
APPEND POITEM.
POITEMX-po_item = '10'.
POITEMX-po_itemx = 'X'.
APPEND POITEMX.
POSERVICES-pckg_no = '0000000022'.
POSERVICES-line_no = '0000000010'.
POSERVICES-ext_line = '0000000010'.
POSERVICES-subpckg_no = '0000000000'.
POSERVICES-delete_ind = 'X'.
APPEND POSERVICES.
CALL FUNCTION 'BAPI_PO_CHANGE'
EXPORTING
PURCHASEORDER = 'C231500880'
TABLES
RETURN = return
POITEM = POITEM
POITEMX = POITEMX
POSERVICES = POSERVICES
.
CALL FUNCTION 'BAPI_TRANSACTION_COMMIT'.
BREAK-POINT.
END-OF-SELECTION.
07-11-2005 1:10 PM
Hi,
As you are deleting the PO item level value so do set your deletion indicator at your POitem level also.
Regards,
jagath
07-11-2005 2:03 PM
Thank for the reply.
I did it, but I don't want to delete the item, but only the PO services. However, I tried deleting item and the po services, but the flag DELETE_IND in the PO services, isn't set.
Regards,
Angelo Gattuso
07-11-2005 3:29 PM
Hi,
Just got some related FM on the same.
MS_SERVICE_SAVE
MS_PRINT_CHANGES_SERVICE
MS_CHANGE_SERVICE_PACKAGE_EC
Regards,
Jagath
07-11-2005 3:42 PM
I do set the ITEM_CAT to blank in the table POITEM and ITEM_CAT TO 'X' in the table POITEMX, so the po services are deleted!
Thank you very much.
Bye