BAPI_ACC_MANUAL_ALLOC_POST 费用分配函数的小bug及解决办法
2010-05-15 14:35
816 查看
function bapi_acc_manual_alloc_post.
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(DOC_HEADER) LIKE BAPIDOCHDRU12P STRUCTURE BAPIDOCHDRU12P
*" VALUE(IGNORE_WARNINGS) LIKE BAPIIW-IGNWARN DEFAULT SPACE
*" EXPORTING
*" VALUE(DOC_NO) LIKE BAPIDOCHDRU12P-DOC_NO
*" TABLES
*" DOC_ITEMS STRUCTURE BAPIMAITM
*" RETURN STRUCTURE BAPIRET2
*" CUSTOMER_FIELDS STRUCTURE BAPIEXTC OPTIONAL
*"----------------------------------------------------------------------
项目中我们用这个BAPI来做费用分摊,有一次竟然报错“请输入有计量单位的数量”。本能的反应以为是没有输入单位,后来跟踪检查才发现了这个
BAPI的内幕。
BAPI中调用了函数
K40C_CO_ACTUAL_POSTING,在这个函数,会对许多参数进行校验,其中有一个函数 'K40C_DOCUMENT_LINE_CHECK'
,里面调用了一个函数
call
function
'UNIT_CONVERSION_SIMPLE'
exporting
input
= doc_item-ausbr
round_sign = 'X'
unit_in = doc_item-aubeh
unit_out = itobjects-auseh
importing
output
= ausbtr
这是个简单的单位转换函数,但是由于设置了round_sign = 'X'
表示会在单位转换后进行四舍五入,这样就会把5毛钱以下的金额舍为0,于是便出现了错误。
之前认为BAPI_ACC_MANUAL_ALLOC_POST
只能进行5毛钱以上的费用分摊,后来向SAP提了message,回复得到的消息是已经在一个note中得到解决。
原文如下:
“the message has been forwarded to us in CO-OM development. As far as
described,
I think note 614127 should be the exact alternative to avoid
rounding of quantities for manual CO-postings.”
找到note 614127,描述如下:
Symptom
You enter quantities for manual CO actual
postings. Even though you can enter up to three decimal places for the
quantity, the system rounds the quantity.
Reason and
Prerequisites
You have implemented the
corrections from Note 503659 or you have imported one of the Support
Packages SAPKH46B41, SAPKH46C32 or SAPKH46C33.
The quantities are
always rounded according to the number of decimal places defined for
the selected unit of measure. This was not the case for the manual
actual postings due to a program error that was corrected with Note
503659.
Solution
Change the number
of decimal places for the
selected unit of measure (transaction CUNI, maintenance of units of
measurement). Note the following: The "Decimal pl. rounding" field
(number of decimal places to which figure is to be rounded) in the
"Conversion" section is relevant for rounding quantities. The "Decimal
places" field in the "Display" section is not relevant.
or
Implement the program modification. This prevents the rounding
of the quantity.
这里面提到了note
503659,检查了一下系统,一般补丁都已经打了。于是按照解决方法里面写的步骤,运行CUNI,修改单位的配置参数。在
BAPI_ACC_MANUAL_ALLOC_POST里面用到的单位是EA,于是双击EA,将Decimal pl.
rounding填入2,表示小数点后两位进行四舍五入。然后保存。
测试通过。
*"----------------------------------------------------------------------
*"*"Lokale Schnittstelle:
*" IMPORTING
*" VALUE(DOC_HEADER) LIKE BAPIDOCHDRU12P STRUCTURE BAPIDOCHDRU12P
*" VALUE(IGNORE_WARNINGS) LIKE BAPIIW-IGNWARN DEFAULT SPACE
*" EXPORTING
*" VALUE(DOC_NO) LIKE BAPIDOCHDRU12P-DOC_NO
*" TABLES
*" DOC_ITEMS STRUCTURE BAPIMAITM
*" RETURN STRUCTURE BAPIRET2
*" CUSTOMER_FIELDS STRUCTURE BAPIEXTC OPTIONAL
*"----------------------------------------------------------------------
项目中我们用这个BAPI来做费用分摊,有一次竟然报错“请输入有计量单位的数量”。本能的反应以为是没有输入单位,后来跟踪检查才发现了这个
BAPI的内幕。
BAPI中调用了函数
K40C_CO_ACTUAL_POSTING,在这个函数,会对许多参数进行校验,其中有一个函数 'K40C_DOCUMENT_LINE_CHECK'
,里面调用了一个函数
call
function
'UNIT_CONVERSION_SIMPLE'
exporting
input
= doc_item-ausbr
round_sign = 'X'
unit_in = doc_item-aubeh
unit_out = itobjects-auseh
importing
output
= ausbtr
这是个简单的单位转换函数,但是由于设置了round_sign = 'X'
表示会在单位转换后进行四舍五入,这样就会把5毛钱以下的金额舍为0,于是便出现了错误。
之前认为BAPI_ACC_MANUAL_ALLOC_POST
只能进行5毛钱以上的费用分摊,后来向SAP提了message,回复得到的消息是已经在一个note中得到解决。
原文如下:
“the message has been forwarded to us in CO-OM development. As far as
described,
I think note 614127 should be the exact alternative to avoid
rounding of quantities for manual CO-postings.”
找到note 614127,描述如下:
Symptom
You enter quantities for manual CO actual
postings. Even though you can enter up to three decimal places for the
quantity, the system rounds the quantity.
Reason and
Prerequisites
You have implemented the
corrections from Note 503659 or you have imported one of the Support
Packages SAPKH46B41, SAPKH46C32 or SAPKH46C33.
The quantities are
always rounded according to the number of decimal places defined for
the selected unit of measure. This was not the case for the manual
actual postings due to a program error that was corrected with Note
503659.
Solution
Change the number
of decimal places for the
selected unit of measure (transaction CUNI, maintenance of units of
measurement). Note the following: The "Decimal pl. rounding" field
(number of decimal places to which figure is to be rounded) in the
"Conversion" section is relevant for rounding quantities. The "Decimal
places" field in the "Display" section is not relevant.
or
Implement the program modification. This prevents the rounding
of the quantity.
这里面提到了note
503659,检查了一下系统,一般补丁都已经打了。于是按照解决方法里面写的步骤,运行CUNI,修改单位的配置参数。在
BAPI_ACC_MANUAL_ALLOC_POST里面用到的单位是EA,于是双击EA,将Decimal pl.
rounding填入2,表示小数点后两位进行四舍五入。然后保存。
测试通过。
相关文章推荐
- BAPI_ACC_DOCUMENT_POST 解决原因代码输入问题-利用BADI
- jquery的slideUp、slideDown函数在IE中bug解决办法
- Linux 驱动之 EXPORT_SYMBOL 函数以及 2.6 内核 Unknown symbol bug 解决办法
- [http] WinInet发送或接收函数超时的bug & 解决办法
- Kernel 4.9 上 dma_alloc_coherent() 函数开辟 DMA 连续内存空间失败 解决办法
- iOS----POST异步请求解析数据时bug解决办法
- $.post函数请求成功但是不执行回调函数的问题解决办法收集与整理
- php的curl函数模拟post、get数据提交,速度非常慢的处理办法
- 火狐浏览器下JS代码不兼容setTimeout函数失效无效不运行执行的解决办法
- MFC类成员函数作为线程函数的解决办法
- c++当某个函数很长时,却不想分写多个函数的解决办法
- winform Focus()函数不起作用 解决办法
- 一些杂七杂八的bug解决办法
- 一个值5000元,且一分钟就学会的“of undefined” bug的解决办法
- gdb函数堆栈乱掉的解决办法
- GL A/C posting using BAPI_ACC_GL_POSTING_POST.
- Firefox对函数getYear()返回不正确的原因和解决办法
- 用Sublime写Lua时Cmd+R列不出某些函数的解决办法
- 【bug】CSRF Security Error解决办法
- 解决GAT项目Bug:ETC费用统计问题