Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to delete the all the Opened PO Through ABAP Program?

akjayaa
Explorer
0 Kudos

How to delete the all the Opened PO Through ABAP Program?

1 ACCEPTED SOLUTION

SugguSandeep
Active Participant
0 Kudos

Hi akjayaa,

If You are performing ABAP Code on Standard Table, Visit This Link It Might Help You Delete Entries from Standard Table

If You are performing ABAP Code on Custom Table, with the help of select query in ABAP Code can perform the operation, Here is the piece of code

DELETE it_at WHERE customer_id = '86427520'. " it_at - Internal Table

Absorb the picture (8642750) data contain after writing code of delete statement it's going to remove the record

* One More Important thing is that it deletes the Data record from the Program Itself, It's not going to delete data from the table in which data is contain...

Thanks,

Suggu Sandeep.

5 REPLIES 5

Jeansy
Active Contributor

Hi,

do you want to set the delection indicator for the related PO-items or do you want to delete the whole PO?

Setting the deletion indicator can be achieved by an ABAP-program that uses the BAPI-module BAPI_PO_CHANGE.

In case you want to completly remove the PO, SAP does provide options for archiving and deletion of PO. Please check transaction SARA for more details (archiving object: MM_EKKO).

Kind regards
Jens

Sandra_Rossi
Active Contributor
0 Kudos

Purchase Order?

SugguSandeep
Active Participant
0 Kudos

Hi akjayaa,

If You are performing ABAP Code on Standard Table, Visit This Link It Might Help You Delete Entries from Standard Table

If You are performing ABAP Code on Custom Table, with the help of select query in ABAP Code can perform the operation, Here is the piece of code

DELETE it_at WHERE customer_id = '86427520'. " it_at - Internal Table

Absorb the picture (8642750) data contain after writing code of delete statement it's going to remove the record

* One More Important thing is that it deletes the Data record from the Program Itself, It's not going to delete data from the table in which data is contain...

Thanks,

Suggu Sandeep.

venkateswaran_k
Active Contributor

Hi akjayaa

What actually you are referring to Opened PO.

Is this

  • Open POs ( ie delivery not yet completed )
  • Open POs ( newly created POs)

You can achieve to delete the PO through ABAP program in two ways

  1. You can mark all the items as deleted using the BAPI
  2. You can mark all items delivery indicator as completed through BAPI.
  3. Or you can use the standard process SARA ( to archive the PO )

Please clearly mention the exact requiremeht with respect to deletion of PO.

akjayaa
Explorer
0 Kudos

Hi Sir Good Aft,

My Question is ................. How to delete the PO History through ABAP Program?

Thank You!