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: 

Calling a Report from one SAP system(4.7) to another SAP system(ECC6)

former_member267445
Participant
0 Kudos

Hello Gurus,

Recently we have upgraded from 4.7 to ECC. While upgrading we were used one Z program to download the objects from 4.7 and used Z program to upload the objects into ECC.

Now we are planning to integrate Z program of 4.7 and Z program of ECC into one program in ECC. When we execute the program in ECC, system should call the program of 4.7 remotely and download the objects in ECC after providing the selections in selection screen and upload program take care as it is in ECC.

I am trying to use SUBMIT statement but I am not sure about the remote call. Could you please suggest on this.

If any one worked on this please suggest me.

In 4.7, the program is ZTOOL,

Thanks and Regards,

Muralikrishna Peravali

15 REPLIES 15

Former Member
0 Kudos

Hi Murali,

i think instead of calling it through program you should build the functionality in RFC function module and then call the FM with destination.

thought i have not worked on such things before but we connect to remote systems via RFC.

thanks

rajpal

0 Kudos

Hi Rajpal,

Thank you for the quick reply.. In RFC FM what will be the import and export parameters?

Can you please explain me because am new to RFC.

Thanks,

Muralikrishna

0 Kudos

Hello Muralikrishna

Let's say that you want to read data of Sales Order from ECC. What you want is and RFC function module in ECC which will have a IMPORTING parameter iv_vbeln TYPE vbeln and EXPORTING parameter es_vbak TYPE VBAK.

You must mark the function module as a RFC enabled.

You also have to mark all the parameters as a transported by value (not reference).

In the function module you write your logic - in my example it will be simple:

SELECT SINGLE *

  INTO ls_vbak

  FROM vbak

  WHERE vbeln = iv_vbeln.

Now, to call the function you do as follows:

  DATA:

    lv_rfc_dest TYPE rfcdest VALUE 'your_rfc_destination',

    ls_vbak TYPE vbak.

  CALL FUNCTION 'NAME_OF_THE_FUNCTION

    DESTINATION lv_rfc_dest

    EXPORTING

      iv_vbeln = 'some_number'

    IMPORTING

      es_vbak = ls_vbak.

And that is it - you can now get that via RFC.

regards

0 Kudos

Hello Adamus,

Thank you for reply...

Here in my case the input of the source(4.7) program is custom object and File path, and output is custom object and number of dependent objects.

In the output screen, report should display the main object and dependent objects after user executes the program in destination(ECC) . After that user will choose the relevant object and he will download the objects into file.

Here in RFC, import parameter is Custom object and export is file path... is my assumption is correct?

Can we use SUBMIT for my requirement?

Please suggest me.

Thanks and Regards,

Muralikrishna

0 Kudos

Hello

You have to make parameters to allow you to send/receive data from the function module.

So if you want to send a path and an custom object (is it really an object like in OOP or do you mean a structure/table variable type?) function module has to have IMPORTING parameters which will allow data (i.e. i_path and i_custom_object).

If you want to receive data from the function module you need to create proper EXPORTING parameters (i.e. e_custom_object_data and e_number_of_children).

RFC module is the same as a standard function module with the exception of being able to be called by RFC and having parameters send by value.

regards

edgar_nagasaki
Contributor
0 Kudos

Hi Muralikrishna,

As an alternative to custom RFC function module you could try std. RZL_SUBMIT which basically has target remote system and report name as parameters. Only point of concern using this is ensure you have authorization to (S_RZL_ADM object, ACTVT '01').

Regards,

Edgar

0 Kudos

Hello Edgar,

I have tried using the FM: RZL_SUBMIT, but this is not fulfill my requirement.

Can you please suggest me another approach.

Thanks and Regards,

Muralikrishna Peravali

0 Kudos

Mmmm... okay.

So you should go with custom RFC function module approach that, in a simpler way, would be just a shell in remote system to allow your report submitting.

Regarding your doubts about function module parameters it would be all data required to fulfill your report selection screen and that you will use within SUBMIT instruction.

0 Kudos

Hello Edgar,

From RFC, can we get the file path also into source system(ECC).

Thanks and Regards,

Muralikrishna Peravali

0 Kudos

You mean to have code at target side that identifies what file path would need to take place? If it was the question, yes, you can implement any logic in your RFC function module to determine it (for instance a code that retrieves values from a table and so on). Also if you need same file path to be sent back to source system, just need to have a return (export) parameter in function module then send file path through it.

But if your requirement is to send file path from source to target system, easy as well, you just need to have a parameter in function module which you would sen file path string through.

0 Kudos

Hello Edgar,

In my requirement, Destination is 4.7, source is ECC. I will create RFC in ECC and RFC destination is 4.7.

In 4.7, the program is having the input parameter as File name with path.After executing the program in in ECC, call the RFC and execute the destination program in 4.7 and the data(entire program of the custom object) should store in file and download into the path which provided in input screen. Is it possible?

Thanks and Regards,

Muralikrishna Peravali

0 Kudos

Hi Muralikrishna,

First of all, sorry for delayed reply, was quite busy this afternoon

But, let's see, only side you'll need to create RFC function module is target system (RFC) and at source system (ECC) you'll only need to call this function module defining your target system (see DESTINATION option for function module calls).

In this way you'd have following:

1 - program at ECC side that will call RFC function module (at 4.7 side)

2 - RFC function module at 4.7 side that will trigger (SUBMIT) target report, also in 4.7

3 - for last, your target report in 4.7

So, answering your question, it is possible to make your target report (3) to generate a file and download it at 4.7 side (application server or, locally, presentation server, whatever you pass as file path to RFC function module, and then and therefore to target program, as long as you have authorization to). In a simpler approach you'll call a program in a remote system (in your scenario that 4.7) making use of a RFC function module (also in 4.7) to allow you to. All started through a RFC call from a program in your source system (ECC).

Not sure my explanation was good enough, please let me know.

Regards,

Edgar

0 Kudos

Hello Edgar,

Sorry for the delay response as I was busy with Go-live work. I understood what you have explained in previous mail.

My doubt is, in present situation we are downloading the objects from source system

(4.7) into one file by executing the program in source system(4.7). But now I want to execute the program in target system(ECC) and download the objects which are in source system into one file and those objects display in target system(ECC) and then upload those objects to target system by using the file. Is it possible?

If yes, could you please help me on this.

Thanks and Regards,

Muralikrishna Peravali

0 Kudos

Hello Edgar,

Any thoughts on this

Thanks and Regards,

Muralikrishna Peravali

former_member267445
Participant
0 Kudos

Hello Guru's,

Any suggestions please.

Thanks and Regards,

Muralikrishna Peravali