Skip to Content

Remove ":" from select option label(description)

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.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Mar 13, 2014 at 04:04 PM

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

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Vikram Shenoy

      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.

  • Posted on Mar 14, 2014 at 03:01 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.