Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

how to call a report through rfc

Former Member
0 Kudos

Hi All,

Is it possible to call a report or submit a report in a different (sap) system when i execute the program in another sap system?

My requirement is like this : When i execute the report in one sap system then it should trigger the report in another system and i need to get the datas in one system.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Raja,

Create an RFC function module in system2 with the the help of code of repot2. then call this RFC function module from your System1.

thanks and regards,

Antony Thomas

6 REPLIES 6

Former Member
0 Kudos

Hi Raja,

Create an RFC function module in system2 with the the help of code of repot2. then call this RFC function module from your System1.

thanks and regards,

Antony Thomas

former_member181995
Active Contributor
0 Kudos

Just little suggestion further to Antony's response.

You can use Submit report option in calling RFC. Just two line of code in RFC

0 Kudos

Hi amit,

Thanks for ur reply. I tried to use the submit statement but i could nt able to get the output. If possible could you please let me know how to use the submit statement in the RFC?.

Regards

Raja

0 Kudos

Hit F1 on SUBMIT statement and look for some additions to be mentioned..... I guess you should not mention Return addition...Help should say you better...

0 Kudos

Sorry ignore my earlier reply.

If your Report done,And you have transaction attached to it,than you can use the below statement

call TRANSACTION '<Your transaction>'."Caps Must on

Sandra_Rossi
Active Contributor
0 Kudos

I just give you more details. Assuming zreport is the report in system2, that you want to call from system1. You must create an RFC function module.

In system2:

First, in zreport, you must [export all the data|http://help.sap.com/abapdocu/en/ABAPEXPORT_SHORTREF.htm] you want to get in system1:

EXPORT variable itab ... TO MEMORY ID 'Z_MY_MEMORY'.

Second, create function module Z_MY_RFC_FUNCTION, in the attributes you must activate RFC-enabled checkbox. Define all importing (parameters needed to call zreport, which are received from system1), and exporting parameters (data you want to take back to system1). SUBMIT the report, and [import data of zreport back from memory|http://help.sap.com/abapdocu/en/ABAPIMPORT_SHORTREF.htm].

FUNCTION z_my_rfc_function.
SUBMIT zreport
   WITH ...
   AND RETURN.
IMPORT variable itab ... FROM MEMORY ID 'Z_MY_MEMORY'.

In your program of system1, [call the RFC function module|http://help.sap.com/abapdocu/en/ABAPCALL_FUNCTION_SHORTREF.htm] in system2:

CALL FUNCTION 'Z_MY_RFC_FUNCTION'
   DESTINATION 'system2'
   EXPORTING 
     (params of zreport)
   IMPORTING
     (variable, itab, etc.)