cancel
Showing results for 
Search instead for 
Did you mean: 

Script Logic to dynamically calculate multiple *IS lines in WHEN/ENDWHEN

Former Member
0 Kudos

Hi

*Following is my script logic to calculate depreciation value for the GL 600610 based account dimension member A_RATE, A_QTY and A_DR.

*XDIM_MEMBERSET C_CATEGORY=101

*XDIM_MEMBERSET C_COSTCENTER=CC_1010

*XDIM_MEMBERSET C_ASSET=%C_ASSET_SET%

*XDIM_MEMBERSET CSS_TIME=2015.ANL

*XDIM_MEMBERSET CSS_ACCOUNT=A_RATE

*My condition is based on a property as below and push the data to GL account. 2015.ANL is a base member where the values are stored for A_QTY,A_DR and A_RATE.

*WHEN C_ASSET.CLASS

*IS AC_COMPUTERS

*REC(EXPRESSION=%VALUE%*[C_ACCOUNT].[A_DR]*[C_ACCOUNT].[A_QTY],C_ACCOUNT = 600610)

*ENDWHEN

This logic works fine for only one when condition. I tried with below logic to push the value to other GL based on the property as below

*XDIM_MEMBERSET C_CATEGORY=101

*XDIM_MEMBERSET C_COSTCENTER=CC_1010

*XDIM_MEMBERSET C_ASSET=%C_ASSET_SET%

*XDIM_MEMBERSET CSS_TIME=2015.ANL

*XDIM_MEMBERSET CSS_ACCOUNT=A_RATE

.

*WHEN C_ASSET.CLASS

*IS AC_COMPUTERS

*REC(EXPRESSION=%VALUE%*[C_ACCOUNT].[A_DR]*[C_ACCOUNT].[A_QTY],C_ACCOUNT = 600610)

*IS AC_VEHICLES

*REC(EXPRESSION=%VALUE%*[C_ACCOUNT].[A_DR]*[C_ACCOUNT].[A_QTY],C_ACCOUNT = 600640)

*IS AC_FURNITURES

*REC(EXPRESSION=%VALUE%*[C_ACCOUNT].[A_DR]*[C_ACCOUNT].[A_QTY],C_ACCOUNT = 600620)

*ENDWHEN

When executed this script logic only the first condition is getting executed and the other 2 conditions are ignored. I request the support from experts how to execute correctly for the above requirement.

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member186338
Active Contributor
0 Kudos

And some other strange things:

*XDIM_MEMBERSET CSS_ACCOUNT=A_RATE

and

*REC(EXPRESSION=%VALUE%*[C_ACCOUNT].[A_DR]*[C_ACCOUNT].[A_QTY],C_ACCOUNT = 600610)

CSS_ACCOUNT or C_ACCOUNT?

Former Member
0 Kudos

Hi VK

Regret for those strange things it is C_ACCOUNT only and not CSS_ACCOUNT.

Asset Dimension Master Data C_ASSET with property

Master DataProperty as Asset Class
AC_COMPUTERS_20101AC_COMPUTERS
AC_LAPTOP_20201AC_COMPUTERS
AC_VEHICLES_40401AC_VEHICLES
AC_VEHICLES_40402AC_VEHICLES
AC_FURNITURE_50101AC_FURNITURE
AC_FURNITURE_50102AC_FURNITURE

ACCOUNT DIM MEMBERSACCOUNT DIM MEMBERS
600610 - AC_COMPUTERSA_QTY - ASSET QUANTITY
600620 - AC_FURNITURESA_RATE - ASSET RATE
600640 - AC_VEHICLESA_DR - ASSET DEPRECIATION RATE

Input data is as below for the scoped dimension members, ALL THE BELOW SIGNED DATA IS INPUT FOR TIME DIMENSION MEMBER 2015.ANL WHICH IS A BASE MEMBER

ASSETINPUT FORM A_DRINPUT FORM A_RATE
INPUT FORM A_QTY
AC_COMPUTERS_201010.2550001
AC_LAPTOP_202010.25100002
AC_VEHICLES_404010.12000001
AC_VEHICLES_404020.14000001
AC_FURNITURE_501010.225003
AC_FURNITURE_501020.240001

I have checked for multiple *is statements for other scenarios that works well.

For the above scenarios Depreciation Value to post in BPC.(GL 600610,600620,600640 - based on asset property CLASS) = A_DR*A_RATE*A_QTY

*I would get back to you on UJKT, logs etc.

Thanks

Saravanan

former_member186338
Active Contributor
0 Kudos

I am still thinking that all this script development job is a waste of time. The script will be able to calculate depreciation only for the Assets purchased in January. For the normal depreciation planning you will need a purchase date - and then calculations can be done only in badi!

Vadim

Former Member
0 Kudos

Hi VK

I reviewed the data maintenance and found inconsistency in property maintenance for the asset master after correcting am able to get the desired results.

Anyways for the depreciation as you said need to go for Custom BADI.

former_member186338
Active Contributor
0 Kudos

First of all, please read:

Second: but why do you think that 2 other conditions are not executed? What do you have in %C_ASSET_SET%, what is the CLASS property of each member in %C_ASSET_SET%?

Please provide all required info including data sample, UJKT logs etc...

Vadim

P.S. In general multiple *IS is working absolutely fine