2007 Apr 09 1:46 PM
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
K01 swuu 01
M01 mmuq 01
S01 ssqq 03
these are the document with the current verison.
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
K01 swuu 01
M01 mmuq 01
S01 ssqq 03
these are the document with the current verison.
2007 Apr 09 1:49 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.
Message was edited by:
Alexander
2007 Apr 09 1:50 PM
HI
sort the itab with Doc_ver.
use "at end of doc_ver" event to print the req output.
regards,
madhu
2007 Apr 09 1:52 PM
Hi,
Sort ur internal table by Doc_no Doc_name Doc_ver
and
loop at internal table and
at end of Doc_ver,
write the output.
Regards,
Sonika
2007 Apr 09 1:52 PM
sort the internal table and then use AT control
at end of Doc_no
write: / Doc_no Doc_name Doc_ver.
enat.
Message was edited by:
liang ren
2007 Apr 09 1:53 PM
Hi,
u need to have a common code for versions i.e
01-latest
02-not latest
03-oldest
then u could say.
Loop at itab where doc_ver = '01'.
write:/....
Endloop.
r else you need to handle all the cases seperately.
Loop at itab where doc_ver = '01'.
perform sub_check print using itab-doc_ver
changing p_flag.
if p_flag = 'X'.
write.
endif.
Endloop.
update the flag when its a new version write ur code in the perform
santhosh
2007 Apr 09 1:54 PM
Hi,
data ITAB1 like ITAB occurs 0 with header line.
Sort ITAB by DOc_no DOC-Name version.
loop at ITAB.
at end of version.
read table itab index sy-tabix.
move-corresponding iTAB to ITAB1.
appen itab1.
clear itab1.
endat.
endloop
reward if useful
regards,
ANJI
2007 Apr 09 2:09 PM
Hi Vani,
Use SORT statement on internal table to sort the content of internal tables on fields.
If your DOC_VER is a character field then use
SORT ITAB BY DOC_NO DOC_VER.
If your DOC_VER is a numeric field then use
SORT ITAB BY DOC_NO DOC_VER DESCENDING.
LOOP AT ITAB.
AT NEW DOC_NO.
READ ITAB INDEX SY-TABIX INTO WA_ITAB.
WRITE:/ WA_ITAB-DOC_NO, WA_ITAB-DOC_NAME, WA_ITAB-DOC_VER.
ENDAT.
ENDLOOP.Thanks,
Vinay
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |