Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Select from SAP

Hello,

I have the following script works fine:

VBPA:

SQL Select * from VBPA

where VBELN in (Select VBELN from VBAK WHERE VKORG = '2011' or VKORG ='2012') ;

store * from VBPA into SendToUSA\Archive\VBPA_USA.QVD;

DROP TABLE VBPA;

I want to change it so that it is as listed below (changes highlighted in Underline).

The modified script does not work

VBPA:

SQL Select * from VBPA

where VBELN in (Select VBELN from VBAK and LIKP WHERE VKORG = '2011' or VKORG ='2012') ;

store * from VBPA into SendToUSA\Archive\VBPA_USA.QVD;

DROP TABLE VBPA;

I'd love to hear your opinions what the correct way to write the script

Elad



2 Replies
Not applicable
Author

Hi Elpel,

you can't use "AND" in the FROM of your script.

What is LIKP? A field? A table?

If it's a table, your script must be : ...(Select VBELN from VBAK, LIKP WHERE VKORG = '2011' or VKORG ='2012')

But, why do you use LIPK? Tell me more.

Kindly,

suniljain
Master
Master

Following Statement is not possible.

SQL Select * from VBPA

where VBELN in (Select VBELN from VBAK and LIKP WHERE VKORG = '2011' or VKORG ='2012') ;

you have to again write sub query for LIKP inside VBAK