Application Development 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: 

its urgent plz help me

Former Member
0 Kudos

hi to every one,

i want the latest status for corresponding sequential no

table(staus table zstatus)

zstat(status) zseq(seq number)

dan 1

dan 2

dan 3

cann 1

cann 2

i want to fetch latest status ie dan which is having seq no 3.ok

plz i want a status and actual date for cooresponding max sequential no which is in some z table.

plz help me in this issue.

5 REPLIES 5

Former Member
0 Kudos

select zstat max(seqnumber) date into table itab

from ztable group by dan.

Message was edited by: Sharath kumar R

Former Member
0 Kudos

1) select max( num ) from z_table into v_max_num.

v_max_num = v_max_num+1.

rgds,

TM.

Please mark points if helpful

Message was edited by: Thomas Mann

Former Member
0 Kudos

Hi Raj,

Please see this example code.

tables : yshell1.

data : begin of itab occurs 0,

name type zovalues,

num type int4,

end of itab.

select name max( num ) into table itab

from yshell1 group by name.

loop at itab.

write 😕 itab-name, itab-num.

endloop.

Hope this solves ur problem.

Former Member
0 Kudos

Hi Raj,

Simple way to do this is do sort on the table and then read. For the given example

SORT i_zstatus BY zstat zseq DESCENDING.

CLEAR wa_zstatus.

READ TABLE i_zstatus INTO wa_zstatus WITH KEY

status = 'dan'

BINARY SEARCH.

WRITE 😕 wa_zstatus-zstat, wa_zstatus-zseq.

Output

dan 3

0 Kudos

HI

FOR ONE STATUS YOU ARE GIVEN .BUT IF I HAD SO MANY STATUSES WHAT WE HAD TO DO.

KINDLY REPLY TO THIS