2007 Oct 10 8:59 AM
Hi all
Any way to make the below statement dynamic.
student table include fields like firstname, lastname, admino.
data: fname(20) type c,
lname(20) type c,
name(20) type c.
fname = 'firstname'.
lname = 'lastname'.
Select <b>fname lname</b> into (name) from student where
admino = '012345'.
endselect.
i want the sql statement for fname, lname take from the variable... anyway to do that?
Hi all
Any way to make the below statement dynamic.
student table include fields like firstname, lastname, admino.
data: fname(20) type c,
lname(20) type c,
name(20) type c.
fname = 'firstname'.
lname = 'lastname'.
Select <b>fname lname</b> into (name) from student where
admino = '012345'.
endselect.
i want the sql statement for fname, lname take from the variable... anyway to do that?
2007 Oct 10 9:05 AM
Hi..Gary..
Can u be more clear in your requirement??
Regards
Pranali
2007 Oct 10 9:08 AM
HI,
TRY LIKE THIS.
data: fname(20) type c,
lname(20) type c,
name(50) type c.
fname = 'firstname'.
lname = 'lastname'.
CONCATENATE FNAME LNAME INTO NAME.
THEN USE WAT CONDITON U WANT.
IF HELPFUL REWARD SOME POINTS.
WITH REGARDS,
SURESH ALURI.
2007 Oct 10 9:12 AM
Hi,
tables : student.
parameters : p_admino TYPE admino. " you can give single value
select-options : s_admino for admino. " u can give range fo values.
data : begin of tbl_student occurs 0,. " internal table with header
fname(20)
lname(20) ,
name(20),
end of tbl_student.
Select fname lname name
from student
into table tbl_student
where admino = p_admino. or
where admino in s_admino.
if sy-subrc = 0.
sort tbl_stuent by fname.
endif.
" to Display the records.
loop at tbl_student.
write 😕 tbl_student-fname,tbl_student-lname,tbl_student-name.
clear :tbl_student.
endloop.
<b>Rewards with points if helpful.</b>
Regards,
Vijay.
| User | Count |
|---|---|
| 6 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |