cancel
Showing results for 
Search instead for 
Did you mean: 

Remove ":" from select option label(description)

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Have you tried dynamically setting design = light for the labels? That is how you normally get rid of the colon.

Former Member
0 Kudos

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,


https://help.sap.com/saphelp_nw70ehp1/helpdata/en/94/29984197eb2e7be10000000a1550b0/content.htm?fram...

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.

Former Member
0 Kudos

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.

Answers (1)

Answers (1)

ramakrishnappa
Active Contributor
0 Kudos

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