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

How to send data of SELECT loop to external RFC?

Hi threre,

a old programm uses CPI-C to send data of a SELECTION loop to a external server:

SELECT abc into buf FROM table.

COMMUNICATION SEND ID CONNID BUFFER buf.

* Works fine!

ENDSELECT.

The selected data is very BIG - so we can NOT use internal tables or multiple open the Selection and skip rows.

Now - we want to replace all CPI-C communication by RFC calls.
But the SELECT loop ends with the first call of a external RFC function (implicit COMMIT WORK).

SELECT abc INTO buf FROM table.

CALL FUNCTION 'ZSEND' DESTINATION 'EXTERNAL'.

* here COMMIT WORK is called implicit and the loop ends!

ENDSELECT.

What is the recomended way to to this?

Thanks on advance,

Andi

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

5 Answers

  • Best Answer
    Posted on Apr 04, 2012 at 02:36 PM

    Using an OPEN CURSOR WITH HOLD, FETCH INTO TABLE itab PACKAGE SIZE n you will be able to ignore implicit db commit.

    (For a true COMMIT-WORK, select data into an internal table and pass those data by slice to the RF FM)

    Regards,

    Raymond

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Raymond Giuseppi

      Hi Raymond,

      thank you for your quick reply. I tried again with an increased keepalive on destination BACK but I am still getting the error message. The timeouts on the destinations in SM59 are at their default values of 300 seconds. Thanks for pointing me to the gateway parameters. There are many of them which I need to investigate and more suggestions on how to fix this issue are very welcome.

      Best regards,
      Christian

  • Posted on Apr 04, 2012 at 02:46 PM

    Hi,

    Try call function in new task (if remote enabled).

    Regards,

    Maria João Rocha

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 05, 2012 at 05:45 AM

    Hi Andreas,

    Try with Native SQL.

    EXEC SQL PERFORMING loop_output .

    SELECT ........
    WHERE ...... :P_INPUT

    ENDEXEC.

    FORM loop_output .
    CALL FUNCTION 'ZSEND' DESTINATION 'EXTERNAL'.
    ENDFORM. "loop_output

    Regards,

    Rakesh.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 10, 2014 at 03:37 PM

    Hi Andreas,

    Did you managed to find a solution/workaround for this?

    I have very similar situation. Tried OPEN CURSOR/FETCH NEXT CURSOR and also ADBC, both approach worked fine with the 7.02 kernel, but raised exception with the 7.4x kernel.

    Thanks a lot,

    Peter

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 04, 2012 at 02:35 PM

    The multiple RFC calls will probably be a performance issue.

    I would change the logic to SELECT into an internal table and then use one RFC call with all of the data. (unless, of course it is going to multiple destinations.)

    Rob

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Rob,

      the selected data is BIG - VERY BIG - so a internal table will be a performance issue for the server.

      It should work like a database cursor which stays open and get all data directly to the remote app.

      Bye,

      Andi

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.