‎2006 Aug 08 2:38 PM
Hi,
I'm trying to create a new text for an existing production order using FM:
CALL FUNCTION 'CREATE_TEXT'
EXPORTING
fid = 'KOPF'
flanguage = sy-langu
fname = l_name "mandt+Prod.order
fobject = 'AUFK'
TABLES
flines = i_line[] "Message text info
EXCEPTIONS
no_init = 1
no_save = 2
OTHERS = 3.
But when I go to see it with transaction CO03 ... this created text do not appear !!!!!
Table STXH has my new register .... can someone help me?
‎2006 Aug 08 3:04 PM
Hi,
after CRETAE_TEXT , call COMMIT_TEXT , then only the changes will reflect. and also some times it happens you will not be able to see the text with the updated one. in that case Checking can be done using READ_TEXT .
i think in your case you can cross check with the help of READ_TEXT FM.
Regards
vijay D T T.
‎2006 Aug 08 2:41 PM
‎2006 Aug 08 2:49 PM
Add statement COMMIT WORK AND WAIT after CREATE_TEXT.
Also populate text name field with MANDT+order number with leading zeros.
Regards
Sridhar
Message was edited by: Sridhar K
‎2006 Aug 08 2:56 PM
Hi,
You must go to table STXH to check the existence of the text. Then, use the function READ_TEXT to read the text content into your internal table.
regards,
keerthi.
‎2006 Aug 08 2:57 PM
Hello,
use FM
First, SAVE_TEXT
then, COMMIT_TEXT
regards,
Naimesh
‎2006 Aug 08 3:00 PM
Thanks ...
But I also used SAVE_TEXT and it doesn't work if initial text was not created.
SAVE_TEXT works as "MODIFY"
I also used FM COMMIT_TEXT ... not work either.
NOTE: Of course I use leading zeros to inform MANDT + Prod. Order.
... Still trying !!!!
‎2006 Aug 08 3:04 PM
hello,
did you pass save_direct = 'X' in create_text ?
Regards,
Naimesh
‎2006 Aug 08 3:09 PM
‎2006 Aug 08 3:32 PM
AUFK-LTEXT should be populated for the text to show up in CO03.
When you use CREATE_TEXT, above mentioned field is not populated, and the text is not showing up in CO03.
Regards
Sridhar
‎2006 Aug 08 3:41 PM
I had this same issue the other day. I was able to create the text using SAVE_TEXT function module and setting the parameters...
call function 'SAVE_TEXT'
exporting
* CLIENT = SY-MANDT
header =
<b> INSERT = 'X'
SAVEMODE_DIRECT = 'X'
</b>
....
Here is the link to the other thread.
Setting these two parameters in the SAVE_TEXT function module worked for me.
Regards,
Rich Heilman
‎2006 Aug 08 4:35 PM
I see the problem now, it shows in STXH, but not in CO02. The problem is that in this transaction, it checks an indicator in AUFK called LTEXT. This needs to be set in order to show the text in the text container in CO02. Normally, I wouldn't suggest a direct table update, but in this case it may be ok to do so. Move SY-LANGU to this field and update, then the text should show fine in the CO02 transaction. See the sample program, this works in my system. I can see the text in the container in CO02.
report zrich_0001.
data: xaufk type aufk.
data: header type thead.
data: ilines type table of tline with header line.
parameters: p_aufnr type aufk-aufnr.
header-tdobject = 'AUFK'.
concatenate sy-mandt p_aufnr into header-tdname.
condense header-tdname no-gaps.
header-tdid = 'KOPF'.
header-tdspras = sy-langu.
ilines-tdline = 'This is a test 1'.
append ilines.
ilines-tdline = 'This is a test 2'.
append ilines.
call function 'SAVE_TEXT'
exporting
client = sy-mandt
header = header
savemode_direct = 'X'
tables
lines = ilines
exceptions
id = 1
language = 2
name = 3
object = 4
others = 5
.
<b>
* Direct Database Update.
if sy-subrc = 0.
select single * into xaufk from aufk
where aufnr = p_aufnr.
check sy-subrc = 0.
xaufk-ltext = sy-langu.
modify aufk from xaufk.
endif.</b>
Regards,
Rich Heilman
‎2006 Aug 08 3:02 PM
Hi Norbert
This works fine for me, though i have tried for Sales Document. Can you check if Text Name is combination of fields MANDT and Production Order for object AUFK and Text-Id: KOPF.
Kind Regards
Eswar
Note: Reward for helpful answers
‎2006 Aug 08 3:03 PM
This problem only happens with Production Order TEXT
id = 'KOPF'
object = 'AUFK'
With other text works correctly.
‎2006 Aug 08 3:06 PM
Hi,
I always used this FM ... but with Production Orders ... doesn't work.
I only can change text ... not create initial text.
Thanks for your help
‎2006 Aug 08 3:04 PM
Hi,
after CRETAE_TEXT , call COMMIT_TEXT , then only the changes will reflect. and also some times it happens you will not be able to see the text with the updated one. in that case Checking can be done using READ_TEXT .
i think in your case you can cross check with the help of READ_TEXT FM.
Regards
vijay D T T.