Skip to Content
0
Former Member
Mar 14, 2007 at 09:29 AM

RFC program

15 Views

Hello All,

I have a requirement to transfer a table from Sandbox1 to sandbox2. Now I have written the program and still it is not giving me results. Can you please point out where am i doing wrong. before the code can you please one of my doubts,

I have created a RFC connection from target sandbox to the sandbox where the table is in target sandbox. SO do i need to create only connection or I have to create it the other way around as well.

the RFC destination name is 'RQ2100'.

Also I have created the program in target system, has it to be done where the table is?

Now please find the code

Tables : TIBAN.

data : tabname like DD02L-TABNAME,

data1 type table of tab512,

field1 type table of RFC_DB_FLD,

options1 type table of RFC_DB_OPT.

tabname = 'TIBAN'.

CALL FUNCTION 'RFC_READ_TABLE'

DESTINATION 'aor3d01_RQ2_00'

EXPORTING

QUERY_TABLE = tabname

  • DELIMITER = ' '

  • NO_DATA = ' '

  • ROWSKIPS = 0

  • ROWCOUNT = 0

TABLES

OPTIONS = Options1

FIELDS = field1

DATA = data1

  • 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.

write : 'test'.

thanks,

Gaurav

Gaurav Mehta