Problem logging on to Web Dynpro application


If a BSPApplication container is used to show a Web Dynpro/ABAP application, the logon screen is shown even if LogonData.User and LogonData.Password properties are set correctly.


In contrary to BSP applications, the Web Dynpro runtime uses some javascript routines to check whether the user has enabled cookies before executing the logon via http Basic Authentication, even if the Basic Authentication are sent with the first request. Therefore, instead of logging on to the application directly, the form-based logon screen is displayed and the user is forced to press the Submit button before being able to work with the application.


To avoid showing the logon screen when logon data is provided programmatically, add the parameter sap-system-login-basic_auth=X to the URL of your application.


If you want to call the TreeDemo application, replace the method call

 url = "/sap/bc/webdynpro/sap/treedemo"

with the following code

 url = "/sap/bc/webdynpro/sap/treedemo?sap-system-login-basic_auth=X"