Delete unused Items
Sebastian Schweer
Hallo,i try to find all unused Items in the Item Master Database, so i can remove them.
If i try to remove an Item from the Database which still exist, the
Compiler gives me the following Information: "10001290 - You cannot
remove item; linked transactions exist".
SAP find this Information very quick, so i guess that there is no
query over all possible tables, but an table or a field witch hold the
Data if an Item was still used or not.
Does anybody know, where i can find these information in the Database?
Best regards,
Sebastian
Paolo Manfrin
Hi Sebastian,why instead of creating such a complex query you just don't loop through all the items trying to remove them one by one?
The one which are not in use will be deleted the others will return the exception
// pseudoCode
foreach (item in OITM)
{
int retVal = removeItem(item)
if (retVal ==0)
WriteSuccess("Item item removed"
else
WriteError("Item item in use, cannot be removed")
}
hth
paolo
Sebastian Schweer
Hi Paolo,thanks for your Reply.
This Request is, because i don't want to delete all Items automaticly, but i want to know which Items i could choose for deleting.
Therefore i make a Query about all Tables which use the ItemCode as Field. But still there is the question, if there is a table, in which stands if an item is used or not.
Best Regards,
Sebastian
Anders Olsson
Hi Sebastian,If you want to know exactly what SAP checks you can run the SQL Profiler when trying to delete an item. Then you will see that a number of queries are run to check where the item is used. There is no single table holding this information - instead SAP checks for warehouse transactions etc.
Regards,
Anders
0
Please sign in to leave a comment.
Comments
0 comments