Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Dear Community Users,
I have been given a SAP query from SAP team, and the objective is to run the SAP query from Qlikview load script and fetch the data.
Below is the query, when i run this query in Qlikview with connection information. am getting Script Error.
SELECT distinct b.objectvalue as ebeln
FROM CDPOS b, CDHDR a
WHERE b.objectclas = ‘EINKBELEG’
AND b.tabname = ‘EKES’
And b.objectvalue = a.objectvalue
AND b.changenr = a.changenr
AND a.objectclas = ‘EINKBELEG’
AND a.udate >= &LastRunDate ;
Appreciate your Help.
Thanks
Balamuralidharan T
What does you connect statement say during script run? Do you get a successful connection? Is it the SELECT statement that really cause the "Script Error"?
You quotes in the SQL above seems off. They are a back-tick as start and forward-tick as end ... which seems odd. I don't know much about SAP but I am pretty sure that single qutoes; straight/vertical like this ' is what you need to use:
SELECT distinct b.objectvalue as ebeln
FROM CDPOS b, CDHDR a
WHERE b.objectclas = 'EINKBELEG'
AND b.tabname = 'EKES'
And b.objectvalue = a.objectvalue
AND b.changenr = a.changenr
AND a.objectclas = 'EINKBELEG'
AND a.udate >= &LastRunDate ;
Try this:
LOAD OBJECTVALUE AS EBELN
;
SQL SUBSELECT OBEJECTVALUE FROM CDPOS
WHERE
OBJECTCLAS='EINKBELEG' AND TABNAME='EKES' AND OBJECTVALUE CHANGENR IN ( SELECT OBJECTVALUE CHANGENR FROM CDHDR WHERE UDATE >= '$(LastRunDate)' );
Make sure that LastRunDate is in YYYYMMDD format and also I believe that OBJECTID is the name for field OBJECTVALUE in SAP TABLE CDPOS and CDHDR.
Hi Aar Kay, Thanks for your reply. I did execute the query which you recommended but still am getting the script error.
Yes, am able to connect the SAP.
Please find below the snapshot of Error message,
Thanks
Balamuralidharan T
Can you please post your script