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

text box

Hi experts,

Iam working on dialog programing.

I want to create long(big) text box (like Material sales text).User should be able to enter very long text.

How can i create this text box?

Reward guaranteed,

thanks

kaki

Add comment
10|10000 characters needed characters exceeded

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 06:58 AM

    Hi Kaki,

    Goto Screen painter provide darag and drop Input Parameter and provide the Length the Input Length either from Datadictionery Object or Manually.

    Hope this would help you.

    😊

    Cheers,

    Prashanth

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 07:00 AM

    Hi,

    You can create a small button for maintaining the long text, and by clicking that you can open the editor to maintain the long text, this can be achieved by using the following fms,

    1. Edit_text

    2. save_text

    3. Read_text

    Hope this helps,

    Rgds,

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 07:06 AM

    Hello you can create a custom container in your screen

    and use the following

    IF g_o_cause IS INITIAL.

    *Creation of cause text edit control

    CREATE OBJECT g_o_cause_cont

    EXPORTING

    container_name = g_f_container

    EXCEPTIONS

    OTHERS = 1.

    CREATE OBJECT g_o_cause

    EXPORTING

    parent = g_o_cause_cont

    wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position

    wordwrap_position = g_f_len

    wordwrap_to_linebreak_mode = cl_gui_textedit=>true.

    CALL METHOD g_o_cause_cont->link

    EXPORTING

    repid = sy-repid

    dynnr = '9001'

    container = g_f_container.

    CALL METHOD g_o_cause->set_width

    EXPORTING

    width = g_f_width.

    CALL METHOD g_o_cause->set_height

    EXPORTING

    height = g_f_height.

    ENDIF.

    CLEAR g_f_container.

    hope it will help.

    Thanks,

    krishna

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 07:11 AM

    Hi,

    For Long Text, i think u can use: SAP TextEdit Control.

    This is Text Edit Control that can accomodate unlimited text.

    For an example about TextEdit Control, you can see program (open using SE80):

    • SAPTEXTEDIT_DEMO_1

    • SAPTEXTEDIT_DEMO_2

    • SAPTEXTEDIT_DEMO_3

    • SAPTEXTEDIT_DEMO_4

    Regards,

    JR.

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Aug 02, 2006 at 07:14 AM

    HI,

    here is the procedure.

    Create a custom table with last field type 'LCHR' with length of your choice and second last field should be integer to store the size of string.

    <b>
    MANDT	MANDT	CLNT	3
    FUND	BP_GEBER	CHAR	10
    CLUSTR	 	INT2	5
    TEXT		LCHR	3000</b>

    insert a custom control area in the screen and create a object of the text editor.

    check this code for PBO and PAI.

    here TEDITOR is the custom contorl area name on screen

    <b>MODULE PBO OUTPUT.
      IF EDITOR IS INITIAL.
    
    *   set status
    SET pf-status '1111'.
    
    *   create control container
        CREATE OBJECT TextEdit_Custom_Container
            EXPORTING
                CONTAINER_NAME = 'TEDITOR'
            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.
        mycontainer = 'TEDITOR'.
    
    *   create calls constructor, which initializes, creats and links
    *   TextEdit Control
        create object editor
              exporting
               parent = TextEdit_Custom_Container
               WORDWRAP_MODE =
    *               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
        container_linked = 1.
    
        refresh mytable.
    
      ENDIF.
    *
    
    
    ENDMODULE.                 " PBO  OUTPUT
    
    
    MODULE pai INPUT.
    case ok_code.
    
    WHEN 'SAVE'.
    *   retrieve table from control
    clear: txt.
          call method editor->get_text_as_r3table
                  importing table = mytable.
    
          loop at mytable into wa.
    
             concatenate txt wa into txt
             separated by '|'.
          endloop.
    
          shift txt left.
          length = strlen( txt ).
    
    
          ztext-CLUSTR = length.
          ztext-text   = txt.
    
          modify ztext.
    
          clear: ztext.
          refresh: mytable.
            call method editor->set_text_as_r3table
                  exporting table = mytable.
          Message s000(zwa).
    
    when 'DISP'.
    
    
          select single * from
          ztext
          where fund = ztext-fund.
    
    
    
         SPLIT ztext-text AT '|' INTO TABLE mytable.
    
       "  APPEND ztext-text TO mytable.
    
    
    
            call method editor->set_text_as_r3table
                  exporting table = mytable.
    
    
    
    
    
    
    endcase.
    
    clear: ok_code.
    
    ENDMODULE.                 " pai  INPUT</b>

    Regards,

    Wasim ahemd

    Message was edited by: Wasim Ahmed

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 02, 2006 at 07:31 AM

    Hi Kaki,

    I hope you are taking the field from the data dictionary in the dialog programming.

    If so, uncheck the <b>from dict.</b> field in the properties screen and change the Def. Length of the field. Again its upto some extend.

    Thanks

    Eswar

    Add comment
    10|10000 characters needed characters exceeded