Quantcast
Channel: SCN : Discussion List - SAP Planning and Consolidation, version for the Microsoft platform
Viewing all articles
Browse latest Browse all 1545

Make *LOOKUP more dynamic

$
0
0

Hi guys,

 

I've tested this almost to death, so I think I already know the answer, but there are people far cleverer than me on here so I though I'd put it to the group!

 

Before I start, I'd like to point out that I inherited this particular script, so I know it's non-standard (i.e. not best-practice). So here goes:

 

We have a lookup section in our script that builds a list of +/- 300 combinations of exchange rate (e.g. USD,ZAR,GBP) and rate type (OPE,CLO,MOV,ADJ,etc.).

 

So in this simple example the resulting list would look something like this (simplified example):

USD_OPE

USD_CLO

USD_MOV

USD__ADJ

ZAR_OPE

ZAR_CLO

etc.

 

Later, in my *REC statement I want to use the use the values in the lookup, but in a LOOP, so rather than writing:

 

*REC(FACTOR = LOOKUP(<RATE FROM LIST>

 

I want to write:

*REC(FACTOR=LOOKUP(%RateList% - (with the corresponding *FOR/*NEXT, of course)

 

Currently, we have so many variations and connotations, that the resulting script is huge. If I can use looping instead, I can make the script much shorter and easier to manage and maintain.

To make it even more complex, I actually need to concatenate another bit of text to the %RateList% variable, so it would actually look more like:

*REC(FACTOR=LOOKUP(ExtraText_%RateList%

 

Am I trying to do something completely ground-breaking?? I really don't think so, but maybe this is simply not supported.

We are using BPC for MS 7.5 sp7, and SQL Server 2008 R2.

 

Any suggestions welcome, before I start looking at stored procedures instead!

Thanks a lot,

Jason


Viewing all articles
Browse latest Browse all 1545

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>