Академический Документы
Профессиональный Документы
Культура Документы
Applies to:
SAP BI 7.0 developers for carrying out tasks related to data loading and monitoring.
Summary
This document provides step by step approach to create infopackage/ datasource routine to fetch
current day's file name present on the application server.
Author(s):
Sanjeev Singh
Author Bio
Sanjeev Singh is a SAP BI Consultant at Vridhi Softech Services Private Limited, India.
Business Scenario
You have been tasked to load files available on application server on daily basis.
File name contains the date appended to it which matches system date. You have not been able to
identify a standard procedure that will accomplish this task for you.
You need to deliver a solution to appropriately generate file names on daily basis through
infopackage and load them to specified data targets.
Introduction
Within SAP-BI system there are info package routines available under "Extraction" tab page in
datasource as well as in Infopackage
which can be leveraged to capture file names as per current system date through the use of
customized ABAP routine to generate file name
Procedure
1. Create Generic Datasource for flatfile source system.
2. Go to external tab page and maintain specific settings for Adapter and File name.
3. Write an ABAP routine to fetch current day's file available on the Application server.
4. Activate datasource and preview the records present in the file.
5. Create an infopackage with similar setting as that of datasource.
6. Schedule the infopackage and monitor to view file records in PSA.
Prerequisite
Files should be placed on Application server with naming convention such as <File
Name>+<Current Day(YYYYMMDD)>
1.
The flat file datasource allows you to capture the file fields information and then to load data into
the BI system.
1.Navigate to Source Systems->File. Expand File to select Flat file source system.
2.Double Click Flat File and create a datasource in appropriate Application Component.
4.Fill out the details in the " General" tab page for datasource
2.
Go to "Extraction" tab page and maintain specific settings for Adapter and
File name.
In this tab page you need to fill in settings related to Delta Process, Adapter and routine for
generating file name
1.Enter the details for Adapter and Click on routine to generate a file name
3.
Write an ABAP routine to fetch current day's file available on the
Application server.
1.Enter the name for routine.
2.Click Editor and write code in the space provided in ABAP editor.
3.Below is the ABAP code which is to be written at DataSource"Extraction" tabpage to fetch file
name:program filename_routine.program filename_routine.program filename_routine.
Global code
$$ begin of global - insert your declaration only below this line -
as well as additional form routines, which you may call from the
DATA: ...
*$$ end of global - insert your declaration only before this line *-
------------------------------------------------------------------form compute_flat_file_filename
using p_infopackage type rslogdpid
p_datasource type rsoltpsourcer
p_logsys
type rsslogsys
changing p_filename type RSFILENM
p_subrc
like sy-subrc.
$$ begin of routine - insert your code only below this line
4.
5.
2. Maintain all Infopackage settings similar to the one defined at the datasource level for fetching
filename through 'ZTEST' routine.
6.
1. Keep default settings for infopackage, go to Schedule tab and click on Start for dataloading.
Alternatively, you can include the infopackag at process chain level as per your design
consideration.
2. Once load finishes successfully, click on Monitor to view and verify the records as per the file
available on the application server.