Invoking RFC enabled BDC from BODS
Document Purpose
This document provides steps required to load data in SAP using one of the SAP interfaces. This document will be use at the time of proof of concept to demonstrate ability of Business Objects Data Services (BODS) to invoke RFC enabled BDC to load data in SAP.
The main objectives are:
- Loading data in SAP using RFC enabled BDC
- Demonstrate how BODS can be used to load data using RFC
- Display step-by-step required configuration & invocation
- Demonstrate actual sample load using BODS job
Overview:
This document provides systematic approach for the data load in three sections:
- Configuration Required on SAP Side:
- Configuration Required on BODS Side:
- Demonstrating Sample Load using BODS Job:
Each of above sections provide information as in how to configure the specific parameters required to get both SAP & BODS ready to communicate with each other. Screen shots provided for better understanding of the parameters & their configuration.
Configuration Required On SAP (ECC 6.0) Side
Following is the required configuration on SAP side.
1. A ZStructure
ZFSP0 is a structure containing fields for creating GL Accounts in transaction FSP0.
The ZFSP0 Structure fields are as follows.
1. ZFSPO Structure
2. ZFSPO_Message Structure
2. Recording
Use T-CODE SHDB to visit FSP0 and do recording according to requirements
3. Transaction Recording
4. Transaction Recording Continue
3. Create Function Module
Attributes information Tab for Input / Output Parameters is as follows
Function Builder
5. Function Module
4. RFC Enabled BDC Parameter Information
The RFC enabled BDC is getting ZFSP0 as input, which is in structure format, it defines BAPIRET2 as RETURN Table for Messages.
Function Builder
6 BDC Parameter Information
5. BDC Source Code
7 BDC Source Code
8. BDC Source Code continue
9. BDC Source Code continue
Configuration Required On BODS Side
Following is the required configuration on BODS side.
1. Input Data File
To simulate legacy data process in BODS we are creating input data file. This file is a text file with required fields only, to be loaded in SAP. Since this is a proof of concept, we are not demonstrating any transformation capabilities of BODS but just the ability to invoke SAP interfaces to load data in SAP.
KTOPL |
SAKNR |
KTOKS |
XPLACCT |
TXT20 |
TXT50 |
CAAU |
194311 |
BS |
Testing |
Testing for BODS |
|
CAAU |
194312 |
BS |
Testing |
Testing for BODS |
|
CAAU |
194313 |
BS |
Testing |
Testing for BODS |
|
CAAU |
194314 |
BS |
Testing |
Testing for BODS |
|
CAAU |
194315 |
BS |
Testing |
Testing for BODS |
|
CAAU |
194316 |
Testing |
Testing for BODS |
||
CAAU |
194317 |
BS |
Testing |
Testing for BODS |
|
CAAU |
194318 |
BS |
X |
Testing |
Testing for BODS |
CAAU |
194319 |
BS |
X |
Testing |
Testing for BODS |
CAAU |
194320 |
BS |
Testing |
Testing for BODS |
2. Flat File Source
Create new flat file source (formats tab) in BODS. This is the way BODS links any external files so that they can be use as source on Data Flow. Create source & link to the Input Data File created in above section.
10. Flat File Source INPUT_GL_DATA
3. Design BODS JOB
Steps to create job is as follows:
- Create BODS_RFC_BDC_JOB in the default project
- Drag & Drop Data Flow (DF) on this JOB
- Drag the Flat File Source INPUT_GL_DATA from “formats” tab on Data Flow
- Build the required logic to process, map required fields from the input data file
BODS JOB
11. BODS Designer Data Flow View
4. Query Transformation
BODS Job is using Query transformation three times in succession.
NRDM – A query transform is used to pass complete schema. Here in this transformation required struture is created that will be required as input to the RFC enabled BDC.
12 NRDM Query Mapping
BDC_Call – A query transform to call BDC (Already imported in SAP Datastore)
To avoid Calling BDC for each record, we are restricting function call to execute only once by using where clause. Since RFC enabled BAPI accepts table as input, it takes all records present and insert into SAP
13. BDC_Call Query Mapping
14. Input Parameter to BDC
Query_Unnest – A query transform to unnest “RETURN” schema with AL_RFC_RETCODE
Output table is mapped to accept ‘GT_MSG’; “return table for messages” to check the status per record.
15. Query Unnest
Demonstration Sample Load using BODS Job
Verify the BODS Job by clicking on the Verify button to check on errors if any.
Execute verified Job by right clicking on the Job and click on execute (option)
1. Running BODS Job
Right click on the job to execute & select Execute from options.
16. Running Job
Execution Properties
Keep default options on this screen & click on ok to execute
17. Properties
2. Checking Log for the Job execution
Go to the Log tab, expand the Job, and click on the execution log to check the entries.
18. Log View
3. Statistic view of Job Execution
Click on the second button from left on the Log view screenshot to check processed data statistics.
19 Statistic View
4. Returned Data View by RFC
After successful execution go back to Data Flow to check the data returned by RFC-BDC.
Confirm that the returned data inserted in table (emp_data_rfc_ouput)
20 Returned Data View
5. Verify Loaded Data in SAP Target
Connect to SAP using SAP GUI
Use T-CODE SE11 and check entries in table SKA1 (G/L Account Master (Chart of Accounts)) to confirm the data insertion.
21 SAP Load Confirmation
Hi Roshan,
Thanks for your post.
We were able to load data from flat file to SAP using RFC enabled BDC.
But we have issue to avoid Calling BDC for each record or to restrict function call to execute only once.If we give two records as input, we are getting four records as output with each record repeating twice but with different material number.
Can anyone help us in restricting the function call based on the above scenario?
hi Roshan,
Great Post.
As you get restrict calls to the function to only do it once ?
Thank you .
Hi,
Is there any way we can debug the RFC FM once the load job is executed ?
Thanks,
AJ.