Skip to Content
-1

When Else SCRIPT logic in Default.LGF

Feb 28 at 12:44 PM

42

avatar image
Former Member

Hi Expert

My below script logic is in Default.LGF

Further part of my script which I have marked in bold and after *ELSE is not working

*XDIM_MEMBERSET RPTCURRENCY = USD
*XDIM_MEMBERSET MEASURES = YTD
*XDIM_MEMBERSET FLOW = F_ACTIVITY
*XDIM_MEMBERSET DATASRC = DS_LOAD,DS_INPUT
*WHEN DATASRC
*IS DS_INPUT
*WHEN ACCOUNT
*IS USO_15000
*REC(FACTOR = 1,DATASRC = DS_CALC,ACCOUNT = 15000)
*ELSE
*WHEN DATASRC
*IS DS_LOAD
*REC(FACTOR = -1,DATASRC = DS_CALC,ACCOUNT = 15000)

*ENDWHEN
*ENDWHEN
*ENDWHEN
*COMMIT

Current Result

Expected Result

7bvdg.png (8.9 kB)
dhc4k.png (9.1 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

4 Answers

Best Answer
Vadim Kalinin Mar 01 at 04:57 PM
0

Correct script for default.lgf:

*WHEN RPTCURRENCY
*IS USD
*WHEN FLOW
*IS F_ACTIVITY
*WHEN DATASRC
*IS DS_INPUT
*WHEN ACCOUNT
*IS USO_15000
*REC(EXPRESSION = %VALUE% - ([DATASRC].[DS_LOAD],[ACCOUNT].[15000]),DATASRC = DS_CALC,ACCOUNT = 15000)
*ENDWHEN
*ENDWHEN
*ENDWHEN
*ENDWHEN

No scoping with XDIM_MEMBERSET!

No stupid COMMIT at the end!

Share
10 |10000 characters needed characters left characters exceeded
Vadim Kalinin Feb 28 at 03:16 PM
0

Sorry, but you are not accepting correct answers!

And not reading: https://blogs.sap.com/2014/01/31/how-to-ask-questions-about-script-logic-issues/

No reason to answer!

Show 7 Share
10 |10000 characters needed characters left characters exceeded
Former Member

I am marking answer as correct wherever I get that answer as useful.

You can see that many of my question are marked answer, including the answer provided by you..

0

You have 11 questions with only 2 having accepted answers.

Your last question is actually a copy of you previous question: https://answers.sap.com/questions/429995/default-logic-not-working-but-script-working-throu.html

And I have provided a correct answer to this question:

"The correct default.lgf - without any XDIM_MEMBERSET!

..."

No responce from your side.

0
Former Member

There is a difference in both, its not exactly the same.

0

Your error in the script is exactly same in both cases :)

First finalize you previous question. Do you understand my answer on

https://answers.sap.com/questions/429995/default-logic-not-working-but-script-working-throu.html ???

0
Former Member
Vadim Kalinin
But this scenario is bit different from earlier one.
0
Former Member

yes I got that answer. However I was able to do other way round.

0

"other way" - I suspect - incorrect way!

0
avatar image
Former Member Mar 01 at 04:18 PM
0

Hi Vadim,

I have gone through your Script logic blog and got the desired result.


*XDIM_MEMBERSET RPTCURRENCY = USD
*XDIM_MEMBERSET FLOW = F_ACTIVITY
*XDIM_MEMBERSET DATASRC = DS_LOAD,DS_INPUT
*WHEN DATASRC
*IS DS_INPUT
*WHEN ACCOUNT
*IS USO_15000
*REC(EXPRESSION = %VALUE% - ([DATASRC].[DS_LOAD],[ACCOUNT].[15000]),DATASRC = DS_CALC,ACCOUNT = 15000)
*ENDWHEN
*ENDWHEN
*COMMIT

Show 2 Share
10 |10000 characters needed characters left characters exceeded

This is practically a copy of my answer for your previous question! Still slightly incorrect.

If you really read my blog you will see that I don't recommend using XDIM_MEMBERSET in default.lgf!

0
Former Member

I already marked your previous question answer as correct.. :) And this que and previous que is slightly different...

0
Vadim Kalinin Mar 01 at 11:34 AM
0

Please explain calculation logic in WORDS, not using incorrect script or using meaningless tables where the input data is not explained!

Please read again: https://blogs.sap.com/2014/01/31/how-to-ask-questions-about-script-logic-issues/

Share
10 |10000 characters needed characters left characters exceeded