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 syntax

Former Member
0 Kudos
451

What are the syntax for the following RFCs:

1. Asynchronous

2. TRFC

3. QRFC

Synchronous will have DESTINATION clause to the CALLFUNCTION method, if im not wrong.

1 ACCEPTED SOLUTION

Former Member
0 Kudos
151

i got the syntax for TRFC:

CALL FUNCTION ‘remotefunction’ IN BACKGROUND TASK

i need the syntax for only QRFC and ARFC. thanku.

8 REPLIES 8

Former Member
0 Kudos
151

Former Member
0 Kudos
151

Hi,

Calling an RFC function module from one system to another

Following are the participant system for our demo purpose:

D05 u2013 System where RFC function module exists

DS3 u2013 Calling system (an RFC call is made from this system to D05)

Scenario:

We would develop a small RFC function module in D05 system, which would add two variables. We would pass two variables from DS3 to D05 and get back the sum of those two variables back to DS3.

Activities to be performed in the system D05

Go to SE37.

Under Utilities > Create Function Group (say ZGB_FUNC), if doesnu2019t exists.

Now create a New Function Module ZGB_FUNC01

Refer the following links,

http://saptechnical.com/Tutorials/ABAP/RFCCall/Page1.htm

http://www.sapnet.ru/abap_docu/ABAPCALL_FUNCTION_DESTINATION.htm

Regards,

Jagadish

0 Kudos
151

can i hav the syntax for all the rfc types with the 'CALL FUNCTION' ..

thank u.

0 Kudos
151

Hi,

Synchronous RFC (CALL FUNCTION-DESTINATION)

Syntax

CALL FUNCTION func DESTINATION dest parameter list.

Effect

Synchronous call of a remote-capable function module specified in func using the RFC interface. With the addition DESTINATION, the destination is specified in dest. Character-type data objects are expected for func and dest. The calling program is continued using the statement CALL FUNCTION, if the remotely called function has finished.

CALL FUNCTION - DESTINATION parameter list

Syntax

[EXPORTING p1 = a1 ... pn = an]

[IMPORTING p1 = a1 p2 = a2 ...]

[CHANGING p1 = a1 p2 = a2 ...]

[TABLES t1 = itab1 t2 = itab2 ...]

[EXCEPTIONS exc1 = n1 exc2 = n2 ... [MESSAGE mess]

[OTHERS = n_others]].

Refer the link below,

http://msdn.microsoft.com/en-us/library/cc185356.aspx

Regards,

Jagadish

Former Member
0 Kudos
152

i got the syntax for TRFC:

CALL FUNCTION ‘remotefunction’ IN BACKGROUND TASK

i need the syntax for only QRFC and ARFC. thanku.

0 Kudos
151

CALL FUNCTION 'TRFC_QUEUE_INITIALIZE'.

CALL FUNCTION 'RFC_FUNCTION_1' " tRFC call -> NO QUEUE

IN BACKGROUND TASK

DESTINATION 'DEST'

EXPORTING ...

TABLES ... .

...

Q_NAME = 'BASIS_TEST_Q1'.

CALL FUNCTION 'TRFC_SET_QUEUE_NAME'

EXPORTING

QNAME = Q_NAME.

CALL FUNCTION 'RFC_FUNCTION_2' " qRFC call -> Q1

IN BACKGROUND TASK

DESTINATION 'DEST'

EXPORTING ...

TABLES ... .

CALL FUNCTION 'RFC_FUNCTION_N-1' "tRFC call -> NO QUEUE

IN BACKGROUND TASK

DESTINATION 'DEST'

EXPORTING ...

TABLES ... .

Q_NAME = 'BASIS_TEST_QM'.

CALL FUNCTION 'TRFC_SET_QUEUE_NAME'

EXPORTING

QNAME = Q_NAME.

CALL FUNCTION 'RFC_FUNCTION_N' " qRFC call -> QM

IN BACKGROUND TASK

DESTINATION 'DEST'

EXPORTING ...

TABLES ... .

...

COMMIT WORK.

http://help.sap.com/printdocu/core/Print46c/en/data/pdf/BCFESDE2/BCFESDE2.pdf

http://help.sap.com/saphelp_nw04/helpdata/en/7d/5b5f3ca0dd9770e10000000a114084/content.htm

u will find complete documentation in the above link.

Regards,

Jagadish

0 Kudos
151

hi...

CALL FUNCTION IN UPDATE TASK IS ALSO ONE OF THE SYNTAX......just check...

0 Kudos
151

Thanks Jagadish, the help.sap link about qrfc is really useful... thanks again.