Skip to Content
author's profile photo Former Member
Former Member

RFC

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2007 at 06:20 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi

      The fm has to be defined in R3 not in BW, the program in BW (that's right) is calling a fm in R3, so you have to create the RFC in R3.

      U need to create that fm in BW, only if you need to call that fm from R3 in order to update the table in BW.

      Max

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2007 at 06:41 PM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2007 at 07:07 PM

    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
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jan 09, 2007 at 11:07 PM

    I have created the function module in R/3 but still the program in BW is not able to call that function module. I appreciate your help .

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.