Module Pool Text Editor Problem
Hi
I have developed module pool program which has 3 tab strips. In the last (3rd) Tab Strip I need to input Long Text. I have the done the coding but when I go to the Last tab and then come back to any other tabs, the text editor is overwriting the other fields in the other tabs. Can any tell how to solve this problem
This is he code I have written
****90000******Screen
PROCESS BEFORE OUTPUT.
MODULE status_9000.
MODULE modify_screen9000.
module test_me.
LOOP AT t_operation INTO s_operation WITH CONTROL toperation.
MODULE move_data.
MODULE modiy_screentblctrl.
ENDLOOP.
CALL SUBSCREEN sub1 INCLUDING sy-repid '9001'.
CALL SUBSCREEN sub2 INCLUDING sy-repid '9002'.
CALL SUBSCREEN sub3 INCLUDING sy-repid '9003'.
PROCESS AFTER INPUT.
MODULE cancel AT EXIT-COMMAND.
CHAIN.
FIELD zaodheader-heatnum MODULE check_heatnumber.
ENDCHAIN.
LOOP AT t_operation.
MODULE update_itab.
ENDLOOP.
MODULE user_command_9000.
CALL SUBSCREEN sub1.
CALL SUBSCREEN sub2.
CALL SUBSCREEN sub3.
**************9003*****
PROCESS BEFORE OUTPUT.
MODULE STATUS_9003.
MODULE display_texteditor.
PROCESS AFTER INPUT.
MODULE USER_COMMAND_9003.
**************9003*****
DATA : ccont TYPE REF TO cl_gui_custom_container,
tedit TYPE REF TO cl_gui_textedit.
MODULE display_texteditor OUTPUT.
CREATE OBJECT ccont
EXPORTING
parent =
container_name = 'CC'
style =
lifetime = lifetime_default
repid =
dynnr =
no_autodef_progid_dynnr =
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5
OTHERS = 6 .
IF sy-subrc <> 0.
ENDIF.
CREATE OBJECT tedit
EXPORTING
max_number_chars =
style = 0
wordwrap_mode = wordwrap_at_windowborder
wordwrap_position = -1
wordwrap_to_linebreak_mode = false
filedrop_mode = dropfile_event_off
parent = ccont
lifetime =
name =
EXCEPTIONS
error_cntl_create = 1
error_cntl_init = 2
error_cntl_link = 3
error_dp_create = 4
gui_type_not_supported = 5
OTHERS = 6.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
ENDMODULE. " DISPLAY_TEXTEDITOR OUTPUT
Edited by: kumar1819 on Apr 7, 2010 8:05 AM
Solved
Hi kumar,
**************9003*****
PROCESS AFTER INPUT.
MODULE USER_COMMAND_9003.
Case SY-UCOMM.
When 'TAB2'.
Call screen 9002.
**************9003*****
In 9001 and 9002 screen what code u r writing.
Regards,
Raj.
Similar Messages
-
Multiple Selection in dropdown in module pool/text editor
Hi,
How to provide an option for multiple selection in dropdown/listbox? Is there any option for this other than triggering F4 function and displaying in ALV or table control with multiple selection option?
otherwise, is it possible to have multiple selection in text editor?
Thanks,
AmalHI,
Instead of displaying multiple selection in deopdown list go for multiple section in ListBOx. It will be easier for you. Here is the demonstration of using ListBox along with screen shots and Code.
Check this Link
<Link farm to blocked site removed by moderator>
Edited by: sum_it2 on Nov 16, 2011 9:37 AM
Edited by: Vinod Kumar on Nov 16, 2011 3:01 PM -
Regarding Module Pool Text Field
Hi,
Can any body tell , is there any possiblity to change the font style and size of the Module pool text field.( Because I want a Heading in the screen)
Regards
PrashanthHi,
Goto the Layout Editor of your Screen.
Double click on the text field .. Double clk the text fild, and from the Botton right u can see an arrow icon -> click on that > will open a Popup > in that <b> set Area Title to TRUE </b>.
Rgds,
Jothi.
Do Award pts for helpful answers. -
In smartform Text editor problem
In smartform in text editor i writing text Invoice number it will in first line Invoice and second line number , Exactly very line taken 7 characters what is problem please give me advise.
hi,
welcome to SDN
just increase ur window width.
or u can adjust it with font size.
do formatting andeach time check print preview.
coz not alwys print preview and text editor is same. -
Module Pool Text field should be display Bold
Hi Freinds,
I have created Module Pool.
1. My requirement is Text Field display Bold & I want to Change of Text Size.
2. After executing Menu bar option are Disable mode, I want in Enable mode.
Thx in Advance.1) By default in PBO you can see 'MODULE status_0001 OUTPUT'
2) if you double click on that it will take you to enable the PF-STATUS (please check the below code).
3) If you double click on PF_0001 then menu painter will be opened to create status.
4) For more information[ click here.|http://help.sap.com/saphelp_nw04s/helpdata/en/d1/801ce8454211d189710000e8322d00/frameset.htm]
*& Module STATUS_0001 OUTPUT
* text
MODULE status_0001 OUTPUT.
SET PF-STATUS 'PF_0001'.
SET TITLEBAR 'TB_0001'.
ENDMODULE. " STATUS_0001 OUTPUT
regards,
~Satya -
Hi,
I'm using stellent 7.5.1.
I cannot upload pics and/or update text via the rich text editor .. The editor field opens, but just stays grey, i.e. they don’t have any option of entering or saving text.
I have even checked Java version its fine.
Do i need to change any config setting to enable to editor again?
ThanksThe 7.5 editor uses an ActiveX plugin, so it only works in Internet Explorer. There may also be security settings in Internet Explorer that might interfere with the way it works.
If you get it going, try this article for some enhancements to the editor.
http://webmonkeymagic.blogspot.com/2007/12/get-enhanced-contributor-editing.html -
import java.io.*;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class TextEditor extends JApplet {
//Declare and create image icons
private ImageIcon openImageIcon = ImageViewer.createImageIcon(
"image/open.gif", this);
private ImageIcon saveImageIcon = ImageViewer.createImageIcon(
"image/save.gif", this);
//Create menu items
private JMenuItem jmiOpen = new JMenuItem("Open", openImageIcon);
private JMenuItem jmiSave = new JMenuItem("Save", saveImageIcon);
private JMenuItem jmiClear = new JMenuItem("Clear");
private JMenuItem jmiExit = new JMenuItem("Exit");
private JMenuItem jmiForeground = new JMenuItem("Foreground");
private JMenuItem jmiBackground = new JMenuItem("Background");
//Create buttons to be placed in a tool bar
private JButton jbtOpen = new JButton(openImageIcon);
private JButton jbtSave = new JButton(saveImageIcon);
private JLabel jlblStatus = new JLabel();
//Create a JFileChooser with the current directory
private JFileChooser jFileChooser1
= new JFileChooser(new File("."));
//Create a text area
private JTextArea jta = new JTextArea();
public TextEditor() {
//Add Menu Items to the menu
JMenu jMenu1 = new JMenu("File");
jMenu1.add(jmiOpen);
jMenu1.add(jmiSave);
jMenu1.add(jmiClear);
jMenu1.addSeparator();
jMenu1.add(jmiExit);
//Add menu items to the OTHER menu
JMenu jMenu2 = new JMenu("Edit");
jMenu2.add(jmiForeground);
jMenu2.add(jmiBackground);
//Add menus to menus lol
JMenuBar jMenuBar1 = new JMenuBar();
jMenuBar1.add(jMenu1);
jMenuBar1.add(jMenu2);
//Set the menu bar
setJMenuBar(jMenuBar1);
//Create toolbar
JToolBar jToolBar1 = new JToolBar();
jToolBar1.add(jbtOpen);
jToolBar1.add(jbtSave);
jmiOpen.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
open();
jmiSave.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
save();
jmiClear.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
jta.setText(null);
jmiExit.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
System.exit(0);
jmiForeground.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
Color selectedColor =
JColorChooser.showDialog(null, "Choose Foreground Color",
jta.getForeground());
if (selectedColor != null)
jta.setForeground(selectedColor);
jmiBackground.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent evt){
Color selectedColor =
JColorChooser.showDialog(null, "Choose Background Color",
jta.getForeground());
if (selectedColor != null)
jta.setBackground(selectedColor);
jbtOpen.addActionListener( new ActionListener(){
public void actionPerformed(ActionEvent evt){
open();
jbtSave.addActionListener( new ActionListener(){
public void actionPerformed(ActionEvent evt){
save();
getContentPane().add(jToolBar1, BorderLayout.NORTH);
getContentPane().add(jlblStatus, BorderLayout.SOUTH);
getContentPane().add(new JScrollPane(jta), BorderLayout.CENTER);
/** Open file*/
private void open() {
if (jFileChooser1.showOpenDialog(this) ==
JFileChooser.APPROVE_OPTION)
open(jFileChooser1.getSelectedFile());
/** Open file with specified File instance*/
private void open(File file){
try{
//Read from the specified file and store it in jta
BufferedInputStream in = new BufferedInputStream(
new FileInputStream(file));
byte[] b = new byte[in.available()];
in.read(b, 0, b.length);
jta.append(new String(b, 0, b.length));
in.close();
//Display the staus of the file opening
jlblStatus.setText(file.getName()+ "opened.");
catch (IOException ex) {
jlblStatus.setText("Error opening "+ file.getName());
/** Save file*/
private void save() {
if (jFileChooser1.showSaveDialog(this) ==
JFileChooser.APPROVE_OPTION){
save(jFileChooser1.getSelectedFile());
/**Save file with specified File instance */
private void save(File file) {
try{
//Write the sext in jta to the specified file
BufferedOutputStream out = new BufferedOutputStream(
new FileOutputStream(file));
byte[] b = (jta.getText()).getBytes();
out.write(b, 0, b.length);
out.close();
//Display this status of the save file operation
jlblStatus.setText(file.getName() + "saved.");
catch (IOException ex) {
jlblStatus.setText("Error saving" + file.getName());
}There is a problem with this part of the code:
private ImageIcon openImageIcon = ImageViewer.createImageIcon(
"image/open.gif", this);
private ImageIcon saveImageIcon = ImageViewer.createImageIcon(
"image/save.gif", this);It says it can't find the variable ImageViewer .
Please help :(
Thanks in advance.What is ImageViewer? It doesn't appear to be a class in Java 5.0 or Java 6.0.
I can't see an import statement for it -are you expecting it to exist in the same folder as your TextEditor class? -
Module pool F4-Help problem for a field in custom Infotype(HR).
Dear Gurus,
I have created a custom Infotype and fields are like
P9015-NAM01.
P9015-NAM02.
P9015-NAM03.
all are fields for name.
I want F4 help for these fields with values same as Family Members-First name given in 21 Infotype .
for all 3 fields same f4 help values.
But when i see in the screen for first field the values are populating as selected but for second field the selected value is not picking..
DATA: BEGIN OF it_val1 OCCURS 7,
nam01 LIKE p9015-nam01,
rel01 LIKE p9015-rel01,
END OF it_val1.
SELECT * FROM t591s INTO TABLE it_t591s WHERE
sprsl = 'EN' AND
infty = '0021'.
*SUBTY
*STEXT
SELECT * FROM pa0021 INTO wa_21 WHERE pernr = p9015-pernr .
READ TABLE it_t591s WITH KEY subty = wa_21-famsa.
it_val1-rel01 = it_t591s-stext.
CONCATENATE wa_21-favor wa_21-fanam INTO it_val-nname SEPARATED BY space.
it_val1-nam01 = wa_21-favor.
APPEND it_val1.
CLEAR : it_val1, it_t591s.
ENDSELECT.
CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
EXPORTING
DDIC_STRUCTURE = ' '
retfield = 'NAM01'
PVALKEY = ' '
dynpprog = sy-cprog
dynpnr = sy-dynnr
dynprofield = 'P9015-NAM01'
STEPL = 0
WINDOW_TITLE =
VALUE = ' '
value_org = 'S'
multiple_choice = ' '
display = 'F'
CALLBACK_PROGRAM = ' '
CALLBACK_FORM = ' '
MARK_TAB =
IMPORTING
USER_RESET =
TABLES
value_tab = it_val1[]
field_tab = t_fields[]
return_tab = t_return[]
DYNPFLD_MAPPING = t_DYNPFLD_MAPPING
EXCEPTIONS
PARAMETER_ERROR = 1
NO_VALUES_FOUND = 2
OTHERS = 3
In the same way i am calling for P9015-NAM02. & P9015-NAM03.
Is there any wrong in calling this FM...kindly help.....Write the FM inside,
at selection-screen on value-request for <nam1>.
It seems that you are calling the funtion module for only first field. Repeat it for other two fields also-
at selection-screen on value-request for <nam2>
call FM.
at selection-screen on value-request for <nam3>
call FM.
Sumit -
Hi, my editor auto format my code as below. How to reset the
newline symbol and ">>>"?
http://i69.photobucket.com/albums/i59/ddlam2/why2.pngYou can change this from the actions panel menu at the top
right of the actions panel, but the easiest way is:
Use Ctrl-Shift-8 to toggle hidden characters -
Hi,
I m using module pool and i have used select-options in the screen, for that i have definged select-options as subscreen and called using call subscreen... in module pool.
My problem is when i validate select-options im thrown error message and that select-options getting disabled i tried to keep chain and endchain in the module program and that says that it can not recognize the select-options(fields).
any solution for this.
Thanks,
Nagaraju.Hi,
Please check out the below links . they might be helpful.
http://help.sap.com/saphelp_46c/helpdata/en/34/8e72da6df74873e10000009b38f9b8/frameset.htm
http://help.sap.com/saphelp_erp2004/helpdata/en/9f/dba9e735c111d1829f0000e829fbfe/frameset.htm
Rgds
Mohit -
Dear friends,
I have a problem in handling tabstrips in module pool programming.
the problem is when i go to next screen it gets initiated to the tab number which i have declared in the data part.
but the data in the screen remains intact.
after pressing the option in the status it gets initiated and then i have to click the particular tab to go the tab and to see the changes get affected.
how to solve this problem.
plz do the needful.
regards
samarendraHi,
You just need to create the screen........
PAI
*& Include MZDS_CRTSCREENI01
*& Module USER_COMMAND_0100 INPUT
* text
MODULE USER_COMMAND_0100 INPUT.
CASE OK_CODE.
WHEN 'BACK'.
LEAVE TO SCREEN 0.
WHEN 'SPFLI' OR 'SBOOK'.
TAB1-ACTIVETAB = OK_CODE.
WHEN 'EXIT'.
LEAVE PROGRAM.
WHEN 'CANCEL'.
LEAVE TO SCREEN 100.
ENDCASE.
ENDMODULE. " USER_COMMAND_0100 INPUT
PBO
*& Include MZDS_CRTSCREENO01
*& Module STATUS_0100 OUTPUT
* text
MODULE STATUS_0100 OUTPUT.
SET PF-STATUS 'BASE'.
SET TITLEBAR 'TITLE'.
ENDMODULE. " STATUS_0100 OUTPUT
*& Module CLEAR_OKCODE OUTPUT
* text
MODULE CLEAR_OKCODE OUTPUT.
CLEAR OK_CODE.
ENDMODULE. " CLEAR_OKCODE OUTPUT
MODULE DISPLAY_DATA OUTPUT.
CASE 'X' .
WHEN RBT-SPFLI.
SELECT CITYFROM AIRPFROM CITYTO AIRPTO FROM SPFLI
INTO CORRESPONDING FIELDS OF TABLE IT_SPFLI
WHERE CARRID = SPFLI-CARRID
AND CONNID = SPFLI-CONNID.
FLDATE = ' '.
BOOKNO = ' '.
CUSTNO = ' '.
LOOP AT IT_SPFLI.
DEP_CITY = IT_SPFLI-CITYFROM.
DEP_AIR = IT_SPFLI-AIRPFROM.
DES_CITY = IT_SPFLI-CITYTO.
DES_AIR = IT_SPFLI-AIRPTO.
ENDLOOP.
WHEN RBT-SBOOK.
SELECT SINGLE FLDATE BOOKID CUSTOMID FROM SBOOK
INTO CORRESPONDING FIELDS OF IT_SBOOK
WHERE CARRID = SPFLI-CARRID
AND CONNID = SPFLI-CONNID.
FLDATE = IT_SBOOK-FLDATE.
BOOKNO = IT_SBOOK-BOOKID.
CUSTNO = IT_SBOOK-CUSTOMID.
DEP_CITY = ' '.
DEP_AIR = ' '.
DES_CITY = ' '.
DES_AIR = ' '.
ENDCASE.
ENDMODULE.
*& Module CALL_DYNNR OUTPUT
* text
MODULE CALL_DYNNR OUTPUT.
CASE TAB1-ACTIVETAB.
WHEN 'SPFLI'.
DYNNR = 102.
WHEN 'SBOOK'.
DYNNR = 103.
WHEN OTHERS.
TAB1-ACTIVETAB = 'SPFLI'.
DYNNR = 102.
ENDCASE.
ENDMODULE. " CALL_DYNNR OUTPUT
*& Module DISPLAY_SFLIGHT OUTPUT
* text
MODULE DISPLAY_SFLIGHT OUTPUT.
SELECT CITYFROM AIRPFROM CITYTO AIRPTO FROM SPFLI
INTO CORRESPONDING FIELDS OF TABLE IT_SPFLI
WHERE CARRID = SPFLI-CARRID
AND CONNID = SPFLI-CONNID.
CITY_FROM = IT_SPFLI-CITYFROM.
AIRP_FROM = IT_SPFLI-AIRPFROM.
CITY_TO = IT_SPFLI-CITYTO.
AIRP_TO = IT_SPFLI-AIRPTO.
ENDMODULE. " DISPLAY_SFLIGHT OUTPUT
*& Module DISPLAY_SBOOK OUTPUT
* text
MODULE DISPLAY_SBOOK OUTPUT.
SELECT SINGLE FLDATE BOOKID CUSTOMID FROM SBOOK
INTO CORRESPONDING FIELDS OF IT_SBOOK
WHERE CARRID = SPFLI-CARRID
AND CONNID = SPFLI-CONNID.
FL_DATE = IT_SBOOK-FLDATE.
BOOKID = IT_SBOOK-BOOKID.
CUSTOMID = IT_SBOOK-CUSTOMID.
ENDMODULE. " DISPLAY_SBOOK OUTPUT
TOP INCLUDE
*& Include MZDS_CRTSCREENTOP Module Pool SAPMZDS_CRTSCREEN
PROGRAM SAPMZDS_CRTSCREEN.
TABLES: SPFLI,SBOOK.
DATA: OK_CODE TYPE SYUCOMM.
CONTROLS TAB1 TYPE TABSTRIP.
DATA: BEGIN OF IT_SPFLI OCCURS 0,
CITYFROM TYPE SPFLI-CITYFROM,
AIRPFROM TYPE SPFLI-AIRPFROM,
CITYTO TYPE SPFLI-CITYTO,
AIRPTO TYPE SPFLI-AIRPTO,
END OF IT_SPFLI.
DATA: IT_SBOOK TYPE SBOOK.
DATA: DYNNR TYPE SY-DYNNR.
DATA: DEP_CITY(20) TYPE C,
DEP_AIR(20) TYPE C,
DES_CITY(20) TYPE C,
DES_AIR(20) TYPE C.
DATA: FLDATE(20) TYPE C,
BOOKNO(20) TYPE C,
CUSTNO(20) TYPE C.
DATA:CITY_FROM(20) TYPE C,
AIRP_FROM(20) TYPE C,
CITY_TO(20) TYPE C,
AIRP_TO(20) TYPE C.
DATA: FL_DATE(20) TYPE C,
BOOKID(20) TYPE C,
CUSTOMID(20) TYPE C.
DATA: BEGIN OF RBT,
SPFLI VALUE 'X',
SBOOK,
END OF RBT.
HTH
Regards,
Dhruv Shah -
Is it possible to call the TEXT EDITOR in a program?
Hi,
I want a function module which will popup a text editor where the user can write some text and then i can use this text for further processing.
do we have any such function modules or text editor which i can call from the program to take long text inputs from the user?
thanks in advanceYou can use the Class CL_GUI_TEXTEDIT
REPORT YTEST.
*module create_container_pbo_2000 output.
DATA:
obj_cust_cont_credential TYPE REF TO cl_gui_custom_container,
* obj_cust_cont_character TYPE REF TO cl_gui_custom_container,
* obj_cust_cont_preempmnt TYPE REF TO cl_gui_custom_container,
obj_text_cred TYPE REF TO cl_gui_textedit,
* obj_text_char TYPE REF TO cl_gui_textedit,
* obj_text_pemp TYPE REF TO cl_gui_textedit,
* Internal table to hold text for container reason1
BEGIN OF i_table_text OCCURS 0,
line(132) TYPE c, " Line text
END OF i_table_text,
* Internal table to hold text for container reason2
BEGIN OF i_table_text1 OCCURS 0,
line(132) TYPE c, " Line text
END OF i_table_text1,
* Internal table to hold text for container looking for another job
beGIN OF i_table_text2 OCCURS 0,
line(132) TYPE c, " Line text
END OF i_table_text2.
* Subroutine to create text container for remarks on credentials
PERFORM get_container_credential.
* Subroutine to create text container for remarks on character
* PERFORM get_container_character.
* Subroutine to create text container for remarks on preemployeement
* PERFORM get_container_preempmnt.
call screen 100.
*endmodule. " create_container_pbo_2000 OUTPUT
form get_container_credential .
IF obj_cust_cont_credential IS INITIAL.
* To create the object custom container and link to the container on
* screen
CREATE OBJECT obj_cust_cont_credential
EXPORTING
container_name = 'CCREDENTIALS'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
* To create the a TextEdit Control and link to the custom container
CREATE OBJECT obj_text_CRED
EXPORTING
parent = obj_cust_cont_credential
wordwrap_mode = cl_gui_textedit=>WORDWRAP_AT_WINDOWBORDER
wordwrap_to_linebreak_mode = cl_gui_textedit=>true
EXCEPTIONS
others = 1.
IF sy-subrc EQ 0.
* To remove the toolbar
CALL METHOD obj_text_CRED->set_toolbar_mode
EXPORTING
toolbar_mode = 0
EXCEPTIONS
error_cntl_call_method = 1
invalid_parameter = 2
OTHERS = 3.
* To remove the status bar
CALL METHOD obj_text_CRED->set_statusbar_mode
EXPORTING
statusbar_mode = 0
EXCEPTIONS
error_cntl_call_method = 1
invalid_parameter = 2
OTHERS = 3
ENDIF. " IF sy-subrc EQ 0
ENDIF. " IF obj_cust_cont_credential
endform. " get_container_credential
module STATUS_0100 output.
SET PF-STATUS 'ZYH454_TEST1'.
SET TITLEBAR 'xxx'.
endmodule. " STATUS_0100 OUTPUT
module USER_COMMAND_0100 input.
if sy-ucomm EQ 'BACK'.
leave to screen 0.
endif.
endmodule. " USER_COMMAND_0100 INPUT -
How to call a text editor from a module pool program
Hi All,
I want to call the text editor from my modulepool program. Enter my text in it and save it.This text needs to be saved in a Z-program with 2 fields as primary keys. The next time while I call this same record from this z table, I need to fetch the existing text and display it.
The user now can put in additional text and can again save it. This process thus goes on..
If anyone has worked in this type of scenario, then please help me in doing this.
Useful answers will surely be rewarded.
Thanks,
Susanth.Hi Sushanth,
We save the text not as fields in a ztable directly but as a text.Please check the format below since it is based on a working code....
first you need to create a text in s010 transaction...
there should be some key based on which you plan to save the text..imagine it is Purchase order then..PO+item numner is always unique.eg:0090010(900PO/item10).so in the code you can append these two and they will be unique..so you can always retrieve them,overwrite,save them anytime you need
**************data declarations
TYPES: BEGIN OF TY_EDITOR,
EDIT(254) TYPE C,
END OF TY_EDITOR.
data: int_line type table of tline with header line.
data: gw_thead like thead.
data: int_table type standard table of ty_editor.
****************fill header..from SO10 t-code..when you save you need the unique key..youfill it here and pass it in save_text function module
GW_THEAD-TDNAME = loc_nam. " unique key for the text -> our unique key to identify the text
GW_THEAD-TDID = 'ST'. " Text ID from SO10
GW_THEAD-TDSPRAS = SY-LANGU. "current language
GW_THEAD-TDOBJECT = 'ZXXX'. "name of the text object created in SO10
*To Read from Container and get data to int_table
CALL METHOD EDITOR ->GET_TEXT_AS_R3TABLE
IMPORTING
TABLE = int_table
EXCEPTIONS
ERROR_DP = 1
ERROR_CNTL_CALL_METHOD = 2
ERROR_DP_CREATE = 3
POTENTIAL_DATA_LOSS = 4
others = 5.
IF SY-SUBRC 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
loop data from int_table and save to int_line-tdline appending it.
*save the text
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
HEADER = GW_THEAD
TABLES
LINES = InT_LINE
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 4
OTHERS = 5.
IF SY-SUBRC 0.
ENDIF.
*To pass to Container
CALL METHOD EDITOR ->SET_TEXT
hope that the above sample with helps you solve the problem
Please check and revert,
Reward if helpful
Regards
Byju -
How to create Long Text in Module Pool Program
Hi all,
I want to develop a new module pool program and I want to use Long text screen in this program and also want this text will store in table.I never develop such type of module pool before.This long text will like sales order long text.Please let me know the steps how I can develop such type of program and how I save long text huge data in table.
Thanks & Regards
NirmalHai ,
here you have to use custom control, for this
DATA: line(256) TYPE c,
text_tab LIKE STANDARD TABLE OF line,
field LIKE line.
1) Create custom control in your screen
2) CREATE OBJECT: container EXPORTING container_name = 'TEXTEDIT', "--> (this is custom control name in screen)
editor EXPORTING parent = container.
3) CALL METHOD editor->get_text_as_stream "This method reads data from custom control , inserts into itab 'text_tab'
IMPORTING
text = text_tab. "
READ TABLE text_tab INTO line INDEX 1. read the text into wa 'line'
if you want more clarity , see 'ABAPDOCU' >ABAP USER DIALOGS> COMPLEXSCREEN ELEMENTS--> DEMO CUSTOM_CONTROL -
Module Pool Programming - Calling SAP Standard Text Screen
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
GaneshHi 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
Maybe you are looking for
-
Please Help! Safari Keeps Crashing every 2 minutes!
I've tried repairing the permissions, emptying the cache and the preferences, and even zapping the PRAM. But every one to two minutes, Safari crashes on me. I'm at my wits' end. Please help. Here is the report. Date/Time: 2009-03-31 10:29:02.480 -070
-
Hello, I have an order that was on hold due to credit check. The order showed fulfilled in the order entry form and 'SHIPPED' in the Shipping Transaction Form. How can a user ship order in the system while it is still on hold. Now that I released the
-
I've got 6 Pro. What is entailed in the upgrade process to 7? Dongle?
I was thinking about jumping up to 7 Pro (I have 6 Pro now). I wanted to first know what was involved. Do I have to send in my existing USB dongle to get the new one or anything like that? Or do I just switch it out for one that will come in the reta
-
Problem using DataSource for JDBC applications
import javax.sql.*; import java.sql.*; import java.io.*; import java.text.*; import javax.naming.*; public class CreateMovieTables { //static String driver="COM.cloudscape.core.JDBCDriver"; //static String url="jdbc:cloudscape:"; Strin
-
JTable - Resize rows the same way as the columns
Hi! I have run into a very frustrating problem and have tried to solve this for many hours but can't come up with a good solution. If there is anyone that can help me on the right track I will be very grateful! When I'm using a JTable it provides goo