Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

variable-large

Former Member
0 Likes
730

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.

6 REPLIES 6
Read only

Former Member
0 Likes
705

Sorry but i can't understand what you need....

explain better

Read only

0 Likes
705

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.

Read only

0 Likes
705

As Bala has noted, the threads below are all the same. This thread has been reported as Abuse.

Read only

former_member585060
Active Contributor
0 Likes
705

This the third thread on same issue? what happened to other threads did u closed?

Read only

Former Member
0 Likes
705

Hi ,

Use this query.

Declare a variable for rollno eg. w_rollno.

Select max(zrollno) from zdetails1

into w_rollno.

that's it...

Success...

Read only

Former Member
0 Likes
705

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.