‎2007 Oct 03 5:02 AM
loop at it_code_det.
read table it_qpct with key codegrp = it_code_det-fegrp
code = it_code_det-fecod.
select single * from qpct where codegruppe = it_code_det-urgrp and
code = it_code_det-urcod.
p0 = ( it_code_det-count / total ) * 100.
cp = cp + p0.
write:/2 sy-vline,(8) it_code_det-fegrp color col_key,sy-vline, (5)
it_code_det-fecod color col_key ,sy-vline,(40) it_qpct-kurztext color
col_key,sy-vline,
(8) it_code_det-urgrp color col_key,sy-vline,
(5) it_code_det-urcod color col_key,sy-vline,
(40) qpct-kurztext color col_key,sy-vline,
(2) it_code_det-st color col_heading,sy-vline,
(4) it_code_det-oteil color col_key,sy-vline,
(6) it_code_det-count color col_key,sy-vline,
(6) p0 color col_key,sy-vline,
(7) cp color col_key,sy-vline.
total1 = total1 + p0.
clear qpct.
clear p0.
clear it_qpct.
endloop.
This is the code.Some fields might have no values.That is not a problem. It will be printed with empty space.But empty line appears in b/w records.
‎2007 Oct 03 5:07 AM
What is the line size declared in the program? If line size is less than the record length, record will be pushed to next line.
Also it is a good practice do SY-SUBRC checks after READ as wel las SELECTs.
‎2007 Oct 03 5:07 AM
here you are not updating value in final table it_code_det.
so when you are going for output it is not printing.
create the two filed for
6) p0 color col_key,sy-vline,
(7) cp color col_key,sy-vline.
update in final table it_code_det.
then print in output from it_code_det.
Rewards if useful............
Minal