Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Incorrect selection via the AND NOT EXIST

I am trying to do a selection of the table VBRK, with the goal that it will select all of the data from VBRK, without those data where the NETWR is 0. The code is as below:

 SELECT DISTINCT * FROM vbrk INTO TABLE gt_vbrk
      FOR ALL ENTRIES IN gt_vbfa_inv
      WHERE vbeln = gt_vbfa_inv-vbeln
        AND NOT EXISTS (SELECT DISTINCT * FROM vbrk 
                        INTO TABLE gt_vbrk
                        FOR ALL ENTRIES IN gt_vbfa_inv
                        WHERE netwr = 0). //Here I get an error

So I am getting an error that it is not grammatically correct to do the AND NOT EXIST. Can someone tell me how can I fix the upper code or do an selection where the data with NETWR=0 will not be selected?

Thank you all in advance!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

Simply add netwr to the WHERE condition, NE is for not equal:

 SELECT DISTINCT * 
        FROM vbrk 
        INTO TABLE gt_vbrk
        FOR ALL ENTRIES IN gt_vbfa_inv
        WHERE vbeln EQ gt_vbfa_inv-vbeln
          AND netwr NE 0.
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading