Friday, March 6, 2020

DBSQL_SQL_ERROR error while writing to BW InfoProviders

I recently faced a strange error while working on simple BW transformation. There was an end routine in place. I had a few arithmetic operations within the end routine. In particular I was multiplying key figure by big number (10mil) – so called I was scaling up the key figure. The routine was syntactically correct. In addition, the transformation did not indicate any problems it was possible to activate it – so no problem in design time at all. On other had while in run time my load failed.
There were messages like following in the load’s monitor:

Runtime error while executing rule -> see long text
Update terminated in accordance with error handling setting
Overflow converting from '1.08647e+14'
An exception was raised
Error in substep
Data package processing terminated

There was also ABAP dump present, which was generated for the failed load in case target infoprovider was info cube.

Category               Installation Errors
Runtime Errors         DBSQL_SQL_ERROR
Except.                CX_SY_OPEN_SQL_DB
 Short Text
     SQL error "SQL code: 0" occurred while accessing table "/BIC/FZZZZ_ZZZ".
 What happened?
     Database error text: "SQL message: "
An exception has occurred which is explained in more detail below. The
exception is assigned to class 'CX_SY_OPEN_SQL_DB' and was not caught
 procedure
"WRITE_ICFACT" "(FORM)", nor was it propagated by a RAISING clause.
Return value of the database layer: "SQL dbsl rc: 99"
>>>>>   INSERT (l_facttab) FROM TABLE g_t_bia.

In case target infoprovider was DSO object the ABAP dump looked like below:

Category               Installation Errors
Runtime Errors         DBSQL_SQL_ERROR
Except.                CX_SY_OPEN_SQL_DB
 Short Text
     SQL error "SQL code: 0" occurred while accessing table "/BIC/AZZZZ_ZZZ00".
 What happened?
     Database error text: "SQL message: "
An exception has occurred which is explained in more detail below. The
exception is assigned to class 'CX_SY_OPEN_SQL_DB' and was not caught in
procedure
"INSERT_ODS" "(FORM)", nor was it propagated by a RAISING clause.
Return value of the database layer: "SQL dbsl rc: 99"
>>>>>   INSERT      /bic/azzzz_zzz00

I tried to comment out my arithmetic operations in the code of the transformation and the load succeeded. It was obvious that there is overflow going on while computing my arithmetic operation I was wondering why in the design time there is no error. My target variable of multiplying was type of DEC 21 Decimal 7 (e.g. IO /CPMB/SDATA in BPC) and that was not able to fit the result of computation that was bigger that DEC 21. When I changed my target variable to type of DEC 31 (e.g. IO /CPMB/LSDATA in BPC) it all worked fine.

In case there is no arithmetic operations in your code there might most likely issue with regarding parallelization. Some processing that are running in parallel are locking the objects (e.g. target infoprovider) that causes the error like this. In such a cases repair of DB object via t-code SE14 may help. Similarly, cube indexes rebuild via ABAP program SAP_INFOCUBE_INDEXES_REPAIR or in t-code RSRV may help. Another solution can be reduce maximum size of the data packages. All these things mentioned above are valid in case the BW is not on HANA DB.

No comments: