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: 

text box

Former Member
0 Kudos

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

6 REPLIES 6

Former Member
0 Kudos

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

Former Member
0 Kudos

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,

Former Member
0 Kudos

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

Former Member
0 Kudos

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.

dani_mn
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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