on 11-11-2008 2:52 AM
Hi All,
In R/3, we can use Select-Option to get the parameter in range. What about in WDA? How can i use the select-option on WDA?
in case i want the selection screen to receive the criteria as a date range. for example:
Posting date: _____ to _____
Thanks in advance. : )
Regards,
Peerasit
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks all
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peerasit,
You can find many resources available on SDN for the same. Try to do a search in the forum or in the bloges section. Am giving out a few available sources to you.
[Working with Select Options in Web Dynpro for ABAP by Abhimanyu Lagishetti|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c09fec07-0dab-2a10-dbbe-c9a26bdff03e]
[Using Select Options in a Web Dynpro(ABAP) Application by Rich Heilman|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/2868] [original link is broken] [original link is broken] [original link is broken];
[Creating and using Variant in Select Options with Web Dynpro for ABAP -1 by Sharad Agarwal|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/10707] [original link is broken] [original link is broken] [original link is broken];
[Creating and using Variant in Select Options with Web Dynpro for ABAP -2 by Sharad Agarwal|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/10731] [original link is broken] [original link is broken] [original link is broken];
[Creating and using Variant in Select Options with Web Dynpro for ABAP -3 by Sharad Agarwal|https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/10756] [original link is broken] [original link is broken] [original link is broken];
Regards,
Uday
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peerasit,
Yes in WDA u can use select option very well.
Lets consider your case that you want to craete select option for posting date:
Step 1) Create a component with a view called main and in this view you want to create a select option called posting date.use componenet wdr_select_option in component usage.Also in view insert the same component i.e dr_select_option
Step 2) Now in wdiniti or view main you are suppose to write code to create select option.So just try to understand following code
method WDDOINIT .
DATA: lt_range_table TYPE REF TO data,
LV_TEXT TYPE STRING,
read_only TYPE abap_bool.
DATA: l_ref_cmp_usage TYPE REF TO if_wd_component_usage.
create the used component
l_ref_cmp_usage = wd_this->wd_cpuse_select_options( ).
IF l_ref_cmp_usage->has_active_component( ) IS INITIAL.
l_ref_cmp_usage->create_component( ).
ENDIF.
get a pointer to the interface controller of the select options
*component
wd_this->m_wd_select_options = wd_this->wd_cpifc_select_options( ).
init the select screen
wd_this->m_handler = wd_this->m_wd_select_options->init_selection_screen( ).
CALL METHOD wd_this->m_handler->set_global_options
EXPORTING
i_display_btn_cancel = abap_false
i_display_btn_check = abap_false
i_display_btn_reset = abap_false
i_display_btn_execute = abap_false.
lt_range_table = wd_this->m_handler->create_range_table( i_typename = 'ZPOSTING_DATS' ).
wd_this->m_handler->add_selection_field( i_id = 'POSTING'
it_result = lt_range_table
i_read_only = read_only
I_DESCRIPTION = 'Posting'
).*
Here the most important code is the bold one .So by using above code u can create a select option in WDA
If you have any further doubts feel free to ask.
regards
PG
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Peerasit,
No you won't have to create a node of type SIGN, OPTION, LOW, HIGH for this. I guess that you were distracted after going through this [blog|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/c09fec07-0dab-2a10-dbbe-c9a26bdff03e] by Abhimanyu Lagishetty. He was just trying to give out an example where you could get to see the criteria entered by the user in an table UI element.
For your requirement you will have to create the range table in the WDDOINIT method using the create_range_table method of IF_WD_SELECT_OPTIONS. (The system will automatically pass back the necessary reference of type IF_WD_SELECT_OPTIONS to you when you call the method init_selection_screen) While creating the range table you just specify an unique id by which you can identify this range table. So suppose you want the select-options to appear for 2 fields say CARRID & CONNID then you will have to create 2 range tables. After making his entries the user will click up on a button to trigger the search action. Within this button's action handler you will have to read the data from this range table and pass it on to your SELECT query using the method get_range_table_of_sel_field. Try refer to this [excellent blog|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/2868] [original link is broken] [original link is broken] [original link is broken]; by Rich Heilman in which he explains about the same. Pay particular attention to the coding he puts into the WDDOINIT method & the button's action handler ONACTIONCONTINUE.
Regards,
Uday
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.