Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Trailing space when using SELECTION-SCREEN COMMENT

Former Member
0 Likes
3,494

Hi All,

I need to display a continuous text (length :130) in selection screen. I am trying with SELECTION-SCREEN COMMENT option and i m aware that we can display max of 79 characters. So i split the text into length: 70 & 60 and coded as below

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT 1(70) text-001.

SELECTION-SCREEN POSITION 73.

SELECTION-SCREEN COMMENT 73(60) text-002.

SELECTION-SCREEN END OF LINE.

Problem is: After displaying first text (text-001), there is a gap of 10-15 characters, then second text starts (text-002). I mean, there is a trailing space.

If i give all text-001 in CAPS, then there is no trailing space. But i dont need to display the text in CAPS.

Do i need to proceed in any other way?, please provide your inputs

Vinoth

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,058
Hi,
AFAIK you won't be able to achieve this with only COMMENT statements. Either go with the proposal of Raymond, or you could also use class CL_DD_DOCUMENT and show your full text within a container docked on your selection screen...
kind of:
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: p1 TYPE c.
PARAMETERS: p2 TYPE c.
PARAMETERS: p3 TYPE c.
SELECTION-SCREEN END OF BLOCK b1.

DATA: msg_dock  TYPE REF TO cl_gui_docking_container,
           msg_panel TYPE REF TO cl_dd_document.

AT SELECTION-SCREEN OUTPUT.
  IF msg_dock IS INITIAL.
    CREATE OBJECT msg_dock
      EXPORTING
        repid     = sy-repid
        dynnr     = sy-dynnr
        side      = msg_dock->dock_at_top
        extension = 35.

    CREATE OBJECT msg_panel.

    msg_panel->add_text( EXPORTING text = text-001 ). "Text of any length
    msg_panel->merge_document( ).
    msg_panel->display_document( EXPORTING  parent = msg_dock
                                                        EXCEPTIONS html_display_error = 1 ).
    msg_dock->set_enable( space ).
  ENDIF.
Kr,
Manu.
8 REPLIES 8
Read only

Former Member
0 Likes
2,058

Hi Vinoth,

Have you tried the same with two text lable fields. i.e. Disabled Input field?

Regards,

Karthik D

Read only

RaymondGiuseppi
Active Contributor
0 Likes
2,058

Your SAPgui to use a proportional font for texts and descriptions (where "i" is much shorter than "W") when it use a non-proportional for input fields. But it use this non-proportional font for input fields even if input is not allowed.

Try this sample to solve your problem. (But your text will be in a box)

REPORT zfontst.

CONSTANTS ctxt TYPE c LENGTH 80 VALUE 'AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz'.

PARAMETERS: p1 TYPE c LENGTH 56.

SELECTION-SCREEN BEGIN OF LINE.

SELECTION-SCREEN COMMENT (2) p2a.

SELECTION-SCREEN POSITION POS_LOW.

SELECTION-SCREEN COMMENT (56) p2.

SELECTION-SCREEN END OF LINE.

PARAMETERS: p3 TYPE c LENGTH 56 MODIF ID dsp.

AT SELECTION-SCREEN OUTPUT.

  p1 = ctxt.

  p2 = ctxt.

  p2a = 'P2'.

  p3 = ctxt.

  LOOP AT SCREEN.

    CASE screen-group1.

      WHEN 'DSP'.

        screen-input = '0'.

    ENDCASE.

    MODIFY SCREEN.

  ENDLOOP.

Regards,

Raymond

Read only

Former Member
0 Likes
2,059
Hi,
AFAIK you won't be able to achieve this with only COMMENT statements. Either go with the proposal of Raymond, or you could also use class CL_DD_DOCUMENT and show your full text within a container docked on your selection screen...
kind of:
SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME.
PARAMETERS: p1 TYPE c.
PARAMETERS: p2 TYPE c.
PARAMETERS: p3 TYPE c.
SELECTION-SCREEN END OF BLOCK b1.

DATA: msg_dock  TYPE REF TO cl_gui_docking_container,
           msg_panel TYPE REF TO cl_dd_document.

AT SELECTION-SCREEN OUTPUT.
  IF msg_dock IS INITIAL.
    CREATE OBJECT msg_dock
      EXPORTING
        repid     = sy-repid
        dynnr     = sy-dynnr
        side      = msg_dock->dock_at_top
        extension = 35.

    CREATE OBJECT msg_panel.

    msg_panel->add_text( EXPORTING text = text-001 ). "Text of any length
    msg_panel->merge_document( ).
    msg_panel->display_document( EXPORTING  parent = msg_dock
                                                        EXCEPTIONS html_display_error = 1 ).
    msg_dock->set_enable( space ).
  ENDIF.
Kr,
Manu.
Read only

0 Likes
2,058

Hi Karthik, Raymond - Thanks for the suggestion.

Hi Manu- Thank you and container's data is always showing top in selection screen (with the same code you given). Is this the std. behaviour?, as i need the continuous text to be showed at the bottom.

Please tell me, is it possible to show the container at bottom?

Vinoth

Read only

0 Likes
2,058

You can use dock_at_top, dock_at_bottom, dock_at_right, dock_at_left for the parameter side for docking container.

Read only

0 Likes
2,058

Look at the attribute DOCK_AT_BOTTOM of class CL_GUI_DOCKING_CONTAINER and adjust the proposed code.

Regards,

Raymond

Read only

0 Likes
2,058

Well answer given

in the code I gave juste replace msg_dock->dock_at_top by msg_dock->dock_at_bottom ...

Cheers,

Manu.

Read only

0 Likes
2,058

Thank you for all the inputs.

Vinoth