Application Development and Automation 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: 
Read only

SAP Query Creation

Former Member
0 Likes
1,280

Hi All,

I am creating a SAP query in the system using the tables KONP,MBEW & A018 i could join tables KONP & MBEW but i am not able to add the table A018 and a error message is displayed

Error Message:

Table A018 cannot be used in a join

Message no. AQ501

Diagnosis

1. You cannot read the selected table with SELECT statements (because, for example, it is a structure without a database table). Therefore, this table cannot be read within a table join either.

2. The chosen table is a pool or cluster table. These tables may not be used in a table join.

Can anyone tell me a alternative to join this table to MBEW & KONP.

I want this Join Conditions:

MBEW-MATNR = A018-MATNR

A018-KAPPL = KONP-KAPPL

A018-KSCHL = KONP-KSCHL

A018-KNUMH = KONP-KNUMH

Thanks & Regards

Andrew

Edited by: Andrew J on Dec 18, 2008 2:49 PM

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
923

hi,

use FOR ALL ENTRIES

EXAMPLE:

Exporting all flight data for a specified departure city. The relevant airlines and flight numbers are first put in an internal table entry_tab, which is evaluated in the WHERE condition of the subsquent SELECT statement. 
PARAMETERS p_city TYPE spfli-cityfrom. 

TYPES: BEGIN OF entry_tab_type, 
         carrid TYPE spfli-carrid, 
         connid TYPE spfli-connid, 
       END OF entry_tab_type. 

DATA: entry_tab   TYPE TABLE OF entry_tab_type, 
      sflight_tab TYPE SORTED TABLE OF sflight 
                       WITH UNIQUE KEY carrid connid fldate. 

SELECT carrid connid 
       FROM spfli 
       INTO CORRESPONDING FIELDS OF TABLE entry_tab 
       WHERE cityfrom = p_city. 

SELECT carrid connid fldate 
       FROM sflight 
       INTO CORRESPONDING FIELDS OF TABLE sflight_tab 
       FOR ALL ENTRIES IN entry_tab 
       WHERE carrid = entry_tab-carrid AND 
             connid = entry_tab-connid.

REGARDS

RAHUL

:

3 REPLIES 3
Read only

Former Member
0 Likes
924

hi,

use FOR ALL ENTRIES

EXAMPLE:

Exporting all flight data for a specified departure city. The relevant airlines and flight numbers are first put in an internal table entry_tab, which is evaluated in the WHERE condition of the subsquent SELECT statement. 
PARAMETERS p_city TYPE spfli-cityfrom. 

TYPES: BEGIN OF entry_tab_type, 
         carrid TYPE spfli-carrid, 
         connid TYPE spfli-connid, 
       END OF entry_tab_type. 

DATA: entry_tab   TYPE TABLE OF entry_tab_type, 
      sflight_tab TYPE SORTED TABLE OF sflight 
                       WITH UNIQUE KEY carrid connid fldate. 

SELECT carrid connid 
       FROM spfli 
       INTO CORRESPONDING FIELDS OF TABLE entry_tab 
       WHERE cityfrom = p_city. 

SELECT carrid connid fldate 
       FROM sflight 
       INTO CORRESPONDING FIELDS OF TABLE sflight_tab 
       FOR ALL ENTRIES IN entry_tab 
       WHERE carrid = entry_tab-carrid AND 
             connid = entry_tab-connid.

REGARDS

RAHUL

:

Read only

Former Member
0 Likes
923

Sorry for the delay in closing the thread.Solved.

Read only

0 Likes
923

Hi,

I am trying a view on A018 for the purpose of datasource creation . Pl post how you resolved it. I need the data in that table to be pushed to BI..

Regards

Vinoth