2009 Aug 11 10:18 AM
hi
when i am using rfc_ping like below the sy-subrc = 0.
CALL FUNCTION 'RFC_PING' DESTINATION dest_asia
EXCEPTIONS
communication_failure = 1
system_failure = 2
OTHERS = 3.
but, when i am using 'RFC_FUNCTION_SEARCH' to check for function module, it is throwing sy-subrc = 3 when the FM is present in the destination system. please help
CALL FUNCTION 'RFC_FUNCTION_SEARCH' DESTINATION dest_asia
EXPORTING
funcname = 'Z_MM_STOCK'
EXCEPTIONS
nothing_specified = 1
no_function_found = 2
OTHERS = 3.
2009 Aug 11 10:51 AM
I think your function 'Z_MM_STOCK' is not remote enabled.first make it remote enabled and then try.
hi
when i am using rfc_ping like below the sy-subrc = 0.
CALL FUNCTION 'RFC_PING' DESTINATION dest_asia
EXCEPTIONS
communication_failure = 1
system_failure = 2
OTHERS = 3.
but, when i am using 'RFC_FUNCTION_SEARCH' to check for function module, it is throwing sy-subrc = 3 when the FM is present in the destination system. please help
CALL FUNCTION 'RFC_FUNCTION_SEARCH' DESTINATION dest_asia
EXPORTING
funcname = 'Z_MM_STOCK'
EXCEPTIONS
nothing_specified = 1
no_function_found = 2
OTHERS = 3.
2009 Aug 11 10:45 AM
Hello Ganesh,
Problem is that you have not provided tables parameter for importing the result of function module execution.
Try adding tables parameter and check if problem persist.
Thanks,
Augustin.
2009 Aug 11 10:51 AM
2009 Aug 11 10:51 AM
I think your function 'Z_MM_STOCK' is not remote enabled.first make it remote enabled and then try.
2009 Aug 11 10:52 AM
2009 Aug 11 10:56 AM
then try to debug 'RFC_FUNCTION_SEARCH' to see where the problem lies..Also,check if you have released the FM 'ZMM_STOCK'.
2009 Aug 11 11:13 AM
when i debugged..the error is showing in the call itslef.. is there anything wrong in the call?
2009 Aug 11 12:40 PM
Hi, This Function module has to be called using the Destination keyword.
For Example,
DATA: lw_rfcfunc TYPE rfcfunc,
i_rfcfunc TYPE STANDARD TABLE OF rfcfunc.
lw_rfcfunc-funcname = 'BAPI_APO_AVAILABILITY_CHECK'.
APPEND lw_rfcfunc TO i_rfcfunc.
CALL FUNCTION 'RFC_FUNCTION_SEARCH' DESTINATION p_rfcdes "System where the FM existence should be checked
EXPORTING
funcname = 'BAPI_APO_AVAILABILITY_CHECK'
GROUPNAME = ' '
LANGUAGE = SY-LANGU
TABLES
functions = i_rfcfunc
EXCEPTIONS
nothing_specified = 1
no_function_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.
ENDIF.
This will return sy-subrc = 0 if FM exists, otherwise sy-subrc is 2.
This RFC Function Module checks, if the FM mentioned is available in the TFDIR Table with PMODE = R (Remote) in the system which is called. If the DEstination keyword is not mentioned, it checks for the entry in the current system table, hence sy-subrc is always 2 in your case.
Please let me know if this works.
REgards,
Janani
Edited by: janani chakrapani on Aug 11, 2009 5:13 PM
2009 Aug 11 2:18 PM
2009 Aug 11 2:54 PM
Have u checked if your function module has an entry in the TFDIR table in the destination system when FMODE = 'R'.
If there is an entry, then the Function module will work, when executed in a program with the DEstination option.
Also, check if the RFC Destination is reachable by using the Funciton Module
CALL FUNCTION 'RFC_PING' DESTINATION p_rfcdes "Destination system where FM/BAPI is available
EXCEPTIONS
system_failure = 1
communication_failure = 2
OTHERS = 99.
If sy-subrc is 0 for RFC_PING, then cal RFC_FUNCTION_SEARCH.
Regards,
Janani
2009 Aug 11 3:08 PM
yes, i checked the table TFDIR and entry is there with FMODE = 'R'.
and have done rfc_ping..it gives sy-subrc = 0.
i havent given tables parameter..but gave funcname..is that any problem?
2009 Aug 11 10:54 AM
hi ,
You can check the RFC connection in tcode: SM59. You can also test the connection through this tcode.
check whether gateway host and gateway service is fulfilled.
Saurabh Goel
2009 Aug 11 10:56 AM
if there was any problem...the FM RFC_PING shud throw sy-subrc ne 0..but its 0..i cheked the connections..they r fine
2009 Aug 11 3:48 PM
See what rc you get with:¨
data: smess type c length 80,
cmess type c length 80.
CALL FUNCTION 'RFC_FUNCTION_SEARCH' DESTINATION dest_asia
EXPORTING
funcname = 'Z_MM_STOCK'
EXCEPTIONS
nothing_specified = 1
no_function_found = 2
OTHERS = 3
system_failure = 4 MESSAGE smess
communication_failure = 5 MESSAGE cmess.Also look at the contents of smess and cmess.
If you still get rc = 3, runn the function on the destination machine with the same parameters, and see what results you get.
matt
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |