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

fm SAVE_TEXT

Former Member
0 Likes
5,951

hi everybody, im using the fm SAVE_TEXT to save a text for a customer, but the text is not being saved to that customer, are the parameters correctly passed in the fm below

header-tdname = tdname.

header-tdspras = p_lang.

header-tdobject = p_object.

header-tdid = p_id.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

  • CLIENT = SY-MANDT

HEADER = header

INSERT = 'X'

SAVEMODE_DIRECT = 'X'

  • OWNER_SPECIFIED = ' '

  • LOCAL_CAT = ' '

IMPORTING

FUNCTION = function

NEWHEADER = newheader

TABLES

LINES = iline2

  • 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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
4,211

Hi,

check whether object ,id is defined TTXOB table TTXID

iline2 tanle has data

Regards

Amole

12 REPLIES 12
Read only

Former Member
0 Likes
4,211

If you are sure of the parameters , call the function COMMIT_TEXT after SAVE_TEXT.

Regards,

Ravi

Note : Please mark the helpful answes

Read only

Former Member
0 Likes
4,211

the code is correct...after this FM just write a dummy program using READ_TEXT and pass the parameters...If the text is been retrieved...customer has text which needs to be seen at a different point.

Read only

Former Member
0 Likes
4,211

Hi Sia anajali.

try to pass the correct paramters, and check the sy-subrc after the FM call. and then call commit_text fm.

header-tdname = tdname.

header-tdspras = p_lang.

header-tdobject = p_object.

header-tdid = p_id.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

CLIENT = SY-MANDT

HEADER = header

INSERT = 'X'

SAVEMODE_DIRECT = 'X'

IMPORTING

FUNCTION = function

NEWHEADER = newheader

TABLES

LINES = iline2

  • EXCEPTIONS

  • ID = 1

  • LANGUAGE = 2

  • NAME = 3

  • OBJECT = 4

  • OTHERS = 5

.

IF SY-SUBRC = 0.

call function 'COMMIT_TEXT'.

ENDIF.

Regards

Vijay

Read only

Former Member
0 Likes
4,212

Hi,

check whether object ,id is defined TTXOB table TTXID

iline2 tanle has data

Regards

Amole

Read only

0 Likes
4,211

im rather inserting a text for a customer, am i using the correct fm?

Read only

0 Likes
4,211

Yes, you are using the correct FM. But what you are passing to FM also Matters.

can you tell what are you passing to each paramter,.

Regards

Vijay

Read only

0 Likes
4,211

data: tdname type thead-tdname,

id type thead-tdid,

header type thead,

newheader type thead,

function(1) type c,

iline like tline occurs 0 with header line,

iline2 like tline occurs 0 with header line.

CONSTANTS : c_x TYPE c VALUE 'X',

object type thead-tdobject value 'KNVV',

lang type thead-tdspras value 'E'.

loop at idatafile.

clear tdname.

concatenate idatafile-kunnr idatafile-new_vkorg into tdname.

concatenate tdname idatafile-new_vtweg into tdname separated by '

'.

concatenate tdname idatafile-new_spart into tdname separated by ' '.

header-tdname = tdname.

header-tdspras = p_lang.

header-tdobject = p_object.

header-tdid = p_id.

CALL FUNCTION 'SAVE_TEXT'

EXPORTING

CLIENT = SY-MANDT

HEADER = header

INSERT = ' X'

SAVEMODE_DIRECT = 'X'

  • OWNER_SPECIFIED = ' '

  • LOCAL_CAT = ' '

IMPORTING

FUNCTION = function

NEWHEADER = newheader

TABLES

LINES = iline2

  • 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.

IF SY-SUBRC = 0.

call function 'COMMIT_TEXT'.

ENDIF.

endloop.

Read only

0 Likes
4,211

Hi Anjali,

Can you tell me , for which Transaction you are maintaining. and if it Customer Master related

then

header-tdname = tdname. "it is Customer Number

header-tdspras = p_lang. "sy-langu

header-tdobject = p_object. "KNA1

header-tdid = p_id. "it depends you need to check it , inside transaction

but i am not understanding... the below code.

concatenate idatafile-kunnr idatafile-new_vkorg into tdname.

concatenate tdname idatafile-new_vtweg into tdname separated by '

'.

concatenate tdname idatafile-new_spart into tdname separated by ' '.

here problem comes...

Regards

vijay

Read only

0 Likes
4,211

no no, its for the object KNVV

where tdname = customer name + sales org + division + distribution channel

i used the fm READ_TEXT first to retrieve the text

then im using the fm SAVE_TEXT to save the text in another combination of tdname

for example i used

00050000301 1 1(customer name + sales org + distribution + division) to retrieve the text

now i hae to save the text in another combination 00050000301 22 1

did u understand?

Read only

0 Likes
4,211

Yes, i understood, but why are you using SAPCES in between.

you are conactenating separated by space. so avoid that.

Regards

vijay

Read only

0 Likes
4,211

its because when using the fm READ_TEXT, the tdname is accepted in the format

customernamesales org 3 spaces + distr channel + 1 space + division

i need not put the text i retrieved from the fm READ_TEXT in the parameter used in fm SAVE_TEXT?

i just use the tdname, language, textid and the text object, right?

Read only

Former Member
0 Likes
4,211

Hi Anjali,

First check the entry in STXH Table. If the entry is there then the text object has been created. Then try to put break-point in your FM at <b>IF SY_SUBRC <> 0.</b>.If it is zero then it will create the entry in STXH. table.

Regds,

Vinsa.R