on 10-14-2007 12:15 PM
Hi,
Pls tell me how to check the connection between R/3 and BW by using Function module...
Pls tell me the function module name..
Thanks.......
Hi,
the easiest is to RFC call the following FM: SUSR_LOGIN_CHECK_RFC (if no user is specified the system will connect with the user defined in the RFC destination definition, e.g. ALREMOTE).
If your RFC doesn't exist, you'll get a dump with non handled exception CALL_FUNCTION_NO_DEST.
If it doesn't dump and don't return an exception then your RFC DEST is OK.
Otherwise manage the other exceptions in your code like below
DATA: rc LIKE SY-SUBRC.
TRY.
CALL FUNCTION 'SUSR_LOGIN_CHECK_RFC'
DESTINATION 'RFC_DESTINATION' "your RFC Dest
* EXPORTING
* BNAME = 'UNAME'
* PASSWORD =
* XBCODE =
* XCODVN =
EXCEPTIONS
WAIT = 1
USER_LOCKED = 2
USER_NOT_ACTIVE = 3
PASSWORD_EXPIRED = 4
WRONG_PASSWORD = 5
NO_CHECK_FOR_THIS_USER = 6
INTERNAL_ERROR = 7
OTHERS = 8.
* CATCH 'CALL_FUNCTION_NO_DEST'.
rc = SY-SUBRC.
IF rc <> 0.
IF SY-MSGID IS INITIAL. "dump
MESSAGE ID 'NORFC' TYPE 'E' NUMBER '004'
WITH 'CALL_FUNCTION_NO_DEST'.
ELSE. "exception
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ELSE.
MESSAGE ID 'RFC' TYPE 'I' NUMBER '000'
WITH 'RFC DESTINATION OK'.
ENDIF.
ENDTRY.
hope this helps...
Olivier.
Message was edited by:
Olivier Cora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
80 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.