Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Help in editor

Former Member
0 Likes
611

Hi

i wrote this code to show editor

i want to show text in the editor and to habe to option to change it and save

but i dont have option to do it.

How can i save the new text?

Maybe you have an example of better editor?

Thanks

The code:

*Create LV_DOCKING

CREATE OBJECT LV_DOCKING

EXPORTING

REPID = LV_REPID

DYNNR = SY-DYNNR

SIDE = CL_GUI_DOCKING_CONTAINER=>DOCK_AT_BOTTOM

EXTENSION = '300'

EXCEPTIONS

CNTL_ERROR = 1

CNTL_SYSTEM_ERROR = 2

CREATE_ERROR = 3

LIFETIME_ERROR = 4

LIFETIME_DYNPRO_DYNPRO_LINK = 5.

ENDIF .

*Set posion

CALL METHOD LV_DOCKING->SET_WIDTH

EXPORTING

WIDTH = 390.

IF LV_EDITOR IS INITIAL.

*Create editor

CREATE OBJECT LV_EDITOR

EXPORTING

PARENT = LV_DOCKING

WORDWRAP_MODE = CL_GUI_TEXTEDIT=>WORDWRAP_AT_FIXED_POSITION

WORDWRAP_POSITION = 256

MAX_NUMBER_CHARS = 100000.

ENDIF .

CALL METHOD LV_EDITOR->SET_TEXT_AS_R3TABLE

EXPORTING

TABLE = LT_TEXTLINES

EXCEPTIONS

OTHERS = 1.

CALL METHOD LV_EDITOR->GET_TEXT_AS_R3TABLE

IMPORTING

TABLE = LT_TEXTLINES

EXCEPTIONS

ERROR_DP = 1

ERROR_CNTL_CALL_METHOD = 2

ERROR_DP_CREATE = 3

POTENTIAL_DATA_LOSS = 4

OTHERS = 5.

*

IF SY-SUBRC <> 0.

EXIT.

ENDIF.

ENDIF.

5 REPLIES 5
Read only

Former Member
0 Likes
575

Hi,

Cant you try the EDITOR-CALL FOR ITAB command. you can set some default text into it and also retrieve the changed text also.

regards,

Mahesh

Read only

0 Likes
575

this call would get you the user entered text.

CALL METHOD LV_EDITOR->GET_TEXT_AS_R3TABLE

IMPORTING

TABLE = LT_TEXTLINES

EXCEPTIONS

ERROR_DP = 1

ERROR_CNTL_CALL_METHOD = 2

ERROR_DP_CREATE = 3

POTENTIAL_DATA_LOSS = 4

OTHERS = 5.

*

IF SY-SUBRC <> 0.

EXIT.

ENDIF.

you seems to already use it. are you having problem in that.

Regards

Raja

Read only

0 Likes
575

check this demo program

SAPTEXTEDIT_DEMO_3

Raja

Read only

0 Likes
575

Hi

Thanks about the answers

But i didnt undrtsand how i can save the data i wrote in the editor

i dont have save icon

Read only

0 Likes
575

you have to set PF status in your application for save button and onclick of that you have to use the method explined aboe to get the user entered text and then save it.

Regards

Raja