title: Database Hana Error : cannot use parameter variable
body: <p>I'm trying to insert value into my temporary 
  this is the code </p>
  
  <pre><code>CREATE PROCEDURE REP_PROC11( in docentry nvarchar(2))
  AS 
  
  totalval DECIMAL (19,6);
  
  
  BEGIN
  CREATE local TEMPORARY  TABLE #TempItem AS (
  select
  'FGA000001' as "ItemCode",
  '2IN' as "WhsCode",
  ifnull(
  (
      select 
          "U_IM1_GR"
      from "@OFNC" where "DocEntry"  = :docentry
  ),0) as "Qty",
  '11080302' as "Account",
  'S02' as "ProfitCode",
  'IN-PN' as "ProfitCode2" 
  from DUMMY
  
  union all
  
  select
  'FGA000002' as "ItemCode",
  '2IN' as "WhsCode",
  ifnull(
  (
      select 
          U_IM2_GR 
      from "@OFNC" where "DocEntry"  = :docentry
  ),0) as "Qty",
  '11080302' as "Account",
  'S02' as "ProfitCode",
  'IN-FN' as "ProfitCode2" from dummy);
  
  SELECT X.*, (X."Qty"*:totalval)/Y."TotalQty" as "Val", :totalval as "TotalVal"
  FROM #TempItem X
      LEFT JOIN (SELECT SUM(X1."Qty") as "TotalQty" FROM #TempItem X1) Y ON 1 = 1
  WHERE X."Qty" &gt; 0;
  
  drop TABLE #TempItem;
  end
  </code></pre>
  
  <p>And I got this error</p>
  
  <blockquote>
    <p>SAP Hana Database Error: cannot
    use parameter variable: DOCENTRY: line 8 col 35 (at pos 127)  2   0</p>
  </blockquote>
  
  <p>I don't know what is wrong, 
  Please give some advise 
  thanks</p>