How to substract one row data from another in a DSO in SAP BW

Scenario: The source data is coming in the form of ytd numbers. Below is an example of year to date (YTD) numbers:

ytd numbers.png

The user wants to see the monthly values instead of the YTD values, below is the data which the user wants to see in the report:

ytd numbers.png

Thus the monthly 2017.02 values are 2017.02 value – 2017.01 value.

Thus, the first month value will be as it is, the second month value will  be second month – first month, the third month value will be third month value – second month value.

Solution:

Continue reading →

Private: How to read child hierarchy entries in DTP

Scenario: There is a requirement to load data with a filter on a certain infoObject.

This filter is a parent node of a hierarchy.

The data in the source is having rows with leaf nodes only for this infoObject.

See below diagram to get clarity:

hier.png

source data.png

From the above diagrams, observe that the data in the source cube is having only leaf nodes for the Region ZREG1. Continue reading →

How to write ABAP program to trigger PC based on file in application server

In this post, I will detail on how to write an ABAP program which checks for a specific file in the application server and triggers a process chain. If no file is found, it just displays a message and does not do anything.

Once the program is ready, you need to schedule a job with this program which runs in the background every 30 minutes for example to check the file and trigger the PC.

Continue reading →

How to write ABAP program to Merge multiple files in one file in Application server

In some scenarios, it may happen that business has loaded multiple files in a period for sales for example. All these files should be merged into one consolidation file and loaded once to target instead of loading each file separately.

Also the consolidation file will have a standard name which the infopackage can recognize and pick up rather than changing the infopackage to load multiple files with different names.

Continue reading →

How to write a program to move files in application server to an archive folder

Many times after loading the file from the application server to BW targets, we need to move it in a separate folder such as archive folder to avoid  the same file being repeatedly processed. Also the archive folder will serve as a storage for history of all the files that were already loaded.This helps in referencing them at a later point in time if required.

Continue reading →

How to write infopackage program to pick up a certain file from the application server

We can write a program in the infopackage in BW to pick up a certain file based on its name from the application server and load it. This is required if there are multiple files in the same folder and only a certain file needs to be loaded out of those.

Suppose we have a scenario like this: Business uploads the files for multiple sales division in a folder in the application server –  /usr/SAP/DEV/Reports/target_sales.csv.

Continue reading →

How to look up a custom table in the transformation

This post describes the procedure to look up a custom table in bw transformation. The business scenario can be calculation of certain key figures based on the entries in the table.

This table can be custom table i.e. created by the user or any standard table too.

The first step for doing a look up is to store all the table entries or selected table entries in a global internal table. Continue reading →

How to write ABAP routine to look up a DSO Active table

Looking up a table while doing data load is a common scenario in SAP BW.

Here the look up table can be active table of some other DSO.

You can note a point here that cube cannot be used for look up. This is because, a cube has a fact table which is based on star schema. Hence the primary keys in a fact table will be dimension ids instead of the primary key values.

Now coming to our scenario, suppose data is loaded from DSO1 to CUBE1. Continue reading →

ABAP routine for calculating AR buckets using master data look up

In Account receivables, there is a due date on which the outstanding amount has to be paid by the customer.

If the due date is passed and the customer has still not paid, the amount becomes overdue and bucket calculation starts Continue reading →