Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

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.

1 Reply
Not applicable
Author

I suspect that the Date function is not supported in SAP OpenSQL. Is xDate a QlikView variable? If yes, I suggest that you change format of xDate into the format the used in SAP. This can be done using QlikView function.