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: 

RFC

0 Kudos
272

Hie Guys,

I am developing an RFC in SAP SYS2 and need to call it in SAP SYS1.

My requirement is we recieve a prenote with a code say '01' which is reason why a Cheque has been returned.So for our on-ward processing we need this reason in text form.To get this we can only find it in SYS2.So i developed a Function (YFUNCTION_SYS2)in SYS2 and made it Remote -enabled.

Import----


I_Code

Export----


Structure EX_ XXXX with the Code and the text

Source code of FM

select single * from Txxxx into wa_xxxx

where code = I_code.

if sy-subrc eq 0.

ex_xxxx = wa_xxxx.

else

raise exception.

endif.

This FM is working quite well in SYS2.

My problem is on calling the FM from a program in SYS1 as the table Txxxx is not in this recieving system.

say

Report YXXXXX.

tables: Txxxx.

parameters: p_code like Txxxx-code.

dest like rfcdes-rfcdest default 'SYS2'.

data: system like sy-sysid.

CALL FUNCTION 'YFUNCTION_SYS2'

destination dest.

EXPORTING

I_CODE = P_CODE

IMPORTING

EX_XXXX = TXXXX

SYS = SYSTEM

exceptions

.............

On doin a syntax check it says the table TXXX is not known.

Do i necessarily need to have this table in the calling SYSTEM system SYS1.

regards.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
198

You don't need the table, only a definition of its structure. Either define it in SE11 as a structure (if you need to use it in many programs) or locally in your program if you only need to use it once. e.g something like.

types: begin of ty_xxxx,

field1 type char01,

field2 type char01,

... etc....

end of ty_xxxx.

data: txxxx type table of ty_xxxx.

Regards,

Nick

4 REPLIES 4

Former Member
0 Kudos
198

I don't think u need to ref the table name TXXX. def another structure manaually with all the fields w/o ref of the table.

0 Kudos
198

Thanks for your answer it quite useful

Former Member
0 Kudos
199

You don't need the table, only a definition of its structure. Either define it in SE11 as a structure (if you need to use it in many programs) or locally in your program if you only need to use it once. e.g something like.

types: begin of ty_xxxx,

field1 type char01,

field2 type char01,

... etc....

end of ty_xxxx.

data: txxxx type table of ty_xxxx.

Regards,

Nick

0 Kudos
198

Thanx for your answer it was very useful