12-04-2014 7:42 AM
Hi experts.
I need your help.
how can I catch value in textedit(notebox) and save it in my ztable.
I'm looking forward to hearing from you.
kind regards.
12-04-2014 7:48 AM
Hi,
Can you provide some more details of your issue. is it long text?
Thanks,
Sree
12-04-2014 9:58 AM
ok.
it is long text, it is a comment, I have provided it like Demo of text edit.
kind regards
12-04-2014 10:13 AM
Hi Elina,
Are you using custom screen?
if yes it will be helpful to you. create a button in screen having fctcode-'P1'(lets assume)
if you click on the button it will trigger the PBI Event.. write the below code in PAI Event.
IF sy-ucomm = 'P1'.
CALL FUNCTION 'TERM_CONTROL_EDIT'
EXPORTING
titel = 'Comments'
LANGU = sy-langu
TABLES
textlines = it_note1
EXCEPTIONS
user_cancelled = 1
OTHERS = 2
.
ENDIF.
it_note1 TYPE TABLE OF TXW_NOTE WITH HEADER LINE.
and before saving the data
LOOP AT it_not1.
CONCATENATE <wa-fieldnam> it_not1-line INTO <wa-fieldnam> SEPARATED BY ' '.
ENDLOOP.
if it helps give me a feedback i will help you whole code..
Thanks
Pedda Raju Jogi
12-04-2014 10:25 AM
Hi,
Have you consider using the standard sap function to read and save your text ?
function 'READ_TEXT'
Using cl_gui_textedit or function EDIT_TEXT
function 'SAVE_TEXT'
You can create your own user texts.
Try SO10 .
Regards.
12-04-2014 10:30 AM
Did you use CL_GUI_TEXTEDIT or did you use FM EDIT_TEXT or EDIT_TEXT_INLINE ?
If you use class, in PAI of program, you can use method get_text_as_r3table to get the text in an internal table. In every case; you can then save it to database with FM SAVE_TEXT.
NB: First create Text object and Id in transaction SE75, then read BC SAPscript: Printing with Forms, SAPscript Function Modules.
Regards,
Raymond
12-04-2014 10:42 AM
code of creating and call textedit is above:
repid = sy-repid.
* create control container
CREATE OBJECT container
EXPORTING
container_name = 'TXT_COMENT'
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
* add your handling
ENDIF.
* create calls constructor, which initializes, creats and links
* TextEdit Control
CREATE OBJECT editor
EXPORTING
parent = container
wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
wordwrap_position = g_line_length
wordwrap_to_linebreak_mode = cl_gui_textedit=>true.
* register editor for event dblclick
CALL METHOD editor->register_event_dblclick
EXPORTING
appl_event = 'X'.
* Create the event_receiver object and set the handlers for the events
* of the control
CREATE OBJECT event_receiver.
SET HANDLER event_receiver->event_handler_dblclick
FOR editor.
* set status text of control
CALL METHOD editor->set_status_text
EXPORTING
status_text = text-011.
* set new pf-status
* SET PF-STATUS 'MAIN100'.
* to manage back
nothing_displayed = 1.
wish that will clarify my doubt
12-04-2014 1:30 PM
Hi expert,
so with this code I could provide the text edit in my screen, but what I want is to save that text I have introduced in my ztable.
kind regards
12-04-2014 1:52 PM
Hi,
We have method in CL_GUI_TEXTEDIT class, by using below methos you can capture the text information.
types : begin of ty_text,
text(50) type c,
end of ty_text.
data : it_text type standard table of ty_text,
wa_text type ty_text.
call method editor->get_text_as_r3table
* EXPORTING
* ONLY_WHEN_MODIFIED = FALSE
importing
table = it_text
* IS_MODIFIED =
* 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.
After capturing this value you can save this information in your custom table.
Hopes it helps you.
Thanks,
Ashok.
12-04-2014 1:54 PM
12-09-2014 8:11 AM
Hi experts,
hope this email finds you well,
I have called the method editor->get_text_as_r3table, in my PAI module when save buttom, but i can't get the text i have wrote in the note box.
I think something is missing.
note box is there but i want to save it's content in the table.
kind regards.
12-09-2014 12:39 PM