Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Script Logic is not behaving as expected

I've written the script shown below and I can't figure out why I can use "GET" to retrieve temporary Revenue records that I'm creating but not the temporary Visit records. I need to retrieve 6 months of actual Revenue and Visits (a statistic), then multiply Budget Visits by actual revenue / actual visits. There are some differences in the datasrc, account, entity and category dimensions among the three types of recods, but I think I've accomodated them. I'm hoping that another set of eyes will see somthing obvious - any help would be greatly appreciated.

Thanks,

Tom

//$$ HERE'S THE CONTENTS OF A FILE THAT CONTAINS CONSTANTS

/////////// BEGIN ConstGrossRev.lgf ///////////////////////////////////////////////////////////////////////

// CONSTANTS FOR USE IN BUDGET GROSS REVENUE AND ALLOWANCES CALCULATIONS

// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

// @@@@@@@ EDIT THE FOLLOWING LINES ONLY WHEN NEW BUDGET YEAR BEGINS @@@@@@@

// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

// Budget Year

*FUNCTION varBUDYR=2009

// Current Year

*FUNCTION varCURYR=2008

// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

// @@@@@@@@ EDIT THE ABOVE LINES ONLY WHEN NEW BUDGET YEAR BEGINS @@@@@@@@

// @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

// Current Year Months for Average Charge Calculation

// FIRST 6 MONTHS

*FUNCTION varCURMOS=varCURYR.JAN,varCURYR.FEB,varCURYR.MAR,varCURYR.APR,varCURYR.MAY,varCURYR.JUN

/////////// END ConstGrossRev.lgf ///////////////////////////////////////////////////////////////////////

//$$ THE CODE....

/////////// BEGIN CreateGrossRev.lgf ///////////////////////////////////////////////////////////////////////

// Budget Gross Revenue = Act 6 mos Gross / Act 6 mos Visits * Bud Visits

// ie. 2009 Bud Gross Rev = 2008 Act 6 Mos Gross / 2008 Act 6 mos Visits * 2009 Bud Visits

// Include the Constants File - This contains a user modifiable value that changes from year to year.

*INCLUDE ConstGrossRev.LGF

// SCOPE FOR ALL VISIT ACCOUNTS AND GROSS CHARGES, ACTUAL AND BUDGET

*MEMBERSET(%ACCTS%,"Descendants([ACCOUNTFIN].[OPTotalVisits],99,LEAVES)")

*MEMBERSET(%BUDMOS%,"Descendants([TIME].[varBUDYR.TOTAL],99,LEAVES)")

*XDIM_MEMBERSET ACTIONPLAN=<ALL>

*XDIM_MEMBERSET AFFILIATE=<ALL>

*XDIM_MEMBERSET CHARGECODE=<ALL>

*XDIM_MEMBERSET DATASRCFIN=<ALL>

*XDIM_MEMBERSET ENTITY=<ALL>

*XDIM_MEMBERSET PROJECT=<ALL>

*XDIM_MEMBERSET CATEGORY=ACTUAL,BUDGET

*XDIM_MEMBERSET TIME=%BUDMOS%,varCURMOS

*XDIM_MEMBERSET ACCOUNTFIN=%ACCTS%,A_41000,A_41100,A_41150,A_41170,A_41200,A_41300,A_41400,,A_41500,A_41600

*WHEN CATEGORY

*IS "ACTUAL"

*WHEN TIME.YEAR

*IS "varCURYR"

*WHEN ACCOUNTFIN.GRREV_ACCT

*IS <> ""

//$$ NEXT NON-COMMENT LINE RETURNS

//$$ ACCOUNTFIN,ACTIONPLAN,AFFILIATE,CATEGORY,PROJECT,CHARGECODE,DATASRCFIN,ENTITY,TIME,SIGNEDDATA

//$$ A_90700,BASE,NO_AFFILIATE,#TEMP_VIS,NO_PROJECT,ALL_cHARGECODES,PEOPLESOFT,FORES,2009.INP,567.89 (AND ANOTHER 50 VALID RECORDS)

*REC(TIME="varBUDYR.INP",ENTITY=ENTITY.BU,CATEGORY="#temp_VIS")

*ELSE

//$$ NEXT NON-COMMENT LINE RETURNS

//$$ ACCOUNTFIN,ACTIONPLAN,AFFILIATE,CATEGORY,PROJECT,CHARGECODE,DATASRCFIN,ENTITY,TIME,SIGNEDDATA

//$$ A_90700,BASE,NO_AFFILIATE,#TEMP_REV,NO_PROJECT,NO_cHARGECODE,PEOPLESOFT,FORES,2009.INP,234567.89 (AND ANOTHER 15 VALID RECORDS)

*REC(ACCOUNTFIN=ACCOUNTFIN.VIS_ACCT,TIME="varBUDYR.INP",ENTITY=ENTITY.BU,CATEGORY="#temp_REV")

*ENDWHEN

*ENDWHEN

*ENDWHEN

*GO

*WHEN CATEGORY

*IS "BUDGET"

*WHEN TIME.YEAR

*IS "varBUDYR"

*WHEN ACCOUNTFIN.GRREV_ACCT

*IS <> ""

//$$ NEXT NON-COMMENT LINE RETURNS

//$$ ACCOUNTFIN,ACTIONPLAN,AFFILIATE,CATEGORY,PROJECT,CHARGECODE,DATASRCFIN,ENTITY,TIME,SIGNEDDATA

//$$ A_90700,BASE,NO_AFFILIATE,BUDGET,NO_PROJECT,NO_cHARGECODE,PEOPLESOFT,FORES,2009.INP,234567.89 (AND ANOTHER 200 VALID RECORDS)

//$$ THIS RETURNS THE CORRECT RECORDS FROM BEFORE THE "GO"

*REC(EXPRESSION=GET(TIME="varBUDYR.INP",CATEGORY="#temp_REV",ENTITY=ENTITY.BU,DATASRCFIN="PEOPLESOFT",CHARGECODE="NO_CHARGECODE"))

//$$ NEXT NON-COMMENT LINE RETURNS

//$$ ACCOUNTFIN,ACTIONPLAN,AFFILIATE,CATEGORY,PROJECT,CHARGECODE,DATASRCFIN,ENTITY,TIME,SIGNEDDATA

//$$ A_90700,BASE,NO_AFFILIATE,BUDGET,NO_PROJECT,ALL_cHARGECODES,PEOPLESOFT,FORES,2009.INP,0 (AND ANOTHER 50 VALID RECORDS)

//$$ THIS RETURNS RECORDS WITH A VALUE OF ZERO IN ALL CASES!

*REC(EXPRESSION=GET(TIME="varBUDYR.INP",CATEGORY="#temp_vis",ENTITY=ENTITY.BU,DATASRCFIN="PEOPLESOFT"))

*ENDWHEN

*ENDWHEN

*ENDWHEN

*COMMIT

/////////// END ConstGrossRev.lgf ///////////////////////////////////////////////////////////////////////

Former Member
Not what you were looking for? Ask a question