- 浏览: 169050 次
- 性别:
- 来自: 成都
文章分类
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.
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.
发表评论
-
DISABLE button(FCODE) from the GUI-Status
2014-08-04 15:54 5721. Goto-> Attributes->Pus ... -
Handy SAP function module to automate user events
2013-11-28 09:49 694*Begin-Auto triggers ENTER comm ... -
set Billing block to blank for Sals Order
2013-04-17 15:16 737FM: SD_WF_ORDER_DEL_BILLING_BLO ... -
set Billing block to blank for Sals Order
2013-04-17 15:16 710FM: SD_WF_ORDER_DEL_BILLING_BLO ... -
Function Module: get all users who have specific role
2013-01-25 14:16 585CALL FUNCTION 'RSRA_USERS_O ... -
Create a SELECT-OPTIONS in a module pool screen
2012-03-07 15:35 982source:http://abap-explorer.blo ... -
Converting OTF data from script to Spool Request
2012-03-06 17:25 0source:http://forums.sdn.sap.co ... -
Calculate the days, months and years between 2 dates.
2012-02-21 16:14 791FORM compute_2date_diff. DAT ... -
Retrieving Domain fixed values
2012-02-16 11:13 782source:http://www.saptechnical. ... -
If 1 equals 2, what’s the purpose?
2012-02-16 10:59 793source:http://sapport.blogspot. ... -
get status name for batch input session
2012-01-31 14:47 884Line 601 in program SAPMSBDC_CC ... -
create zip folder with cl_abap_zip
2011-12-05 18:11 1173REPORT ztest. DATA: gv_file ... -
MIRO
2011-11-29 10:39 2027from: http://help-sap.blogspot. ... -
Create Vendor or Customer_master Data
2011-11-23 16:22 2844To Create or Change Vendor_mast ... -
Pay attention to the following points when using append structures
2011-10-27 13:43 1270You cannot create append str ... -
Help Views
2011-10-20 10:46 689source:http://help.sap.com/saph ... -
What is the Different Types and Usage of Views
2011-10-19 23:06 807source:http://www.sap-img.com/a ... -
Upload a Comma Delimited CSV file that contains commas in data
2011-09-23 17:22 2185source:http://wiki.sdn.sap.com/ ... -
What is the difference between SET SCREEN and CALL SCREEN ?
2011-09-19 21:50 697source:http://www.saptechies.co ... -
cl_gui_frontend_services=>file_open_dialog
2011-09-09 09:21 1373CALL METHOD cl_gui_frontend_ser ...
相关推荐
双柱图 和 折线图 的组合图表#Combination chart of 2-column and line chart.twbx
Work with a combination of access modifiers, prefixes, properties, fields, attributes, and local variables to encapsulate and hide data Master DOM manipulation, cross-browser strategies, and ES6 ...
Work with a combination of access modifiers, prefixes, properties, fields, attributes, and local variables to encapsulate and hide data Take advantage of specialization and the possibility to overload...
Developers who are familiar with writing traditional software applications and want to broaden their understanding of concepts in order to include BI fall into this category. Some may have never ...
本资资打包重新shade package name : com.sini,官网例子已测试通过
We were concerned that the development of business analysis, and the inroads made in appreciating the benefits it can offer, were in danger of being eroded if agile was adopted by organisations and ...
Focus is on creating the right combination of scalability, high-availability, backup and recovery, integrity, and resource control. The book covers everything from simple to enterprise-class ...
The intelligent surfer probabilistic combination of link and content information in pagerank
MySQL and Perl for the Web provides a much-needed handbook for database and Web developers seeking an extensive and detailed guide for using the combination of MySQL and Perl to build dynamic and ...
A Combination of Probabilistic Classification and Finite-State Sequence Modeling Mauritius A. R. Schmidtler, and Jan W. Amtrup . . . . . . . . . . . . . . . . . . . . 123 9 Evolving Explanatory Novel ...
Combination of HPLC chromatogram and hypoglycemic effect identifies isoflavones as the principal active fraction of Belamcanda chinensis leaf extract in diabetes treatment.
5.4.8. Redefining Classes and Changing the Class of Instances 5.4.9. Extending CLOS Using the Metaobject Protocol 5.4.10. Performance Considerations 5.4.11. Summary of CLOS Operators Part V—...
"In this thoroughly revised edition, Jos and Anneke offer a concise, pragmatic, and pedagogic explanation of the Object Constraint Language (OCL) and its different applications. Their discussion of ...
"In this thoroughly revised edition, Jos and Anneke offer a concise, pragmatic, and pedagogic explanation of the Object Constraint Language (OCL) and its different applications. Their discussion of ...
regardless of bus type Fits on a diskette for easy transportability and quick downloads Drag and drop captured data to other products in html format<br> Save captured data to a text ...
The selectivity method of the best signal from hybrid network of 802.11 and 802.16,亚米迪,武穆清, Recently the combination technology of two different networks 802.11 and 802.16 as the ...
结合先验知识,学习贝叶斯网络的文档,可以看看
An Improvement Using Combination of VQ and PCA Based Techniques
There are also good examples that show how to model various circuit components such as a power transformer by using a combination of elements and commands. ... The material on simulation errors ...
This book would enable readers to overcome these vulnerabilities through an efficient combination of proactive countermeasures and design-for-security solutions, as well as a wide variety of IP ...