How to count duplicate rows in a query in efficient way?
问题 I am creating a report in SAP SQ01/SQ02 whose purpose is to show the number of times a product was picked in the specified time frame. The data is mainly sourced from table LTAP. I just need to be able to count the number of rows Material XYZ is duplicated in and output the number into an extra field and show the value. Also I want this count to happen in a specified time frame, let's say in the last 30 days, this is to make sure it's up to date and relevant. The below code works, but it's so