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: 

complete example code for rfc

Former Member
0 Kudos

can anybody give one <b>complete example code</b> for

1. Synchronous rfc

2. Asynchronous rfc

3.Transactional rfc.

i know the theory part. what i wanna <b>complete code</b> for each of the above rfc (not only the calling syntax)with the scenario..

points will be rewarded....

1 ACCEPTED SOLUTION
3 REPLIES 3

0 Kudos

HI NEGI..

thax for ur reply....

i hv seen that doc for AlE and i know how to configure the rfc destination at sm59..

can u gv me a report where where an rfc fm is called from another non sapsystem ....

Former Member
0 Kudos

Hi,

Please find a code of : sRFC...(for aRFC and tRFC give me time of 1 week)

1. Server FM Module ( RFC Enabled).

FUNCTION ZRFC_TEST.

*"----


""Local interface:

*" EXPORTING

*" VALUE(TEST) TYPE SSTRING

*" TABLES

*" IT_MARA STRUCTURE MARA

*"----


Concatenate 'DATE:' sy-datum into TEST separated by ','.

select * from mara into table it_mara up to 100 rows.

ENDFUNCTION.

2. Client Module:

REPORT ZRFC_CLIENT

.

TABLES: MARA.

DATA: PTEST TYPE SSTRING.

DATA: IT_MARA TYPE TABLE OF MARA.

DATA: WA_MARA TYPE MARA.

CALL FUNCTION 'ZRFC_TEST'

DESTINATION 'DEST_AAAA'

IMPORTING

TEST = PTEST

TABLES

IT_MARA = IT_MARA.

WRITE: PTEST.

LOOP AT IT_MARA INTO WA_MARA.

< WRITE: > as per your need.

ENDLOOP.

NOTE: You have to Creat DEST_AAAA using TCODE SM59