‎2007 Jan 04 2:10 PM
Hi all,
name of my internal table is my_tab.i need to calculate the discounts depending upon the condition types(KSCHL) FROM KONV TABLE.
WHEN KSCHL = ZDO1 calulation procedure is in percentage
KSCHL= ZD02 calculation procedure is in fixed amount.
and so on.....
my_tab has fields
my_tab-total
my_tab-discount
if kschl = ZD01, discount = my_tab-total - my_tab-discount
if kschl = ZD02, discount = my_tab-total * my_tab-discount/100.
i wanted to know how to use this in CASE AND END CASE statement.
regards
akmal
‎2007 Jan 04 2:13 PM
Hi akmal,
loop at my_tab.
Case my_tab-kschl.
when 'Zd01'.
discount = my_tab-total - my_tab-discount.
when 'ZD02'.
discount = my_tab-total * my_tab-discount/100.
endcase.
endloop.
hope it helps u,
keerthi
‎2007 Jan 04 2:13 PM
Hi akmal,
loop at my_tab.
Case my_tab-kschl.
when 'Zd01'.
discount = my_tab-total - my_tab-discount.
when 'ZD02'.
discount = my_tab-total * my_tab-discount/100.
endcase.
endloop.
hope it helps u,
keerthi
‎2007 Jan 04 2:14 PM
Hi akmal,
chek out this code.
Case kshcl.
when 'ZD01'.
discount = my_tab-total - my_tab-discount.
when 'ZD02'.
if kschl = ZD02, discount = my_tab-total * my_tab-discount/100.
end case.
if you ar looping through the internal table sthen you can do the same af ter the when statements.
regards,
sateesh.