‎2010 Mar 30 11:06 AM
Hi All,
I want to text box on our screen in module pool programming.Text box should be scroll.
The user want to put unlimited data like word and save it.
Is it possible for unlimited data. I dont want to call FM edit_text coz word document
willl open. I want scrollable text. Give me the solution.
Thanks,
Rakesh
‎2010 Mar 30 11:45 AM
Hi Rakesh,
For your purpose, create a custom container in the screen 100 and use the CL_GUI_TEXTEDIT class which gives you a text-editor. With this you can get the text entered by user in an internal table using method GET_TEXT_AS_R3TABLE and you can set the values, restrict the number of characters and so on. Finally it will give a scrolling automatically if the values entered are more than the screen area.
Thanks,
Srinath S
‎2010 Mar 30 11:10 AM
Hi,
There is a check box im screen painter that will allow you to scroll the text. But it wont give you unlimited text.
Regards,
Sumit.
‎2010 Mar 30 11:12 AM
‎2010 Mar 30 11:40 AM
Hi,
I have already screen 100. I want to put one scrollable textbox on that screen so that User can
enter the unlimited input. can i put one subscreen on my screen 100 so that user can put data.
if yes then pls give solution.
Thanks,
Rakesh
‎2010 Mar 30 11:52 AM
Hi Rakesh,
There isn't any need to create new sub screen.you can create text editor in the main screen itself. Just need to take one custom container and usning CL_GUI_TEXTEDIT class u can do that.
I have already provided link which will be helpful to create text editor.
Thanks,
Neel Thakkkar.
‎2010 Mar 30 11:45 AM
Hi Rakesh,
For your purpose, create a custom container in the screen 100 and use the CL_GUI_TEXTEDIT class which gives you a text-editor. With this you can get the text entered by user in an internal table using method GET_TEXT_AS_R3TABLE and you can set the values, restrict the number of characters and so on. Finally it will give a scrolling automatically if the values entered are more than the screen area.
Thanks,
Srinath S
‎2010 Mar 30 11:58 AM
Hi,
please check this program in se 38
SAPSCRIPT_DEMO_NOTE_EDITOR you may get some idea..
or c this site too
http://help.sap.com/erp2005_ehp_04/helpdata/EN/eb/549e36cf0ecb7de10000009b38f889/frameset.htm
Edited by: Bhavana Amar on Mar 30, 2010 12:59 PM
‎2010 Mar 30 12:04 PM
Hi,
I once had the same requirement. Find below the logic of test program I have made.
In the Pseudo example below I have created two screens one for Key, against which we want to save our text and second screen is for the text editor.
1. Create first screen 100.This screen will have two screen UI element text and key(I/O) of type let say CHAr10.
2. In the second screen create a custom container.
3. In the PAI of this screen create a module for user command and create an Object for custom container and one more object for class cl_gui_textedit.
4. On user action call screen 200( next screen)
5. On the PBO of next screen set GUI status in one modue. GUI status will contain EDIT and SAVE button.
6. In the PBO of same screen create one more module let say with name EDITOR. In this module first we will be reading if user is displaying the text he has earlier saved . To do this first populate a table
WA_THEAD-TDNAME = G_VALUE.
WA_THEAD-TDID = 'ST'.
WA_THEAD-TDOBJECT = 'TEXT'.
WA_THEAD-TDSPRAS = sy-langu.
MOVE-CORRESPONDING WA_thead TO G_HEAD.
Then select from table STXL if any text exist if select is successful then call function module READ_TEXT. Then using method SET_TEXT_AS_R3TABLE and set_focus display the text on screen.
7. If OK_CODE <> EDIT then call method set_readonly_mode .
8. In the PAI of screen 200 first check for user command
case sy-ucomm.
when 'EDIT'.
IF edit = 'X'.
edit = ' '.
ELSE.
edit = 'X'.
ENDIF.
ENDCASE
9. Create one more module for user action on second screen. If user has press on EDIT button then call method set_focus and CALL METHOD g_gui_editor- >set_readonly_mode
EXPORTING
readonly_mode = '0'.
10 If user has press SAVE then call method GET_TEXT_AS_R3TABLE and then then FM SAVE_TEXT