‎2008 May 06 2:36 PM
hi all
Parameters : p_fam(3) type c.
Select single Prodh8(3) from t179 into gv_family where prodh8(3) = p_fam.
write : gv_family.
I need to validation like this.
But this code is not working, let anybody know how to solve this substring.
any keyword help is appreciable.
Regards,
Madhavi
‎2008 May 06 2:40 PM
You can't use the substring directly in the select query.
Try to get all relevent records into an internal table and than do the substring processing.
Regards,
Naimesh Patel
‎2008 May 07 8:26 AM
Hi,
Just copy the following code & execute it. This pgm selects all records from MAKT where 3rd character of the description is 'E'. You may run & see. This is the code.
TYPES: BEGIN OF t_makt.
INCLUDE STRUCTURE makt.
TYPES: END OF t_makt.
DATA: t_makt TYPE TABLE OF t_makt,
t_makt_wa TYPE t_makt.
data: w_ii type i.
*
tables makt.
Select * from makt into table t_makt
where maktx like '__E%'.
break-point.
I hope this helps,
Regards
Raju Chitale
‎2008 May 06 2:51 PM
DATA: gv_fam_pattern TYPE prodh,
gv_prodh TYPE prodh.
CONCATENATE '________' p_fam '%' INTO gv_fam_pattern.
SELECT SINGLE prodh
INTO gv_prodh
FROM t179
WHERE prodh LIKE gv_fam_pattern.
gv_family = gv_prodh+8(3).
Note: above code was not checked or tested, use at your own risk. For one, it will not handle families of less than 3 characters nicely.
Or use native SQL.
Oh, and tell your analysts to not put smarts or meaning into object ID's.
Greetings,
Gert.