‎2012 May 18 12:23 PM
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
‎2012 May 18 1:45 PM
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.‎2012 May 18 12:48 PM
Hi Vinoth,
Have you tried the same with two text lable fields. i.e. Disabled Input field?
Regards,
Karthik D
‎2012 May 18 1:27 PM
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
‎2012 May 18 1:45 PM
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.‎2012 May 18 2:18 PM
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
‎2012 May 18 2:26 PM
You can use dock_at_top, dock_at_bottom, dock_at_right, dock_at_left for the parameter side for docking container.
‎2012 May 18 2:29 PM
‎2012 May 18 3:00 PM
Well answer given
in the code I gave juste replace msg_dock->dock_at_top by msg_dock->dock_at_bottom ...
Cheers,
Manu.
‎2012 May 18 4:48 PM