08-10-2006 8:20 AM
Hi Friends,
suppose i have 6 fields f1,f2,f3,f4 & f5, f6.
Now i wrote the select statement.
I wanted to write the logic for field f6. If f6 is blank then it will exclude the records from the report.
My selection is based on 2 fields criteria so that it will select other values i.e
select f1 f2 f3 f4 from table where f5 = '1' and not f6 is initial.
Is the above select statement is correct??
Plz send me the coding.
08-10-2006 8:22 AM
Hello,
data : begin of itab occurs 0,
f1,
f2,
f3,
f4,
end of itab.
select f1 f2 f3 f4
into table itab
from d_table
where f5 = 1
and nto f6 is initial.
loop at itab.
write here
endloop.
regards,
Naimesh
08-10-2006 8:24 AM
08-10-2006 8:45 AM
select f1 f2 f3 f4 from table where f5 = '1' and not f6 is initial.
The only suggestion here would be to use into option.
SELECT F1 F2 F3 F4 INTO TABLE ITAB
FROM XYZ
WHERE F5 = '1' AND NOT F6 IS INITIAL.
Regards
Anurag
08-10-2006 8:49 AM
Hi,
you can do this..
select f1 f2 f3 f4 from table into itab where f5 = '1' .
if sy-subrc = 0.
delete itab where f6 = ' '.
endif.
regards
vijay
08-10-2006 8:52 AM
select f1 f2 f3 f4 from ztable into table itab
where f5 = '1' and f6 ne space.
08-10-2006 8:53 AM
select f1 f2 f3 f4
into table itab
from d_table
where f5 = 1
and f6 NE space.
If F6 is a character type u can define as above.
Or if F6 of other than character type and it is of NUMC length 6.
select f1 f2 f3 f4
into table itab
from d_table
where f5 = 1
and f6 NE '000000'.
OR for type I
select f1 f2 f3 f4
into table itab
from d_table
where f5 = 1
and f6 NE ' '. (6 spaces)
Try any one of these, this will work.
Reward points if this anwers your query.