Skip to Content

HANA data type is changing in SQL PROCEDURE

CREATE TYPE SAPABAP1.TT_TEST AS TABLE (  
MATERIAL NVARCHAR (000018),
ZSLAMT_GC DECIMAL (000017, 000002));
   CREATE PROCEDURE SAPABAP1.SP_TEST
   ( 
    IN I_VIEW SAPABAP1.TT_TEST,
    I_PERCENT  DECIMAL (000017, 000002) ,
    OUT E_VIEW  SAPABAP1.TT_TEST 
  	) 
  	LANGUAGE SQLSCRIPT READS SQL DATA AS
  BEGIN
  E_VIEW = SELECT  MATERIAL, AMOUNT * :i_PERCENT AS AMOUNT FROM :I_VIEW ;					
  END;

I am getting this warning

java.sql.SQLWarning: general warning: general warning: Type mismatch for table variable E_VIEW:Declared type "DECIMAL(17,2)"  of attribute "AMOUNT" not same as assigned type "DECIMAL(35,4)" :line 12 col 3 (at pos 270) 

How do I fix this type mismatch ?

PS : searching older SCN posts are so difficult and also to post questions

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jan 22, 2017 at 05:59 AM
    TO_DECIMAL(AMOUNT * :i_PERCENT, 17,2) AS AMOUNT

    PS: I found that I can cast to decimal , but wondering that is there any other alternate way , as casting to decimal will slow down my query

    Add comment
    10|10000 characters needed characters exceeded