Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Help with SQL query

0 Kudos
650
  • SAP Managed Tags:

Hi,

I am quite new in this query stuff from SAP and I wanted to ask for help regarding the following error, when I try to execute I get this:

1) Incorrect table name or table alias name "LIKP". "LIKP". table alias name "LIKP". table alias name "LIKP". table alias name

and

2) "LIKP". table alias name "LIKP". table "".

The query is this:

select distinct

LIPS~VBELN AS DELIVERY_NOTE_NUMBER,

LIPS~VGBEL AS ORDER_NUMBER,

LIKP~BOLNR AS TRACKING_NUMBER,

VBKD~BSTKD AS PURCHASE_ORDER_NUMBER,

VBAK~AUART,

VBAK~VSBED,

VBAK~ERDAT AS ERDAT_ORDER,

VBAK~ERZET AS ERZET_ORDER,

LIPS~WERKS,

T001W~KUNNR,

T001W~NAME1 AS FROM_NAME,

T001W~STRAS AS FROM_STREET,

T001W~PSTLZ AS FROM_ZIP_CODE,

T001W~ORT01 AS FROM_CITY,

T001W~LAND1 AS FROM_COUNTRY

from LIPS

join VBAK on LIPS~VGBEL = VBAK~VBELN and LIPS~VTWEG = VBAK~VTWEG and LIPS~SPART = VBAK~SPART

join VBAP on VBAK~VBELN = VBAP~VBELN and LIPS~VGPOS = VBAP~POSNR

join VBKD on VBKD~VBELN = VBAK~VBELN

join T001W on LIPS~WERKS = T001W~WERKS

where VBAK~AUART in ('ZV90','ZV9H','ZV9F')

and VBAK~VSBED = 'L4'

and VBAK~ERDAT >= '20220901'

and LIPS~WERKS not in ('0201','0202')

Thanks in advance

4 REPLIES 4

AlexGourdet
Product and Topic Expert
Product and Topic Expert
0 Kudos
432
  • SAP Managed Tags:

Thank you for visiting SAP Community to get answers to your questions.

As you're looking to get most out of your community membership, please consider include a profile picture to increase user engagement & additional resources to your reference that can really benefit you:

I hope you find this advice useful, and we're happy to have you as part of SAP Community!

All the best,

Alex

andreas_baldauf
Active Participant
0 Kudos
432
  • SAP Managed Tags:

Hello,

Your question is tagged with "SAP IQ". I assume that you are not using SAP IQ, but SAP HANA database.
If you want to execute the statement in the SQL Editor (transaction DBACOCKPIT, DB02 or ST04), you should replace all "~" with ".". If it is not working you should provide more information and screenshots.

Example:
select distinct LIPS~VBELN AS DELIVERY_NOTE_NUMBER from LIPS
select distinct LIPS.VBELN AS DELIVERY_NOTE_NUMBER from LIPS

Best regards,
Andreas

chaouki_akir
Contributor
0 Kudos
432
  • SAP Managed Tags:

Table LIKP is missing in FROM clause.

So, you can

  1. add JOIN LIKP in the FROM clause
  2. or
  3. you can remove in the SELECT clause the line refering to table LIKP "LIKP~BOLNR AS TRACKING_NUMBER"

raymond_giuseppi
Active Contributor
0 Kudos
432
  • SAP Managed Tags:

With a proper label like ABAP Development, you would have gotten an answer faster.