10-27-2008 6:40 AM
hello guyz,
im new to ABAP and i try query REGUP table using this code:
i try to run this code but it always prompt, FOR POOLED TABLES, CLUSTER TABLES, AND PROJECTION VIEWS, JOIN IS NOT ALLOWED: "REGUP"
IF SY-SUBRC EQ 0.
READ TABLE I_EDID4 INDEX 1.
SELECT SINGLE itab-MGSTYP "insert msgtyp
A~BUKRS "Company Code
A~LIFNR "Vendor
B~XEDIP "Registered or Not
INTO (I_COUNT-BSART, I_COUNT-BUKRS, I_COUNT-LIFNR, I_COUNT-XEDIP)
FROM REGUP as A
INNER JOIN LFB1 as B
ON ALIFNR EQ BLIFNR
WHERE A~VBLNR = I_EDID4-SDATA+21(10).
I_COUNT-DOCNUM = ITAB-DOCNUM.
APPEND I_COUNT.
ENDIF.
what is the best alternative way for this?
THanks in advance!
10-27-2008 7:23 AM
Hi,
The best possible way is to select the desired data from tables
into the internal table respectively and then read internal tables as per your requirement.
eg : select * from mara into itab1 where cond(if applicable)
select * from makt into itab2 where cond(if applicable)
loop at itab1.
l_tabix sy-tabix.
read table itab2 with key matnr = itab1-matnr.
modify itab1 index l_tabix transporting maktx.
endloop.
Thanks & Regards
Ruchi Tiwari
10-27-2008 6:42 AM
from the message it is very clear that it is not possible to use joins, so use separate selects and use for all entries for second select using the first selected data. read the help on selecting the data using various ways from database.
10-27-2008 7:23 AM
Hi,
The best possible way is to select the desired data from tables
into the internal table respectively and then read internal tables as per your requirement.
eg : select * from mara into itab1 where cond(if applicable)
select * from makt into itab2 where cond(if applicable)
loop at itab1.
l_tabix sy-tabix.
read table itab2 with key matnr = itab1-matnr.
modify itab1 index l_tabix transporting maktx.
endloop.
Thanks & Regards
Ruchi Tiwari
10-27-2008 7:30 AM
there are three types of Database Tables.
1. Transperant Table
2. cluster table
3. pooled table
INNER JOIN in select query is allowed only in case of transperant table.
As REGUP is a Cluster Table, you cannot write INNER JOIN with this table