2007 Jan 05 1:49 PM
Hi,
I am trying to create a sales order type CR using BAPI. But i couldn't create a sales order , iam getting an error.
Can you please help me.
Thanks in advance
KIRAN.
Hi,
I am trying to create a sales order type CR using BAPI. But i couldn't create a sales order , iam getting an error.
Can you please help me.
Thanks in advance
KIRAN.
2007 Jan 05 1:51 PM
2007 Jan 05 2:00 PM
Hi,
This is the error.
" Unpermitted combination of business object BUS2032 and sales doc. category K"
Thanks.
Kiran.
2007 Jan 05 2:15 PM
2007 Jan 05 3:18 PM
Hello Kiran and John
I think there is no need to clone BAPI BAPI_SALESORDER_CREATEFROMDAT2 because the BAPI does nothing else but calling <b>SD_SALESDOCUMENT_CREATE</b> which itself is a BAPI (even if it is not called like a BAPI).
If you look at the coding of BAPI_SALESORDER_CREATEFROMDAT2 you will see that creating sales order is indeed restricted to business object 'BUS2032'.
However, if you call SD_SALESDOCUMENT_CREATE directly you should be able to create most, if not all, types of sales orders because IMPORTING parameter <b>BUSINESS_OBJECT</b> is optional.
Looking under the hood SD_SALESDOCUMENT_CREATE you will see the following coding:
...
if business_object ne space.
perform i_check_type tables return
using sales_header_in
business_object.
endif.
...If you do not provide any business object (= space) then this check is not executed. Looking into the FORM routine you will find function module SD_OBJECT_TYPE_DETERMINE which determines the allowed business objects.
In conclusion, do not use the BAPI but use SD_SALESDOCUMENT_CREATE directly (RFC-enabled). That is how I create sales order in a currently ongoing project.
Regards
Uwe