Skip to Content
avatar image
Former Member

RFC Lookup

Hi

I am new to PI i have the requirement like i need to implement the RFC Lookup in file to file scenario i have gone through some blogs but i didn't proper answer so can any one explain it step by step .

Thanksℜgards

Ramesh

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

  • Sep 22, 2017 at 06:47 AM

    Hi Ramesh,

    1. create a function module: make sure it is remote enabled

    source code:

    FUNCTION ZPI_READ_MARM_TAB.
    *"----------------------------------------------------------------------
    *"*"Local Interface:
    *" IMPORTING
    *" VALUE(PI_MATERIAL) TYPE MATNR
    *" EXPORTING
    *" VALUE(ET_MARM) TYPE MARM_TAB
    *" EXCEPTIONS
    *" NOT_FOUND
    *"----------------------------------------------------------------------


    DATA:
    ld_matnr TYPE matnr
    .

    CALL FUNCTION 'CONVERSION_EXIT_MATN1_INPUT'
    EXPORTING
    input = pi_material
    IMPORTING
    output = ld_matnr
    EXCEPTIONS
    length_error = 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.


    CALL FUNCTION 'MARM_GENERIC_READ_WITH_MATNR'
    EXPORTING
    * KZRFB = ' '
    MATNR = ld_matnr
    * MAXTZ = 0
    TABLES
    MARM_TAB = et_marm
    * MEINH =
    * O_MARM_TAB =
    * O_MEINH =
    EXCEPTIONS
    WRONG_CALL = 1
    NOT_FOUND = 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
    raising not_found.
    ENDIF.



    ENDFUNCTION.

    then is the big question: do you use graphical mapping in SAP PI/PO or XSLT?

    Best regards, Peter

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 25, 2017 at 06:49 AM

    Thanks a lot for your reply

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Sep 25, 2017 at 06:09 AM

    Hi Ramesh,

    nicely explained by peter about rfc lookup..

    Please if you can not avoid rfc look up, you may opt to go for proxy lookup which is far better compared to RFC lookup .

    Add comment
    10|10000 characters needed characters exceeded