cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

When Else SCRIPT logic in Default.LGF

bhagyesh_ravange
Active Participant
0 Likes
1,207

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

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Likes

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!

Answers (3)

Answers (3)

bhagyesh_ravange
Active Participant
0 Likes

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

former_member186338
Active Contributor
0 Likes

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!

bhagyesh_ravange
Active Participant
0 Likes

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

former_member186338
Active Contributor
0 Likes

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/

former_member186338
Active Contributor
0 Likes

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!

bhagyesh_ravange
Active Participant
0 Likes

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..

former_member186338
Active Contributor
0 Likes

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.

bhagyesh_ravange
Active Participant
0 Likes

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

former_member186338
Active Contributor
0 Likes

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 ???

bhagyesh_ravange
Active Participant
0 Likes

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

bhagyesh_ravange
Active Participant
0 Likes
But this scenario is bit different from earlier one.
former_member186338
Active Contributor
0 Likes

"other way" - I suspect - incorrect way!