Error in Tax Code Setup [SAP AG][LIBODBCHDB DLL][HDBODBC] General error;339 invalid number

Error in Tax Code Setup [SAP AG][LIBODBCHDB DLL][HDBODBC] General error;339 invalid number

************************* INTERNAL PURPOSE  ****************************

The article is about the approach to trace /troubleshoot the error coming in SAP

Environment : 

iVend Version 6.6.7989 SAP B1 9.3

Problem Statement: 

Facing issue in creating the Sales tax in ERP and getting below error.

“[SAP AG][LIBODBCHDB DLL][HDBODBC] General error;339 invalid number: "XHALE_MS_PROD"."SBO_SP_TRANSACTIONNOTIFICATION": line 26 col 1 (at pos 801): "XHALE_MS_PROD"."CXS_IVEND_SP_TRANSACTIONNOTIFICATION": line 3852 col 6 (at pos 116252): not a valid number” 



Resolution/Work Around:

In reference to the error shown in screenshot, the initial observation suggests that the exception might have been caused due to any custom code is written in the SP " SBO_SP_TRANSACTIONNOTIFICATION" in SAP Database.

Tracing problematic code :

The error message mentions the Line number (e.g. line 3852)  of the code which throws the exception , so as a troubleshooting approach  the listed SP XS_IVEND_SP_TRANSACTIONNOTIFICATION need to be opened in database and go to the listed line number to check it's existence.

In the reported scenario While checking the SP CXS_IVEND_SP_TRANSACTIONNOTIFICATION in customer’s SAP database “XHALE_MS_PROD”, we found below code written by CitiXsys team. After commenting below code, issue is resolved.

/*IF :object_type = '1470000062' AND transaction_type='A'
AND (SELECT COUNT(*)

FROM OBCD A
INNER JOIN OUSR B ON A."UserSign2" = B."USERID"
WHERE B."USER_CODE" IN ('CXSiVend') AND A."BcdEntry" = :list_of_cols_val_tab_del)=0
THEN
SourceType := 59;
END IF; */

Recommendations /Suggestion: 

None

Reference Case:

CS0005950