‎2006 Jul 25 12:21 PM
Hi,
In module pool program is there any way to have an input field of variable height.
Thank you,
Ramu N.
‎2006 Jul 25 12:23 PM
‎2006 Jul 25 12:23 PM
‎2006 Jul 25 12:24 PM
sorry sir,
it is not possible.
u can only play with width.
naveen
‎2006 Jul 25 12:24 PM
‎2006 Jul 25 12:28 PM
Hi,
Thanks for all your replies.
My requirement is to create a Screen where an user can enter multiple lines of text.
Thank you,
Ramu N.
‎2006 Jul 25 12:30 PM
Hello,
You can create the Text Editor control on the screen.
CREATE OBJECT CUSTOM_CONTAINER
EXPORTING
CONTAINER_NAME = 'MYCONTAINER1'
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5
OTHERS = 6
.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE 'I' NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
CREATE OBJECT EDITOR
EXPORTING
WORDWRAP_MODE =
CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION
WORDWRAP_POSITION = LINE_LENGTH
WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>TRUE
PARENT = CUSTOM_CONTAINER
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
GUI_TYPE_NOT_SUPPORTED = 5
OTHERS = 6
Regards,
Naimesh
Message was edited by: Naimesh Patel
‎2006 Jul 25 12:32 PM
Hi ,
You can create a container by using Textedit control and you can use it for several text lines.
hope this helps.
Caglar
‎2006 Jul 25 1:26 PM
Hi Naimesh,
CREATE OBJECT <b>EDITOR</b>
EXPORTING
WORDWRAP_MODE =
CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION
WORDWRAP_POSITION = LINE_LENGTH
WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>TRUE
PARENT = CUSTOM_CONTAINER
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
GUI_TYPE_NOT_SUPPORTED = 5
OTHERS = 6.
In the above code what type of DATA is EDITOR.
Thank you,
Ramu N.
‎2006 Jul 25 1:30 PM
Hello,
DATA: CUSTOM_CONTAINER TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
EDITOR TYPE REF TO CL_GUI_TEXTEDIT.
to display any text
CALL METHOD EDITOR->SET_TEXT_AS_STREAM
EXPORTING
TEXT = IT_SOURCE1
EXCEPTIONS
ERROR_DP = 1
ERROR_DP_CREATE = 2
OTHERS = 3
to save as a local file use mehtod SAVE_AS_LOCAL_FILE
Regards,
Naimesh
‎2006 Jul 25 1:31 PM
Ramu, here is a complete example which implements the editor in a docking container, this is very simular to implementing in a custom control container.
report zrich_0001 .
data:
dockingleft type ref to cl_gui_docking_container,
<b>text_editor type ref to cl_gui_textedit</b>,
repid type syrepid.
data: textlines type table of tline-tdline,
wa_text type tline-tdline.
parameters: p_check.
at selection-screen output.
repid = sy-repid.
create object dockingleft
exporting repid = repid
dynnr = sy-dynnr
side = dockingleft->dock_at_left
extension = 1070.
create object text_editor
exporting
parent = dockingleft.
start-of-selection.
call method text_editor->get_text_as_r3table
importing
table = textlines
exceptions
others = 1.
loop at textlines into wa_text .
write:/ wa_text.
endloop.
Regards,
Rich Heilman
‎2006 Jul 25 12:30 PM
‎2006 Jul 25 1:45 PM
Hi Ramu,
DATA: ok_code LIKE sy-ucomm,
container TYPE REF TO cl_gui_custom_container,
editor TYPE REF TO cl_gui_textedit,
t_thead LIKE thead, "OCCURS 0 WITH HEADER LINE,
line_length TYPE i.
DATA: t_tline LIKE tline OCCURS 0 WITH HEADER LINE.
DATA : BEGIN OF t_line OCCURS 0,
line(256) TYPE c,
END OF t_line.
DATA line TYPE i.
CREATE OBJECT container
EXPORTING
container_name = 'MYCONTAINER'.
CREATE OBJECT editor
EXPORTING
parent = container
wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
wordwrap_position = line_length
wordwrap_to_linebreak_mode = cl_gui_textedit=>true.
SELECT SINGLE *
FROM stxh
WHERE tdname = thead-tdname AND tdid = thead-tdid
AND tdobject = thead-tdobject.
IF sy-subrc = 0.
MESSAGE e101(zvikalp).
ENDIF.
CLEAR flag.
CALL FUNCTION 'INIT_TEXT'
EXPORTING
id = t_thead-tdid
language = t_thead-tdspras
name = t_thead-tdname
object = t_thead-tdobject
TABLES
lines = t_tline[]
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CALL METHOD editor->get_text_as_r3table
IMPORTING
table = t_line[]
EXCEPTIONS
error_dp = 1
error_cntl_call_method = 2
error_dp_create = 3
potential_data_loss = 4
OTHERS = 5
.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
LOOP AT t_line.
t_tline-tdline = t_line-line.
APPEND t_tline.
ENDLOOP.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
header = t_thead
TABLES
lines = t_tline[]
EXCEPTIONS
id = 1
language = 2
name = 3
object = 4
OTHERS = 5.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
CLEAR: t_line[], t_line.
CALL METHOD editor->set_text_as_r3table
EXPORTING
table = t_line[]
EXCEPTIONS
error_dp = 1
error_dp_create = 2
OTHERS = 3
.
IF sy-subrc = 0.
MESSAGE s106(zvikalp).
ENDIF.
Regards,
Seema.