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: 

Document Structure deletion.

0 Kudos

Hi All,


We have a Scenario of Document sturcture where-
DRW_1 having Doc structure with (BKT_1 and BKT_2)
BKT_1 has Doc structure (BKT_5 and BKT_6)

Using the out program , we want to mark "BKT_1" for Deletion for which the below points need to be taken care-

1) Remove Doc structure from BKT_1 (Remove BKT_5 and BKT_6) – Happening perfectly with CSAP_DOC_BOM_DELETE
2) Since BKT_1 is part of DRW_1 we need to get rid of that association – Removes that one single BKT_1 from DRW_1 using BAPI - bapi_document_change2 ,

please note BKT_2 is still part of DRW_1
3) bapi_document_change2 removes that one Document from DRW_1, however retains record in “STPO” table due to which we are still unable to Mark BKT_1 for Deletion


We tried using CS_SF_BOM_DELETE_FOR_ARCHIVE to mark only that specific record from “STPO” for deletion, however FM clears all the records related to the combination of STLNR and BOM Category as shown below-

Meaning CS_SF_BOM_DELETE_FOR_ARCHIVE deletes both BKT_1 and BKT_2 from DRW_1 (entries deleted from “STPO” table) instead of only removing BKT_1.

Please let us know if there is any BAPI or FM to delete one specific document from a parent Document and retain others in the list.Please note that we need something to remove from STPO.

Thanks in advance

Regards,

Pavithranad.

1 REPLY 1

kesavadas_thekkillath
Active Contributor
0 Kudos

I am not sure about this.

I found this in the documentation

To delete all items in a BOM, a document structure with exactly one entry can be transferred (deletion flag is set; document number contains *).

Restrictions:

The document key fields are equally keys for the BOM items, which means that a document may not be used for several items.