Sunday, December 19, 2010

Calling a Web Dynpro application from another Web Dynpro application

Summary:

Webdynpro application to demonstrate how 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.

Application One:

  1. Create a Webdynpro component using TCode SE80 with name ZDEMO_FLIGHTS.
  2. Create a View with name FLIGHTS.
    1. Go to context tab of view and then create context node with name FLIGHTS.
    2. Add attributes to the node from structure SFLIGHT.

  1. Go to Layout tab of view to design the view.

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.

Now it will generate a method (ONACTIONCLICK) to handle the Event. Later we will Implement the Method.

4. Poplate table FLIGHTS with flights details.

a. Go to methods tab of view FLIGHTS and implement DOINIT method to get Flight details from table SFLIGHT.

5. Assign view FLIGHTS to window, activate the component and then create an 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.

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

Implement the Method ONACTIONCLICK of view FLIGHTS to handle the Event:

Result:

Test the Application ZDEMO_FLIGHTS, click on lead selection of FLIGHTS table. You will see the second application in other window.

Result of second Application





No comments:

Tutorials on SAP-ABAP

Adobe Interactive Forms Tutorials

Business Server Pages (BSP)

Userexits/BADIs

Web Dynpro for ABAP (Step by step procedure for web dynpro,Tutorials on Web Dynpro,)

ALV Tutorials

Blog Archive

goodsites