cancel
Showing results for 
Search instead for 
Did you mean: 

ByDesign : How to find product categories

former_member402814
Participant
0 Kudos

HI There,

How to find product categories for which there has no products assigned?

Thanks, Vishal Kambare

Accepted Solutions (0)

Answers (1)

Answers (1)

rohanarthur
Participant
0 Kudos

Hi Vishal,

Interesting question, and I must admit I couldn't think of an elegant solution, but here are a couple of attempts.

Would you consider an excel-based solution (if this is not meant to be a frequent activity)? If yes, then just get all the following rows from repository explorer and get the delta in excel:

1. BO Material-->empty query to select all-->select all rows-->navigate to CrossProcessCategory-->select all and copy to excel
2. BO ProdutCategoryHierarchy-->empty query to select all-->select all rows-->navigate to ProductCategory-->select all and copy to excel

Compare both results and extract the delta of columns "ProductCategoryIDKey/ProductCategoryInternalID" from result set 1 and "InternalID" from result set 2.

Note: this will only work for <200 records in both Material and ProductCategoryHierarchy, because the query in repository explorer only gets a max of 200 records.

If you have more than 200 records, but still don't mind using Excel, you can try building OData services to read all the corresponding BO data into excel ("Power Query" is a free excel plugin that will help with this. Check this blog: https://blogs.sap.com/2015/10/07/using-sap-bydesign-odata-in-microsoft-power-query/ ).


If you want to have a ByD application based solution, then this could be achieved in two ways:
I) creating a joined data source of two custom data sources "Material Master Data" and "Product Category Master Data". An inner join between these two will give you the delta of unused product categories.
II) creating a custom BO that first reads all instances of ProductCategoryHierarchy-->ProductCategory and compares with all instances of Material-->CrossProcessCategory within a loop.


Regards,
Rohan

rohanarthur
Participant
0 Kudos

Hi vishalkambare

curious to know what approach you are using. Please let me know when you can.

Thanks,
Rohan

former_member402814
Participant
0 Kudos

Hi Rohan,

Above solution is very hard to understand & execute.

Is there any easy way out?