cancel
Showing results for 
Search instead for 
Did you mean: 

Multiple executions when calling BAPI using Data services

vivek_priyadarshi2
Participant
0 Kudos

Hi All,

I am working on POC to execute call to BAPI from data services.

SCENARIO: For this scenario the source is a text file with 8 lines representing 8 unique records that need to eventually update a custom( Y) table in SAP via BAPI.

DETAILS:

This is how the Data Flow looks like.

This is the source file with 8 records

The first Query Transform (QUERY_NEST). This is just creating a dummy table structure with one to one mapping to the data coming from the file ( source).

Next Query transform maps the table data from QUERY_NEST to table input I_MISC_SETTING_RECS of BAPI ( YDSF_LOAD_SETTINGS.

RFC: Only TABLE parameters defined no IMPORT/EXPORT

The RETURN structure from BAPI call query transport is mapped to another Query transform ( QUERY_UNNEST) to map data to another dummy structure which is eventually pushed to a flat file.

ISSUE: In this POC the BAPI is getting executed 8 times ( corresponding to the number of rows in the source file ) when the DATA FLOW (DF) executes from data services.

I have looked at below blog but still don't know where i am going wrong.

https://blogs.sap.com/2012/07/23/calling-rfc-bapi-within-sap-data-services/

Thanks in advance.

Vivek

View Entire Topic
RichS
Participant

Try using the Row_Generation transform to generate a single row under which you nest the input from your flat file. Then execute the BAPI in a subsequent query.

vivek_priyadarshi2
Participant

Thanks Rich,

That resolved my issue. Below are steps i took to make this work.

1. Add a row generation transform with starting row = 1.

2. Updated the QUERY_NEST transform to nest the input from source file under ROW_ID column. Here i was struggling with restricting the row generation to work ( increment from 1 to n ) finally got it working by only selection 'Row_Generation' as the source under FROM tab.

3. Set a WHERE restriction to only execute the JOB for ROW_ID = 1