05-21-2011 11:44 AM
Hi All,
I am executing BAPI -("BAPI_SALESORDER_CREATEFROMDAT2") in SE37 and getting error - "Unpermitted combination of business object BUS2032 and sales doc. category 0".
I passed SD_Doc_Cat - 'C'.
Please suggest, where should i correct.
Regards,
Chessleo.
Edited by: chessleo on May 21, 2011 12:46 PM
05-21-2011 12:25 PM
Sales document category for validation is picked up from master (TVAK-VBTYP) based on the document type (Structure field ORDER_HEADER_IN-DOC_TYPE). Based on the SD document category permitted Business objects are determined by the function module SD_OBJECT_TYPE_DETERMINE. In your case, the value you are passing into document type many not be belonging to the document category permitted for business object BUS2032.
See the form module I_CHECK_TYPE from include LVBAKF0I (Line number 72) for more details.
Regards, Vinod
05-21-2011 12:25 PM
Sales document category for validation is picked up from master (TVAK-VBTYP) based on the document type (Structure field ORDER_HEADER_IN-DOC_TYPE). Based on the SD document category permitted Business objects are determined by the function module SD_OBJECT_TYPE_DETERMINE. In your case, the value you are passing into document type many not be belonging to the document category permitted for business object BUS2032.
See the form module I_CHECK_TYPE from include LVBAKF0I (Line number 72) for more details.
Regards, Vinod
05-23-2011 7:52 AM
Hi Vinod,
I changed Doc_type = 'TA', earlier i used 'MAST'. Metioned error get solved, but am getting new errors (1)- "Order type 'TA' has not been defined in Sales area <' PGBU ', ' PG ', ' PG ' >" and " ( 2 ) Sales document was not changed".
First time am using this BAPI. kindly suggest, where should i correct.
Edited by: chessleo on May 23, 2011 8:53 AM
Edited by: chessleo on May 23, 2011 8:56 AM
05-23-2011 8:11 AM
Hi,
Try creating sales order manually with correct data and then use it in the bapi..
Try using order type 'OR' and see in the bapi.
Regards,
Nagaraj
05-23-2011 8:14 AM
There are certain configurations required to be done for mapping between ORDER TYPE and sales organization/distribution channel. Contact your functional analyst to know more details.
Regards, Vinod
05-26-2011 7:22 AM
Hi All,
As you suggest, I created sales order in VA01. Thats more helpful, coz lots of configuration problem.
If single sales item data in ORDER_ITEM_IN, is creating sales order fine.
if more than one sales item data in ORDER_ITEM_IN, am facing below issue.
Now same value am passing in BAPI - "BAPI_SALESORDER_CREATEFROMDAT2".
When executing first time bapi in the morning, its creating sales order fine.
Next time onwards, its showing below errors.
T ID NUM MESSAGE
S V4 233 SALES_HEADER_IN has been processed successfully
S V4 233 SALES_ITEM_IN has been processed successfully
E KO 144 Order TEMP02070100 already exists
E V4 248 Error in SALES_ITEM_IN 000200
W V1 555 The sales document is not yet complete: Edit data
E V4 219 Sales document was not changed
****************************************************************************************
Kindly suggest where should i correct.
Regards
chessleo.
05-26-2011 8:23 AM
Hi,
As per the log it clearly shows that the sales document already exists.. Please remove the sales order number which you are passing in the bapi .. If this is external number then pass different number, but if it is internal number then don't pass the sales order number.
Regards,
Nagaraj
05-26-2011 8:32 AM
Hi Nagaraj,
I am not passing any value in SALESDOCUMENTIN. 'SALESDOCUMENTIN' field is empty.
while executing first time, its wotrking fine and gettting all successful message.
2nd time time onwards am facing this issue and getting mentioned errors.
Regards
chessleo.
Edited by: chessleo on May 26, 2011 9:33 AM
05-26-2011 9:00 AM
Hi,
Please share your code.. please have a look at the sample code
ORDER_HEADER_IN-DOC_TYPE = <DOC_TYPE>.
ORDER_HEADER_IN-SALES_ORG = <SALES_ORG>.
ORDER_HEADER_IN-DISTR_CHAN = <DISTR_CHAN>.
ORDER_HEADER_IN-DIVISION = <DIVISION>.
ORDER_ITEMS_IN-ITM_NUMBER = <ITM_NUMBER>.
ORDER_ITEMS_IN-PLANT = <PLANT>.
also pass quantity, unit of measure.
APPEND ORDER_ITEMS_IN.
Regards,
Nagaraj
05-26-2011 9:15 AM
Hi,
Please find my code. before passing values, am doing initial check.
all the passing values, am getting from ALV.
CALL FUNCTION 'BAPI_SALESORDER_CREATEFROMDAT2'
EXPORTING
order_header_in = lwa_order_header_in
order_header_inx = lwa_order_header_inx
IMPORTING
salesdocument = lfd_vbeln
TABLES
return = pit_e_messages
order_items_in = lit_order_items_in
order_items_inx = lit_order_items_inx
order_partners = lit_order_partners.
after this code am calling BAPI transaction commit.
my problem is, today morning i executed first time, working fine with sucess msg.
2nd time onwards getting mentioned error.
Regards
chessleo.
05-26-2011 9:23 AM
Hi,
Passing values in BAPI :
_Header data :_
REFDOCTYPE ZGK
DOC_TYPE ZRPS
SALES_ORG PGBU
DISTR_CHAN PG
DIVISION PG
REQ_DATE_H 05/10/2010
PURCH_NO_C 123456 "Fixed values
PO_DAT_S 05/21/2011 "Fixed values
SD_DOC_CAT C
REF_DOC P057
COMP_CDE_B W001
REFDOC_CAT 0.
_Item data :_
ITM_NUM MATERIAL TARGET_QTY SHORT_TEXT SAL
100 R-I UNSP MAJ COMP 15 TESTING1 EA
200 R-I UNSP MAJ COMP 16 TESTING1 EA
Partners Data :
PA PARTN_NUMB
SP 603424
SH 200530
********************************
Purchase order no and date - Fixed values
********************************
Please find the passing values.
Regards
chessleo.
Edited by: chessleo on May 26, 2011 10:29 AM
05-26-2011 10:04 AM
Hi,
Try this don't pass REFDOCTYPE and pass 10 and 20 instead of 100 and 200 for ITM_NUM.
Regards,
Nagaraj
05-26-2011 11:51 AM
05-23-2011 10:01 AM
Hi ,
There id no provision of passing Business Object Number in "BAPI_SALESORDER_CREATEFROMDAT2" .
Instead of this use function module SD_SALESDOCUMENT_CREATE , all other BAPI's internally calls this function module only.
In this function module youcan pass your document type and business object combination.
I have did the same thing recently and it helped me in creating sales order of different types.
Thanks and Regards,
Mithun
05-25-2011 2:17 PM
HI,
Create the order you wish to emulate first in VA01.
then goto SE37 and use BAPISDORDER_GETDETAILEDLIST to list the details of the order
This is the data you will need to populate the order
See SAP notes 93091 & 366265 as a starter here.
The referred notes mentioned in the above notes also should be helpful
kind regards
Paul Quinn
05-26-2011 12:36 PM