‎2006 Mar 28 3:20 PM
Hello,
I need create a table with a field which data element is LRAW (or similar) like the long text that you can add to an invoice o a sales order (header or position). Then I have to maintain that table and I don't know how to do that.
I think to create a program copy of BCALV_EDIT_04 (this ALV let you to add, delete or modify records in the table) and modify the program in order to when you press two clicks in the line a new screen will be showed and develop that screen to modify the text but I don't know any class to maintain the long texts. Does anybody know which class I can use?
Do anybody has any other idea to get what I want?
Can anybode help and show can I work with long texts? I didn't find documentation about that.
Thank you very much in advance,
Manuel
‎2006 Mar 28 3:29 PM
CL_GUI_TEXTEDIT class.
demo program
BC_CONTROLS_TUTORIAL
Regards
Raja
‎2006 Mar 28 4:01 PM
Thanks both for you promt answer.
Special thanks to Raja for demo program.
Do you know where I can get the controls tutorial?
Regards,
Manuel
‎2006 Mar 28 4:17 PM
Hi Manuel,
you can find the tutorial from SAP help.
http://help.sap.com/saphelp_nw04/helpdata/en/e4/6013361d5af835e10000009b38f839/frameset.htm
Regards
Vijay
‎2006 Mar 28 6:18 PM
Hi again,
One more question, I have been looking but I didn't find any method to save the text in my table.
Can you help me?
Kind regards,
Manuel
‎2006 Mar 28 6:25 PM
hi,
you need to use <b>SAVE_TEXT</b> to save the long text. for help read the documentation.
Regards
Vijay
‎2006 Mar 29 8:51 AM
check this demo program on how to get the text entered in the text edit and you can then use the text to save it in your table.
SAPTEXTEDIT_DEMO_3
Regards
Raja
Reward points to the helpful answers
‎2006 Mar 29 11:47 AM
Hi Manuel,
i too have the similar kind of requirement.
Please find the code below this will help you.
Declaration part of the class
-
Reference to wrapper class of control based on OO Framework
LCL_editor_2001 TYPE REF TO cl_gui_textedit,
reference to custom container: necessary to bind TextEdit Control
LCL_editor_container_2001 TYPE REF TO cl_gui_custom_container,
-
destroy_controls_2001 .
IF NOT lcl_editor_2001 IS INITIAL.
CALL METHOD lcl_editor_2001->free
EXCEPTIONS
OTHERS = 1.
IF sy-subrc NE 0.
ENDIF.
destroy container
CALL METHOD lcl_editor_container_2001->free
EXCEPTIONS
OTHERS = 1.
IF sy-subrc <> 0.
MESSAGE E002 WITH F_RETURN.
ENDIF.
finally flush
CALL METHOD cl_gui_cfw=>flush
EXCEPTIONS
OTHERS = 1.
endif.
" destroy_controls_2001
create control container
CREATE OBJECT LCL_EDITOR_CONTAINER_2001
EXPORTING
container_name = 'TEXTEDITOR_2001'
EXCEPTIONS
cntl_error = 1
cntl_system_error = 2
create_error = 3
lifetime_error = 4
lifetime_dynpro_dynpro_link = 5.
IF sy-subrc NE 0.
add your handling
ENDIF.
create calls constructor, which initializes, creats and links
a TextEdit Control
CREATE OBJECT lcl_editor_2001
EXPORTING
parent = lcl_editor_container_2001
wordwrap_mode = cl_gui_textedit=>wordwrap_at_fixed_position
wordwrap_to_linebreak_mode = cl_gui_textedit=>true
EXCEPTIONS
others = 1.
to read the long text
CALL FUNCTION 'READ_TEXT'
EXPORTING
CLIENT = SY-MANDT
ID = 'K16'
LANGUAGE = sy-langu
NAME = P_LCL_TEXT_KEY
OBJECT = 'EKKO'
TABLES
LINES = lcl_tbl_lines
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
NOT_FOUND = 4
OBJECT = 5
REFERENCE_CHECK = 6
WRONG_ACCESS_TO_ARCHIVE = 7
OTHERS = 8.
IF SY-SUBRC eq 0.
loop at lcl_tbl_lines.
append lcl_tbl_lines-tdline to P_TEXT_TABLE.
endloop.
ENDIF.
SAVE_TEXT
-
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
CLIENT = SY-MANDT
HEADER = lcl_thead
INSERT = ''
SAVEMODE_DIRECT = 'X'
OWNER_SPECIFIED = ' '
LOCAL_CAT = ' '
IMPORTING
FUNCTION =
NEWHEADER =
TABLES
LINES = tbl_tlines
EXCEPTIONS
ID = 1
LANGUAGE = 2
NAME = 3
OBJECT = 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.
I think this will solve your requirement.
Regards
Anil Kumar K
Message was edited by: K.Anil Kumar
‎2006 Mar 28 3:32 PM
Hi,
if you want to maintain long text then you can use this class <b>cl_gui_textedit</b>
regards
vijay