11-05-2007 10:51 AM
Hi experts,
I would like to know how can I translate this nested SQL statement into an ABAP query (both MyTable1 and MyTable2 have as primary key the field "myfield"):
SELECT t1.myfield
FROM MyTable1 as t1
WHERE t1.myfield NOT IN (SELECT t2.myfield
FROM MyTable2 as t2)
Full points available
Thank you
Francesco
11-05-2007 10:58 AM
Hi
SELECT T1.MYFILED FROM TABLE1 INTO TABLE ITAB1 WHERE CONDITION .
IF NOT ITAB1[] IS INITIAL
SELECT T2.MYFILED FROM TABLE2 INTO ITAB2 FOR ALL ENTRIES IN ITAB1 WHERE CONDITION T2.MYFILED = ITAB1-T1.MYFIELD.
ENDIF.
reward if usefull
11-05-2007 11:02 AM
hi
yes this i s possible with the for all entries in abap
u can use like this
select myfield
from mytable1
into table itab1
for all entries not in itab2
where myfield = itab2-myfield.
otherwise
u can use joins also
11-05-2007 11:04 AM
Hi Francesco,
try this.
SELECT T1.MYFILED FROM TABLE1 INTO TABLE ITAB1 WHERE CONDITION .
IF NOT ITAB1[] IS INITIAL
SELECT T2.MYFILED FROM TABLE2 INTO ITAB2 FOR ALL ENTRIES IN ITAB1 WHERE CONDITION T2.MYFILED NE ITAB1-T1.MYFIELD. ( bcos, in the select statemnet there its given <b>NOT IN</b> )
ENDIF.
Reward If uSeful
Regards,
Chitra
11-08-2007 3:47 PM
Thank you all! I resolved thanks to your help. I'm trying to assing points but the radio button are not visible....