cancel
Showing results for 
Search instead for 
Did you mean: 

*WHEN/*REC/*ENDWHEN using *WHEN_REF_DATA = MASTER_DATA

maleodillet
Participant
0 Kudos
78

Hi Gurus,

I have a requirement in which I need to set a flag of "1", "2", or zero out data intersections based on a VERSION member selection. However, since there is no records being populated on my scope records are not being saved (at least that's what I believe. Please see below;

*SELECT(%NEXT%,NEXT_VERSION,VERSION,[ID]=%VERSION_SET%) 
*SELECT(%PRIOR%,PRIOR_VERSION,VERSION,[ID]=%VERSION_SET%) 

*XDIM_MEMBERSET VERSION = %VERSION_SET%
*XDIM_MEMBERSET FUND = %FUND_SET% 
*XDIM_MEMBERSET LOGFRAME = BAS(%LOGFRAME_SET%)

*XDIM_MEMBERSET TIME = BAS(TIME.YR)
*XDIM_MEMBERSET CURRENCY = LC 
*XDIM_MEMBERSET AUDIT_TRAIL = VC_FLAG
*XDIM_MEMBERSET COMMITMENT_ITEM = CINR 
*XDIM_MEMBERSET FUNDED_PRGM = FPNR
*XDIM_MEMBERSET GRANT_ID = GMNR
*XDIM_MEMBERSET SP_PROGRAM = SPNR

*WHEN_REF_DATA = TRANS_DATA

*WHEN VERSION
*IS R0_VC1
*REC(EXPRESSION = 1, VERSION = %VERSION_SET%,AUDIT_TRAIL = "VC_FLAG")
*REC(EXPRESSION = 2, VERSION = %NEXT%,AUDIT_TRAIL = "VC_FLAG")

*WHEN VERSION
*IS <> R0_VC1
*REC(FACTOR = 0, VERSION = %PRIOR%,AUDIT_TRAIL = "VC_FLAG")
*REC(EXPRESSION = 1, VERSION = %VERSION_SET%,AUDIT_TRAIL = "VC_FLAG")
*REC(EXPRESSION = 2, VERSION = %NEXT%,AUDIT_TRAIL = "VC_FLAG")

*WHEN VERSION
*IS R5_VC4
*REC(FACTOR = 0, VERSION = %PRIOR%,AUDIT_TRAIL = "VC_FLAG")
*REC(EXPRESSION = 1, VERSION = %VERSION_SET%,AUDIT_TRAIL = "VC_FLAG")

*ENDWHEN
*ENDWHEN
*ENDWHEN
 

UJKT Validates just fine and when Executing the log does not show any records being generated.

Could anybody assist me here? Thanks in advance

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member186338
Active Contributor
0 Kudos

First - incorrect WHEN/ENDWHEN syntax! *WHEN VERSION has to be used only once...

Second - the logic is not clear:

*IS R0_VC1 - OK
...
*IS <> R0_VC1 - OK
...
*IS R5_VC4 - ???? 

May be something like:

*WHEN VERSION
*IS R0_VC1
*REC(EXPRESSION = 1, VERSION = %VERSION_SET%,AUDIT_TRAIL = "VC_FLAG")
*REC(EXPRESSION = 2, VERSION = %NEXT%,AUDIT_TRAIL = "VC_FLAG")

*IS R5_VC4
*REC(FACTOR = 0, VERSION = %PRIOR%,AUDIT_TRAIL = "VC_FLAG")
*REC(EXPRESSION = 1, VERSION = %VERSION_SET%,AUDIT_TRAIL = "VC_FLAG")

*ELSE
*REC(FACTOR = 0, VERSION = %PRIOR%,AUDIT_TRAIL = "VC_FLAG")
*REC(EXPRESSION = 1, VERSION = %VERSION_SET%,AUDIT_TRAIL = "VC_FLAG")
*REC(EXPRESSION = 2, VERSION = %NEXT%,AUDIT_TRAIL = "VC_FLAG")

*ENDWHEN

Please read:

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