Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

How to make text box as multiline?

Hi All,

HOw can we make a text box multi line so that it looks like a text area.

thanks

Tripti

Tags:
Former Member
Former Member replied

Hi,

Add this code and try

  • Custom Container declaration

DATA GR_CCONTAINER1 TYPE REF TO CL_GUI_CUSTOM_CONTAINER.

  • Text Editor Declaration

DATA G_EDITOR1 TYPE REF TO CL_GUI_TEXTEDIT.

1. Craete container with one name like 'CC_NAME'

CREATE OBJECT gr_ccontainer1

EXPORTING

container_name = 'CC_NAME'

lifetime = cntl_lifetime_default

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 SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

2. Create Editor control

  • Text Editor Control

CREATE OBJECT g_editor1

EXPORTING

style = 0

wordwrap_mode = '2' "CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION "WORDWRAP_AT_WINDOWBORDER

wordwrap_position = 78

wordwrap_to_linebreak_mode = cl_gui_textedit=>true

parent = gr_ccontainer1

EXCEPTIONS

error_cntl_create = 1

error_cntl_init = 2

error_cntl_link = 3

error_dp_create = 4

gui_type_not_supported = 5

OTHERS = 6.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

3. Set Status bar

  • To set Status bar

CALL METHOD g_editor1->set_statusbar_mode

EXPORTING

statusbar_mode = 0

EXCEPTIONS

error_cntl_call_method = 1

invalid_parameter = 2

OTHERS = 3.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

4.Set Tool Bar

  • To set Toolbar

CALL METHOD g_editor1->set_toolbar_mode

EXPORTING

toolbar_mode = 0

EXCEPTIONS

error_cntl_call_method = 1

invalid_parameter = 2

OTHERS = 3.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDIF.

Try this code in ur program

Regards,

Kalp.

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question