In my current project I have to filter data with a lot of logic. So I build some ABAP routines in a DTP filter to receive the necessary data. First you have to open the DataTransferProcess (DTP) in change mode and select the Filter button on the Extraction tab.
Now a new window is opened. You see the selection for the DTP. If your field is not visible, click on Change Selection and select the necessary field. When you have the field you want to filter, use the small icon on the right to create a ABAP routine.
Enter a name for the routine and you see the following screen.
And now we have the full power of ABAP to build some really cool stuff. My example is we read a hierarchy and select all leaves under a node and set the DTP Filter with it. Or you read the attributes of an InfoObject and select all entries which are equal to the attributes and enter them into the filter.
After I have now all elements in an internal table, I can add them to the DTP Filter.
After we saved our development and go back, we see a the little ABAP icon on the right (highlighted in red). If you want to remove a filter, click on the trashcan to remove the logic.
Sometimes it is necessary to filter your data. You could do this in different ways, but the most effiencient way is the DTP filter. Because the loading don't touch the data you not select. If you remove the data via a start routine, all the data has to be catched from the database and you select more than you need at the end.
Besides ABAP routine you could also use variables to filter data. In SAP BW/4HANA the filter is a little bit different this will be covered in another post.
I am Tobias, I write this blog since 2014, you can find me on twitter, facebook and youtube. I work as a Senior Business Warehouse Consultant. In 2016 I wrote the first edition of Analysis Office - The Comprehensive Guide. If you want you can leave me a paypal coffee donation. You can also contact me directly if you want.
- In my newsletter you get informed about new topics
- You learn how to use Analysis Office
- You get tips and tricks about SAP BI topics
- You get the first 3 chapters of my ebook Analysis Office - The Comprehensive Guide for free