cancel
Showing results for 
Search instead for 
Did you mean: 

Script logic Select

Former Member
0 Kudos

Hello Script Experts,

can you please tell me what this script code is doing....I am new to script so I am not able to understand it.

We are having a model SALES_TARG and in that this script is written. It would be kind help if you can mention the usage of each keyword in this ...

*SELECT(%SAL%,"ID",TIME,"[LOCAL1] = 'M'")

*SELECT(%LINE%,"ID",LOB,"[LOCAL2] = 'K'")

*XDIM_PACKAGEBY TIME = 5

*XDIM_MEMBERSET ACCOUNT = BAS(STAT_EARNPATT)

*XDIM_MEMBERSET MATSEG = NACUS//BAS(MATSEG_TOTAL)//P_IsP

*XDIM_MEMBERSET CLIENTSEG = NACLS// BAS(CLIENTSEG_TOTAL)

*XDIM_MEMBERSET PARTNER = NAPAR

*LOOKUP SALES_TARG

*DIM TIME = %TIME_SET%

*DIM TIME_MAPPING = NA_TIME

*FOR %x% = 2,3,4,5,6,7,8,9,10,11,12,13,14

*DIM STAT_EARN_PATT_%x%:SALE_MAPPING = STAT_SAL_01

*DIM STAT_EARN_PATT_%x%:MATSEG = NACUS

*DIM STAT_EARN_PATT_%x%:CLIENTSEG = NACLS

*DIM STAT_EARN_PATT_%x%:ACCOUNT = STAT_EARNPATT_%x%

*NEXT

*ENDLOOKUP

*WHEN ACCOUNT

*IS STAT_EARNPATT_01,STAT_EARNPATT_02

*REC(FACTOR = 1,ACCOUNT = STAT_EARNPATT_3, SALES_MAPPING = STAT_SAL_01,TIME = TMVL(0,%TIME_SET%))

*IS STAT_EARNPATT_01,STAT_EARNPATT_02,STAT_EARNPATT_03

*REC(FACTOR = 1,ACCOUNT = STAT_EARNPATT_4, SALES_MAPPING = STAT_SAL_01,TIME = TMVL(0,%TIME_SET%))

.......another 10 lines like above...

*ENDWHEN

*COMMIT

Thank you

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

Hi,

First of all, please read official help about script logic keywords.

Second: you have to understand the business purpose of this script - talk with business.

Third: there are some strange things in this code - the LOOKUP is not used in REC, TMVL(0,%TIME_SET%) is the same as simply %TIME_SET%, useless COMMIT is at the end...

Vadim

Former Member
0 Kudos

Hi Vadim,

Thanks for your reply.

I am going through the script logic keywords but somehow I was not able to understand them in the context of above logic .

As I am not able to contact the business and the developers in this case so there is no much help for me. Only thing I can do now is to get help from SDN experts.

could you please throw more light on the third point.

Thank you.

former_member186338
Active Contributor
0 Kudos

In general it's not possible to understand the logic looking only on script! You need to analyze all dimensions structure, data in the cube and script parameters set by user...

This script contains few keywords, just ask specific questions!

1. LOOKUP is defined:

*LOOKUP SALES_TARG

...

*ENDLOOKUP

But I don't see the LOOKUP(STAT_EARN_PATT_x) in the REC(EXPRESSION=... code

2. TMVL(0,%TIME_SET% - read help about TMVL

3. COMMIT is useless with WHEN/ENDWHEN for BPC NW - doing nothing but scope reset!

Also, before analyzing complex scripts - train yourself writing simple!

Vadim

Answers (2)

Answers (2)

former_member222556
Contributor
0 Kudos

Hi,

Please go through BPC NW script logic primer document.

http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/e025fa8d-1c22-2e10-cd9f-c488c7eea...

Thanks

Obaid

former_member186338
Active Contributor
0 Kudos

Unfortunately this document doesn't contain recent changes in script logic and looks like compiled official help on logic keywords. It also contain error about COMMIT on page 17 - COMMIT is not used to write data after WHEN/ENDWHEN loop.

former_member200327
Active Contributor
0 Kudos

*SELECT(%SAL%,"ID",TIME,"[LOCAL1] = 'M'") populates variable %SAL% with members from Dimension Time.

*SELECT(%LINE%,"ID",LOB,"[LOCAL2] = 'K'") populates variable %LINE% with members from Dimension LOB.

Problem is that those variables aren't used in the script and hence lost after you finish running it.