Application Development and Automation 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: 
Read only

RFC

Former Member
0 Likes
1,581

Hi,

I created a simple RFC FM and called from report program with a valid destination to XI system.

the only parameters i am passing is tables ITAB to XI.

But it is going in Synchronous mode to XI.. but i want in Asynchronous RFC...

Any idea how to achieve this?

CALL FUNCTION 'ZTEST_RFC' DESTINATION 'SAPXI'

TABLES

T_TAB = ITAB.

how can i change this to Asynchronous RFC?

Giri

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,556

Hi,

Use IN BACKGORND TASK.

CALL FUNCTION 'ZTEST_RFC' DESTINATION 'SAPXI'

IN BACKGOURND TASK

TABLES

T_TAB = ITAB.

Any error, you can check in the transaction SM58.

Edited by: Fernando Pinto on May 2, 2008 6:12 PM

13 REPLIES 13
Read only

Former Member
0 Likes
1,556

CALL FUNCTION - RFC

INDEX @@CALL FUNCTION - RFC@@ABAP Statement@@

Syntax Forms

Synchronous RFC

1. CALL FUNCTION func DESTINATION dest

parameter_list.

Asynchronous RFC

2. CALL FUNCTION func STARTING NEW TASK task

[DESTINATION {dest|{IN GROUP {group|DEFAULT}}}]

parameter_list

[{PERFORMING subr}|{CALLING meth} ON END OF TASK].

Transactional RFC

3. CALL FUNCTION func IN BACKGROUND TASK

[DESTINATION dest]

parameter_list

[AS SEPARATE UNIT].

4. CALL FUNCTION func IN BACKGROUND UNIT

parameter_list.

Read only

0 Likes
1,556

Aparna,

I come across your answer by F1 help.... what i dont understand is

Asynchronous RFC

2. CALL FUNCTION func STARTING NEW TASK task

{IN GROUP {group

parameter_list

{CALLING meth} ON END OF TASK.

what task to be created?

how to modify my current RFC?

Giri

Read only

0 Likes
1,556

The task just has to be a valid input. you dont need to declare anything. You have to add one more form to receive results inside which you will use RECEIVE RESULTS FROM FUNCTION 'your_function_name '

Read only

0 Likes
1,556

CALL FUNCTION 'ZTEST_RFC' STARTING NEW TASK 'T_RFC' DESTINATION 'SAPXI'

PERFORMING receive_results ON END OF TASK

TABLES

T_TAB = ITAB.

FORM RECEIVE_RESULTS USING L_TASKMNAME.

RECEIVE RESULTS FROM FUNCTION 'ZTEST_RFC'

TABLES

T_TAB = ITAB.

EXCEPTIONS

COMMUNICATIONS_FAILURE = 1

SYSTEM_FAILURE = 2.

ENDFORM.

Read only

0 Likes
1,556

I GOT SHORT DUMP..

Exception condition "COMMUNICATION_FAILURE" raised.

A RAISE statement in the program "ZGIRI" raised the exception

condition "COMMUNICATION_FAILURE".

Since the exception was not intercepted by a superior

program, processing was terminated.

Giri

Read only

0 Likes
1,556

Add this to you main RFC call also

EXCEPTIONS

COMMUNICATIONS_FAILURE = 1

SYSTEM_FAILURE = 2.

Read only

0 Likes
1,556

APARNA,

Still same error, IN BACKGROUND TASK methods works for me but in my itab there are 2 fields .. but it sending only 1 field values and other fields r blank..

any idea?

Giri

Read only

Former Member
0 Likes
1,556

Hello,

You need to put IN BACKGROUND MODE at the call function command.

Regards,

Read only

Former Member
0 Likes
1,557

Hi,

Use IN BACKGORND TASK.

CALL FUNCTION 'ZTEST_RFC' DESTINATION 'SAPXI'

IN BACKGOURND TASK

TABLES

T_TAB = ITAB.

Any error, you can check in the transaction SM58.

Edited by: Fernando Pinto on May 2, 2008 6:12 PM

Read only

0 Likes
1,556

Hi Fernando,

the data is not passing to XI?

after call function i wrote write statemnt with the itab.

i can see values in basic list but its not passing to XI.

it showing there only empty structure

Regards

Giri

Read only

0 Likes
1,556

Hi,

Have you check the RFC destination SM59 connection ( Test Connection) ?

Looks like problems with XI.

In the XI, is the communication channel is OK?

Regards,

Fernando

Read only

0 Likes
1,556

If commnication channel is not setup correctly then why only 1 field values pass to XI?

i mean itab emp no: and emp name there

1 abc

2 xyz

3 dsf

in xi it is showing like

1

2

3

no values for emp name.

pls help on this issue..

Giri

Read only

0 Likes
1,556

Hi,

Please check in the SM59 , Tab "MDMP & Unicode" if Unicode is checked.

Regards,

Fernando