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: 

Logic to calculate percentage

Former Member
0 Kudos

Hi Gurus,

Can anyone explain the logic to calculate the average in percentage for a summary report.Exact scenario is given below:

A 20%

B 25%

C NOT APPLICABLE

D 0%

Here we have to ignore the field that contain non applicable value while calculating teh average.

Thanks in advance:)

Deepika

1 ACCEPTED SOLUTION

Former Member
0 Kudos

HI,

Loop at itab.

if itab-field2 CA '0123456789'

counter = counter + 1.

total = field2 + total.

endif.

endloop.

Avg = total / counter.

Rgds,

Bujji

2 REPLIES 2

Former Member
0 Kudos

HI,

Loop at itab.

if itab-field2 CA '0123456789'

counter = counter + 1.

total = field2 + total.

endif.

endloop.

Avg = total / counter.

Rgds,

Bujji

0 Kudos

Thanks Bujji..