cancel
Showing results for 
Search instead for 
Did you mean: 

Delete Purchase orders in APO Database

Former Member
0 Kudos

We have some purchase orders in APO that we cannot delete from the database.

When we run WUF for a specific material we can see that we have two ATP orders for the material. When we check the orders in R/3 we can see that the orders are deleted purchase orders. In APO we would like to delete these orders properly as we need to delete the material.

We have tried to do this by running the following programs:

/SAPAPO/SDORDER_DEL

SAPAPO/DELETE_PP_ORDER

/SAPAPO/RLCDELETE

We have also tried to run a comparison (TCODE: /SAPAPO/CCR) but no inconsistencies were found.

None of this has deleted the two purchase order from the data base.

Does anybody know how we can delete these orders?

BR Trine

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

Hi all,

I have tried to run SDORDER_DEL with slightly different settings and that seems to have done the trick.

Thak you for your answers.

BR

Trine

Former Member
0 Kudos

guess this is a bit late but try this next time

if you go to the table in OM19 - /sapapo/ordkey and look for orders that dont have an order number with the selections - pick the order GUID from there

you can then use the report /SAPAPO/OM_DELETE_INCON_ORDERS and supply the order GUID to delte them

Former Member
0 Kudos

Hi,

Try this, if still purchase orders are not deleted.

Use BAPI "BAPI_POSRVAPS_GETLIST3" to get the order no and use "BAPI_POSRVAPS_DELMULTI" to delete the same.

Best Regards,

Vaibhav

babu_kilari4
Active Contributor
0 Kudos

Hi All,

I am facing similar problem now.

I wanted to delete the STO Orders for all the inactive Product and Location combination.

How can I achieve this?

If it is with the help of the BAPIs mentioned above, could you all please provide me with an example of how to do that.

Thanks in advance.

Thanks,

Babu Kilari

Former Member
0 Kudos

Check whether the two leftover purchase orders are in an inactive version. If so run the reports that you are running for inactive versions too. You should be able to delete then.

Thanks

Sanjeev

Former Member
0 Kudos

Otherwise /SAPAPO/DELETE_PP_ORDER says smth like "No deletion in active version"

Former Member
0 Kudos

First of all you need to understand if these orders were:

- created in APO

- CIFed from R/3

APO: in this case only /SAPAPO/RLCDEL can help you. You can also try /SAPAPO/DELETE_PP_ORDER. I've never had any issues when deleting APO-orders. This shouldn't be a problem.

R/3: in this case you should be able to fix issues via /SAPAPO/CCR. When using this report remember that it compares APO and R/3 ONLY in case material/location exists in integration model. In case you checked integration model and it's OK and /SAPAPO/CCR still not able to find the problem then you can use /SAPAPO/DELETE_PP_ORDER. But when using it together with purchase order you need to slightly modify contents of internal variables.

Report /SAPAPO/DELETE_PP_ORDER, rows 373 - 384

IF sy-subrc = 0.

lv_tabix = sy-tabix.

  • nur im Expertenmodus k³nnen umgesetzte Auftrôge gel³scht werden

IF lv_execu = gc_true

AND ( TO lt_ordkey_no_del.

DELETE lt_ordkey INDEX lv_tabix.

ENDIF.

ENDIF.

Here you should set lv_execu to TRUE ('X') and then it is able to delete purchase order. DO IT ONLY IF YOU UNDERSTAND THE CONSEQUENCES

Dmitry