cancel
Showing results for 
Search instead for 
Did you mean: 

Data action copy with date condition

brahmareddy_kolli
Participant
0 Kudos

Hi ,

The version dimension has two attributes Start_date (202308) and End_Date (202412) and the asset dimension has a disposal month attribute (202410). The disposal month will vary from asset to asset and a few assets might be greater than the end date.

if the disposal month is less than the end date, then tractional data should copy from the previous month to the disposal month only.

if the disposal month is greater than the end date, then transaction data should copy from previous months to the end date.

With Regards,

KBR.

Accepted Solutions (1)

Accepted Solutions (1)

N1kh1l
Active Contributor
0 Kudos

kollibrahma

Thanks for putting up the example. The below code should do the job. I have created the example using Product dimension but you can replace it with your Asset dimension

Version Dimension

Asset Dimension

MEMBERSET [d/CALMONTH] =[d/Version].[p/START_DATE] TO [d/Version].[p/END_DATE]
MEMBERSET [d/MEASURE]="DEPRECIATION"


DELETE()
FOREACH [d/CALMONTH]
	
	IF DATEDIFF([d/CALMONTH],[d/SAP_CEP_PRODUCT].[p/DISPOSAL_DATE],"MONTH")>=0 THEN
		DATA()=RESULTLOOKUP([d/CALMONTH]=PREVIOUS(1,"MONTH",[d/Version].[p/START_DATE]),[d/Version]="public.Actual")
	ENDIF
ENDFOR

Initial Data:

After Depreciation Copy

Asset1 with disposal date 202410, data was copied only till 202410

Asset2 with disposal date 202504, data was copied only till 202412 (202504 > 202412 (version end date)

Hope this helps !!

Please accept/upvote if this helps

Nikhil

Answers (2)

Answers (2)

brahmareddy_kolli
Participant
0 Kudos

Thanks for your reply. Here is the exmaple

N1kh1l
Active Contributor
0 Kudos

kollibrahma

if the disposal month is less than the end date, then tractional data should copy from the previous month to the disposal month only.

if the disposal month is greater than the end date, then transaction data should copy from previous months to the end date.

Which previous month ? Previous is subjective. Could you put up an example. I think I had answered a similar question before on depreciation. Your example will help in answering your query better.

https://answers.sap.com/questions/13784229/how-to-calculate-depreciation-in-sac-when-we-have.html?ch...

Nikhil