Wednesday 3 April 2024

How to collect hardcoded values, ABAP routines & OLAP variable values used in DTP filters

Introduction


This blog talks about how to collect selections or filter details used in a DTP by using some standard tables in both BW on Hana & BW4HANA systems.

Especially In migration projects (SAP BW on Hana to BW4HANA), it’s very hard to collect hardcoded values or ABAP routines or OLAP variable details used in DTPs manually for ‘n’ number of DTPs. So, to overcome from this issue, below steps will help us to collect DTP filter details by using the tables RSBKREQUEST, RSSELDTP, RSBKSELECT.

1. DTP filters in BW on Hana


As we know, in a DTP filter we can maintain hardcoded values, ABAP routines & OLAP variables to restrict data while loading into Target objects. Below steps will help us to get the selection details used in a DTP for n number of DTPs.

a) Hardcoded values used in a DTPs.

Here, taking one example DTP DTP_4G4QWVRDA3L500T4AN4PBQYQA to explain the below steps.

Step 1: Use the table RSBKREQUEST and enter the DTP id in DTP field as shown below.

How to collect hardcoded values, ABAP routines & OLAP variable values used in DTP filters
Initial screen & input to the table RSBKREQUEST

Step 2: After executing the table, search for the field TSTMP_START and consider latest time stamp (descending order) and take the first request name as shown below.

How to collect hardcoded values, ABAP routines & OLAP variable values used in DTP filters
Output of RSBKREQUEST table

Step 3: Use the table RSSELDTP and enter the request name in RNR field and execute the table.

How to collect hardcoded values, ABAP routines & OLAP variable values used in DTP filters
Initial screen & input to the table RSSELDTP

How to collect hardcoded values, ABAP routines & OLAP variable values used in DTP filters
Output of RSSELDTP

Conclusion: The table RSSELDTP holds the hardcoded values used in a DTP as shown in above screen shot.

Note: Follow the same process for n number of DTPs.

b) ABAP routines used in a DTPs.

As we know, in a DTP we can use ABAP routines to derive CALMONTH value or any logic to filter data while loading into Target. Below steps help us to identify an ABAP routine details used in a DTP.

Step 1: Use the table RSBKREQUEST and enter the DTP id in DTP field as shown below.

How to collect hardcoded values, ABAP routines & OLAP variable values used in DTP filters
Initial screen & input to the table RSBKREQUEST

Step 2: After executing the table, search for the field TSTMP_START and consider latest time stamp (descending order) and take the first request ID value as shown below.

How to collect hardcoded values, ABAP routines & OLAP variable values used in DTP filters
Output of REBKREQUEST table

Step 3: Use the table RSBKSELECT and enter the ‘*’ symbol followed by REQUID value in REQUID field and enter value 6 in SEL_TYPE filed and execute the table as shown below.

How to collect hardcoded values, ABAP routines & OLAP variable values used in DTP filters
Initial screen & input to the table RSBKSELECT

How to collect hardcoded values, ABAP routines & OLAP variable values used in DTP filters
Output of RSBKSELDTP

Conclusion: The table RSBKSELECT holds the ABAP routines details used in a DTP as shown in above screen shot.

Note: Follow the same process for n number of DTPs.

C) OLAP Variables used in a DTPs.

Follow the steps 1 & 2 explained in above section b.

Here, to get the OLAP variable details, Use the table RSBKSELECT and enter the ‘*’ symbol followed by REQUID value in REQUID field and enter value 7 instead of 6 in SEL_TYPE filed and execute the table as shown below.

How to collect hardcoded values, ABAP routines & OLAP variable values used in DTP filters
Initial screen & Input to the table RSBKSELECT

2. DTP Filters in BW4HANA

As we know, BW4HANA is an advanced version of BW. In older BW systems, it was quite easy to check DTP filter settings in standard tables but in BW4HANA, we don’t have any straightforward tables to get DTPs filter details.

We can get some partial details from the standard table RSPMDTASELECTION but not useful and also SAP provided the standard program RSBK_DTP_SHOW_FILTER, with this program we can display the filter criteria for a single DTP.

In addition to DTP filters, this blog also talks about how to handle exclusion filters in BW4HANA for ODP data sources.

How to handle exclusion filters in BW4HANA for ODP data sources

If there is a requirement to load data from classic BW/BW on HANA 7.5 system to another BW4HANA system with some exclusion filters, then we cannot apply the exclusion filters directly in DTP because exclusion filter criteria doesn’t work in BW4HANA for ODP data sources.

To overcome from this scenario, we can create an ABAP program with logic to fetch exclusion filters from control table (exclusion filters should be maintained) and apply the same program in DTP filter routine and also we can reuse the same include program for exclusion filters in other ODP data flows by maintaining a control table. Please find the sample ABAP code in below screenshots.

SAMPLE ABAP CODE

How to collect hardcoded values, ABAP routines & OLAP variable values used in DTP filters
Sample ABAP code

How to collect hardcoded values, ABAP routines & OLAP variable values used in DTP filters
Continuation of Screenshot 10

Control Table

In control table, we must maintain exclusion filters details. So, that extraction for exclusion filters will work properly from classic BW/BW 7.5 system to BW4HANA system for ODP data sources. Please find the parameters details in below.

Let's take an example, we have a COMP_CODE = C1,C2,C3 in Source but I want only C1 & C2 into my target system.

PARAM            = DTP ID --> (DTP ID, in which we wanted to apply exclusion filters)

SUB_PARAM   = COMP_CODE –(Field name)

SIGN                = E ------> (E indicates Exclude)

OPT                 = EQ ---->(EQ indicates Equal)

Low              = C3 -->(exclusion company code) 

How to collect hardcoded values, ABAP routines & OLAP variable values used in DTP filters
Sample data in Control table

No comments:

Post a Comment