I have created a custom table in both R/3 and BW. I have to update the R/3 table from the BW table. I am calling a function module from BW in a program with destination as test system of R/3 for updating the table in R/3 but the table is not getting updated . How can i correct this ? Shown below is the code for selecting each record from the table and calling the function module
SELECT f1 f2 f3 FROM customtable INTO
CORRESPONDING FIELDS OF wa.
CALL FUNCTION 'Z_RFC_UPDATETABLE' destination 'T03'
EXPORTING
F1 = F1
F2 = F2
F3 = F3
IMPORTING
RETURN =
EXCEPTIONS
NOT_AVAILABLE = 1
OTHERS = 2
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDSELECT.
Hi
The call seems to be right, but the code should be:
SELECT f1 f2 f3 FROM customtable INTO CORRESPONDING FIELDS OF wa. CALL FUNCTION 'Z_RFC_UPDATETABLE' destination 'T03' EXPORTING F1 = WA-F1 "<----- F2 = WA-F2 F3 = WA-F3 EXCEPTIONS NOT_AVAILABLE = 1 OTHERS = 2 ENDSELECT.
I suppose the FM 'Z_RFC_UPDATETABLE' is in R3, so you should check:
- A) Destination T03 is right;
- B) Abap code in 'Z_RFC_UPDATETABLE'
Max
Hi,
I think if the sy-subrc = 2..It means SYSTEM_FAILURE ..
This is triggered if a system crash occurs on the receiving side.
You can trap the message using the MESSAGE addition..
Example
-
CALL FUNCTION 'RFC_SYSTEM_INFO'
DESTINATION 'NONE'
IMPORTING
RFCSI_EXPORT = INFO
EXCEPTIONS
COMMUNICATION_FAILURE = 1 MESSAGE MSG_TEXT
SYSTEM_FAILURE = 2 MESSAGE MSG_TEXT.
IF SY-SUBRC NE 0.
WRITE: MSG_TEXT.
ELSE.
WRITE: 'O.K.'.
ENDIF.
Thanks,
Naren
Hi,
As mentioned by Max, the RFC needs to be there in R/3 instead of B/W..
Log on to the R/3 system..goto SE37..Give the RFC Z_RFC_UPDATETABLE..
Press display..
If the RFC is not there in R/3..create the RFC in R/3..Then call it from B/W.
Your call from B/W will not work..
Thanks,
Naren
Add a comment