Skip to Content
Author's profile photo Former Member

[Web Dynpro ABAP] Dynamic Display with Query String

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.

Example Scenario

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.

Blog001 - Pic01.jpg

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.

Blog001 - Pic02.jpg

Next, create a Web Dynpro Application and execute it. You will notice that there are no data populated as there are no Query String.

Blog001 - Pic05.jpg

Now try with a Query String e.g. “?carrid=AA&connid=0017”.

Blog001 - Pic03.jpg

Voila, and now try with another Query String e.g. “?carrid=SQ&connid=0158”.

Blog001 - Pic04.jpg

Let’s look at the backend. As you can see, CARRID and CONNID are populated based on the Query String.

Blog001 - Pic06.jpg

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! 😀

Assigned Tags

      4 Comments
      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Useful tips, thank you! Looking for you next blog 🙂

      Author's profile photo Former Member
      Former Member

      Hi, I dint find the next post on 'how to create Password Reset Web Dynpro with Email Authentication using Query String concept'.

      Incase it is already posted , can you please share the link 🙂 .

      Author's profile photo Former Member
      Former Member

      Hi Raj,

      Thanks for motivating me to post another blog, here is the link as requested:

      http://scn.sap.com/community/abap/blog/2013/03/23/web-dynpro-abap-password-reset-with-email-authentication

      Do rate my post if you have the time. Thanks and cheers. 🙂

      Author's profile photo Former Member
      Former Member

      Hello Yi,

      Thank you fort this document.

      I would like to ask one thing.

      for these two variables CARRID and CONNID ,, web portal guys can send dynamically from their compay portal.

      As per the document it is hard coded  ?carrid=AA&connid=0017”.

      in place of 'AA'   can portal guys will send dynamical value to webdynpro ?