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: 

BAPI_SALESORDER_CREATEFROMDAT1: header text

Former Member
0 Kudos
203

How do I pass in header text in BAPI BAPI_SALESORDER_CREATEFROMDAT1? I can't find any parameters for header text.

I tried to use BDC and use SM35 to record the steps to change header text, but SAP can't record. I'm using ECC5.0. Any advice on this issue?

1 ACCEPTED SOLUTION

Former Member
0 Kudos
55

With the above function module you cannot create the texts.Use BAPI_SALESORDER_CREATEFROMDAT2 this function module.

2 REPLIES 2

Former Member
0 Kudos
56

With the above function module you cannot create the texts.Use BAPI_SALESORDER_CREATEFROMDAT2 this function module.

Former Member
0 Kudos
55

hi

1.) update Bapitext with header message and item message

then pass this bapi table to 'SD_SALESDOCUMENT_CREATE'

Function module.

*-- Append Header messages

SORT Z_HEADER_MSG BY TEXT_ID.

LOOP AT Z_HEADER_MSG.

IF Z_HEADER_MSG-TEXT_ID = K_0002.

MOVE: K_0002 TO IT_BAPITEXT-TEXT_ID,

Z_HEADER_MSG-MESSAGE TO IT_BAPITEXT-TEXT_LINE,

SY-LANGU TO IT_BAPITEXT-LANGU,

'*' TO IT_BAPITEXT-FORMAT_COL.

APPEND IT_BAPITEXT.

CLEAR IT_BAPITEXT.

ENDIF.

IF ORDER_HEADER_IN-AUGRU = K_205.

IF Z_HEADER_MSG-TEXT_ID = K_Z004.

MOVE: K_Z004 TO IT_BAPITEXT-TEXT_ID,

Z_HEADER_MSG-MESSAGE TO IT_BAPITEXT-TEXT_LINE,

SY-LANGU TO IT_BAPITEXT-LANGU,

'*' TO IT_BAPITEXT-FORMAT_COL.

APPEND IT_BAPITEXT.

CLEAR IT_BAPITEXT.

ENDIF.

ENDIF.

IF Z_HEADER_MSG-TEXT_ID = K_Z007.

MOVE: K_Z007 TO IT_BAPITEXT-TEXT_ID,

Z_HEADER_MSG-MESSAGE TO IT_BAPITEXT-TEXT_LINE,

SY-LANGU TO IT_BAPITEXT-LANGU,

'*' TO IT_BAPITEXT-FORMAT_COL.

APPEND IT_BAPITEXT.

CLEAR IT_BAPITEXT.

ENDIF.

ENDLOOP.

*-- Append Item messages

SORT Z_ITEMS_MSG BY TEXT_ID.

SORT ORDER_ITEMS_IN BY UEPOS.

LOOP AT Z_ITEMS_MSG.

IF Z_ITEMS_MSG-TEXT_ID = K_Z003.

READ TABLE ORDER_ITEMS_IN WITH KEY UEPOS

= Z_ITEMS_MSG-SLSDOCITM BINARY SEARCH

TRANSPORTING POSNR.

IF SY-SUBRC = 0.

MOVE: ORDER_ITEMS_IN-POSNR TO IT_BAPITEXT-ITM_NUMBER,

K_Z003 TO IT_BAPITEXT-TEXT_ID,

Z_ITEMS_MSG-MESSAGE TO IT_BAPITEXT-TEXT_LINE,

SY-LANGU TO IT_BAPITEXT-LANGU,

'*' TO IT_BAPITEXT-FORMAT_COL.

APPEND IT_BAPITEXT.

CLEAR IT_BAPITEXT.

ENDIF.

ENDIF.

ENDLOOP.

ENDIF.

**************************************************

CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'

EXPORTING

SALES_HEADER_IN = R_BAPISDHEAD

BUSINESS_OBJECT = 'BUS2094'

IMPORTING

SALESDOCUMENT_EX = SALESDOCUMENT

TABLES

RETURN = RETURN

SALES_ITEMS_IN = IT_BAPIITEMIN

SALES_PARTNERS = IT_PARTNERS

SALES_CONDITIONS_IN = IT_BAPICOND

SALES_TEXT = IT_BAPITEXT

EXTENSIONIN = IT_BAPI_EXTN.

Bye

Srinivas