cancel
Showing results for 
Search instead for 
Did you mean: 

How to Derive the Duration in Years between 2 dates in SAP Subscription Billing?

ankitb16
Newcomer
0 Kudos
127

Hi,

I am trying to understand the Duration Calculation component and need assistance with deriving the number of years between two dates.

ankitb16_0-1740573979149.png

 

ankitb16_2-1740574027795.png

I have configured the system as follows:

  • I am using the Computed Property "Years" as an input to the table. The table data is maintained according to the screenshot below.

    ankitb16_3-1740574113962.png

     

  • The fields are mapped in "Calculate Price Element" as indicated in the configuration details below.

ankitb16_4-1740574142798.png

 

When creating a subscription, I have set the subscription start date to 01.01.2024, but I am receiving a value of 0 in the pricing calculation.

ankitb16_5-1740574215128.png

 

Could you please help me understand why this is happening and how I can resolve it?

Thank you for your support.

Best regards,
Ankit

View Entire Topic
CarstenJ
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Ankit, 
that is an interesting use case. 
However, it is not fully clear what you want to achieve. If the target is to pick a price condition dependant on the year of a contract, then this is a valid approach. However, there are two observations:

First: the rounding rule of the duration component is defined as 'Round Down'. This means, that if the duration of the subscription start date to the billing cycle start date is below 1 year, then it is rounded down to 0.
So the result is Years = 0 years.
If you expected to get 1 year, then you would need to change it to Round Up.

Second: The years is also used as scale value and quantity. So in your example, you finally calculate the price for a quantity of 0 years, which is very likely 0 INR.
To me it looks like this is redundant. 
With the table lookup the quantity range already considers the calculated Years to identify the price condition.
Then probably you need to use the standard field 'quantity' in the Calculate statement.

Cheers,
Carsten