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

Long text in module pool.

Former Member
0 Likes
2,010

Hi all,

I am working on one module pool program

.in that i have one text field need to enter some comments of length 250.

I want to enter more than one line in that text field,instead of entering it in a single field.Anybody please help how to do that.Is there any other option other than custom control?

Thanks in advance

Ambili

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,594

Hi Ambili Balakrishnan,

You can use class CL_GUI_TEXTEDIT for your purpose..

Define custome container and call the object of the above class...

For more information search on SCN with subject as above class...

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

ilesh Nandaniya

3 REPLIES 3
Read only

Former Member
0 Likes
1,594

Hi,

Instead of capturing the 250 lines of comment using custom control or label, you can directly store the long text in STXH table. To create a long text CREATE_TEXT can be used, where as to edit an existing text EDIT_TEXT and to display READ_TEXT can be used. These FMs can be called from the module pool on a button click.

Each longtext can be identified by a unique name passed to TDNAME. It'll call the SAP Scripts Text Editor automatically and no text formatting also needs to be done.

Please let me know for furher details and the code.

Read only

MarcinPciak
Active Contributor
0 Likes
1,594

Refer this snippet:


DATA: it_str TYPE TABLE OF char72.

CALL SCREEN 100.

MODULE pbo_0100 OUTPUT.
  SET PF-STATUS space.

  CALL FUNCTION 'RH_EDITOR_SET'
    EXPORTING
      repid          = sy-repid
      dynnr          = '0100'
      controlname    = 'CONTAINER'
      max_cols       = 72
      max_lines      = 20
    TABLES
      lines          = it_str.
ENDMODULE.              

MODULE pai_0100 INPUT.
  IF sy-ucomm = 'BACK' OR
     sy-ucomm = '%EX'  OR
     sy-ucomm = 'RW'.
    LEAVE TO SCREEN 0.
  ENDIF.

  CALL FUNCTION 'RH_EDITOR_GET'
    EXPORTING
      controlname    = 'CONTAINER'
      col_width      = 72
    TABLES
      lines          = it_str.

ENDMODULE.                   

Regards

Marcin

Read only

Former Member
0 Likes
1,595

Hi Ambili Balakrishnan,

You can use class CL_GUI_TEXTEDIT for your purpose..

Define custome container and call the object of the above class...

For more information search on SCN with subject as above class...

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7

ilesh Nandaniya