‎2006 Jan 30 7:34 PM
Hi,
I am using EDIT_TEXT function to show and save text.
I need in some cases to open that screen in read-only mode, is there any way I can do this?.
Thanx in advance
‎2006 Jan 30 7:38 PM
Hi,
You can use the same EDIT_TEXT also to open in read only mode.Just pass parameter DISPLAY as 'X'.
‎2006 Jan 30 7:38 PM
Hi,
You can use the same EDIT_TEXT also to open in read only mode.Just pass parameter DISPLAY as 'X'.
‎2006 Jan 30 7:46 PM
Use the display parameter.
report zrich_0002.
data: header type thead.
data: txt_lines type table of tline with header line.
<b>data: mode(1) type c.
parameters: p_edit radiobutton group grp1 default 'X',
p_disp radiobutton group grp1.</b>
* Set up the text header
header-tdobject = 'AUFK'.
header-tdname = '001000000001'.
header-tdid = 'LTXT'.
header-tdspras = sy-langu.
header-tdlinesize = 70.
* First read the text, if there is any.
call function 'READ_TEXT'
exporting
* CLIENT = SY-MANDT
id = header-tdid
language = sy-langu
name = header-tdname
object = header-tdobject
* ARCHIVE_HANDLE = 0
* LOCAL_CAT = ' '
* IMPORTING
* HEADER =
tables
lines = txt_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 <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
<b>if p_edit = 'X'.
mode = space.
else.
mode = 'X'.
endif.</b>
* throw editor, allow user to change
call function 'EDIT_TEXT'
exporting
<b> display = mode</b>
* EDITOR_TITLE = ' '
header = header
* PAGE = ' '
* WINDOW = ' '
save = 'X'
* LINE_EDITOR = ' '
* CONTROL = ' '
* PROGRAM = ' '
* LOCAL_CAT = ' '
* IMPORTING
* FUNCTION =
* NEWHEADER =
* RESULT =
tables
lines = txt_lines
* EXCEPTIONS
* ID = 1
* LANGUAGE = 2
* LINESIZE = 3
* NAME = 4
* OBJECT = 5
* TEXTFORMAT = 6
* COMMUNICATION = 7
* OTHERS = 8
.
if sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
* WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
* When user comes back from editor, save the text
* Only for edit mode.
<b>check mode = space.</b>
call function 'SAVE_TEXT'
exporting
client = sy-mandt
header = header
* INSERT = ' '
* SAVEMODE_DIRECT = ' '
* OWNER_SPECIFIED = ' '
* LOCAL_CAT = ' '
* IMPORTING
* FUNCTION =
* NEWHEADER =
tables
lines = txt_lines
* 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.