Skip to Content
avatar image
-1
Former Member

When Else SCRIPT logic in Default.LGF

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Mar 01 at 04:57 PM

    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!

    Add comment
    10|10000 characters needed characters exceeded

  • Feb 28 at 03:16 PM

    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!

    Add comment
    10|10000 characters needed characters exceeded

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

    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

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

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

  • Mar 01 at 11:34 AM

    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/

    Add comment
    10|10000 characters needed characters exceeded