Problem logging on to Web Dynpro application

Symptoms

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.

Cause

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.

Solution

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.

Example

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

 url = "/sap/bc/webdynpro/sap/treedemo"
 bsp.ShowApplication(url)

with the following code

 url = "/sap/bc/webdynpro/sap/treedemo?sap-system-login-basic_auth=X"
 bsp.ShowApplication(url)