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

Issue with SAVE_TEXT fm

Former Member
0 Likes
532

Hi,

I am trying to append the text for the sales order through SAVE_TEXT function module. i wrote the code as below but it was not appending the text or not giving any error. can you please let me know what might be the problem.

the code is

---

data: t_header like thead. " long text

data t_long like tline occurs 0 with header line.

data:c_tdform type thead-tdform value 'SYSTEM'." Form name

data: c_tdformat type tline-tdformat value '*'."Tag column

T_HEADer-TDOBJECT = 'VBBK'.

t_HEADer-TDNAME = '0000040457'.

T_HEADer-TDID = 'Z010'.

t_header-tdform = c_tdform.

T_HEADer-TDSPRAS = 'E'.

t_long-tdline = 'Text to append'.

t_long-tdformat = c_tdformat.

append t_long.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

CLIENT = SY-MANDT

HEADER = t_header

SAVEMODE_DIRECT = ''

TABLES

LINES = t_long

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

OBJECT = 4

OTHERS = 5.

if sy-subrc <> 0.

write: /10 'error'.

endif.

---

can you please correct if you find anything wrong, i am trying for VA02 transaction.

Regards

Jaya

Hi,

I am trying to append the text for the sales order through SAVE_TEXT function module. i wrote the code as below but it was not appending the text or not giving any error. can you please let me know what might be the problem.

the code is

---

data: t_header like thead. " long text

data t_long like tline occurs 0 with header line.

data:c_tdform type thead-tdform value 'SYSTEM'." Form name

data: c_tdformat type tline-tdformat value '*'."Tag column

T_HEADer-TDOBJECT = 'VBBK'.

t_HEADer-TDNAME = '0000040457'.

T_HEADer-TDID = 'Z010'.

t_header-tdform = c_tdform.

T_HEADer-TDSPRAS = 'E'.

t_long-tdline = 'Text to append'.

t_long-tdformat = c_tdformat.

append t_long.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

CLIENT = SY-MANDT

HEADER = t_header

SAVEMODE_DIRECT = ''

TABLES

LINES = t_long

EXCEPTIONS

ID = 1

LANGUAGE = 2

NAME = 3

OBJECT = 4

OTHERS = 5.

if sy-subrc <> 0.

write: /10 'error'.

endif.

---

can you please correct if you find anything wrong, i am trying for VA02 transaction.

Regards

Jaya

2 REPLIES 2
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
481

What happens if you set the SAVEMODE_DIRECT = 'X' in the function module interface.

Regards,

Rich Heilman

Read only

Former Member
0 Likes
481

Please use - 'COMMIT_TEXT' - after save_text FM

if sy-subrc eq 0.

CALL FUNCTION 'COMMIT_TEXT'

EXPORTING

OBJECT = t_header-TDOBJECT

NAME = t_header-TDNAME

ID = t_header-TDID

LANGUAGE = t_header-TDSPRAS.

endif.