‎2007 Jul 09 10:31 AM
Hi,
I have a requirement to create a sales order of Order Type 'ZDR'.
I am using a std BAPI
Business Object BUS2032
Method CREATEFROMDAT2
Message Type SALESORDER_CREATEFROMDAT2
Basic Type SALESORDER_CREATEFROMDAT2
When I try to execute it i am getting the following error.
'Unpermitted combination of business object BUS2032 and sales doc. category L'
Kindly let me know wat could be the pblm?
Thanks in Advance,
Regards,
Meera
‎2007 Jul 09 10:37 AM
Hi,
I think there is no need to clone BAPI BAPI_SALESORDER_CREATEFROMDAT2 because the BAPI does nothing else but calling SD_SALESDOCUMENT_CREATE 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 BUSINESS_OBJECT 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.
See this thread:
<b>Reward points</b>
Regards