‎2007 Apr 12 12:46 PM
hi,
may i know if the select statement can work if can satisfy in the where? i check the tablex entry for where clause and it is correct but i do not know why no data collected.
any reason?
thanks
internal table it_tab with fields below
fielda
fieldb
fieldc
fieldd
fielde
select fieldb fieldc fieldd into corresponding fields of wa_tab
from tablex
where ......
if sy-subrc = 0
select single aa bb into (wa_tab-fieldd , wa_tab-fielde) where ....
concatenate wa_tab-fieldb wa_tab-fieldc to wa_tab-fielda.
collect wa_tab to it_tab.
endif.
endselect.
‎2007 Apr 12 12:55 PM
internal table it_tab with fields below
fielda
fieldb
fieldc
fieldd
fielde
select fieldb fieldc fieldd into corresponding fields of wa_tab
from tablex
where ......
if sy-subrc = 0
select single aa bb into (wa_tab-fieldd , wa_tab-fielde) where ....
concatenate wa_tab-fieldb wa_tab-fieldc to wa_tab-fielda.
<b>append wa_tab to it_tab.</b>
endif.
endselect.
u need to append data to internal table....
sort it_tab by fielda fieldb fieldc fieldd.
loop at it_tab.
collect it_tab.
endloop.
‎2007 Apr 12 12:49 PM
could u paste your where clause code here !!!
regards,
sai ramesh
‎2007 Apr 12 12:51 PM
Use Like That
Select A B C from XYZ into wa_xyz where xxxxxxxxxx.
endselect.
if sy-subrc eq 0.
endif.
if you are fetching one value then use single
declare fields according to the table sequence
‎2007 Apr 12 12:53 PM
Hi El,
In the code u have written here :
select fieldb fieldc fieldd into corresponding fields of <b>wa_tab</b>
from tablex
where ......
if sy-subrc = 0.
In this code, instead of using the i<b>nternal table it_tab</b> u have used <b>workarea wa_tab.</b>
Only when we use <b>select single </b>, we will be using <b>work area</b>.
Hope this helps you fetch the data.
Regards,
Thasneem
‎2007 Apr 12 12:55 PM
internal table it_tab with fields below
fielda
fieldb
fieldc
fieldd
fielde
select fieldb fieldc fieldd into corresponding fields of wa_tab
from tablex
where ......
if sy-subrc = 0
select single aa bb into (wa_tab-fieldd , wa_tab-fielde) where ....
concatenate wa_tab-fieldb wa_tab-fieldc to wa_tab-fielda.
<b>append wa_tab to it_tab.</b>
endif.
endselect.
u need to append data to internal table....
sort it_tab by fielda fieldb fieldc fieldd.
loop at it_tab.
collect it_tab.
endloop.
‎2007 Apr 12 1:03 PM