Summary: This is a step by step guide for those ABAP consultants who want to try their hand at Web Dynpro ABAP. By following these 5 easy steps anyone who has knowledge of ABAP can create their first fully functioning Web Dynpro ABAP Application which fetches data from an SAP back-end system. This example Web Dynpro Applications displays the personal information of an employee whose personal number (PERNR) is provided.
Step 1. Create Web Dynpro Component
- Go to Transaction SE80, choose Web-Dynpro-Comp./Intf in the object list and provide a new name (Y_FIRST_WEBDYNPRO) and click on Display.
- Confirm you want to create the object by clicking on Yes.
- Enter the description and choose the Type radio button as Web Dynpro Component.
Step 2: Component Controller
- Go to Component Controller and Right click on the CONTEXT, select Create and then select Node.
- Provide a Node Name as PA0002 and Dictionary Structure as PA0002 and then select Add Attribute from Structure.
- Select the following attributes from the PA0002 structure.
This is how the context should look like after you have completed Step 2.3.
Step 3: Designing the View Layout
- Click on MAIN View.
- Go to the Context in the view and then drag and drop the PA0002 node which appears in Right side (Component Controller) of the View.
- Now, go to the Layout Tab in View and right click the ROOTUIELEMENTCONTAINER and then choose Insert element.
- Provide ID and select type as Label.
- Again right click the ROOTUIELEMENTCONTAINER and then choose Insert element. Select InputField UI element this time.
- Now select the EMPLOYEE_NUMBER_LBL and provide the Text property as Employee Number in the Property Editor.
- Now, we will bind the Value property of the InputField UI element to the context. This is done by clicking on the selected area and then selecting the context attribute PERNR.
- This is how the value property will look after binding it with the required Context Attribute.
- Insert a Button UI element which will be used to fetch the data from the back-end. Bind the event property of the UI element with action SHOW_DETAILS.
- Similarly, insert a Label and TextView UI elements for First Name, Last Name, Date of Birth and Nationality Output Fields.
- This is how the ROOTELEMENTCONTAINER should look after all the required UI elements are inserted.
Step 4: Adding ABAP Code
- Now we will insert Code to the actions that were created in Step 3. Here, we will fetch data from back-end for the employee number entered by the user. Click on the Actions Tab of the View.
- Double click on SHOW_DETAILS Action
- Below is a screenshot of the ABAP Code that goes between method and endmethod.
- Click on Save and Activate all the inactive objects created in this tutorial.
Step 5: Creating Web Dynpro Application
- Create Web Dynpro Application by right clicking the Web Dynpro.
- Give your application a name and description.
- Right click on the Web Dynpro component and activate it.
- Output : Right click on the application and select Test to run your application.
Output In The Web Browser
Update: A follow on article is now available here: How To Use Inbound And Outbound Plugs In SAP Web Dynpro ABAP Programs
This documentation was very helpfull, it is quite simple and easy to follow.
Could you please provide an example with more than one view using the outbound and inbounds plugs.
Kind regards and many thanks
José Carneiro
Hi José,
Thanks for the kind words. I will add your request to tutorial queue.
Pete
hi
Can u please send me how to configuration of alert in r/3 please provide the step by with screen shot
Thanks
Kaustubh Mane
Hi Kaustubh,
I will add it to the list of topics that have been requested
Thanks,
Pete
thanks pete
kaustubh