on 02-24-2013 5:01 PM
Hi All,
In my Requirement fields are not coming from context node we need to generate the fields Dynamically through selection screen in WDR_SELECT_OPTIONS.
How to do this?
Thanks,
Durga.
HI Durga,
I am assuming that u r using the componet 'WDR_SELECT_OPTIONS' to create some select option fields in your screen. However not sure what r u trying to convey 'by fields are not coming from context node we need to generate the fields Dynamically'.
When you define a select option field, u dont have to link it to any context , creating the reange table by providing a data element will do the work like below.
DATA: lt_range_table TYPE REF TO DATA.
" Call the interface controller method init_selection_screen to get the helper class
WD_THIS->M_WD_SELECT_OPTIONS_REPORT = WD_THIS->WD_CPIFC_SELECT_OPTION( ).
WD_THIS->M_HANDLER_REPORT = WD_THIS->M_WD_SELECT_OPTIONS_REPORT-
>INIT_SELECTION_SCREEN( ).
wd_this->m_handler_report->set_global_options(
i_display_btn_cancel = abap_false
i_display_btn_check = abap_false
i_display_btn_reset = abap_true
i_display_btn_execute = abap_false ).
* create a range table that consists of this new data element
lt_range_table = wd_this->m_handler_report->create_range_table( i_typename = 'S_CARR_ID' ).
* add a . field to the selection with description
wd_this->m_handler_report->add_selection_field( i_id = 'S_CARR_ID'
I_DESCRIPTION = ' Airline No'
it_result = lt_range_table ).
Now you might be need some more adding to this, can you explain your requirement in details.
Regards,
Monishankar Chatterjee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Based on the fields of WDR_SELCT_OPTIONS build dynamic context in WDDOINIT method of the view.
check the following code which I used to give you an Idea.
1)* get meta data info of root context node
lo_nd_info_root = wd_context->get_node_info( ).
2) Add node dynamically to context
DATA dref TYPE REF TO data.
FIELD-SYMBOLS <ref> TYPE ref to if_wd_context_node_info.
CONCATENATE 'HEADER_' ls_form-formid into str.
CONDENSE str.
CREATE DATA dref TYPE REF TO if_wd_context_node_info.
ASSIGN dref->* TO <ref>.
<ref> = lo_nd_info_root->add_new_child_node(
name = str
is_mandatory = abap_true
is_mandatory_selection = abap_false
is_multiple = abap_false
is_multiple_selection = abap_false
is_singleton = abap_true
is_initialize_lead_selection = abap_true
is_static = abap_false ).
3) add attributes to node
ls_attribute-name = ls_invrules-fieldname. ->name
ls_attribute-type_name = 'CHAR40'. -> type which comes from your select options
<ref>->add_attribute( attribute_info = ls_attribute ).
Hope this helps..
Thanks
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Durga,
Try this tutorial for creating select options.
http://webdynproabap.wordpress.com/2012/07/14/select-options-set/
Regards,
Arun Krishnamoorthy
Hi,
Procedure to achieve SELECT OPTIONS for a field
Instantiate Used Component WDR_SELECT_OPTIONS.
User | Count |
---|---|
84 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.