Application Development 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: 

Creating Text for co01

leonardo_pavia
Participant
0 Kudos

Hi friends, i have a FM to create the "first time" text of an order (co01), this order was previously created via "call transaction", the problem is that the text is empty, the FM is not saving the order text (checking transactions co02 or co03), the FM CREATE_TEXT returns sy-subrc = 0, the table SHTX have the corresponding record saved by CREATE_TEXT, i dont know what to do, can you help me?. I have posted the code below.

This problem is similar to one posted previously:

But i don't know the solution.

FUNCTION zcc_updateorder_text.

*"----


""Interfase local

*" IMPORTING

*" REFERENCE(AUFNR) TYPE AUFK-AUFNR

*"----


DATA: p_orden TYPE aufk-aufnr,

p_tdname TYPE thead-tdname,

p_tdid TYPE thead-tdid,

p_tdobject TYPE thead-tdobject,

p_header TYPE thead,

it_tline TYPE STANDARD TABLE OF tline

WITH HEADER LINE,

p_function.

CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'

EXPORTING

input = aufnr

IMPORTING

output = p_orden.

CONCATENATE sy-mandt

p_orden

INTO p_tdname.

it_tline-tdline = 'Some Text...'.

APPEND it_tline.

p_tdid = 'KOPF'.

p_tdobject = 'AUFK'.

CALL FUNCTION 'CREATE_TEXT'

EXPORTING

fid = p_tdid

flanguage = sy-langu

fname = p_tdname

fobject = p_tdobject

save_direct = 'X'

fformat = '*'

TABLES

flines = it_tline

EXCEPTIONS

no_init = 1

no_save = 2

OTHERS = 3.

ENDFUNCTION.

1 ACCEPTED SOLUTION

Former Member

hi ..leonrado ..good to hear that the problem has been solved ..i got my points as u appreciated me , but have u find out the reason why we cannot c the text when we upload ......if u find then tell me too ,, anyway r u from india ?

thanks

regards

farukh

2 REPLIES 2

Former Member
0 Kudos

Add the text in normal transaction and then go to the long text screen by double clicking the text. In the menu, here, you should see the object, object key etc. I think your object key is not formed correctly. Check if you need MANDT to be concatenated or not. Also, check if you need to add more fields in the concatenate statement. The easiest way is to go to STXH after you save long text using CO01(not the function module). Also, use SAVE_TEXT, instead of CREATE_TEXT. Some long texts cannot be seen from transactions if added this way. This is because, these transaction look for some indicator to be set on the corresponding table. Typically it will be the language key. See if the table field is set when you create the long text using standard transaction.

Former Member

hi ..leonrado ..good to hear that the problem has been solved ..i got my points as u appreciated me , but have u find out the reason why we cannot c the text when we upload ......if u find then tell me too ,, anyway r u from india ?

thanks

regards

farukh