For a given BW master data object, I needed to identify deletions that take place in the source system. However for this particular object, the data source does not provide you with a deletion flag. Instead, the object is simply removed from the source tables.
I therefore created a transformation in BW that flags as ‘deleted’ those master data records that do not appear any more in the PSA table of the daily FULL load.
The transformation i created is a loop-back transformation (the source and target of the transformation are the same object). In the source routine, the PSA table of the objects data source is checked.
To identify the PSA table dynamically I used the functions described in the Following SDN Article. (If you use SAPLINK, the report described in the article is available for download below.
You can download the code of the function here in Saplink format.
Download – PROG_ZBW_IDENTIFY_PSA.slnk – 5.2 KB – 544 downloads
See also SAP FM ZAIB2_PSA_TAB_AND_REQ_GET returns lots of info (PSA table, last request et al)
Some information on how to access PSA data:
When the system detects an incompatible change to the transfer structure, a new version of the PSA, meaning a new PSA table, is created. Data is written to the new table when the next request is updated.
The original table remains unchanged and is given a version. You can continue to use all of the PSA functions for each request that was written to the old table.
Data is read from a PSA table in the appropriate format.
1. If the request was written to the PSA table before the transfer structure was changed, the system uses the format that the transfer structure had before the change.
2. If the request was been written to the PSA table after the transfer structure was changed, the system uses the format that the transfer structure has after the changed