用bapi
BAPI_INCOMINGINVOICE_CREATE1创建发票校验时报错
原因:税率不可多行显示,相同税码显示于同一行
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught in
procedure "MRM_INVOICE_TAXES_SAVE" "(FUNCTION)", nor was it propagated by RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
If you use an ABAP/4 Open SQL array insert to insert a record in
the database and that record already exists with the same key,
this results in a termination.
跟踪代码发现错误点: insert RBTX FROM TABLE T_RBTX.
分析数据插入失败,应该是数据主键重复,检查税率赋值,将append 调整为collect
loop xx....
*税
lt_taxdata-tax_code = gs_alv-mwskz."税码
lt_taxdata-tax_amount = gs_alv-invoice_tax_amount."税额
* append lt_taxdata."
COLLECT lt_taxdata."同一种税码不可分两行
CLEAR lt_taxdata.
...
endloop.
原因:税率不可多行显示,相同税码显示于同一行
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_OPEN_SQL_DB', was not caught in
procedure "MRM_INVOICE_TAXES_SAVE" "(FUNCTION)", nor was it propagated by RAISING clause.
Since the caller of the procedure could not have anticipated that the
exception would occur, the current program is terminated.
The reason for the exception is:
If you use an ABAP/4 Open SQL array insert to insert a record in
the database and that record already exists with the same key,
this results in a termination.
跟踪代码发现错误点: insert RBTX FROM TABLE T_RBTX.
分析数据插入失败,应该是数据主键重复,检查税率赋值,将append 调整为collect
loop xx....
*税
lt_taxdata-tax_code = gs_alv-mwskz."税码
lt_taxdata-tax_amount = gs_alv-invoice_tax_amount."税额
* append lt_taxdata."
COLLECT lt_taxdata."同一种税码不可分两行
CLEAR lt_taxdata.
...
endloop.
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/31405259/viewspace-2155262/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/31405259/viewspace-2155262/