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

Problem: Create SO with BAPI_SALESORDER_CREATEFROMDAT2 & Head-Text Elements

Former Member
0 Likes
1,434

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

5 REPLIES 5
Read only

Former Member
0 Likes
978

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

Read only

gabriel_braun
Explorer
0 Likes
978

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

Read only

Former Member
0 Likes
978

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

Read only

Former Member
0 Likes
978

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

Read only

Former Member
0 Likes
978

Thank you all!!