‎2008 Apr 09 3:33 PM
Hi all,
I hape that sb can help me with my problem.
I have created a ABAP-Program to create sales-orders with the function module:
BAPI_SALESORDER_CREATEFROMDAT2
Everythiunk works fine but I can not create text-elements (from the head) with this bapi.
I know that I have to use the table "ORDER_TEXT" but I do not know how to fill this table.
Can anybody help me?
Best regards,
pb974
‎2008 Apr 09 3:46 PM
If you see the structure of table order_text..you find it self explainatory...anyway, I'll tell you what to fill inside it..
Do as follows ..
1) Open a sales order through VA03
2) From menu options choose Go To>Header>Texts
3) In the command field type TP_ANALYSE and press enter
4) Expand all the nodes..Now the third column is the text-id..
5) TEXT_LINE is ur text entry..gotta fill it manually in the code..other things you gotta fill is Sales Order no, item and language
‎2008 Apr 09 3:57 PM
Thorsten,
You have to use the SAP function SAVE_TEXT
Function SAVE_TEXT is a released SAP function and there is a documentation for this function in the SAP system.
Good Luck
Gabriel
‎2008 Apr 09 4:05 PM
Hi,
yes, you have to fill the order_text table. The following fields you have to fill:
DOC_NUMBER
-> not to fill, let it blank
ITM_NUMBER
-> if you want to create a header-text then fill ITM_NUMBER with '000000'
-> if you want to create a position-text then fill the related position-number '000010' or '000020'....
TEXT_ID
-> fill this field with the text-id for which you want to create the text.
-> The text-id must be defined in your customizing
LANGU
-> set the language for the text: 'E' or 'D' or......
LANGU_ISO
-> let it blank
FORMAT_COL
-> set a star (*) if you want to have the standard-format. If you have a special format defined in SapScript or in a Style you can set this one.
TEXT_LINE
-> fill in the text
FUNCTION
-> let it blank
see below:
data: i_text LIKE bapisdtext OCCURS 0 WITH HEADER LINE.
Texte...
CLEAR i_text.
i_text-itm_number = '000010'. "Text for Position 10
i_text-text_id = 'ZA10'. "Defined Text-ID
i_text-langu = 'D'. "Language German
i_text-format_col = '*'. "Standardformat
i_text-text_line = 'This is text for Pos. 10 - line 2'. "the text
APPEND i_text.
...if your text has more then one row... the same one to do...
i_text-itm_number = '000010'. "Text for Position 10
i_text-text_id = 'ZA10'. "Defined Text-ID
i_text-langu = 'D'. "Language German
i_text-format_col = '*'. "Standardformat
i_text-text_line = 'This is text for Pos. 10 - line 2'. "the text
APPEND i_text.
...and so one...
and now text for position 20...
CLEAR i_text.
i_text-itm_number = '000020'. "Text for Position 20
i_text-text_id = 'ZA10'. "Defined Text-ID
i_text-langu = 'D'. "Language German
i_text-format_col = '*'. "Standardformat
i_text-text_line = 'Text für Pos. 20 - Zeile 1'. "the text
APPEND i_text.
...and now the text for position in englisch
i_text-itm_number = '000020'. "Text for Position 20
i_text-text_id = 'ZA10'. "Defined Text-ID
i_text-langu = 'E'. "Language German
i_text-format_col = '*'. "Standardformat
i_text-text_line = 'This is text for Pos. 20 - line 1'. "the text
APPEND i_text.
I hope it's a help for you.
Erhard
‎2008 Apr 09 4:28 PM
Hi Torsten,
In the ORDER_TEXT structure fill the following fields.
DOC_NUMBER - Sales Order No
ITM_NUMBER - Item No
TEXT_ID - Text ID (Length 4 can be any value)
LANGU - Language (Generally English)
TEXT_LINE - Text Line (Text that you want to use)
Apart from the above values rest you have been doing already.
Hope this helps you out. <REMOVED BY MODERATOR>
Thanks and Regards,
Maddineni Bharath.
Edited by: Alvaro Tejada Galindo on Apr 9, 2008 5:51 PM
‎2008 Apr 09 5:32 PM