‎2008 Feb 07 7:32 PM
Can we do a partial field selection in ABAP SELECT like
For example -
select department first 3 characters < DEPT+0(3)>
from emp_table
where employee first name start with 'A' < EMP_NAME+0(1) = 'A'>
for listing dept first 3 char for Emp name starting with 'A' . How we can implement in ABAP ?
Can we do this without putting in to an internal table ( that is in a single select statement ) ?
Thanks
Mano
‎2008 Feb 07 7:39 PM
select * from table
into itab
where emp+(3) like 'ABC' "<< employe starting with ABC.
and id+(2) like '12'. "<< id number starting with 12.
or you can create a range and use that..
where emp in ra_emp and
id in ra_id.
is it right Rob?
‎2008 Feb 07 7:47 PM
Thank you of the answer .. if I want to select only the first 3 character of department , what will be the selection look like ?
‎2008 Feb 07 8:19 PM
‎2008 Feb 07 8:35 PM
you cant get only first three characters of the department... you can select the data based on the first three characters (using offset as per my previous post).. as Rob suggested we need to use LIKE in the where Clause..
thanks Rob.
‎2008 Feb 07 8:45 PM
OK - do you mean any department that has 'A' anywhere in the first three characters?
Rob