cancel
Showing results for 
Search instead for 
Did you mean: 

Script. Fixed variable with a value...

Former Member
0 Kudos

Hi,

a simple problem... But can't find the correct syntax..

I need a variable in the beginning my script defining my offset (tmvl) value.

Right now my offset is "19", and I have to correct the value "19" multiple placed in my script.

*rec(......., TIME=TMVL(19, 2xxx.xxx)

Instead i want something like

*rec(......., TIME=TMVL(%OFFSET%, 2xxx.xxx)

I tried multiple syntaxs in the beginning of the script, like

%OFFSET% = 19

None works..

So how do i define a  variable in BPC with a userdefined value ?

Thank you,

jdalby

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor

The simplest way:-)

*XDIM_MEMBERSET ANYDIMENSIONNAME AS %OFFSET% = 19

It looks like BPC don't check the dimension in this statement and simply asigns the value to the variable. The scope of the dimension is not changed.

Former Member
0 Kudos

Hi Vadim,

works like a charm...

Thank you,

jdalby

former_member186338
Active Contributor
0 Kudos

Instead of real dimension name you can use any combination of characters!

former_member200327
Active Contributor
0 Kudos

I'd think that even easier would be to put

*FOR %VAR% = 19

at the beginning of your script and

*NEXT

at the end.

Answers (3)

Answers (3)

former_member186338
Active Contributor
0 Kudos

Another option is to use modified RUNLOGIC BADI described in my post http://scn.sap.com/message/13186255#13186255

This version of RUNLOGIC allow you to use the following code in scripts:

First script will define the variable:

*START_BADI RUNLOGIC

WRITE=ON

QUERY=OFF

LOGIC=CALLINGSCRIPT.LGF

APP=SOMEAPP

DIMENSION SOMEDIM1=MEMBER1

DIMENSION SOMEDIM2 = MEMBER2

VARIABLE OFFSET=19

DEBUG=OFF

*END_BADI

Second script CALLINGSCRIPT.LGF will get the $OFFSET$ variable from the first script

...
*rec(......., TIME=TMVL($OFFSET$, 2xxx.xxx)
...
Former Member
0 Kudos

Hi,

Please look at the below link from help.sap:

http://help.sap.com/saphelp_bpc75_nw/helpdata/en/59/f145f708724b9c86d8a65dd57d5e4f/content.htm

You need to use the Prompt statement to capture the offset value from the user. And then pass this value to your script using the task statement with the REPLACEPARAM option.

Hope this helps.

Former Member
0 Kudos

Hi,

thank you, I i know how to pass a parameter value from DM, this works fine, but is it not possible to simply add it directly in the beginnning of the script ?

I can ofcourse cheat an add the value "19" as a dimensionmember, and then do a *select.. but this seems a bit to much of a workaround. 🙂

regards

jorgen

former_member186338
Active Contributor
0 Kudos

If you run the script by DM, you can use DM variable and assign the value of this variable using "info" in DM script.

DM Script

INFO(%EQU%,=)

INFO(%OFFS%,19)

TASK(/CPMB/DEFAULT_LOGIC,REPLACEPARAM,OFFSET%EQU%%OFFS%)

Script:

*rec(......., TIME=TMVL($OFFSET$, 2xxx.xxx)

Message was edited by: Vadim Kalinin