Saturday, March 17, 2012

Select-Options in ABAP

Using Select-Options, the user can specify complex selection criteria. If the selection criteria is complex, you need not write lengthy logical expressions in the select query, which is solved by the select-options statement. Select-Options defines a range table which is having four columns Sign, Option, Low and High.
SELECT-OPTIONS : so_pernr for pernr-pernr.

Select-Options in Web Dynpro ABAP
To show a select options in Web Dynpro ABAP, We have to use SAP’s Standard component WDR_SELECT_OPTIONS. Select options in Web Dynpro work the same way as in ABAP reports.

Procedure to achieve SELECT OPTIONS for a field
  • Create Web Dynpro Component with Window and View.(Automatically View is embedded into Window).
  • Define Component Use for the WDR_SELECT_OPTIONS under Used Components tab of Web Dynpro Component. 
  • Define Controller usage for WDR_SELECT_OPTIONS in the Properties tab of view. 
  • Create ViewContainerUIElement in the view Layout. 
  • Do the following in WDDOINIT hook method.
    • Instantiate Used Component  WDR_SELECT_OPTIONS.
    • Instantiate Used Component Controller IWCI_WDR_SELECT_OPTIONS and and Call method INIT_SELECTION_SCREEN.
    • Create Range Table using IF_WD_SELECT_OPTIONS->CREATE_RANGE_TABLE.
    • Add Selection field by passing Range table and Field to IF_WD_SELECT_OPTIONS-> ADD_SELECTION_FIELD .
  • Go to Window of the component->View->ViewContainerUIElement 
  • Embed the view WND_SELECTION_SCREEN of Used Component WDR_SELECT_OPTIONS into ViewContainerUIElement of Web Dynpro Component.
  • Activate Web Dynpro Component
  • Create Web Dynpro Application and Run. 
  • Please Click here and Check the example program.

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.