on 03-13-2014 3:58 PM
Hello All
I have a requirement to remove the select option description (which SAP displays by default from the field label maintained in the data element),
I thought the best way to achieve that requirement is by passing "space" to the parameter 'I_DESCRIPTION' to the method IF_WD_SELECT_OPTIONS->ADD_SELECTION_FIELD, however, it turned out that SAP still displays the label from the data element inspite of passing space(blank) to the parameter 'I_DESCRIPTION', to overcome this limitation I have created a data element without maintaining any labels this approach worked expect that SAP still displays ":"(colon) as the label, is there any way to get rid of this ":" too?
As shown above, ":" is still displayed as the label of the date select option. I'm also looking for a way to reduce the distance between the last radio button and the select option, any pointers would be appreciated.
Thanks for looking into this.
-Vikram.
Have you tried dynamically setting design = light for the labels? That is how you normally get rid of the colon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
sounds like a plan (https://help.sap.com/saphelp_nw70ehp1/helpdata/en/99/0ed2416d9c1c7be10000000a1550b0/content.htm),
now the challenge would be to get the instance of the label UI element,
I checked the dynamic programming notes provided by SAP help and couldn't find any pointers in retrieving the layout elements of a used component,
the following attempt to get the elements of a selection screen resulted in a dump
wd_this->m_handler->get_selection_screen_items( importing et_selection_screen_items = lt_sel_scr_items ), what would be my options now?
Thank you.
You could use the below methods to recursively scan all elements of the view and set the design of all labels to light.
method adjust_view .
* IO_VIEW Importing RefTo IF_WD_VIEW
data lo_container type ref to cl_wd_uielement_container.
check io_view is bound.
lo_container ?= io_view->get_root_element( ).
process_elements( io_container = lo_container ).
endmethod.
method PROCESS_ELEMENTS .
* IO_CONTAINER Importing RefTo CL_WD_UIELEMENT_CONTAINER
data lo_container type ref to cl_wd_uielement_container.
data lt_elements type cl_wd_uielement=>tt_uielement.
data ls_elements type ref to cl_wd_uielement.
data lo_lbl type ref to cl_wd_label.
lt_elements = io_container->get_children( ).
loop at lt_elements into ls_elements.
try.
lo_container ?= ls_elements.
process_elements( io_container = lo_container ).
catch cx_sy_move_cast_error .
if ls_elements->_definition_name eq 'LABEL'.
lo_lbl ?= ls_elements.
lo_lbl->set_design( value = '01' ).
endif.
endtry.
endloop.
endmethod.
Hi Vikram,
Mr. Samuli's code will not work if you place it in your component as selection screen belongs to other used component.
Only possible option to remove ':' from selection screen is to copy the component WDR_SELECT_OPTIONS and write the above suggested code in view SELECT_OPTIONS.
Now, use this ZWDR_SELECT_OPTIONS in your component for bulding selection screen.
Or, you can also enhance the view SELECTION_SCREEN of component WDR_SELECT_OPTIONS and add the code to meet your requirement.
But, it is not suggested as it applies to many components.
Hope this helps you.
Regards,
Rama
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
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.