Skip to Content

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:

  1. Configuration Required on SAP Side:
  2. Configuration Required on BODS Side:
  3. 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.

/wp-content/uploads/2012/07/1_119479.png

                                              1. ZFSPO Structure

/wp-content/uploads/2012/07/2_119498.png

                                             2. ZFSPO_Message Structure

  

2.    Recording       

Use T-CODE SHDB to visit FSP0 and do recording according to requirements

/wp-content/uploads/2012/07/3_119499.png

                                                                                3. Transaction Recording

/wp-content/uploads/2012/07/4_119500.png


                                                                      4. Transaction Recording Continue

3.    Create Function Module    

Attributes information Tab for Input / Output Parameters is as follows

Function Builder

  /wp-content/uploads/2012/07/5_119501.png

                                                                 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

/wp-content/uploads/2012/07/6_119502.png

                                                   6 BDC Parameter Information

5.    BDC Source Code 

                       /wp-content/uploads/2012/07/7_119503.png

                                               7 BDC Source Code

/wp-content/uploads/2012/07/8_119504.png

  8. BDC Source Code continue

/wp-content/uploads/2012/07/9_119505.png

  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.

/wp-content/uploads/2012/07/10_119506.png

                                        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

/wp-content/uploads/2012/07/11_119507.png

                                 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.

/wp-content/uploads/2012/07/12_119508.png

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

/wp-content/uploads/2012/07/13_119509.png

13. BDC_Call Query Mapping

/wp-content/uploads/2012/07/14_119510.png

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.

/wp-content/uploads/2012/07/15_119511.png

                                             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.

/wp-content/uploads/2012/07/16_119512.png

16. Running Job

Execution Properties

Keep default options on this screen & click on ok to execute

/wp-content/uploads/2012/07/17_119516.png

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.

/wp-content/uploads/2012/07/18_119517.png

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.

/wp-content/uploads/2012/07/19_119518.png

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)

/wp-content/uploads/2012/07/20_119519.png

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.

/wp-content/uploads/2012/07/21_119521.png

21 SAP Load Confirmation

To report this post you need to login first.

3 Comments

You must be Logged on to comment or reply to a post.

  1. Karthik Rajan P

    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?

    (0) 

Leave a Reply