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

SD_SALESDOCUMENT_CREATE

Former Member
0 Likes
3,399

Hi experts,

I'm using BAPI SD_SALESDOCUMENT_CREATE & I wanted to update the Ship to party field in item 10(Shipping tab). My problem is I can't find any ship to party parameter in the BAPI. Thank you for your help & time.

10 REPLIES 10
Read only

Former Member
0 Likes
1,710
"SALES_PARTNERS STRUCTURE  BAPIPARNR

there is a parameter called SALES_PARTNERS here you need to pass the information.

Partner functuon and Partner number.

But if your requirement is To Change or Update then why are you using the Function SD_SALESDOCUMENT_CREATE

you have to use the Change Function.

instead of Create Function

Read only

Former Member
0 Likes
1,710

Sorry, my requirement is to create. So if I pass partner parameter in the BAPI, the ship to party in item 10 (shipping tab) will have a value. Is that correct?

Read only

0 Likes
1,710

Yes it will Have the value after creation.

In General Item Partners are equal to Header partners.

So

PARTN_ROLE = 'WE'.

PARTN_NUMB = '1224452'.

ITM_NUMBER = '000000'. "For header

For Item you have to pass the item number

ITM_NUMBER = '000010'.

Read only

Former Member
0 Likes
1,710

Thanks I'll try.

Read only

0 Likes
1,710

If you are creating the Sales Order then use the BAPI

BAPI_SALESORDER_CREATEFROMDAT2

Read only

Former Member
0 Likes
1,710

Can't I use SD_SALESDOCUMENT_CREATE? What is the difference?

Read only

0 Likes
1,710

There is no difference actually. The Function which you are using is inturn called inside the BAPI which i mentioned.So don't confuse, and proceed with your approach.

and use the Transaction commit

call the BAPI_TRANSACTION_COMMIT after the success of the BAPI.

Read only

Former Member
0 Likes
1,710

Hi experts,

How can I update the reference document number field in VBAK-VGBEL & VBAP-VGBEL using SD_SALESDOCUMENT_CREATE? Thanks...

Read only

0 Likes
1,710

the structure BAPISDHD1 or SALES_HEADER_IN (Communication Fields: Sales and Distribution Document Header) has field REF_DOC for the header

the structure BAPISDITM or SALES_ITEMS_IN (Communication Fields: Sales and Distribution Document Item) has field ref_doc for the items

make sure you also check the appropriate fields in the structures bapisdhd1x and bapisditmx to tell the function module which fields to update.

Read only

Former Member
0 Likes
1,710

sold to party is SP

Ship to party is WE

*set up sold to party

x_order_partners-partn_role = 'SP'. " Partner function

x_order_partners-partn_numb = x_draw-kunnr. " Customer Number 1

APPEND x_order_partners TO it_order_partners.

CLEAR x_order_partners.

  • routine to determine ship to party

SELECT single KUNN2 into x_order_partners-partn_numb FROM knvp

WHERE kunnr = x_draw-kunnr

AND vkorg = x_draw-vkorg

AND vtweg = c_00 " Distribution Channel

AND spart = c_00

AND parvw = 'WE'.

  • AND parza = ___.

x_order_partners-partn_role = 'WE'. " Partner function

APPEND x_order_partners TO it_order_partners.

CLEAR x_order_partners.

then when calling your function module

set the following table

order_partners = it_order_partners