Skip to Content
author's profile photo Former Member
Former Member

text editor in DYNPRO: how can I limit text lines?

Hi!

I have a DYNPRO with a TextEditor, but I need limit the line number to 4. Anybody could help me to try?

Thank a Lot

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2008 at 03:11 PM

    Hi try limiting it by the size of the custom control in the screen.

    If you want only 4 lines in text edit, keep the custom control size to 4 lines.

    Regards

    Karthik D

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 22, 2008 at 06:34 PM

    Hi,

    I am also having the same requirment but in my case no need to restirct the lines. Please share the code for saving the data entered in the Text Editor.

    Waiting for your valuable post.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Balu CH!

      At first You must defined a CUSTOM CONTAINER to recibe the textEditor in a DYNPRO,

      And implemented this code (I had implemented in the main program):

      • PROCESS FOR TEXTEDITOR (20/09/08)

      • DEFINING VARS

      "CONSTANTS: line_length TYPE i VALUE 256.

      CONSTANTS: line_length TYPE i VALUE 69. " LONGITUD EDITABLE CAJA

      DATA:

      g_editor TYPE REF TO cl_gui_textedit,

      g_editor_container TYPE REF TO cl_gui_custom_container,

      g_repid LIKE sy-repid,

      g_relink TYPE c, " to manage relinking

      g_mytable(line_length) TYPE c OCCURS 0,

      g_mycontainer(30) TYPE c, " string for the containers

      g_container_linked TYPE i. "#EC NEEDED

      • TEXTEDIT CLASS.

      CLASS cl_gui_cfw DEFINITION LOAD.

      • CREATING TEXT EDITOR

      IF g_editor IS INITIAL.

      CREATE OBJECT g_editor_container

      EXPORTING

      container_name = 'YOUR_CONTAINER_NAME'

      EXCEPTIONS

      cntl_error = 1

      cntl_system_error = 2

      create_error = 3

      lifetime_error = 4

      lifetime_dynpro_dynpro_link = 5.

      IF sy-subrc NE 0.

      • add your handling

      ENDIF.

      g_mycontainer = 'YOUR_CONTAINER_NAME'.

      ENDIF.

      CREATE OBJECT g_editor

      EXPORTING

      parent = g_editor_container

      wordwrap_mode =

      max_number_chars = 360

      • cl_gui_textedit=>wordwrap_off

      cl_gui_textedit=>wordwrap_at_fixed_position

      • cl_gui_textedit=>WORDWRAP_AT_WINDOWBORDER

      wordwrap_position = line_length

      wordwrap_to_linebreak_mode = cl_gui_textedit=>true.

      • to handle different containers

      g_container_linked = 1.

      REFRESH g_mytable. " to initialize table upon OK_CODE 'BACK' at PAI

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2008 at 06:16 AM

    hi,

    check texteditor class method and properties. There is option to fix limit for line length, no of lines, total no of char.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      hi,

      PROTECT_LINES is not allow to edit the lines. it means user can't do anything in protected lines.i feel this is your requirement. Use following parameters.

      PROTECT_LINES

      EXPORTING

      FROM_LINE = 5

      TO_LINE = 100

      EXCEPTIONS

      ERROR_CNTL_CALL_METHOD = 1

      INVALID_PARAMETER = 2

      others = 3.

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.