Calling A Web Dynpro Application From Another Web Dynpro Application

Download as pdf or txt
Download as pdf or txt
You are on page 1of 13

Cal l i ng a Web Dynpr o Appl i c at i on

f r om Anot her Web Dynpr o


Appl i c at i on
Applies to:
SAP NetWeaver 2004s. For more information, visit the Web Dynpro J ava
Summary
This Document explains step by step procedure to call one Webdynpro application from another Webdynpro
application. We will develop two applications one is to show flight details ZDEMO_FLIGHTS and the other
one is to show booking details ZDEMO_BOOKINGS, on click of lead selection of a table FLIGHTS in
ZDEMO_FLIGHTS it will call another application ZDEMO_BOOKINGS.

Author: Suman Kumar Chinnam.
Company: YASH Technologies
Created on: 30 J uly 2008
Author Bio
Suman Kumar is a Consultant for YASH Technologies, Pvt., and Ltd. Based in India. He has 2 years of IT
experience. He has good knowledge of ABAP, BSP and Web Dynpro for ABAP.
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
2008 SAP AG 1
Calling a Web Dynpro Application from Another Web Dynpro Application
Table of Contents
Create Web Dynpro Applications .......................................................................................................................3
Application One:..............................................................................................................................................3
Application Two:..............................................................................................................................................7
Call Second Application..................................................................................................................................9
Test Application................................................................................................................................................10
Result of second Application......................................................................................................................................11
Related Content................................................................................................................................................12
Disclaimer and Liability Notice..........................................................................................................................13
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
2008 SAP AG 2
Calling a Web Dynpro Application from Another Web Dynpro Application
Create Web Dynpro Applications
Application One:
1. Create a Webdynpro component using TCode SE80 with name ZDEMO_FLIGHTS.
2. Create a View with name FLIGHTS.
a. Go to context tab of view and then create context node with name FLIGHTS.
b. Add attributes to the node from structure SFLIGHT.


Node Name
3. Go to Layout tab of view to design the view.
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
2008 SAP AG 3
Calling a Web Dynpro Application from Another Web Dynpro Application
a. Add table element with name FLIGHTS to the Layout container.

b. Now bind the table with context node FLIGHTS.
The result will be like.

c. Create an Action to the Table (when user clicks on lead selection it will call another application).
Give event name is CLICK.
Go to the properties of table FLIGHTS click onLeadSelect to create action to the table.
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
2008 SAP AG 4
Calling a Web Dynpro Application from Another Web Dynpro Application


Now it will generate a method (ONACTIONCLICK) to handle the Event. Later we will implement the
Method.
4. Populate table FLIGHTS with flights details.
a. Go to methods tab of view FLIGHTS and implement DOINIT method to get Flight details from table
SFLIGHT.
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
2008 SAP AG 5
Calling a Web Dynpro Application from Another Web Dynpro Application

5. Assign view FLIGHTS to window, activate the component and then create an application.


SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
2008 SAP AG 6
Calling a Web Dynpro Application from Another Web Dynpro Application
Application Two:
Repeat steps from 1 to 5 for second application ZDEMO_BOOKINGS.
1. Create a Webdynpro component with name ZDEMO_BOOKINGS.
2. Create view BOOKINGS.
a. Create Context Bookings and add required attributes from SBOOK to the node.
3. Insert an element table (BOOKINGS) to the Layout.
a. Create binding to the table with Context node.
The resulted view looks like.

4. Get the bookings data.
a. Go to methods of view BOOKINGS and Implement DOINIT to get the Booking details.
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
2008 SAP AG 7
Calling a Web Dynpro Application from Another Web Dynpro Application

5. Assign view BOOKINGS to the window, activate the component and create the application.


SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
2008 SAP AG 8
Calling a Web Dynpro Application from Another Web Dynpro Application
Call Second Application
Implement the Method ONACTIONCLICK of view FLIGHTS to handle the Event:

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
2008 SAP AG 9
Calling a Web Dynpro Application from Another Web Dynpro Application
Test Application
Test the Application ZDEMO_FLIGHTS, click on lead selection of FLIGHTS table. You will see the second
application in other window.


Click on lead
Selection
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
2008 SAP AG 10
Calling a Web Dynpro Application from Another Web Dynpro Application
Result of second Application

SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
2008 SAP AG 11
Calling a Web Dynpro Application from Another Web Dynpro Application
Related Content
Please include at least three references to SDN documents or web pages.
Webdynpro for ABAP : Tutorials for Beginners
For more information, visit the User Interface Technology homepage.
For more information, visit the Web Dynpro J ava
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
2008 SAP AG 12
Calling a Web Dynpro Application from Another Web Dynpro Application
SAP DEVELOPER NETWORK | sdn.sap.com BUSINESS PROCESS EXPERT COMMUNITY | bpx.sap.com
2008 SAP AG 13
Disclaimer and Liability Notice
This document may discuss sample coding or other information that does not include SAP official interfaces and therefore is not
supported by SAP. Changes made based on this information are not supported and can be overwritten during an upgrade.
SAP will not be held liable for any damages caused by using or misusing the information, code or methods suggested in this document,
and anyone using these methods does so at his/her own risk.
SAP offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this technical article or
code sample, including any liability resulting from incompatibility between the content within this document and the materials and
services offered by SAP. You agree that you will not hold, or seek to hold, SAP responsible or liable with respect to the content of this
document.

You might also like