Mentor SAP

 

Step 11 − Activate all the checkboxes under Binding for all context attributes by selecting them. Confirm Entry by pressing the Enter key.

 

 

The result should look like this −

 

 

Step 12 − Save the changes.

 

Step 13 − To supply data to TEST table, go to Methods tab and double-click method WDDOINIT. Enter the following code −

 

method WDDOINIT .

* data declaration
data:
Node_TEST type REF TO IF_WD_CONTEXT_NODE,
Itab_TEST type standard table of TEST.

* get data from table TEST
select * from TEST into table Itab_TEST.

* navigate from <CONTEXT> to <TEST> via lead selection
Node_TEST = wd_Context->get_Child_Node( Name = `TEST_NODE` ).

* bind internal table to context node <TEST>
Node_TEST->Bind_Table( Itab_TEST ).

endmethod.

Web Dynpro applications, you should not access database tables directly from Web Dynpro methods, however, you should use supply functions or BAPI calls for data access.

 

 

Step 14 − Save the changes by clicking the save icon on top of the screen.

 

How to Create a Web Dynpro Application?

Step 1 − Select the ZZ_00_TEST component in the object tree → right-click and create a new application.

 

 

Step 2 − Enter the application name and click continue.

 

 

Step 3 − Save the changes. Save as a local object.

 

 

 

 

Next is activating objects in Web Dynpro component −

 

Step 4 − Double-click on the component ZZ_00_TEST and click Activate.

 

 

Step 5 − Select all the objects and click continue.

 

 

Step 6 − To run the application, select Web Dynpro application → Right-click and Test.

 

 

A browser will be started and Web Dypro application will be run.

 

 

Calling a Web Dynpro Application

In a Web Dynpro application, the component window has an inbound plug. This inbound plug can have parameters, which have to be specified as URL parameters.

 

Default values that are overwritten by the URL parameters can be set in the application for these parameters. If neither a default value nor a URL parameter is specified, a runtime error is triggered.

 

To create a new inbound plug, specify plug as a startup and data type should be a string. Activate the component.