10-22-2008 4:16 PM
Hi Gurus
I am working on Module Pool Programming...In the one of the screen there is a column named "Description" where I need to keep a Button to call a SAP standard text editing screen and what ever information I enter in the field should be downloadable
is this option possible?If so...Plz send me the Sample code
Thanks
Ganesh
10-22-2008 4:25 PM
Hi Gani,
I can help you till getting the text editor in your module pool program.
TOP
PROGRAM ZREDDY_TEXT.
constants: line_length type i value 132.
data:
reference to wrapper class of control
g_editor type ref to cl_gui_textedit,
reference to custom container: necessary to bind TextEdit Control
g_editor_container type ref to cl_gui_custom_container,
g_repid like sy-repid, " getting program name
g_ok_code like sy-ucomm, " return code from screen
g_mytable(132) type c occurs 0, " getting the text of table
g_mycontainer(30) type c, " string for the containers
v_result(256) type c, " getting the text of table control
gw_thead like thead, " for header information
it_line type table of tline with header line. " internal table of type tline
PBO
MODULE STATUS_0900 OUTPUT.
SET PF-STATUS 'ZTEXT'.
SET TITLEBAR 'xxx'.
if g_editor is initial.
create control container
create object g_editor_container
exporting
container_name = 'CUSTOM_CONTROL' " Make sure when you create custom container in layout give name as Custom container
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
g_mycontainer = 'CUSTOM_CONTROL'.
create calls constructor, which initializes, creates and links
TextEdit Control
create object g_editor
exporting
parent = g_editor_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.
refresh g_mytable. " to initialize table upon OK_CODE 'BACK' at PAI
endif.
ENDMODULE. " STATUS_0900 OUTPUT
Cheers!!
Balu
Edited by: Balu CH on Oct 22, 2008 8:55 PM
10-22-2008 4:25 PM
Hi Gani,
I can help you till getting the text editor in your module pool program.
TOP
PROGRAM ZREDDY_TEXT.
constants: line_length type i value 132.
data:
reference to wrapper class of control
g_editor type ref to cl_gui_textedit,
reference to custom container: necessary to bind TextEdit Control
g_editor_container type ref to cl_gui_custom_container,
g_repid like sy-repid, " getting program name
g_ok_code like sy-ucomm, " return code from screen
g_mytable(132) type c occurs 0, " getting the text of table
g_mycontainer(30) type c, " string for the containers
v_result(256) type c, " getting the text of table control
gw_thead like thead, " for header information
it_line type table of tline with header line. " internal table of type tline
PBO
MODULE STATUS_0900 OUTPUT.
SET PF-STATUS 'ZTEXT'.
SET TITLEBAR 'xxx'.
if g_editor is initial.
create control container
create object g_editor_container
exporting
container_name = 'CUSTOM_CONTROL' " Make sure when you create custom container in layout give name as Custom container
exceptions
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
g_mycontainer = 'CUSTOM_CONTROL'.
create calls constructor, which initializes, creates and links
TextEdit Control
create object g_editor
exporting
parent = g_editor_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.
refresh g_mytable. " to initialize table upon OK_CODE 'BACK' at PAI
endif.
ENDMODULE. " STATUS_0900 OUTPUT
Cheers!!
Balu
Edited by: Balu CH on Oct 22, 2008 8:55 PM
10-22-2008 4:29 PM
Hi
If you don't want to use OO, u can also call the fm EDIT_TEXT
Max
10-22-2008 4:36 PM
Hi,
You can Call Standard SAP Text Editing Screen by using Statement EDITOR-CALL , or you can use the Class cl_gui_textedit.
You need to call these statements in the Case Statement for the Sy-Ucomm field of your Screen.
Now, I am not very sure about your second question.....
When you say "what ever information I enter in the field should be downloadable", Do you want to say that you want to save the entered text into SAP???
Please specify.......
10-22-2008 5:27 PM
Hi Gurus
Thanks For all the Answers....
Hi Ajay
This text should be able to be downloaded with all information being moved to an Excel spreadsheet.
Thanks
Ganesh