Technical Articles
SAP PaPM Writer function – ‘BW write type’: Planning – How to create simple planning writer
Introduction:
When ‘Model BW’ is used in the project for reporting and/or planning, a writer function can be used to write data to this ‘Model BW’(ADSO)
‘BW write type’ can be selected either
Loading: The Blog Series 1, describes how the data is written to ‘Model BW’ (ADSO) using DTP(Data Transfer Process) and the technical artifacts generated behind this loading writer function.
Planning: This blog series 2, focuses mainly how the data is written to ‘Model BW'(ADSO) using the BW planning Engine and how different Model writer types (Insert, Modify and Delete & Insert) works
Blog Series 2 – ‘BW write type’: Planning
This blog series has 3 parts
Part 1: How to create writer function with ‘BW write type’ Planning – We create simple Planning writer functions to understand these functionalities.
Part 2: ‘BW write type’ Planning – An Inside Story
Part 3: Troubleshooting and known issues
Part 1: How to create simple writer function with ‘BW write type’ – Planning
We use the same Model Table and ‘Model BW’ that we created in the Blog Series 1. As you have already gained expertise with creation of these objects, we skip the creation steps in this blog post. For comparison of the results, we create 3 ‘Model BW’s and 3 writer functions one for each Model writer type.
After you have created the objects, function tree may look
Planning writer uses the SAP BW planning engine which basically execute the planning function named as ‘Performance Management Planning function type’. This planning function selects the data from ADSO, compares it with input data and as per the Model writer type it generates the necessary changed records and finally written to ADSO.
To compare the results, we execute 3 Runs for each ‘Model writer type’ and check the data in the respective ADSO after each run.
Run 1
To begin, delete any old/existing data from the Model Table MT01 and add these 4 records. Then execute the 3 writer functions (WR01, WR02, WR03) for the first time. As the ADSOs are previously empty, data is just inserted as new records in all the 3 cases.
How to View data in ADSO: Log in to your BW client -> Tcode RSA1 -> search for Infoprovider of the ‘Model BW’ -> select ‘Manage’ Or you can view the data in ‘Model BW’ -> Analyze
ADSO technical name can be found under Infoprovider in the Runtime Attributes of the ‘Model BW’
Active Data in ADSO: All the 3 ADSOs have 4 records same as Model Table
Run 2
We change the Model table data similar to the data below (Key Figure values changed in the first two records, 2 old records deleted, 2 new records inserted)
Insert : Run the writer WR01 and check the ADSO active data of ‘Model BW’ BW01.
Records are
Aggregated – When the keyfields combination are the same, key figure values are aggregated with new values
New – When the keyfields combination is new, new record is inserted
Old/existing (Unaltered) – When the keyfields combination does not exist in the input data, those records are left unchanged
Modify : You run the writer WR02 and check the contents of the ADSO active data of ‘Model BW’ BW02.
Modified – When the keyfields combination are the same, key figure values are overwritten with new values
New – When the keyfields combination is new, new record is inserted
Old/existing records – When the keyfields combination does not exist in the input data, those records are left unchanged
Delete & Insert : Now you run the writer WR03 and check the active data of the ADSO for the ‘Model BW’ BW03.
Modified records – When the keyfields combination are the same, key figure values are overwritten with new values
New records – When the keyfields combination is new, new record is inserted
Old/existing records – When the keyfields combination does not exist in the input data, those records are zeroed out ie key figures values are made as ‘0’. These records are not physically deleted from the ADSO. In case input function has complete new sets of records each time, old records still exists in the ADSO with zero values for the key figures and new records are inserted. As a result, record count keeps increasing each time when the writer is executed.
Run 3
When the writers are executed without any data changes to the input Model Table.
Insert : When you run the writer WR01, a new request is loaded to the ADSO and data is aggregated to the existing records
Modify : When you run WR02, you can see no new request is loaded. This is because BW planning engine compares the input data with ADSO data, when it did not find any difference, it does not generate any change records. At the end of the execution, application log displays the success message with no new request loaded to ADSO.
Delete & Insert : When you execute WR03, this works similar to ‘Modify’ as discussed earlier.
‘Delete & Insert’ with Process selection:
This could be quite interesting when you use ‘Delete & Insert’ with process selections.
Define process selection at the environment level for Product EQ PROD01, PROD03
When the function WR03 is executed with this process selection
Records for the product PROD01, PROD03 are only selected(in this example, there are 3 records)
During execution of writer, planning function zeroes out the existing records of PROD01,PROD03 and inserts new data for these products. Writer should be set as Executable to perform deletion otherwise data is just inserted without zeroing out the old records.
For more information on Delete & Insert, you can also refer to this interesting blog PaPM Writer: Delete and Insert
Performance Tip:
When you have ‘Model BW’ having data for all fiscal years (around 1 million records), on execution of planning writer SAP BW planning engine selects all these 1+ million records from ADSO. Then it compares with input data and generate necessary changed records that are written to ADSO. This can lead to performance issues and OOM (out of memory) dumps.
How to prevent this: Let us assume the input function has data only for fiscal year 2021. Define this selection FISCYEAR = 2021 either in input, output or Process selection. This selection is propagated to the planning engine, and then records are selected based on this selection instead of all records from ADSO.
As a result, writer function consumes less memory and system resources for processing the data. It reduces the writer runtime.
Conclusion:
Hope this blog post helps you to have a clear understanding how the planning writer functions with different Model writer types (Insert, Modify, and Delete & Insert)
Part 2 describes the technical artifacts generated in the background when the writer function is activated.
Follow the tag ‘SAP Profitability & Performance Management’ to receive new content notification.
Post your questions here – SAP Profitability and Performance Management – Q&A
Good luck!
Hi Dinesh,
Thank you for detailed explanation in this blog but when we are using the Writer function with Delete and insert & selection at activities, System does not consider the selections and delete all the data irrespective of selection. Is this a bug?
Regards,
Hi Sanjaykumar,
Please implement the note ‘3021783 – FS-PER Rel 3.0 SP13: Write to Bw with planning selection not applied’
Regards,
Dinesh
Hi Dinesh,
Thanks for quick feedback, but we are on SP10 and this note is not applicable. Also checked SAP note 2944754 but the same is also not applicable.
Regards,