cancel
Showing results for 
Search instead for 
Did you mean: 

Script logic - Capture property for member in scope

0 Kudos

Hello,

In script logic, how do you capture a value stored in a property for a member currently in scope?

Background: I am developing allocation functionality for a client that wants to input into a "summary" customer and have the new number allocated down to its base descendants. I have created dummy customers that represent the summaries, e.g. for CUST1 I have created CUST1.INP.

When the user sends data, CUST1.INP will be in scope, and I need to capture its equivalent summary (CUST1) to allocate to it. In lieu of any method of simply removing the .INP (which I don't think is possible?), I have created a property that will store the summary. I am trying to get the script logic to capture the value of that property.

I have tried various *SELECT and *MEMBERSET functions but can't find anything that will work. For example:

*SELECT(%CUST_MBR%,"CUSTMAP","CUST","ID in %CUST_SET%")

or

*MEMBERSET(%CUST_MBR%,"[CUST].CurrentMember.Properties("CUSTMAP")")

etc.

Thanks,

Steve

Accepted Solutions (0)

Answers (5)

Answers (5)

0 Kudos

I did not find an answer to my original question, but I was able to meet the requirement by reorganizing the Customer member ID's and simplifying the allocation. Thanks again to everyone who replied.

Former Member
0 Kudos

Hi Karthik,

I select only one Category in DM prompt, but the problem is that the logic script gives an error on validating.

I think, it's because SELECT statement is executed on validation time, and Category value arrives when the package is executed.

Is there any other statement like SELECT but executed on execution time?

Thanks in advance,

Albert Mas

Former Member
0 Kudos

Thanks Jason,

Let me know if you find something, I'll do the same.

Does anybody some idea?

Thanks in advance,

Albert Mas

Former Member
0 Kudos

Hi Albert,

If you select only one Category in the DM package prompt, then the Select statement should work fine.

But if you are selecting more than one member in in the Category dimension, then you must use the filter like

"ID in ('%CATEGORY_SET%')".

Your select statement must be like,

*SELECT(%NUM%,"STARTMTH","CATEGORY","ID in ('%CATEGORY_SET%')")

Hope this helps.

Karthik AJ

Former Member
0 Kudos

Hi experts,

I have a problem similar to Steve. I want to capture a property of a member selected by users such as parameter, and I tried to use *SELECT statement like that:

*XDIM_MEMBERSET TIME=%TIME_SET%

*XDIM_MEMBERSET CATEGORY=%CATEGORY_SET%

*XDIM_MEMBERSET MARKETP=%MARKETP_SET%

*SELECT(%NUM%,"STARTMTH","CATEGORY","[ID]='%CATEGORY_SET%'")

This last statement doesn't work, I think because %NUM% variable is calculated on script logic validating time.

I need to user %NUM% in a *RUN ALLOCATION like that:

*RUNALLOCATION

*FACTOR=USING

*DIM TIME

WHAT=%YEAR%.INPUT;

WHERE=[MONTHNUM]>=%NUM%;

USING=<<<;

*ENDALLOCATION

*COMMIT

Any idea?

Thanks in advance,

Albert Mas

Former Member
0 Kudos

Hi Albert,

Your *SELECT doesn't work because you can't pass a variable to the ID argument, only a static member - I had this same problem, unless I am writing something incorrectly...

I'm still trying to find a way around this, will let you know If I find something useful.

Cheers,

Jason

former_member599120
Contributor
0 Kudos

Dear Steve Conatser,

I think you need FLD function to capture your properties value. I assume your script correct, you could change your code base on my example such as:

 


*REC(EXPRESSION=%VALUE% * FLD(PRODUCT.CONVERSIONVALUE), CONTAVENDAS="VOLUMECONVERTED")

Kind Regards,

Wandi Sutandi

0 Kudos

Wandi,

Thank you for the reply. I am trying to capture the property value so that I can use it in an allocation script, as in:

*RUNALLOCATION

*FACTOR=USING/TOTAL

*DIM CUST WHAT=%CUST_SET%; WHERE=BAS(???); USING=<<<; TOTAL=<<<;

*ENDALLOCATION

*COMMIT

...where the ??? is the value of the CUSTMAP property for the member stored in %CUST_SET%.

Do you know how I can use the FLD function outside of a *REC statement to capture and store the value in the property so that I can use it in the allocation script? I could not find any documentation on the FLD function and could not find a way to get it to work for my purposes.

Thanks again for your assistance.

Steve

Former Member
0 Kudos

Hi Steve,

You can try to use a select statement to fetch the required property from the dimension for the ID = %CUST_SET%. Store this in a variable and you can use this variable in your allocation logic.

You can refer to the *SELECT statement in the help.sap for more information:

http://help.sap.com/saphelp_bpc75/helpdata/en/12/bddcd3f6ba42f1aeb0b500fca1b876/content.htm

Hope this helps.

Former Member
0 Kudos

Steve,

I've used this in the past:

*RUNALLOCATION

*FACTOR=USING/TOTAL

*DIM ACCOUNT USING=RETAIL001; TOTAL=<<<;

*DIM CCPC WHAT=AQM_R5_NM_RETAIL; WHERE=[GROUP]="8884000"; USING=<<<; TOTAL=<<<

*DIM DATASRC WHAT=INPUT; WHERE=F1_ALLOC_RETAIL_REG; USING=F1_ALLOC_RETAIL; TOTAL=<<<;

*DIM TIME WHAT=[COST_ASSIGN]="ACTUAL"; WHERE=<<<; USING=<<<; TOTAL=<<<;

*ENDALLOCATION

You can see on the 4th line of the allocation logic, I'm using [group]="8884000". Group is a property in the dimension, and 8884000 is the value in the property. I'd imagine if you were able to add a property to the lower level members, you could use the same logic.

I hope this helps.

-Dan

Edited by: Dan Frost on Dec 16, 2010 11:37 AM

0 Kudos

Dan,

Thank you for the reply. In my case, I can not hardcode the value of the property. This script can run with different Customer members in scope, and I need to grab the value of the property for whatever Customer is in scope at any given time and then use that value in an allocation, so I think my requirement is a little different.

Thanks again,

Steve