‎2008 Aug 22 1:55 PM
HI
i hav table with roll no and i need to find out which is the larger number
i hav used the code as
types: begin of s_details,
rollno like zdetails1-zrollno,
name like zdetails-zsname,
end of s_details.
data: i_details type STANDARD TABLE OF s_details.
data: wa_details like line of i_details.
*SELECT max( zrollno ) FROM zdetails1 INTO wa_details.
*
if sy-subrc = 0.
message i009(zssk) with 'records fetched'.
endif.
*
write: wa_details-rollno, 'is the large number'.
BREAK-POINT.
select zrollno zsname from zdetails1 into wa_details.
endselect.
sort i_details by rollno DESCENDING.
if sy-subrc = 0.
message i009(zssk) with 'records fetched'.
endif.
loop at i_details into wa_details.
read table i_details index 2 INTO wa_details.
endloop.
write:/ wa_details-rollno.
it works fine
but instead of using the
read statement i need to use the variable
eg: data: rno type i
using variable i need to find out which is the larger number how can i use it?
pls help me out.
‎2008 Aug 22 2:01 PM
‎2008 Aug 22 2:05 PM
i want which is the large number in ROLLNO
USING the READ statement i got which is the large number and it is fine but my requirment is that
using variable i want to find out which number is the large number in rollno.
‎2008 Aug 22 2:18 PM
‎2008 Aug 22 2:02 PM
This the third thread on same issue? what happened to other threads did u closed?
‎2008 Aug 22 2:04 PM
Hi ,
Use this query.
Declare a variable for rollno eg. w_rollno.
Select max(zrollno) from zdetails1
into w_rollno.
that's it...
Success...
‎2008 Aug 22 2:32 PM
Hi,
From what you have given, i understand you need to get the largest roll number in a list of entries.
first option:
Check if roll number is the key field.
sort the table i_details by roll number descending.
read the table i_details index 1.
read table i_details into gwa_details index 1.
lv_rollno = gwa_details-rollno.
Second option:
select max(roll number) from zdetails1 into lv_rollno.