1 Reply Latest reply: Jul 3, 2013 10:53 PM by Khim Hoe Tan RSS

    Problem in SAP with Where SQL Condition - script

      I have the field date call AUDAT in SAP...here like: VBAK~AUDAT.

       

      And I need to put a WHERE condition in this part of the script in QV.

       

      SQL Select VBAP~VBELN VBAP~POSNR VBAP~KWMENG VBAP~VRKME VBAP~PSTYV

            VBAK~SPART VBAK~KUNNR VBAK~VKGRP VBAP~MATNR VBKD~BZIRK KNA1~BRSCH        

            VBAK~KNUMV VBUP~LFGSA VBAK~AUDAT VBAK~ERZET VBAK~CMFRE VBAP~ABGRU VBAK~AUART

            VBAP~WAERK VBAP~NETWR VBAP~STCUR VBAP~UMVKN VBAP~LGORT

            VBAK~AUGRU VBKD~ZLSCH VBAK~ERNAM VBKD~PLTYP from VBAP

      JOIN VBAK ON VBAK~VBELN = VBAP~VBELN

      JOIN VBKD ON VBAK~VBELN = VBKD~VBELN

      JOIN KNA1 ON KNA1~KUNNR = VBAK~KUNNR

      JOIN VBUP ON VBAP~VBELN = VBUP~VBELN AND VBAP~POSNR = VBUP~POSNR

      WHERE VBKD~POSNR = '000000';

       

      example:

       

      WHERE DATE([AUDAT]) >= xDATE

       

      or

       

      WHERE DATE([VBAK~AUDAT]) >= xDATE

       

      but always get an error:

       

      OpenStream failed. Key = SQL_ERROR ( Number:000) for statement:

      SQL Select VBAP~VBELN VBAP~POSNR VBAP~KWMENG.....etc.