Skip to Content
author's profile photo
Former Member

abap % calc

Hi ,

i have a requirment where i need to calculate the % discount for a order.

actual value before discount i_value = 165.

discount rate = 75.23%.

net value after discount will be = 40.87 (output)

able to get i_value as = 165.

discount value i am getting while reading into variable is = 752.30-

Can you please let me know how to calculate to get the value as '40.87'.

Thanks in advance,

Vind.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

3 Answers

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 12:42 PM

    hi,

    try like this.

    If discout on 100 is 75.23 so how much on 165?

    means (165 * 75.23)/ 100.

    now subtract that value from 165.

    reward if useful.

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 12:48 PM

    Hi

    data: P type p decimals 2, dis type p decimals 2.

    dis = 165 * 7523 / 10000.

    p = 165 - dis.

    write / P.

    Regards

    anji

    Add comment
    10|10000 characters needed characters exceeded

  • author's profile photo
    Former Member
    Posted on Sep 28, 2007 at 12:49 PM

    Hello Vind,

    Check this:

    REPORT ZV_TEST_SDN .
    
    PARAMETERS: INPUT TYPE P DECIMALS 2,
                DISCOUNT TYPE P DECIMALS 2.
    
    DATA: OUTPUT TYPE P DECIMALS 2,
          INPUT1 LIKE OUTPUT.
    INPUT1 = INPUT / 100.
    DISCOUNT = DISCOUNT * INPUT1.
    OUTPUT =  INPUT - DISCOUNT.
    WRITE OUTPUT.
    

    Cheers,

    Vasanth

    Add comment
    10|10000 characters needed characters exceeded