cancel
Showing results for 
Search instead for 
Did you mean: 

file to rfc (file has multiple records)

Former Member
0 Kudos

Hi Guys,

I have a filr to rfc scenario..

I created a Z table with ITAB in import tab and field names and then a BAPi using se37...

The BAPI source code is just one line

Modify Ztable from ITAB

I first tried wth input file having one record, and in scenario runs successfully to update the Z table, checked in se 16

Now when the input file has more than one record, but ZBAPI has just 1..1 ITAB tab

Ho can I do multiple inserts using the same rfc/bapi??

Regards,

Teja

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

As Prateek suggested 2 opionts, so I think option 2 is best for your otherwise option 1 can lead into performance issues.

Make sure that you have declard your internal table ITAB as standard table of ztable. e.g.

DATA: ITAB      type standard table of ztable,
       WA_ITAB  type ztable.

if you do like this and import the BAPI in XI then you can see the occurence of target has been changed as 0..unbounded

Finally, when you have multiple records in your internal table then loop on it and update the table. e.g.

Loop at itab into wa_itab.
Modify Ztable from WA_ITAB.
Clear:wa_itab.
Endloop.

Regards,

Sarvesh

Answers (3)

Answers (3)

former_member187339
Active Contributor
0 Kudos

Hi,

You need to do an implicit commit in BAPI.

If there are multiple call of BAPI using RFC Adapter, all calls are made together and RFC adapter cannot COMMIT.

Check point *10: What's about BAPIs? *

in Note 730870 - FAQ XI 3.0/ PI 7.0/ PI 7.1/ PI 7.11/ PI 7.2 RFC Adapter

Regards

Suraj

Edited by: S.R.Suraj on Oct 6, 2009 9:29 AM

Former Member
0 Kudos

Hi,

In your RFC i guess you have defined the ITAB as import structure...... Instead try having this as a table.

Reimport the RFC in XI and then do mapping. Here you can map the row node of your file structure to table node of RFC.

Hope this helps.

Regards,

Siddhesh S.Tawate

prateek
Active Contributor
0 Kudos

Two ways:

1. If it is a text file and you use FCC, you may use option "Recordset per message'. If you specify 1, then each record will become a new message and RFC would be called multiple times.

2. To reduce number of RFC calls, you may use multimapping logic. Export RFC to local system as XSD, change the occurrence of root node and reimport it. Then you may map the occurrence of record to the RFC root node.

Regards,

Prateek