Application Development 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: 

Module Pool Program

Former Member
0 Kudos

Hi,

In module pool program is there any way to have an input field of variable height.

Thank you,

Ramu N.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi ramu,

1. No its not possible.

regards,

amit m.

11 REPLIES 11

Former Member
0 Kudos

Hi ramu,

1. No its not possible.

regards,

amit m.

Former Member
0 Kudos

sorry sir,

it is not possible.

u can only play with width.

naveen

Former Member
0 Kudos

Hi Ramu,

This is not possible........

Regards

Abhishek

Former Member
0 Kudos

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.

0 Kudos

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

0 Kudos

Hi ,

You can create a container by using Textedit control and you can use it for several text lines.

hope this helps.

Caglar

0 Kudos

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.

0 Kudos

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

0 Kudos

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

Former Member
0 Kudos

You can use long text.

Make a text editor using container.

Former Member
0 Kudos

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.