‎2008 Mar 23 11:06 AM
hi guru,
i have 2 vaues one is onspec total = 543 . 00
grand total = 1098.00
how i caculate percentage means i want (543 / 1098)*100
help me in alv ....
thanks
‎2008 Mar 24 3:08 AM
hi subhasis.....
CALL METHOD go_alv_serv->get_subtotals
IMPORTING
ep_collect00 = lv_total.
ASSIGN lv_total->* TO <fs_total_serv>.
READ TABLE <fs_total_serv> INDEX 1 INTO ls_zsmmpur003.
ls_zsmmpur003-zporcent = 100.
MODIFY <fs_total_serv> FROM ls_zsmmpur003
INDEX 1 TRANSPORTING zporcent.
Refresco la grilla para reflejar los cambios
CALL METHOD go_alv_serv->refresh_table_display
EXPORTING
i_soft_refresh = 'X'.
Regards..
Sudarsan
‎2008 Mar 24 2:56 AM
For the percentage u need to use a numeric variable where to store the value:
PERC = NUM / SUM * 100.
Use:Function Module - CALCULATE_PERCENTAGE calculates the Percentage
Reward points if it is useful..
‎2008 Mar 24 3:06 AM
Hi,
DATA : v_subtotal TYPE I,
v_grntotal TYPE I,
v_percen TYPE I.
onspec total = 543 . 00
grand total = 1098.00
v_percen = ( v_subtotal / v_grntotal ) *100.
WRITE : v_percen.
‎2008 Mar 24 3:08 AM
hi subhasis.....
CALL METHOD go_alv_serv->get_subtotals
IMPORTING
ep_collect00 = lv_total.
ASSIGN lv_total->* TO <fs_total_serv>.
READ TABLE <fs_total_serv> INDEX 1 INTO ls_zsmmpur003.
ls_zsmmpur003-zporcent = 100.
MODIFY <fs_total_serv> FROM ls_zsmmpur003
INDEX 1 TRANSPORTING zporcent.
Refresco la grilla para reflejar los cambios
CALL METHOD go_alv_serv->refresh_table_display
EXPORTING
i_soft_refresh = 'X'.
Regards..
Sudarsan