2007 Jan 17 7:30 AM
Hi,
I want to create New Sales Order using BAPI: BAPI_SALESORDER_CREATEFROMDAT2. I am populating the following fields:
ORDER_HEADER_IN : DOC_TYPE Sales document type
SALES_ORG Sales organization
DISTR_CHAN Distribution channel
DIVISION Division
ORDER_HEADER_INX : UPDATEFLAG as 'I' and the above fields as 'X'.
ORDER_PARTNERS..: PARTN_ROLE Partner role, SP sold-to party
PARTN_NUMB Customer number
ORDER_ITEMS_IN..: MATERIAL Material number
ORDER_ITEMS_INX..:
UPDATEFLAG as 'I' and the above fields as 'X'.
ORDER_SCHEDULES_IN ::Sales document number POSNR ITM_NUMBER
Order quantity KWMENG REQ_QTY .
I getting the following error message :
"Unpermitted combination of business object BUS2032 and sales doc. category H"
Can you tell me where the problem is?
Regards,
Tanmay
2007 Jan 17 8:41 AM
Hello Tanmay
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.
Regards
Uwe
Hi,
I want to create New Sales Order using BAPI: BAPI_SALESORDER_CREATEFROMDAT2. I am populating the following fields:
ORDER_HEADER_IN : DOC_TYPE Sales document type
SALES_ORG Sales organization
DISTR_CHAN Distribution channel
DIVISION Division
ORDER_HEADER_INX : UPDATEFLAG as 'I' and the above fields as 'X'.
ORDER_PARTNERS..: PARTN_ROLE Partner role, SP sold-to party
PARTN_NUMB Customer number
ORDER_ITEMS_IN..: MATERIAL Material number
ORDER_ITEMS_INX..:
UPDATEFLAG as 'I' and the above fields as 'X'.
ORDER_SCHEDULES_IN ::Sales document number POSNR ITM_NUMBER
Order quantity KWMENG REQ_QTY .
I getting the following error message :
"Unpermitted combination of business object BUS2032 and sales doc. category H"
Can you tell me where the problem is?
Regards,
Tanmay
2007 Jan 17 7:39 AM
Hi
Check what have you given in <b>ORDER_HEADER_IN-SD_DOC_CAT</b>
2007 Jan 17 8:41 AM
Hello Tanmay
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.
Regards
Uwe
2007 Jan 17 9:21 AM
Hi Uwe ,
Thanks for your valuable reply.It solves my problem.
Regards,
Tanmay
2011 May 27 11:19 AM
2011 Jul 13 11:59 AM
2007 Jan 17 8:55 AM
Cheak wether u r giveing right combination sale area i.e.
<b>SALES_ORG Sales organization
DISTR_CHAN Distribution channel
DIVISION Division</b> check in the table TVTA
2007 Jan 17 9:40 AM
hi
Probobly you are creating a sales order for the REturn order
BAPI_SALESORDER_CREATEFROMDAT2 will not work for return orders may be the reason as above.
for return orders use this BAPI <b>BAPI_CUSTOMERRETURN_CREATE</b>
2011 Dec 20 9:04 AM
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |