Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Authenticating User Login Details in SAP

Former Member
0 Kudos
1,549

Dear Experts,

We are having a Mobile Application using Sybase where user sends his user name and password to SAP via a Custom Bapi. In this Bapi how can i Authenticate whether the users login Credentials are correct.

Please kindly let me know.

Regards

Sam

1 ACCEPTED SOLUTION
Read only

vijaymanikandan
Contributor
0 Kudos
877

Hi

In your custom BAPI use the function module 'RFC_LOGIN' and check the sy-subrc value to check the LOGON details of the user..

Regards,

Vijay V

7 REPLIES 7
Read only

vijaymanikandan
Contributor
0 Kudos
878

Hi

In your custom BAPI use the function module 'RFC_LOGIN' and check the sy-subrc value to check the LOGON details of the user..

Regards,

Vijay V

Read only

0 Kudos
877

Dear Vijay,

The RFC_LOGIN is not working. whatever password we provide it is giving sy-subrc 0.

Please give some other solution.

Regards

Sam

Read only

0 Kudos
877

Hello Sam,

try the Function Module SUSR_LOGIN_CHECK_RFC.

Kind regards,

Hendrik

Read only

0 Kudos
877

Hi,

I gave my user name and password correct to SUSR_LOGIN_CHECK_RFC but its always giving wrong password.

please help.

regards

sam

Read only

0 Kudos
877

Hi

Add this piece of code in your Function module or create a test program and run this.

NOTE: Depending on the system your password might be case sensitive.

parameters: p_name type sy-uname,

p_bcode type XUBCODE.

CALL 'INTERNET_USER_LOGON' ID 'AUTHTYPE' FIELD 'P' "passwor

ID 'TESTMODE' FIELD SPACE

ID 'UNAME' FIELD p_name

ID 'PASSW' FIELD p_bcode.

If sy-subrc = 0.

write: 'success'.

endif.

Regards,

Vijay V

Read only

0 Kudos
877

Hi,

If you will use this FM in your program, then it will work fine perfectly.

It is showing error because you didn't check the uppercase/lowercase checkbox in FM execution screen.

It automatically converts it into Uppercase hence error.

Try by checking that checkbox.

Regards,

Harsh Bansal

Read only

Harsh_Bansal
Contributor
0 Kudos
877

Hi,

You can use SUSR_LOGIN_CHECK_RFC for verifying credentials.

sy-subrc = 0 will mean correct credentials. Otherwise based on error, different exceptions like 'wrong password' will be caught.

You can put check also like if user sends wrong password 3 times then you can lock the user by using 'BAPI_USER_LOCK'

Regards,

Harsh Bansal