cancel
Showing results for 
Search instead for 
Did you mean: 

Condition value formula: How to copy rate?

Former Member
0 Kudos

Hello,

The abaper in our team has written a condition formula for calculating condition value of condition type based on some rules of subtotals.

The condition value (kwert) is coming correctly , but the condition rate (kbetr) is showing as Zero.

So kindly advice how we can copy condition rate also ?

Thanks and rgds,

Anand

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

thanks.

Former Member
0 Kudos

Hi,

LIke wise condition value, condition rate can also be fetched. But before this remember this that you cannot fetch it from KONV table since it will not be in direct responce with the document value, since your document will not be saved.

If you want the rate to be fetched from the condition master record you need to fetch it from access sequence table, & then from KONP.

The code below may help you:

DATA : xkwert1 LIKE komv-kwert,

xworkh LIKE komv-kbetr.

DATA : L_KBETR TYPE KBETR,

L_RATE TYPE KBETR,

l_knumh like a057-knumh.

DATA xkomv TYPE STANDARD TABLE OF komv_index

WITH HEADER LINE INITIAL SIZE 50.

select single knumh from a507 into l_knumh

where ( auart_sd eq komk-auart

or auart_sd eq komk-fkart )

and vkorg eq komk-vkorg

and kunnr eq komk-kunnr

and kondm eq komp-kondm

and kschl eq 'ZDS3'

and datab le sy-datum

and datbi ge sy-datum.

select single kbetr FROM KONP into l_kbetr where KNUMH EQ L_KNUMH

AND kschl = 'ZDS3'.

L_RATE = ABS( L_KBETR ) / 10 + 10000 .

XKWERT1 = ( komp-KZWI3 * 10000 ) / ( L_RATE ).

XKWERT = xkwert1.

xkomv-kwert = xkwert.

*} INSERT

ENDFORM.

Hope this helps you.

Regards,

Dhananjay

Former Member
0 Kudos

I think he might have missed out on writing the code for condition rate. You should include code to divide the condition value by item quantity to arrive at condition rate.

Regards,

GSL.