02-25-2009 9:21 AM
hi,
In a module pool program, for a input field, how to make multiple lines?
i mean, the input should be in multiple lines..
please help me
chitra
02-25-2009 10:00 AM
Hi Chitra,
Try this sample code:
Declare a Cutom Container in the screen with name 'TEXT_CONTROL'.
Now incorporate the following logic in the PBO of your screen.
DATA: lo_custom_container type ref to cl_gui_custom_container,
lo_texteditor type ref to CL_GUI_TEXTEDIT.
create text_edit control
IF lo_custom_container IS INITIAL.
CREATE OBJECT lo_custom_container
EXPORTING
CONTAINER_NAME = 'TEXT_CONTROL'
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5.
create text_edit control
take control container from splitter_control
CREATE OBJECT LO_TEXTEDITOR
EXPORTING
PARENT = LO_CUSTOM_CONTAINER
WORDWRAP_MODE = CL_GUI_TEXTEDIT=>WORDWRAP_AT_WINDOWBORDER
WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>FALSE
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
GUI_TYPE_NOT_SUPPORTED = 5.
ENDIF.
This will work.
Regards,
Prakash Pandey
02-25-2009 9:28 AM
Hi Chitra,
One way to have multiple lines in a screen is to put multiple input fields and inside the code u can concatenate all the values from the input fields.
if there are 3 Input fields , ip1, ip2, ip3.
Then ,
data: str type string.
concatenate ip1 ip2 ip3 into str.
so the field str will have all the values entered.
Keerthi
02-25-2009 9:47 AM
Hi Chitra,
Take the example of the standard TCODE ST05 and hit the button "Enter SQL statement". This shows a text editor. The size of the container can be changed.
Try using the class CL_GUI_TEXTEDIT.
Regards
02-25-2009 9:50 AM
Hi,
This facility is available in OO ABAP.
For this you need to create cusom container in the Screen. And the use class CL_GUI_TEXTEDIT for displaying the TEXT EDITOR on the screen.
Tell me if more info is required regarding the coding logic.
Regards,
Prakash Pandey
02-25-2009 10:00 AM
Hi Chitra,
Try this sample code:
Declare a Cutom Container in the screen with name 'TEXT_CONTROL'.
Now incorporate the following logic in the PBO of your screen.
DATA: lo_custom_container type ref to cl_gui_custom_container,
lo_texteditor type ref to CL_GUI_TEXTEDIT.
create text_edit control
IF lo_custom_container IS INITIAL.
CREATE OBJECT lo_custom_container
EXPORTING
CONTAINER_NAME = 'TEXT_CONTROL'
EXCEPTIONS
CNTL_ERROR = 1
CNTL_SYSTEM_ERROR = 2
CREATE_ERROR = 3
LIFETIME_ERROR = 4
LIFETIME_DYNPRO_DYNPRO_LINK = 5.
create text_edit control
take control container from splitter_control
CREATE OBJECT LO_TEXTEDITOR
EXPORTING
PARENT = LO_CUSTOM_CONTAINER
WORDWRAP_MODE = CL_GUI_TEXTEDIT=>WORDWRAP_AT_WINDOWBORDER
WORDWRAP_TO_LINEBREAK_MODE = CL_GUI_TEXTEDIT=>FALSE
EXCEPTIONS
ERROR_CNTL_CREATE = 1
ERROR_CNTL_INIT = 2
ERROR_CNTL_LINK = 3
ERROR_DP_CREATE = 4
GUI_TYPE_NOT_SUPPORTED = 5.
ENDIF.
This will work.
Regards,
Prakash Pandey
03-09-2009 8:09 AM