2007 Apr 09 1:55 PM
Hi Experts,
I have internal table like this
Doc_no Doc_name Doc_ver
K01 swuu 01
M01 mmuq 01
S01 ssqq 01
S01 ssqq 02
S01 ssqq 03
While displaying all the datas are coming.But I wants to display
Document with the current version.
In this case S01 ssqq 03 this is the document with the current verison.
kindly put some light on this, Thanks in advance.
Cheers...
Santosh
2007 Apr 09 1:58 PM
Sort ur internal table by Doc_no Doc_name Doc_ver
loop at internal table and
at end of Doc_ver,
write the output.
Endloop.
2007 Apr 09 1:58 PM
Sort ur internal table by Doc_no Doc_name Doc_ver
loop at internal table and
at end of Doc_ver,
write the output.
Endloop.
2007 Apr 09 2:00 PM
sort the table and then use at control
at end of Doc_name
format color COL_HEADING on,
write Doc_no Doc_name Doc_ver
format color off.
endat.
2007 Apr 09 2:01 PM
HI..
<b>loop at itab where Doc_ver = '03'.
write: / itab-Doc_no ,
itab-Doc_name,
itab-Doc_ver.
endloop.</b>
2007 Apr 09 2:06 PM
Hi there. Another option is to sort descending and then use the first record. This should be a little faster. Example:
SORT itab by Doc_no DESCENDING Doc_name Doc_ver DESCENDING.
LOOP AT itab.
write: / "Current version: ", itab-Doc_no, ' ', itab-Doc_name, ' ', itab-Doc_ver.
EXIT.
ENDLOOP.
- April King
2007 Apr 09 2:06 PM
Hi..,
data wa_current_version like line of itab.
data w_version like itab-doc_ver vallue '00'.
loop at itab .
if itab-doc_ver gt w_version .
w_version = itab-doc_ver.
wa_current_version = itab.
endif.
endloop.
here wa_current_version contains the record with version '03'.
reward if it helps u..
sai ramesh