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 →