08-16-2009 6:27 PM
Hi,
I have a pricing codition and a discount condition is applied on it. If you look in billing document the discount is shown as 8.000 and unit as % . But where as this value is stored in KONV table as 80.00(KBETR). So the same value is being retrieved in my coding, and if try to calculate the percentage getting wrong value. How to get the correct value in my print program? In this case it should be 8.000 not 80.00. How to convert this 80.00(KBETR) to the correct value 8.000 in my code for calculating correct discount vlaue?
Your help is appreciated.
Thank you,
Surya.
08-16-2009 7:07 PM
Hi Surya,
I faced a similar issue while i was creating a Invoice smartform in which i had to calculate discount on each line item in VBRP table.
following is the solution----->>
all the percentage values stored in KONV and KONP table in KBETR field have to be divided by 10 to get the exact percentage value,so u r doing correct take the KBETR value i.e 80.00 and divide by 10 so it will become 8, all % values in KONV-KBETR Field have to be divided by 10 in order to get exact % value.
Example---->>>
CLEAR WA_KONV.
READ TABLE T_KONV INTO WA_KONV WITH KEY KNUMV = WA_VBRK-KNUMV
KSCHL = 'ZCSV'
KPOSN = WA_VBRP-POSNR.
IF SY-SUBRC = 0.
WA_FINAL-ZCSV = WA_KONV-KBETR / 10. " percentage value of zcsv divided by 10.
ENDIF.
here, i had earlier filled T_KONV table with values from KONV table,
now when i am reading the 'ZCSV' Condition which in in % ,
see the above code we are dividing the KBETR value from KONV table for condition 'ZCSV' as its a % amount.
Hope this resolves ur issue,
Regards,
Akash Rana
Edited by: AKASH RANA on Aug 16, 2009 8:20 PM
08-16-2009 7:07 PM
Hi Surya,
I faced a similar issue while i was creating a Invoice smartform in which i had to calculate discount on each line item in VBRP table.
following is the solution----->>
all the percentage values stored in KONV and KONP table in KBETR field have to be divided by 10 to get the exact percentage value,so u r doing correct take the KBETR value i.e 80.00 and divide by 10 so it will become 8, all % values in KONV-KBETR Field have to be divided by 10 in order to get exact % value.
Example---->>>
CLEAR WA_KONV.
READ TABLE T_KONV INTO WA_KONV WITH KEY KNUMV = WA_VBRK-KNUMV
KSCHL = 'ZCSV'
KPOSN = WA_VBRP-POSNR.
IF SY-SUBRC = 0.
WA_FINAL-ZCSV = WA_KONV-KBETR / 10. " percentage value of zcsv divided by 10.
ENDIF.
here, i had earlier filled T_KONV table with values from KONV table,
now when i am reading the 'ZCSV' Condition which in in % ,
see the above code we are dividing the KBETR value from KONV table for condition 'ZCSV' as its a % amount.
Hope this resolves ur issue,
Regards,
Akash Rana
Edited by: AKASH RANA on Aug 16, 2009 8:20 PM
08-16-2009 8:35 PM