Unpermitted combination of business object BUS2032 and sales doc. category H

Q: create New Sales Order using BAPI: BAPI_SALESORDER_CREATEFROMDAT2, but get the error message:Unpermitted combination of business object BUS2032 and sales doc. category H.

A:This is a shortcoming of this BAPI. If you look into the coding you will see that it call SD_SALESORDER_CREATE with restriction to business object 'BUS2032'.


CALL FUNCTION 'SD_SALESDOCUMENT_CREATE'
EXPORTING
...
BUSINESS_OBJECT = 'BUS2032'
...


Now if you look into SD_SALESORDER_CREATE you will find the following routine call where the function module checks the valid combination of business object and sales document type (DOC_TYPE):

*
if business_object ne space.
perform i_check_type tables return
using sales_header_in
business_object.
endif.
*
if not return is initial.
exit.
endif.



In the routine you will find the function module that makes the check:
...
* 3. determine the businessobject *
CALL FUNCTION 'SD_OBJECT_TYPE_DETERMINE'
EXPORTING
I_DOCUMENT_TYPE = TVAK-VBTYP
IMPORTING
E_BUSINESS_OBJECT = US_OBJTYPE
EXCEPTIONS
OTHERS = 1.

IF US_OBJTYPE NE BUSINESS_OBJECT.

PERFORM ERROR_PROCESSING TABLES US_RETURN
USING 'E'
'V1'
'761'
BUSINESS_OBJECT
TVAK-VBTYP
SPACE
SPACE.

ENDIF.
ENDFORM.


If you call this function module with I_DOCUMENT_TYPE = 'H' it will return 'BUS2102' as allowed business object.


To overcome the problem with BAPI_SALESORDER_CREATEFROMDAT2 simply call the (RFC-enabled) function module <b>SD_SALESORDER_CREATE directly.</b>. Leave the IMPORTING parameter BUSINESS_OBJECT empty since it it optional.
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值