Application Development 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: 

WRITE_TEXT

Former Member
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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

4 REPLIES 4

Former Member
0 Kudos

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

Clemenss
Active Contributor
0 Kudos

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

Former Member
0 Kudos

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.

0 Kudos

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