Problem logging on to Web Dynpro application

Symptoms

If BSPApplication container is used to show a Web Dynpro/ABAP application, the logon screen is shown even if the 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

 bsp.ShowApplication("/sap/bc/webdynpro/sap/treedemo")
with the following variant
 bsp.ShowApplication("/sap/bc/webdynpro/sap/treedemo?sap-system-login-basic_auth=X")