Applies to:
SAP BI 3.5 and SAP BI 7.0. For more information, visit the Business Intelligence homepage.
Summary
Sometimes the data loaded into BI objects are to be exported to external servers. This document talks about one such scenario where-in data from BI (info cube / info objects) is to be loaded on to external non-SAP system via FTP server. Data from BI objects is put onto application server in the form of Flat File. For this operation InfoSpoke is used. To load file generated by info spoke onto a specific path, Logical path is created using FILE transaction. Further the document covers the use of a Program to load files to external server via FTP. Author: Sanika Deo
Author Bio
Sanika Deo is working in Patni computer system Ltd. Currently she is working on SAP BI 3.5.
Table of Contents
Scenario Explained.............................................................................................................................................3 Problem Statement .........................................................................................................................................3 Solution Steps .................................................................................................................................................3 Extract Data from BW objects using Info Spokes...............................................................................................4 InfoSpoke Creation .........................................................................................................................................4 InfoSpoke Tabs explored....................................................................................................................................5
GENERAL TAB............................................................................................................................................................5 DESTIONATION TAB ..................................................................................................................................................6 INFOOBJECTS TAB....................................................................................................................................................7 SELECTION TAB.........................................................................................................................................................8 TRANFORMATION TAB..............................................................................................................................................8
Using BADI to enhance info spoke extract structure..........................................................................................9 Creation of logical path to store file on a specific location................................................................................12 Loading data into Database Table ................................................................................................................12 Loading data into File....................................................................................................................................13 Using FILE T-Code to create Logical Paths..................................................................................................14
Creation of Logical File Path Definition ......................................................................................................................15 Assign a Physical Path to a Logical Path...................................................................................................................15 Define a Logical File Name Definition ........................................................................................................................16
Store file on external server via FTP ................................................................................................................16 Automate the process via Process Chain.........................................................................................................18 Related Content................................................................................................................................................19 Disclaimer and Liability Notice..........................................................................................................................20
Scenario Explained
Problem Statement
We need to extract data from a particular cube/info object to external file or Data base on another application server. For Example: Data from info Object 0PROJECT is to be loaded into a flat file on a specific path /interface/BWD/outbound. The file structure should be as given below in the table. The file created is to be loaded to external application server say for example DEVBP01.ccc.coopcam.com. Note: The text in blue indicates requirement specifications. The given file format is as follows: File Name: 0PROJECT.CSV
Info Object
0PROJECT-0PROJECT 0PROJECT- 0PROJECT_EX 0PROJECT 0PROJECT- 0STATUSSYS0 0PROJECT- 0OBJ_CURR 0PROJECT- 0COMP_CODE (Restricted for 2400, 2500, 2700 and 6600.)
Profit Center
0PROJECT- 0PROFIT_CTR (Restricted for 2430, 2440, 2525, 2780 and 6615.)
Solution Steps
Extract data from BW objects to external application server using Info Spokes. Using BADI to get required field (Text) into the file structure of Info Spoke. Creation of Logical path and Logical file to store the generated file on specific path of Application server in AL11 transaction. Using program RSFTP002, stored the file on external application server via FTP. Process Chain to make this process automated.
Enter technical name of info spoke to be created. E.g.: 0ZPROJECT (To get the data from 0PROJECT info Object into flat file)
We need to include text of info object along with other attributes as mentioned in the file format but when we select Info object (attributes) we have no option to select text of info object. Due to this we need to write BADI to include text in the extracted data. Enter the info Object of which data is to be extracted into flat file. Extraction can be Full or Delta mode.
DESTIONATION TAB In Destination tab we can specify whether to store data in the form of DB Table or As a File on Local System or Application Server.
Specify a logical target system. Logical system is for Open Hub monitoring. The open hub monitor groups the requests according to target system, open hub destination, and InfoSpoke.
If we select DB table, a table /BIC/0H0PROJECT is automatically created. Data is extracted into this table. Data can be viewed by SE11/SE16.
If we select File, then we can create a file on local system or on application server. There is a default path for application server where the file is stored. To store the file on a specific path, we need to use Logical Paths. Note: Details of File option is covered in further topic Logical Path.
INFOOBJECTS TAB In this tab we can select the fields from the BI object which we need to extract into flat file. We will select all the fields mentioned in the above table from available source fields of Info Object. These will appear as the columns in file or table based on selection. In case of Cubes, all the navigational attributes which are switched on, are available in these selections.
Note: Here we have no filed to select text for 0PROJECT. Using BADI we can bring in text in the file. In Info Objects (Text), we can select Info Object value and its description only.
SELECTION TAB In this tab we can restrict the data being extracted from BI Objects. In above mentioned scenario we want to extract data for few Profit Centers and company Code. So we will restrict the data in this Tab.
E.g.: Info Spoke will get all the data from 0PROJECT where 0PROFIT_CTR = 2430, 2440, 2525, 2780, 6615 and Company Code is 2400, 2500, 2700, 6600. If we have to extract a particular record, then we can exclude the selection by clicking on the Green = button. It will turn Red =. TRANFORMATION TAB
This tab has the option to implement BADI. If we select the check box then a BADI implementation is created. If no enhancement is to be done, no changes are done in this tab.
Save and activate the infospoke. This infospoke is ready to extract data from Info Object 0PROJECT. But the extract file will not have Text field in it. To add the field text, we will implement a BADI via Transformation Tab explained next.
It asks for the confirmation and activation of the info spoke. Due to which a target structure is generated along with a BADI implementation as shown above. On activation it opens the Transaction of BADI Implementation.
In the implementation, we have to specify filter. In filter we specify our Info Spoke name. An implementing class is created. When we click on implementing class we can write code in method.
Before that we need to enhance the existing target structure which is generated when we save the BADI Implementation. As we need to populate text in some filed of the target structure. So we need to add a filed to populate text in target structure. This target structure is automatically generated.
We will add a field PROJECT_TXT in the target structure as shown below. This will populate description of info Object in the info Object generated file.
Note: To add a field to existing structure make use of append structure or best option is to create a structure similar to target structure and add this newly created structure in the Target Structure filed in Info Object. This is because, when info Spokes are transported the enhanced structure is not transported, so the BADI ends up giving error.
This gets the data from text table of info Object into output table of info Spoke.
In the above code we are populating Text from 0PROJECT text table for each 0PROJECT value.Save and activate the BADI Implementation.
We can extract the data from BW Objects either in a Data Base Table or a file. Loading data into Database Table A database name is generated, which is created when the info spoke is executed. We can view the database table from SE11.
Delete Table Before Extraction: Every time the info spoke is executed, the table contents will be deleted. Technical Key: This includes the OHREQUID, DATAPAKID, and RECODE in the key field. Notification to third Party tool: When this flag is set the third party tool is notified to start extraction.
Loading data into File We can store the file onto local system or on Application server. When we uncheck the checkbox of Application Server, the file can be stored on local system.
When we check as Application server, a default path of application server (AL11) appears where the file is stored.
If we want to change the default path we need to go for Logical File Name
Here we have to specify the logical Path name created by using t-code /nFILE
Step 1 Step 2
Step 3
Step 1: Here we will create a logical file path definition. Step 2: Then we assign a physical path to a logical path Step 3: Define a logical file name definition
As syntax of out file path is of type UNIX, the Syntax Group will be UNIX. Assign a Physical Path to a Logical Path After creating a logical file path definition, we will assign a physical path to logical path.
The path (AL11) on which we want to store our file generated by info Spoke is /interface/CCD/BWD/outbound Now when this will be transported to quality the path generated should be /interface/CCQ/BWQ/outbound
To make it generic across landscapes we can use system defined variables. <SYSID> will contain the current BW instance name. <FILENAME> this will be replaced by a value we will define in the next step. Define a Logical File Name Definition
<FILENAME> will be replaced by the contents of Physical file. We specify the data format and the application component. The Logical file name i.e. ZPROJECT will be specified in the info spoke. So that the info spoke will store the file 0PROJECT.CSV on path (AL11) /interface/CCD/BWD/outbound/0PROJECT.CSV
Using this program we can store the file generated by info spoke on external server. This program takes input as user name, password, Host name of remote server and Command to be performed.
FTP Command
SAPFTPA will accept files form application server. SAPFTP will accept file from
To put file from application server to remote host the command is put /interface/CCD/BWD/outbound/0PROJECT.CSV /SAP/0PROJECT.CSV To check it the file is placed we can use command dir SAP
This process type stores the file from application server to FTP server using program RSFTP002
Related Content
Following reference tells more about Info Spokes and BADI http://help.sap.com/saphelp_nw04/helpdata/en/c5/03853c01c89d7ce10000000a11405a/frameset.htm Some Problems faced with respect to Info Spokes https://www.sdn.sap.com/irj/sdn/thread?messageID=5953843 https://www.sdn.sap.com/irj/sdn/thread?threadID=64204 https://www.sdn.sap.com/irj/sdn/thread?threadID=325605 For more information, visit the Business Intelligence homepage.