02-11-2005 11:23 AM
I am trying to create Sales Order using bapi function, this is giving me error as mentioned below
*Please enter SHIP-TO-PARTY OR SOLD TO PARTY
*SALES DOCUMENT WAS NOT CHANGED.
it does not GIVE ME THE SALES DOCUMENT NO .
The BAPI I am using is BAPI_SALESORDER_CREATEFROMDAT2.
Would someone know which parameters I have to papulate,or have any other suggestion
THE INTERNAL TABLES I AM PASSING TO BAPI FUNCTION ARE
DATA: IT_BAPI_HEADER LIKE BAPISDHD1.
DATA: IT_BAPI_SOLD_TO_PARTY LIKE BAPIPARNR occurs 0 with header line.
DATA: SO_NO LIKE BAPIVBELN-VBELN.
DATA: IT_BAPI_ITEMS_IN LIKE BAPISDITM occurs 0 with header line.
DATA: IT_BAPI_RETURN LIKE BAPIRET2 occurs 0 with header line.
IS THERE ANYTHING ELSE TO POPULATE OTHER THAN THIS STRUCTURES
HEADER
Sales-Document type:
* Sales-Organization
* Distrubution-Channel:
* Division
PARTNER
Partner Function
Customer Number
ITEM DETAIL
Material Number
how to accomplish my task?
02-11-2005 8:40 PM
We are also using the BAPI_SALESORDER_CREATEFROMDAT2. I think you need to fill in the ORDER_PARTNERS-PARTN_ROLE field. We are filling the field with 'SP' which means Sold-to party. You can also use 'SH' for ship-to party. There is documentation on this in the BAPI.
Becky
02-11-2005 2:23 PM
The bapi has an Importing section. You need it to get the document number
IMPORTING
salesdocument = salesdocument
Brian
02-11-2005 5:21 PM
Nandan,
Please go through the documentation of the BAPI. It gives you details of what needs to be filled in in which structure/parmater. Also, read the documentation associated with each structure, that will tell what to fill.
It is really hard to explain it in simple terms as to what are required. But, you need the header, items and partners at the minimum. Also, with some of these structures there are also 'X' structures(like ORDER_ITEMS_INX for ORDER_ITEMS_IN) which should also be filled based on what fields you filled in the original structure. For example, if you filled 'MATERIAL' field on the ORDER_ITEMS_IN structure, you should also fill in the same field on the ORDER_ITEMS_INX structure with an 'X' in it.
All this is well documented in the BAPI.
Srinivas
02-11-2005 8:40 PM
We are also using the BAPI_SALESORDER_CREATEFROMDAT2. I think you need to fill in the ORDER_PARTNERS-PARTN_ROLE field. We are filling the field with 'SP' which means Sold-to party. You can also use 'SH' for ship-to party. There is documentation on this in the BAPI.
Becky