‎2007 Sep 28 4:16 PM
I need to do the following select but I am not sure of the correct syntax.
select vbeln fkart netwr into table it_table from vbrk where
fkdat NE erdat.
What I need is every record (only fields vbeln, fkart, and netwr) from vbrk where fkdat and erdat are not equal. Is there a way to do this in a single select? It is looking for erdat to be defined in the program but erdat and fkdat are both the values in the database and are not supplied by the program or the use. I hope this makes sense.
Davis
‎2007 Sep 28 4:22 PM
Hi,
Please try this.
select vbeln fkart netwr fkdat erdat
into (vbrk-vbeln, vbrk-fkart, vbrk-netwr, vbrk-fkdat, vbrk-erdat)
from vbrk
where fkdat ne space.
if vbrk-fkdat ne vbrk-erdat.
it_table-vbeln = vbrk-vbeln.
it_table-fkart = vbrk-fkart.
it_table-netwr = vbrk-netwr.
append it_table.
endif.
endselect.
Regards,
Ferry Lianto
‎2007 Sep 28 4:22 PM
Hi,
Please try this.
select vbeln fkart netwr fkdat erdat
into (vbrk-vbeln, vbrk-fkart, vbrk-netwr, vbrk-fkdat, vbrk-erdat)
from vbrk
where fkdat ne space.
if vbrk-fkdat ne vbrk-erdat.
it_table-vbeln = vbrk-vbeln.
it_table-fkart = vbrk-fkart.
it_table-netwr = vbrk-netwr.
append it_table.
endif.
endselect.
Regards,
Ferry Lianto
‎2007 Sep 28 4:26 PM
Ferry, thank you very much. I was unaware that you could do such a thing. I have learned a lot from you and I appreciate it very much!
Davis
‎2007 Sep 28 4:27 PM
Hi,
May be this way.
tables : vbrk.
select vbeln fkart netwr from vbrk
if vbrk-fkdat NE vbrk-erdat.
move-corresponding vbrk to it_table.
append it_table.
endif.
endselect.
a®