title: How to convert MS SQL Server code into SAP HANA code?
body: <p>Hello I am new in SAP HANA  and I have this T-SQL code:</p>
  
  <pre><code>`if(@IsBes='E')begin
  
                 if((select top 1 U_bBesYontem from OHEM where empID=@EmpId)='O') begin
  
                       set @Bes=@Brut*(select top 1 U_bBesOran from OHEM where empID=@EmpId)/100
  
                    end
  
                 if((select top 1 U_bBesYontem from OHEM where empID=@EmpId)='T') begin
  
                       set @Bes=(select top 1 U_bBesTutar from OHEM where empID=@EmpId)
  
                    end
  
           end`
  </code></pre>
  
  <p>And I am trying this code for SAP HANA </p>
  
  <p><code>IF (:IsBes = 'E') THEN 
            IF ((SELECT TOP 1 “U_bBesYontem" 
  FROM 
       OHEM 
  WHERE 
  "empID" = :EmpId) = 'O') 
  THEN 
  Bes := :Brut * (SELECT TOP 1 "U_bBesOran" 
       FROM OHEM 
        WHERE 
           "empID" = :EmpId) / 100;
      END IF;
      IF ((SELECT TOP 1 "U_bBesYontem" 
   FROM OHEM 
   WHERE "empID" = :EmpId) = 'T') THEN 
           SELECT (SELECT TOP 1 "U_bBesTutar" 
          FROM OHEM 
          WHERE "empID" = :EmpId) INTO Bes 
   FROM DUMMY;
      END IF;
      END IF;</code></p>
  
  <p>And  tried lots of code variations but I always end up getting this error:</p>
  
  <pre><code>SAP DBTech JDBC: [7]: feature not supported:
   Sub-query is not supported in a nested procedure call: 
   line 47 col 28 (at pos 2273)
  </code></pre>
  
  <p>I am confused so can somebody give any advise ?</p>