‎2008 Nov 24 12:25 PM
Hi All ,
While creating ABAP query to fetch data from a table , i want to fetch data where one field begins with 1* or 2* or 3* or 4* . If it possible to write select stmt while creating query thru SQ01 , where should i write it ? Where should i COUNT the data selected and display it . i'm using SAP 6.0
Thanks & Regards ,
Sabu
‎2008 Nov 25 4:27 AM
Hi,
I hope Alex is right.please close the thread
Regards
rasheed
‎2008 Nov 24 12:31 PM
Actually you can get report for the query.May be be you can write in that.
search the forum.
‎2008 Nov 24 1:39 PM
Hi
I think you can write a report to fetch data and count data, then display.
For select statement
select field1 field2 ...
from db_tab
into table i_tab
where condition_field like '1%'
or condition_field like '2%'
or condition_field like '3%'
or condition_field like '4%'.
For display
loop at i_tab into w_tab.
write:/ w_tab-field1, w_tab-field2, ... .
endloop.
Edited by: alex yu on Nov 25, 2008 6:00 AM
‎2008 Nov 25 4:27 AM
Hi,
I hope Alex is right.please close the thread
Regards
rasheed
‎2008 Nov 25 7:15 AM
No, above mentioned is not the solution for your problem.
I believe you want to write ABAP Query (i.e. Tcode SQ01), NOT the SQL Query in a normal program.
Now, if you want to put abap code behind a field in your SQ01 query then you need to create custom field in your infoset. To learn how to create custom fields I have written a blog:
Good news is that you do not need to create custom fields for the requirement that you mentioned.
i want to fetch data where one field begins with 1* or 2* or 3* or 4* .
For this, simply put the field on the selection screen by selecting appropriate check box and just use 1, 2, 3* or 4* in on the selection screen.
Where should i COUNT the data selected and display it .
when you execute the report, click on the 'Layout' icon, and select 'Column for number of rows'. It will give you last row with count. You can then save the layout as default layout so that it appears automatically.
If you want to do anything different than above then you need to create custom fields, see my blog for that.
‎2008 Nov 25 8:13 AM
Thank you all , the issue solved .
Thanks Shafiq this is very useful one .
Sabu