Skip to Content
author's profile photo Former Member
Former Member

file to rfc (file has multiple records)

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

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Oct 06, 2009 at 08:54 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 06, 2009 at 01:28 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Oct 05, 2009 at 08:33 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Oct 06, 2009 at 01:24 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.