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: 

OPEN SALESORDER

Former Member
0 Kudos

Hi all,

i am uploading sales order using BAPI_SALESORDER_CREATEFROMDAT2,

how to upload the address related data for one time shipto customers in the sales orders using this bapi.

thanks,

deepthi n

3 REPLIES 3

Former Member
0 Kudos

Hi,

You pass partner related information in table "<b>ORDER_PARTNERS</b>" of this BAPI.

If you want to change the address of ship-to partner permanently, then you have to use the BAPI <b>BAPI_CUSTOMER_CHANGEFROMDATA1</b>.

Please explain what exactly you want to do.

Regards,

RS

0 Kudos

Hi,

through which structure do we populate the header text in this bapi.

thanks,

deepthi.

0 Kudos

Hi,

You can not use BAPI to populate header text. You have to save the header text after you create or save sales order. The function module you will be using is <b>SAVE_TEXT</b>.

If you mean "Header Note" text by header text, see the code below to populate header text.

*----------------------------------------------------------------------*
*----------------------------------------------------------------------*
DATA: l_objname LIKE thead-tdname,
      l_vbeln   LIKE vbak-vbeln.

DATA: lst_header LIKE thead.    "Target Text Header

*" internal table for text to be inserted
DATA: lit_textline  LIKE tline OCCURS 10 WITH HEADER LINE.

*" move sales document number
l_vbeln = 'Pass Sales document number here'.
l_objname = l_vbeln. "(or you can directly assing VBELN value here)

*" Create text header
lst_header-tdobject = 'VBBK'.
lst_header-tdname   = l_objname.
lst_header-tdid     = '0001'.
lst_header-tdspras  = sy-langu.

lit_textline-tdformat = '*'.
lit_textline-tdline   = 'This is 1st line'.
APPEND lit_textline.

lit_textline-tdformat = '*'.
lit_textline-tdline   = 'This is 2nd line'.
APPEND lit_textline.

lit_textline-tdformat = '*'.
lit_textline-tdline   = 'This is 3rd line'.
APPEND lit_textline.

* Save text
CALL FUNCTION 'SAVE_TEXT'
  EXPORTING
    client          = sy-mandt
    header          = lst_header
    insert          = 'X'
    savemode_direct = 'X'
  TABLES
    lines           = lit_textline.
IF sy-subrc <> 0.
*  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.
*----------------------------------------------------------------------*
*----------------------------------------------------------------------*

Let me know which text you wants to populate on header. I can give you the code for that.

Let me know if you have any question.

Regards,

RS