12-01-2007 11:20 PM
Using READ_TEXT we can read the sapscript text. Is there a function to write text to sapscript text. I want to replace the existing text.
12-01-2007 11:22 PM
Hi Megan,
You have to use SAVE_TEXT.
Here you have to pass THEAD & IT_LINES
thead-tdid = <Object ID>.
thead-tdobject = <Object>.
thead-tdspras = 'EN'.
thead-tdname = <Object Name>.
IT_LINES is the internal table like TLINE, through this you can pass the text which you want to save.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
CLIENT = SY-MANDT
HEADER = thead
SAVEMODE_DIRECT = 'X'
insert = ' '
OWNER_SPECIFIED = ' '
LOCAL_CAT = ' '
IMPORTING
FUNCTION =
NEWHEADER =
TABLES
LINES = it_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.
Regards,
Satish
Message was edited by:
Satish Panakala
12-01-2007 11:22 PM
Hi Megan,
You have to use SAVE_TEXT.
Here you have to pass THEAD & IT_LINES
thead-tdid = <Object ID>.
thead-tdobject = <Object>.
thead-tdspras = 'EN'.
thead-tdname = <Object Name>.
IT_LINES is the internal table like TLINE, through this you can pass the text which you want to save.
CALL FUNCTION 'SAVE_TEXT'
EXPORTING
CLIENT = SY-MANDT
HEADER = thead
SAVEMODE_DIRECT = 'X'
insert = ' '
OWNER_SPECIFIED = ' '
LOCAL_CAT = ' '
IMPORTING
FUNCTION =
NEWHEADER =
TABLES
LINES = it_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.
Regards,
Satish
Message was edited by:
Satish Panakala
12-02-2007 12:11 AM
Megan,
yes it's WRITE_TEXT. But if the text object is used in transactional handling (like order header/item or material texts), you will need COMMIT_TEXT also.
Regards,
Clemens
12-02-2007 12:14 AM
I am trying out SAVE_TEXT. But it writes another line of text and keeps the existing lines of text. I want to delete the existing lines of text and replace them with the new text. How to do that?
Or is there another fm that I can use.
12-02-2007 12:22 AM
You can use SAVE_TEXT even to replace the text.
Go through below link for more information
http://help.sap.com/saphelp_nw04/helpdata/en/d6/0db771494511d182b70000e829fbfe/frameset.htm
Regards,
Satish