cancel
Showing results for 
Search instead for 
Did you mean: 

Doubt regarding calling RFC from ABAP program with XI destination

Former Member
0 Kudos

Hi,

I want to call Synch RFC call in ABAP programe.

In ABAP programe do i need to give XI destination for calling RFC. If possible plz provide sample code for this purpose. please help me out.

thanks

siva

null

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Siva,

Check block below...I think you are looking for this..

/people/swaroopa.vishwanath/blog/2006/12/28/send-rfc-to-sap-xi-150-asynchronous

Nilesh

Former Member
0 Kudos

hi Nilesh,

thanks for providing URL, but it does not show any code.

thanks

siva

Former Member
0 Kudos

Hi Siva,

Code is there( Inside Text Box)..I am copy/pasting for you..

&----


*& Report ZRFC_READ_TABLE_EOFM *

*& *

&----


*& *

*& *

&----


REPORT zrfc_read_table_eofm.

data: i_options like RFC_DB_OPT occurs 0,

i_fields like RFC_DB_FLD occurs 0,

i_data like TAB512 occurs 0,

i_table_name like dd02L occurs 0 with header line.

SELECTION-SCREEN: BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.

PARAMETERS: tab_name like DD02L-TABNAME.

SELECTION-SCREEN: END OF BLOCK b1.

CALL FUNCTION 'RFC_READ_TABLE'

EXPORTING

query_table = tab_name

  • DELIMITER = ' '

  • NO_DATA = ' '

  • ROWSKIPS = 0

  • ROWCOUNT = 0

tables

OPTIONS = i_options

fields = i_fields

data = i_data

EXCEPTIONS

TABLE_NOT_AVAILABLE = 1

TABLE_WITHOUT_DATA = 2

OPTION_NOT_VALID = 3

FIELD_NOT_VALID = 4

NOT_AUTHORIZED = 5

DATA_BUFFER_EXCEEDED = 6

OTHERS = 7

.

*IF sy-subrc <> 0.

    • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

    • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

*ENDIF.

I_TABLE_NAME-TABNAME = tab_name.

append I_table_name.

CALL FUNCTION 'ZRFC_READ_TABLE_EOFM' IN BACKGROUND TASK DESTINATION

'NWDCLNT100'

TABLES

i_data = i_data

i_options = i_options

i_fields = i_fields

i_table_name = i_table_name

EXCEPTIONS

COMMUNICATION_FAILURE = 1

SYSTEM_FAILURE = 2

OTHERS = 3

.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

commit work.

Let me know if you need more details.

Nilesh

Former Member
0 Kudos

Nilesh,

Thanks for your information, can you please tell me the command for callin Synchronouse RFC from ABAP programe.

thanks

siva

null

Former Member
0 Kudos

Hi Siva,

In blog can you see ..

&----


*& Report ZRFC_READ_TABLE_EOFM *

*& *

&----


*& *

*& *

&----


This is nothing but "Text Area"..there is scroll bar on left hand side for this text area. Scroll down ..you will see complete code.

This how you call RFC in abap program..

CALL FUNCTION 'ZRFC_READ_TABLE_EOFM' IN BACKGROUND TASK DESTINATION

'NWDCLNT100'

TABLES

i_data = i_data

i_options = i_options

i_fields = i_fields

i_table_name = i_table_name

EXCEPTIONS

COMMUNICATION_FAILURE = 1

SYSTEM_FAILURE = 2

OTHERS = 3

.

"sorry to ask these small things"

No problem. We are here to help each other

Let me know if you need more details.

Nilesh

Former Member
0 Kudos

Hi Nilesh, thank a lot for ur information.

this code is for Asyncronuse RFC call

CALL FUNCTION 'ZRFC_READ_TABLE_EOFM' IN BACKGROUND TASK DESTINATION.'NWDCLNT100'

can you please let me know for Syncronouse RFC call.

thanks

siva

Former Member
0 Kudos

Check out below thread..

( Reply from Sekhar.)

Hope this will help.

Nilesh

Answers (0)