cancel
Showing results for 
Search instead for 
Did you mean: 

HANA data type is changing in SQL PROCEDURE

rmuhuri
Participant
0 Kudos
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

Accepted Solutions (0)

Answers (1)

Answers (1)

rmuhuri
Participant
0 Kudos
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