Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member222068
Active Participant

Author : Sankar Gelivi

Date    : 05.02.2014

Summary :  This documents explains creation of select options and various methods that are available under the interface IF_WD_SELECT_OPTIONS.

                    This document tells how to create blocks, how to get the range table data etc.

List of methods available in the interface IF_WD_SELECT_OPTIONS:

1.  ADD_SELECTION_FIELD( )

2.  ADD_SELECTION_FIELDS( )

3.  ADD_HORIZONTAL_DIVIDER( )

4.  ADD_TEXT_LINE( )

5.  ADD_BLOCK( )

6.  ADD_PARAMETER_FIELD( )

7.  ADD_SELECTION_SCREEN_ITEMS( )

8.  CREATE_RANGE_TABLE( )

9.  GET_RANGE_TABLE_OF_SEL_FIELD( )

10.SET_GLOBAL_OPTIONS( )

11.RESET_ALL_SELECTION_FIELDS( )

12.GET_SELECTION_FIELDS( )

and so on.

Requirement : Creation of select options in Web Dynpro ABAP using list of methods of the interface IF_WD_SELECT_OPTIONS

Note: 1. SAP has provided a component 'WDR_SELECT_OPTIONS' for select options.

Procedure :

1. Define 'WDR_SELECT_OPTIONS' under used components tab of the using or current component.

just like the way we create an instance to the class, we are define component use  ( this will act like a instance ) to the component to the component.

2. Define two attributes in the attributes tab of the view.

Note: If you are define select options only in single view of a component then define two attributes in the view controller else define in component controller.

3. Define used controllers in the view controller.

4. Click on the CREATE icon and select the INTERFACE CONTROLLER of the WDR_SELECT_OPTIONS

5. Component and interface controller of WDR_SELECT_OPTIONS are defined under the view controller's - used controllers

6. Implement the logic in the view controller WDDOINIT( ). This method acts as an initialization.

First instantiate the used component. just like the way we instantiate the classes in ABAP.

click on the F4 of input field and select the component WDR_SELECT_OPTIONS.

7. Code gets auto generated.

8. Implement the following code

Note:

wd_this->WD_CPIFC_SELECT( ), is a interface component. This will return all the properties of the WDR_SELECT_OPTIONS component.

9. Define the method CREATE_RANGE_TABLE( ), to create range table for a field.

click on pattern and select call method

10. code gets auto generated. define the variables LV_MATNR AND LR_MATNR

11. Define the method ADD_SELECTION_SCREE( ), to add field to the selection screen

12. Design the view with the viewcontainer UI element. Viewcontainer UI element acts like a SUB SCREEN Area in Module pool

13. Assign View to window. To assign View of the select options, Right click on the VC --> Embed view.

14. click F4 on the View to be Embedded property and select WND_SELECTION_SCREEN view/Interface view

15. View is assigned to View Container

16. Create Web Dynpro Application and execute. Select options for Material is displayed.

Note: To make four buttons invisible, we have to use the method SET_GLOBAL_OPTIONS( ).

17. Active and re-execute the application.

Note: 4 standard buttons are now invisible.

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

18. ADD_BLOCK( 😞 To create a block.

Result :

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

19 .  Create a node in the context.

20. Design the view with a Table and Button

21. GET_RANGE_TABLE_OF_SEL_FIELD( 😞 To read the data of select options.

22. Assign LR_MATNR data to a field symbol.

22. Logic to fetch the data based on the user inputs

23. Result:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

24. ADD_SELECTION_FIELDS( 😞 To add multiple fields to the selection screen

Result:

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

25. GET_SELECTION_FIELDS( 😞 To read data of all the selection screen fields.

26. Logic to fetch the data for multiple fields

Active and execute the application

Note: As the size of the document is exceeding 1 MB, rest of the methods of will be published in a new document as SELECT OPTIONS -- Part 2

19 Comments
former_member182534
Active Participant
0 Kudos

Hi Sankar,

Nice document but kindly copy past the code using code spinster.

Regards

Piyas

former_member222068
Active Participant
0 Kudos

Thank you Piyas,

Thanks & Regards,

Sankar Gelivi

former_member5006
Participant
0 Kudos

nice document .. .

In this scenario  my requirement is, material text has to display in bold . like emphazied option ..  how can i achieve dis ?

former_member210804
Active Participant
0 Kudos

Good to share the knowledge. Keep going ahead :smile:

Former Member
0 Kudos

Very descriptive and informative material. Nice job. :smile:

former_member222068
Active Participant
0 Kudos

Thank you Amit.

former_member222068
Active Participant
0 Kudos

Thank you Narasimha

former_member222068
Active Participant
0 Kudos

Hi Naveen, we dont have option to set text as BOLD.

Thanks & Regards,

Sankar Gelivi

Former Member
0 Kudos

Nice document

srikanth_j4
Explorer
0 Kudos

Thanks for this , It's a great help for me understand this process

former_member222068
Active Participant
0 Kudos

Thank you Sankar

former_member222068
Active Participant
0 Kudos

Thank you Srikanth

Former Member
0 Kudos

Helpful document, Thanks for sharing.

Regards,

Prakash.

0 Kudos

Thank u very much for this document... Really helpful.

former_member222068
Active Participant
0 Kudos

Thank you Siva Shankar

fabio_bellocchio
Participant
0 Kudos

Such a helpful and well produced document. Thank you.

former_member222068
Active Participant
0 Kudos

Thank you Bellocchio

devendra_patel
Participant
0 Kudos
Hi Sankar,
This page is really helpful can you please provide link to part 2 of this document.
cdprasanna
Active Participant
0 Kudos
Hi

Helpful, Thanks for Sharing....I want to develop dependent search help using select options.

Kindly suggest if it is possible.

Example : Second F4 values should be dependent on first F4.

Thanks,

Prasanna CD
Labels in this area