06-17-2008 2:45 PM
Hey, Folks.
Is there a chance to have an input field with more lines on a selection screen? Like an input text box on va01-> head-> texts?
Let's say, users can type in a text which is printed on a form.
thank you for any ideas.
06-17-2008 2:57 PM
Use class 'CL_GUI_TEXTEDIT'.
Check the program 'DEMO_CUSTOM_CONTROL'
06-17-2008 2:57 PM
Use class 'CL_GUI_TEXTEDIT'.
Check the program 'DEMO_CUSTOM_CONTROL'
06-17-2008 3:00 PM
06-17-2008 4:00 PM
It will work in Module Pool programs. You can upload data from this textbox in the PAI module
06-17-2008 3:00 PM
You need to use class CL_GUI_TEXTEDIT or if you are working on ECC6 (Netweaver7) then please check demo program RSMDS_DEMO.
a®
06-17-2008 3:28 PM
Pl. follow the steps:
Step 1 - Create a sub-screen using screen painter in the repot program.
Step 2 - Set the size of the sub-screen.
Step 3 - Place a custom control on the screen set its name to u2018C_CONTAINERu2019 and set the size of the custom control to the size of the required multi-line input output field.
Step 4 - Save and activate the sub-screen.
Step 5 - Code the Data Declarations
Code snippet: -
Create a reference to the custom control
DATA: v_text TYPE REF TO c_textedit_control.
DATA: v_line(72),
internal table to hold user entered text
i_tab LIKE STANDARD TABLE OF v_line.
Step 6 - Define Selection Screen.
Displaying a sub-screen in a sub-screen area on a selection screen is a special case of a tab-strip control on a selection screen. A sub-screen area on a selection screen, is defined using following statements:
SELECTION-SCREEN: BEGIN OF TABBED BLOCK <sub_area>
FOR <n> LINES,
END OF BLOCK <sub_area>.
Code snippet: -
PARAMETER matnr LIKE mara-matnr.
Data transfer error. Your installation is faulty.
SELECTION-SCREEN: BEGIN OF TABBED BLOCK sub FOR 6 LINES,
END OF BLOCK sub.
SELECT-OPTION DATE FOR SY-DATUM.
Step 7 - Before the selection screen is displayed, the subscreen must be assigned to the subscreen area <sub_area>. This is done in the initialization event by using the components PROG and DYNNR of the structure <sub_area>, which is created automatically when the subscreen area is defined . The program name of the sub-screen screen is assigned to the component PROG, and its screen number to DYNNR.
Then Create the Multi-line Input Output custome control instance and set its properties.
The Constructor parameters are explained below
a) wordwrap_mode can have following values.
WORDWRAP_OFF = 0: No line break
WORDWRAP_AT_WINDOW_BORDER = 1: Line break at the edge of the window
WORDWRAP_AT_FIXED_POSITION = 2: Line break at a fixed position
b) wordwrap_position Position for the automatic line break in a line (if <wordwrap_mode> = 2)
c) wordwrap_to_linebreak_mode Converts soft line breaks to hard ones when you save in the R/3 System.
0 or false: Soft line breaks are ignored when you save
1 or true: Soft line breaks are converted to hard breaks when you save
The method set_statusbar_mode allows to show or hide the status bar of the control. It has following parameter possible values.
a) statusbar_mode
True: Status bar visible
False: Status bar invisible
The method set_toolbar_mode allows to show or hide the toolbar. It has following parameter possible values.
b) toolbar_mode
True: Toolbar visible
False: Toolbar invisible
Code snippet: -
INITIALIZATION.
sub-prog = sy-repid.
sub-dynnr = 110.
create an object of class c_textedit_control
CREATE OBJECT v_text
EXPORTING repid = sy-repid
dynpro_container = u2018C_CONTAINERu2019
wordwrap_mode = 2
wordwrap_position = 70
wordwrap_to_linebreak_mode = 1.
set the status bar display off
CALL METHOD v_text ->set_statusbar_mode
EXPORTING statusbar_mode = '0'.
set the toolbar display off
CALL METHOD v_text ->set_toolbar_mode
EXPORTING toolbar_mode = '0'.
Step 8 - Code the flow logic of the sub-screen.
Code snippet: -
PROCESS BEFORE OUTPUT.
MODULE PBO.
PROCESS AFTER INPUT.
MODULE PAI.
Step 9 - Code the PBO and PAI modules.
Code snippet: -
****PBO Module.
MODULE PBO OUTPUT.
CALL METHOD v_text ->set_text_as_r3table
EXPORTING table = i_tab.
****Synchronize the front and back ends
CALL METHOD c_textedit_control=>flush
EXCEPTIONS
flush_error = 01.
IF NOT sy-subrc IS INITIAL.
Data transfer error. Your installation is faulty.
MESSAGE a001(cndp).
ENDIF.
ENDMODULE. " PBO OUTPUT
****PAI Module.
MODULE PAI INPUT.
CALL METHOD v_es_1->get_text_as_r3table
IMPORTING table = i_sys_1.
ENDMODULE. " PAI INPUT
Step 10 - Save and activate the program.
Regards,
Joy.