Skip to Content
0
Former Member
Apr 04, 2011 at 10:44 AM

Problem while using ON CHANGE OF event.

327 Views

Hi experts,

I am facing a problem when using on change of event while an internal table is looping.In my itab first field is 'racct'.The first 10 values in this field are same.But when the loop passes at the first time this event triggers and i will not get the expected result.How can i handle this problem?.The given below are the sample code which i have written.Plz help me to solve this problem.

LOOP AT it_final INTO wa_final.

IF wa_final-prctr BETWEEN 'PC1000000' AND 'PC1000999'.

sum1 = sum1 + wa_final-hsl.

ELSEIF wa_final-prctr BETWEEN 'PC2000000' AND 'PC2000999'.

sum2 = sum2 + wa_final-hsl.

ENDIF.

ON CHANGE OF wa_final-racct.

wa_sum-gl_no = g_old_glno.

wa_sum-amount1 = sum1.

wa_sum-amount2 = sum2. .

APPEND wa_sum TO it_sum.

ENDON.

ENDLOOP.