Automatic Event triggering in Web Dynpro ABAP

By Chandrashekhar Mahajan, John Deere India

Summary

Sometime user wants functionality such as, on clicking the URL; it should open the required Web Dynpro ABAP application iView along with values passed to the URL should be populated in the input field of the UI and also it should trigger the event automatically so that business user will directly see the desired output. In this paper, I explained how to achieve this result.

Business Scenario

User can pass parameters into the Enterprise Portal URL to be able to go to a specific iView of Web Dynpro ABAP application.  This should automatically populate a parameter values in UI field/s.

And also trigger automatically an event (E.g. Button Click event). This will be helpful for quick launch of application with automatic event triggering and displaying the end result to users.

 iView Related Changes

1.     Setting quick link in Web Dynpro ABAP iView

Open the role in question, and navigate to the properties for the iView which is the destination. It will have a property called "Quick Link." Assign a unique string value to this field (such as "testQuickLink" in the example below). Now you can directly call a specific iView using a URL like: https://<host>:<port>/irj/portal/testQuickLink

2.     URL Parameter passing to Web Dynpro

There is a property of iView called "Parameters Forwarded to Web Dynpro." Here, you can list out which parameters get passed from EP into the destination Web Dynpro ("pin" in the example below). So users would then (theoretically) be able to pass in a unique ID on the end of the URL as a parameter, such as:  https://<host>:<port>/irj/portal/testQuickLink?pin=1234

This technique is detailed in this paper under "Parameter forwarding for NW04 Web Dynpro iViews":

 http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/808fb397-1fcf-2910-7884-8f075c939666?QuickLink=index&overridelayout=true

Web Dynpro ABAP Component Changes

It is assumed that reader knows basic Web Dynpro ABAP coding and knows how to create Web Dynpro component, reading attributes and triggering button event etc.

 In this example, we have WD application with PIN as input field and button called Process. On click of button, additional information will be displayed.                

1.     Map component controller context node/attribute to the Window context.

As shown below, node NODE_INPUT is mapped.

Context Mapping

2.     Define attribute in Component controller

Declare attribute in Component controller which will be available globally in Web Dynpro Component.

As shown below, attribute G_FLAG_CALL_FROM_URL is defined on component controller. 

Global Attribute

3.     Declare parameter/s in event handler method HANDLEDEFAULT of WINDOW

Please note that the name should be similar to parameter name/s used in URL and should be optional parameter. Check flag Optional. For e.g. here PIN is passed to URL. It is declared in parameter of method with flag optional. ( https://<host>:<port>/irj/portal/testQuickLink?pin=1234 )

Figure 5.JPG

Click here to continue...

SAP Virtual/Onsite Trainings

Document Categories:

What's New?

Contribute?

Sample Specs

What's Hot?

Web Dynpro for ABAP Tutorials 


Join the Mailing List
Enter name and email address below:
Name:
Email:
Subscribe  Unsubscribe 

Please send us your feedback/suggestions at webmaster@SAPTechnical.COM 

HomeContribute About Us Privacy Terms Of Use • Disclaimer • SafeCompanies: Advertise on SAPTechnical.COM | Post JobContact Us  

Graphic Design by Round the Bend Wizards

footer image footer image