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.
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.
- In BW related ABAP, you work mainly with tables. Tables are the essential data structures in the database system.
- Besides database tables, you can create internal tables which exist only during the runtime of your program.
- A particularly important use for internal tables is for storing and formatting data from a database table within a program.
- The data type of an internal table is normally a structure. Each component of the structure is a column in the internal table.
- The number of lines in an internal table is not fixed. Depending on requirements, the system increases the size of internal tables at runtime.
- The data is stored on a row-by-row basis, where each row has the same structure.
- It has two different parts. Header Line (optional) and Body (Compulsory). Any value that comes to or goes from internal table, that travels through header line.
The internal table with header lines are now obsolete.
- You can create explicit work area
- The statements for the access to individual rows use explicit work area specified.
Declaring Internal Tables
TYPES BEGIN OF TY_FLY, CARRID TYPE SPFLI-CARRID, CONNID TYPE SPFLI-CONNID, CITYFROM TYPE SPFLI-CITYFROM, CITYTO TYPE SPFLI-CITYTO, END OF TY_FLY. DATA WA TYPE TY_FLY. DATA ITAB TYPE TABLE OF TY_FLY.
DATA WA TYPE SPFLI. DATA ITAB TYPE TABLE OF SPFLI.
In the above two methods, WA is the work area defined for internal table ITAB.
TABLES SPFLI. DATA ITAB TYPE TABLE OF SPFLI.
In this method TABLES SPFLI statement creates an Implicit Header Line for Database table SPFLI. But it can be used as explicit header line for internal table ITAB.