This is a blog post showing how we can make use of Query String aka URL Parameters in Web Dynpro ABAP. Query String is useful for Web Dynpro that needs to be displayed dynamically based on the URL given e.g. URL link to Web Dynpro in email notifications.
In below example, you will see how Query String can be used in Web Dynpro ABAP. Before deciding to use Query String, security should be the main concern. This is because if users know how Query String works, there is a chance whereby they will access information that they are not authorized to see. Therefore, authorization check should be in place at the start of the Web Dynpro.
A Web Dynpro that displays Flight Details dynamically based on Query String given.
Steps How To
First in Web Dynpro component, create a View that can display SPFLI as a form and SFLIGHT as a table.
Next, create a Window and add above View. Go to Inbound Plugs and double click Default. A Event Handler HANDLEDEFAULT will be created. Create CARRID and CONNID as parameters which will be the Query String. Use the parameters’ value to retrieve data that are then bind to the context.
Next, create a Web Dynpro Application and execute it. You will notice that there are no data populated as there are no Query String.
Now try with a Query String e.g. “?carrid=AA&connid=0017”.
Voila, and now try with another Query String e.g. “?carrid=SQ&connid=0158”.
Let’s look at the backend. As you can see, CARRID and CONNID are populated based on the Query String.
Hope this blog post will give you an idea on how to use Query String in Web Dynpro ABAP. Do feel free to share with us on how you use Query String for different scenarios.
In the next blog post, I will show you all on how to create Password Reset Web Dynpro with Email Authentication using the same Query String concept. Cheers! 😀