‎2008 Jul 22 3:15 PM
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.
‎2008 Jul 22 3:21 PM
"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
‎2008 Jul 22 3:27 PM
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?
‎2008 Jul 22 3:35 PM
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'.
‎2008 Jul 22 3:37 PM
‎2008 Jul 22 3:39 PM
If you are creating the Sales Order then use the BAPI
BAPI_SALESORDER_CREATEFROMDAT2
‎2008 Jul 22 3:45 PM
Can't I use SD_SALESDOCUMENT_CREATE? What is the difference?
‎2008 Jul 22 3:57 PM
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.
‎2008 Jul 22 10:30 PM
Hi experts,
How can I update the reference document number field in VBAK-VGBEL & VBAP-VGBEL using SD_SALESDOCUMENT_CREATE? Thanks...
‎2008 Jul 22 11:16 PM
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.
‎2008 Jul 22 11:07 PM
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