03-14-2007 9:29 AM
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
03-14-2007 9:32 AM
Hi
Can u please tell me wathere your RFC function modulw getting trigger or not.
If yes what sort of problem u faced.
Reg
Hiren Patel
03-14-2007 9:42 AM
Hi Hiren,
Yes the function module is getting triggered and I am using it in a program. But wat my doubt is possibly I need to run the program in the system where table is rather then the target system.
Hi Tomasz,
The rfc destinations you are seeing is what i found in table RFCDES and hence I am using it.
thanks,
Gaurav
03-14-2007 10:01 AM
Hi
See Gaurav lets take case system A is source and system B Target.
Now Your table is in traget system B so you need to write a function module in System A and that you have to call in System B using RFC destination which is created in System B for B to A Communication.
Regards,
Hiren Patel.
<b>Don't forget to Reward Points.</b>
03-14-2007 9:35 AM
Hi,
Make sure destination name is correct...You have 'aor3d01_RQ2_00' instead of 'RQ2100'.
Uncomment exceptions as well to investigate errors that may occur during function call
...
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.