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

Announcements
Join us to spark ideas for how to put the latest capabilities into action. Register here!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

SAP /SQL Openstream failed SQL ERROR Number:000

Hello together,

I try to execute the folowing code and get the errormessage, that is shown in the screenshot in the bottom of this article. Can someone help me, please. I don't habe any more ideas.

CU Florian


SET ThousandSep='.';
SET DecimalSep=',';
SET MoneyThousandSep='.';
SET MoneyDecimalSep=',';
SET MoneyFormat='#.##0,00 €;-#.##0,00 €';
SET TimeFormat='hh:mm:ss';
SET DateFormat='DD.MM.YYYY';
SET TimestampFormat='DD.MM.YYYY hh:mm:ss[.fff]';
SET MonthNames='Jan;Feb;Mrz;Apr;Mai;Jun;Jul;Aug;Sep;Okt;Nov;Dez';
SET DayNames='Mo;Di;Mi;Do;Fr;Sa;So';
// DataConnect zur SAP JP6 Datenbank (SAP Connector 5.2)
CUSTOMCONNECT TO "Provider=QvSAPConnector;ASHOST=HOSTNAME;SYSNR=01;CLIENT=400;XUserId=CLZcXDFISSVGVZAZZZ;XPassword=QMYQSaJOMLYKHRBGZJDZ;";
let vStartJahr = 2006;
let vAktJahr = 2009;
for j = $(vStartJahr) to $(vAktJahr)
[VBAP_$(j)]:
Load
*;
SQL
SELECT * FROM VBAP
where mid(ERDAT,7,4) = $(j);

// QVD Datei mit neuen Zeilen speichern
store VBAP_$(j) into VBAP_$(j).qvd;
drop table VBAP_$(j);
next


error loading image

9 Replies
Not applicable
Author

I think the MID function will not work in your SQL.

Either you put MID function in your LOAD statement,

OR you modify the SQL such as WHERE ERDAT LIKE '%2006%' something like that.

Rgds,

Not applicable
Author

You want to create only the staging QVDs. Try by removing the LOAD *; only SQL SELECT is required?

--Arun

Not applicable
Author

I want to save all SAP-data from table ...

vbap in year 2008 into vbap_2008.qvd

vbap in year 2009 into vbap_2009.qvd

... and so on.

Not applicable
Author

Then following is not working?

for j = $(vStartJahr) to $(vAktJahr)

[VBAP_$(j)]:
SQL SELECT * FROM VBAP
where mid(ERDAT,7,4) = $(j);
store VBAP_$(j) into VBAP_$(j).qvd;
drop table VBAP_$(j);

next


Not applicable
Author

Did u try loading someother table from the SAP Connector. Like a Simple table

"T000 ". I have a doubt that you dont have a role in the System.

PS: Ich meine die Berechtigung für Qlikview von SAP, die Daten zu holen

Not applicable
Author

This one should work:

for j = $(vStartJahr) to $(vAktJahr)

[VBAP_$(j)]:
SQL SELECT * FROM VBAP
where ERDAT LIKE '$(j)%';
store VBAP_$(j) into VBAP_$(j).qvd;
drop table VBAP_$(j);

next

Not applicable
Author

Yes, you are right. It works. Thank your for your support/help. Now I must wait, there are a lot of data in SAP.

I hope that the SQL only store the data in the correct QVD-File.

Not applicable
Author

Sravan, if there is a connection issue, that should be flagged during connect execution itself?

Not applicable
Author

@ Arun

You are right.