Sunday, April 1, 2012
This program is used as base program for other posts related to ALV events implementation in this blog.
Program steps
  • Create Web Dynpro Component with Window and View(Automatically View is embedded into Window). 
  • Define Component Use ALV for the Used component SALV_WD_TABLE under Used Components tab of Web Dynpro Component.
  • Go to Component Controller COMPONENTCONTROLLER
    • Properties tab->Define or Include Used Controllers/ Components of ALV.
    • Context tab->Create PA0002 node with cardinality 0..n.
    • Methods tab->Write the code in WDDOINIT to populate data in ALV.
    • WDDOINIT method code
    • method wddoinit .
        wd_this->get_data( ).
      
      endmethod.
      
  • GET_DATA method code
      METHOD get_data .
        DATA lo_nd_pa0002 TYPE REF TO if_wd_context_node.
        DATA lt_pa0002    TYPE wd_this->elements_pa0002.
      
        "Navigate from <CONTEXT> to <PA0002> via lead selection
        lo_nd_pa0002 = wd_context->get_child_node( name = wd_this->wdctx_pa0002 ).
        SELECT *
          FROM pa0002
          INTO CORRESPONDING FIELDS OF TABLE lt_pa0002
          UP TO 40 ROWS.
        lo_nd_pa0002->bind_table( new_items = lt_pa0002 set_initial_elements = abap_true ).
      
      ENDMETHOD.
      
  • Go to view ALV_EVENTS_V
    • Layout tab->Create View Container UI element to display ALV output. 
  • Go to INTERFACECONTROLLER_USAGE of ALV->Map Context node PA0002 of component controller to node DATA of ALV Interface Controller.
  • Go to window  ALV_EVENTS _W->Embed TABLE view of SALV_WD_TABLE component in window as shown in the screen.
  • Activate Web Dynpro component.
  • Create Web Dynpro Application and Save it as local object.
  • Run web dynpro application.

0 comments:

Post a Comment

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.