cancel
Showing results for 
Search instead for 
Did you mean: 

Script Logic - Scoping Statement Challenge

former_member345621
Discoverer
0 Kudos

Dear Friends,

I have a requirement where I need to write a script logic to calculate the net of all Balance Sheet accounts which are under a Hierarchy node (say: BALANCESHEET) and post the reversal to another Account (say: 9999999) which is also located under the hierarchy node: BALANCESHEET

Now the tricky bit is to exlcude the posting account (9999999) when I am reading the Accounts under the hierarchy node: BALANCESHEET.

Anyone knows how to do it ?

Below is my code which only works when the Account: 9999999 is located outside of the hier node: BALANCESHEET

     *XDIM_MEMBERSET ACCOUNT = BAS(BALANCESHEET)
     *XDIM_MEMBERSET TIME = 2014.APR

     *WHEN TIME
     *IS 2014.APR
     *REC(FACTOR = -1, ACCOUNT=9999999)
     *ENDWHEN

The scoping statement I wish that would work is:

     *XDIM_MEMBERSET ACCOUNT = BAS(BALANCESHEET), BUT EXCLUDE 9999999

Appreciate any response on this.

Thanks,

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Try this:

*XDIM_MEMBERSET ACCOUNT AS %ACCT% = BAS(BALANCESHEET)

*SELECT(%ACC%,"[ID]",ACCOUNT,"[ID]=%ACCT% AND [ID]<>9999999"

*XDIM_MEMBERSET ACCOUNT = %ACC% // scope will be without 9999999!

*WHEN ....

But please, read:

BPC version?, SP?

Vadim

former_member345621
Discoverer
0 Kudos

Hi Vadim,

I was hoping you would respond.

Your code worked like a charm!!

I never know until now that we could use the below statement prior to *SELECT statement and use that variable within succeeding *SELECT statement.

*XDIM_MEMBERSET ACCOUNT AS %ACCT% = BAS(BALANCESHEET)

Because before I tried below with no luck but never knew about above statement.

*SELECT(%ALLBSEXIMBAL%,"[ID]",GL_ACCOUNT,"[ID]=BAS(CBS) AND [ID]<>2199999")

Even the SAP Help doesn't have the above syntax in their documentation, how did you know about it??

You are a genius.

Thanks very much for helping out

Cheers!

former_member186338
Active Contributor
0 Kudos

If you search forum you can find another 2 discussions with the same my code

For years SAP do not explain the syntax like:

*XDIM_MEMBERSET SOMEDIM AS %SOMEVAR% = SOMEMEMBERS

You can find some info about it only in some notes.

By the way, this statement doesn't change scope, only assign variable some value.

B.R. Vadim

Answers (0)