Skip to main content
Announcements
Have questions about Qlik Connect? Join us live on April 10th, at 11 AM ET: SIGN UP NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
rahulhv1
Creator II
Creator II

SQL Query to extract data from SAP not working

Hi Guys

We have SAP ECC 6 , Oracle 11 i   as data base. Below is the query which i have in Qlikview to extract the data from SAP.

SQL SELECT

MBLNR,  WERKS, MATNR, CHARG,  BWART, MENGE, MJAHR,  MKPF.BUDAT  FROM MSEG  , MKPF  where MSEG.MBLNR = MKPF.MBLNR and WERKS ='A100' and  MATNR = 'RM010000'  AND MKPF.BUDAT >= TO_DATE(’01-JAN-2014’,’DD-MON-YYYY’)

Above query is not working with SAP , on the contrary, when i use this query with our oracle server (Other than SAP), it works fine. Can anybody pls. help me out for this. 

Below is the error which i am getting.

/QTQVC/OPEN_STREAM failed after 00:00:00 Key = SQL_ERROR (ID:00 Type:E Number:001 Comma without preceding colon (after OPEN ?).)

4 Replies
its_anandrjs

First try to execute this query from the Qlikview SAP query viewer if you installed it from the SAP connector to Check that it is working or not other wise you have to change the query. Also check the TO_DATE function is properly used in the query or not may be that is the reason.

panosalexand
Creator
Creator

Hi try this first in your SQL Server to see if it will fetch data.


SELECT TOP (1000) * from openquery (HAP,
'SELECT * FROM Table A  ');

 

If it will work then try to create a qvw with the following.:

LET vConnectionStringDB=  ' [Provider=SQLOLEDB....................] ' 
OLEDB CONNECT TO $(vConnectionStringDB);

 

LOAD *;
SQL
select *
from openquery(HAP,
'SELECT *
FROM Table');

Hope this helped. 

MyrtleFletcher
Contributor
Contributor

Also check the TO_DATE function is properly used in the query or not may be that is the reason.   lcps go

cwolf
Creator III
Creator III

For the QlikView SAP connector you have to use ABAP SQL syntax:

SQL select
MSEG~MBLNR
MSEG~MJAHR
MSEG~ZEILE
MSEG~BWART
MSEG~MATNR
MSEG~WERKS
MSEG~CHARG
MSEG~MENGE
MKPF~BUDAT
from MSEG join MKPF on (MKPF~MBLNR=MSEG~MBLNR and MKPF~MJAHR=MSEG~MJAHR)
where MSEG~WERKS='A100' and MSEG~MATNR='RM010000' and MKPF~BUDAT>='20140101';