Skip to Content
avatar image
Former Member

how to calculate percentage

hi,

i have requirement below.

i want to calculate 20 percent of wa_ameng .and if wa_menge value is more than 20 percent of wa_ameng then i will capture that value to another varibale.how to write the code please help me

data:wa_ameng type i,

wa_menge type i,

wa_percent type i.

*DATA: BEGIN OF xe1edp10.

  • INCLUDE STRUCTURE e1edp10.

*DATA: END OF xe1edp10.

*

LOOP AT dint_edidd

WHERE segnam EQ 'E1EDP10'.

CLEAR xe1edp10.

MOVE dint_edidd-sdata TO xe1edp10.

loop at DEKEH .

move dekeh-ameng to wa_ameng.

move dekeh-menge to wa_menge.

endloop.

ENDLOOP.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Oct 30, 2009 at 10:19 AM

    Hi,

    Take the variables of type P with decimals insted of I.

    wa_percent  = (20 /100) * wa_amen.
    if wa_menge GT wa_percent
     wa_percent1 = wa_percent 
    endif.

    Thanks,

    Sri.

    Add comment
    10|10000 characters needed characters exceeded