飞过太平洋的鱼  

This is my first time to write blogs in the cnblogs.com.

I just finished SAP web-application tech training as the trainer in the class a couple weeks ago, which is mainly based on Web Dynpro and Floor Plan Manager (FPM).

Personlly I do recommend  developers to adopt FPM to develop sap web-based applcations, becasue it is much easier to maintain and reuse your components.

Today, i would like to share some experience about how to build web dynpro application by a simple demo. In my next blogs, i could focus on FPM developmemt.

I want to use Sflights as the database of this demo becasue of convenience.

To begin with we need to create a web as below,

The name will be your component name and the window name is mandatory, each web dynpro component needs at least one Window Name and one View Name.

After that we need to implement one interface to help you managing your componment, which is IF_FPM_UI_BUILDING_BLOCK

 Now we have already created the a component. we can set up our controllers in the view and create your own assistance class to help you to manager your page logic by inheriting CL_WD_COMPONENT_ASSISTANCE . From the next picture, we are able to see the arcitecture of web dynpro

 The component controller is the top level for the web dynpro, we  can write our methods in thecomponent comtroller. All the data transcation, we need to build our context nodes to store and read data by the context nodes which we create, and map to the view context by business requirments.

The SFLIGHT_TABLE is for storing the data for the table, so when we create a table to display a data which you search. we can map SFLIGHT_TABLE to the view table. After we get data by our methods, we set these data into SFLIGHT_TABLE  and bind the table. we can use Web dynpro Code Wizard to generate code to read and set context node.

 Simple code as below,

 lo_nd_sflight wd_context->get_child_nodename wd_this->wdctx_sflight_table ).
 lo_nd_sflight->bind_tableNEW_ITEMS lt_sflight_table ).
 

 The Simple Demo

 

posted on 2012-06-23 22:33  飞过太平洋的鱼  阅读(186)  评论(0)    收藏  举报