Skip to Content
author's profile photo Former Member
Former Member

Script. Fixed variable with a value...

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

Add a comment
10|10000 characters needed characters exceeded

Related questions

4 Answers

  • Best Answer
    Posted on Apr 25, 2012 at 08:55 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Apr 25, 2012 at 08:19 AM

    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

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Apr 25, 2012 at 08:29 AM

    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.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      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

  • Posted on Apr 25, 2012 at 08:48 AM

    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)
    ...
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.