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 CREATE_TEXT

Former Member
0 Likes
3,464

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?

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
2,712

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.

14 REPLIES 14
Read only

Former Member
0 Likes
2,712

Instead of CREATE_TEXT use SAVE_TEXT.

Regards,

Prakash.

Read only

sridhar_k1
Active Contributor
0 Likes
2,712

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

Read only

Former Member
0 Likes
2,712

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.

Read only

naimesh_patel
Active Contributor
0 Likes
2,712

Hello,

use FM

First, SAVE_TEXT

then, COMMIT_TEXT

regards,

Naimesh

Read only

Former Member
0 Likes
2,712

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 !!!!

Read only

0 Likes
2,712

hello,

did you pass save_direct = 'X' in create_text ?

Regards,

Naimesh

Read only

0 Likes
2,712

Hi,

Yes .... SAVE DIRECT = 'X' .... but nothing.

Thanks

Read only

0 Likes
2,712

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

Read only

0 Likes
2,712

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

Read only

0 Likes
2,712

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

Read only

Former Member
0 Likes
2,712

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

Read only

Former Member
0 Likes
2,712

This problem only happens with Production Order TEXT

id = 'KOPF'

object = 'AUFK'

With other text works correctly.

Read only

0 Likes
2,712

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

Read only

Former Member
0 Likes
2,713

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.