2006 Nov 16 11:35 AM
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.
2006 Nov 16 11:41 AM
Hi,
check whether object ,id is defined TTXOB table TTXID
iline2 tanle has data
Regards
Amole
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.
2006 Nov 16 11:37 AM
If you are sure of the parameters , call the function COMMIT_TEXT after SAVE_TEXT.
Regards,
Ravi
Note : Please mark the helpful answes
2006 Nov 16 11:38 AM
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.
2006 Nov 16 11:40 AM
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
2006 Nov 16 11:41 AM
Hi,
check whether object ,id is defined TTXOB table TTXID
iline2 tanle has data
Regards
Amole
2006 Nov 16 11:47 AM
im rather inserting a text for a customer, am i using the correct fm?
2006 Nov 16 11:50 AM
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
2006 Nov 16 11:53 AM
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.
2006 Nov 16 12:00 PM
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
2006 Nov 16 12:15 PM
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?
2006 Nov 16 12:23 PM
Yes, i understood, but why are you using SAPCES in between.
you are conactenating separated by space. so avoid that.
Regards
vijay
2006 Nov 16 12:33 PM
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?
2006 Nov 16 11:43 AM
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
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |