How to dynamic for declaration variable?

This is my problems
I will by PLMK-STELLEN data to determine decimals
Example:
IF PLMK-STELLEN = 3
then data: l_amt1 type p decimals 3.
IF PLMK-STELLEN = 2
then data: l_amt1 type p decimals 2.
For this case, how can i do, please help.
Thanks a lot!!

You should use dynamic declaration.
TYPES:
p3 TYPE p DECIMALS 3,
p2 TYPE p DECIMALS 2.
DATA dref TYPE REF TO data.
FIELD-SYMBOLS <l_amt1> TYPE ANY.
IF PLMK-STELLEN = 3
  CREATE DATA dref TYPE p3.
ELSEif IF PLMK-STELLEN = 2.
  CREATE DATA dref TYPE p2.
ENDIF.
ASSIGN dref TO <l_amt1>.
Hope it helps.

Similar Messages

  • How to wait for a variable to be set?

    Hi,
    I need to wait for a variable to be set. I tried this, but it didn't work (IllegalMonitorStateException). How to do it?
    Thanks!
    public class MyClass {
      private Boolean succed = null;
      public static boolean doStuff() {
        MyClass my = new MyClass();
        while (my.succed == null) {
          try {
            my.wait();
          } catch (InterruptedException e) { } // Nothing
        return my.succed.booleanValue();
      // and elsewhere set succed to Boolean.TRUE / FALSE and call notifyAll()
    }

    Try this:
    import java.util.*;
    public class Test {
      private Boolean  flag = null;
      public synchronized boolean waitForFlag() {
        boolean  res;
        while(flag == null) {
          try  { wait(); }  catch(InterruptedException e)  {}
        res  = flag.booleanValue();
        flag = null;
        notifyAll();
        return  res;
      public synchronized void setFlag(boolean  flag) {
        while(this.flag != null) {
          try  { wait(); }  catch(InterruptedException e)  {}
        this.flag = new Boolean(flag);
        notifyAll();
      public static void main(String[] args) {
        final Test  t = new Test();
        new Thread() {
          public void run() {
            System.out.println("1: " + t.waitForFlag());
        }.start();
        new Thread() {
          public void run() {
            System.out.println("2: " + t.waitForFlag());
        }.start();
        try  { Thread.sleep(5000); }  catch(InterruptedException e)  {}
        t.setFlag(true);
        t.setFlag(false);
    }

  • How to check for the variable passed to a function inside a component

    I'm trying to pass a variable to a function inside of a
    component in a conditional statement.
    How to check the existance of this variable inside the
    function so that I can use the right <CFarguments>:
    in aForm.cfm I have:
    <cfinvoke component="#application.cfcroot#.business.Order"
    method="selOrderItems"
    returnvariable="q_OrderItems"
    OrderItemAbbreviation="Min"></cfinvoke>
    <cfset MCompIDs = ValueList(q_OrderItems.OrderItemID)>
    <cfif listFind(MCompIDs,attributes.CompID)>
    <cfset isM = true>
    <cfelse>
    <cfset isM = false>
    </cfif>
    <cfinvoke component="#application.cfcroot#.business.Order"
    method="selOrderItems"
    returnvariable="q_OrderItems"
    OrderItemAbbreviation="SMEnroll"></cfinvoke>
    <cfset SM_CompIDs =
    ValueList(q_OrderItems.OrderItemID)>
    <cfif listFind(SM_CompIDs,attributes.CompID)>
    <cfset isSM = true>
    <cfelse>
    <cfset isSM = false>
    </cfif>
    <CFIF isSM>
    <cfset temppath = frmcreator.buildFrm(isSMFlag=isSM)>
    <CFELSE>
    <cfset temppath = frmcreator.buildFrm(isMFlag=isM)>
    </CFIF>
    On aFormComp.cfc where the function is,
    I checked the existance of isSMFlag this way and I got error
    saying that :
    Context validation error for tag CFARGUMENT.; The tag must be
    nested inside a CFFUNCTION tag.
    How can I properly check the existance of isSMFlag inside the
    function so I can use the right cfarguments?
    <CFFUNCTION NAME="buildFrm" access="public"
    returntype="String" output="No">
    <cfif StructKeyExists(arguments, "isSMFlag")>
    <CFARGUMENT NAME="isSMFlag" REQUIRED="YES"
    TYPE="NUMERIC">
    <cfelse>
    <CFARGUMENT NAME="isMFlag" REQUIRED="YES"
    TYPE="NUMERIC">
    </cfif>
    ........ etc
    </CFFUNCTION>

    <CFFUNCTION NAME="buildFrm" access="public"
    returntype="String"
    output="No">
    <cfif StructKeyExists(arguments, "isSMFlag")>
    <CFARGUMENT NAME="isSMFlag" REQUIRED="YES"
    TYPE="NUMERIC">
    <cfelse>
    <CFARGUMENT NAME="isMFlag" REQUIRED="YES"
    TYPE="NUMERIC">
    </cfif>
    ........ etc
    </CFFUNCTION>
    NOT this way, that is for sure.
    The <cfargument ...> tag is for defining the arguments
    a function
    accepts either optional or not, but they are not required.
    Give this a
    try to see the differences.
    test.cfc
    <cfcomponent>
    <cffunction name="a">
    <cfdump var="#arguments#">
    </cffunction>
    <cffunction name="b">
    <cfargument name="foo">
    <cfargument name="bar">
    <cfdump var="#arguments#>
    </cffunction>
    </cfcomponent>
    test.cfm
    <cfset something = createObject("component","test")>
    <cfoutput>
    #something.a("blue","green")#
    #something.b("blue","green")#
    </cfoutput>
    Not tested or debugged so watch out for typos.

  • Change the description dynamically for formula variable in Bex

    Hi Everyone ,
    I need to change the description of my formula variable that i have created in coulmns.
    My requirement is as follows:
    Depending on the date it must show for next 5 days . So i have created 5 formulas and i need to change the description dynamically.
    22 july 2013
    23 july 2013
    24 july 2013
    25 july 2013
    26 july 2013
    XXX
    XXX
    XX
    XXXX
    XXXX
    Please help me in this.
    Thanks in Advance.
    JC

    Hi,
    Please follow this doc to create text variables to display texts dynamically.
    http://scn.sap.com/docs/DOC-11187
    Regards,
    Suman

  • How to prompt for Prewsentation Variable

    Hi Gurus,
    I wanted to create a flexible, parametric report fro the TOPN function.
    Like this:
    TOPN(EMPLOYEES.SALARY,@{p_var}) where p_var is presentation variable.
    When I create a Dashboard prompt - where i can use presentation variable- the problem is that i can do it for columns only!
    Not for formula.
    When I create a column prompt i can create filter for the value of the formula not for the presentation variable.
    Any tip appreciated.
    Thanks.
    Laszlo

    Easiest explained with an example XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <saw:view xmlns:saw="com.siebel.analytics.web/report/v1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="saw:globalFilterPrompt" rptViewVers="200510010" scope="dashboard">
      <saw:prompt type="columnFilter" formula="42" subjectArea="&quot;LOGIC Accounts&quot;" eOperator="in" eControl="drop" includeReportDefaults="true" includeAllChoices="false" columnID="c0" eValues="sql" sql="SELECT CAST(CASE WHEN 1=0 THEN "F1 Revenue"."1-01  Revenue  (Sum All)" ELSE 10 END AS INTEGER) FROM &quot;Sample Sales&quot; UNION ALL SELECT CAST(CASE WHEN 1=0 THEN "F1 Revenue"."1-01  Revenue  (Sum All)" ELSE 25 END AS INTEGER) FROM &quot;Sample Sales&quot; UNION ALL SELECT CAST(CASE WHEN 1=0 THEN "F1 Revenue"."1-01  Revenue  (Sum All)" ELSE 50 END AS INTEGER) FROM &quot;Sample Sales&quot; UNION ALL SELECT CAST(CASE WHEN 1=0 THEN "F1 Revenue"."1-01  Revenue  (Sum All)" ELSE 100 END AS INTEGER) FROM &quot;Sample Sales&quot;" constrainChoices="false" eDefault="specific" default="10" eSetVariable="web" setVariable="vPromptedTopN">
        <sawx:expr xmlns:sawx="com.siebel.analytics.web/expression/v1" xsi:type="sawx:list" op="in">
          <sawx:expr xsi:type="sawx:sqlExpression">1</sawx:expr>
          <sawx:expr xsi:type="sawx:untypedLiteral">10</sawx:expr>
        </sawx:expr>
        <saw:label>
          <saw:caption>
            <saw:text>Show Top</saw:text>
          </saw:caption>
        </saw:label>
      </saw:prompt>
    </saw:view>Mind you the best approach still is to have a LOV table holding your TopN values and select from there, but the above works immediately w/o any need for physical objects.
    Cheers,
    C.

  • Dynamically Setting a Variable from a Connection String that has been set by a Config File

    Hi Guys
    I'm setting up a Master / Slave (Parent / Child) dtsx environment but I'm unable to work out how to dynamically set a variable in the Master dtsx from a connection string that has had its value set by a config file. I'm sure it's possible.
    Below is the what I'm hoping to achieve. I've set up everything apart from the highlighted section.
    Any ideas?

    First, what version of SQL Server are you using?
    You could switch the problem around.  You could set the value of a variable from the config file, then it is easy to use that variable as the connection string source for your connection manager.  At the same time you can use a parent variable
    configuration to map that variable to variables in your child package.
    Russel Loski, MCT, MCSE Data Platform/Business Intelligence. Twitter: @sqlmovers; blog: www.sqlmovers.com

  • Using action script 2 how can i send a variable value to a dynamic textbox on a different keyframe?

    using action script 2 how can i send a variable value to a dynamic textbox on a different keyframe?

    Thanks for your swift response.
    That sounds like a good solution, but the code I have on frame 2 is this
    timer = 0;
    countup = function(){
    timer++;
    countupInterval = setInterval(countup,100);
    If I added the same actionscript to frame 3 which has a dynamic textbox with a variable timer attached wouldn't it just put the timer back to 0? What I want is the last known value that was given when it was in frame 2.
    I am thinking of temple run here, I am trying to caculate the total distance(set in the timer variable) from the previous try.
    Hope this makes sense.
    Chazwick

  • How to declare variable in the scipt

    data is coming from standard program .
    rf140-stida key entry date.
    bsik-bldat posting date
    i want to display difference between  rf140-stida and bsik-bldat in scipt form it will give number of days.
    how can i declare variables for this.
    how to write code in my form.

    Hi
    U need to create a routine to calculate the difference:
    /: DEFINE &DELTA& = SPACE
    /: PERFORM <FORM NAME> IN PROGRAM <PROGRAN NAME>
    /: USING &RF140-STIDA&
    /: USING &BSIK-BLDAT&
    /: CHANGING &DELTA&
    &DELTA&
    The routine has to be defined in your Z-PROGRAM and to have these interface:
    FORM <FORM NAME>  TABLES IN_TAB_EM     STRUCTURE ITCSY
                                                       OUT_TAB_EM STRUCTURE ITCSY.
      DATA: DELTA TYPE I.
      DATA: DATE1 LIKE SY-DATUM,
                 DATE2 LIKE SY-DATUM.
    * ---> Rembember the date has the ouput format, so it has to be converted in the
    * input format
      READ TABLE  IN_TAB_EM WITH KEY NAME = 'RF140-STIDA'.
      IF SY-SUBRC = 0.
         DATE1(4)     = IN_TAB_EM-VALUE+6(4).
         DATE1+4(2) = IN_TAB_EM-VALUE+3(2).
         DATE1+6(2) = IN_TAB_EM-VALUE(2). 
      ENDIF.
      READ TABLE  IN_TAB_EM WITH KEY NAME = 'BSIK-BLDAT'.
      IF SY-SUBRC = 0.
         DATE2(4)     = IN_TAB_EM-VALUE+6(4).
         DATE2+4(2) = IN_TAB_EM-VALUE+3(2).
         DATE2+6(2) = IN_TAB_EM-VALUE(2). 
      ENDIF.
      DELTA = DATE1 - DATE2.
      READ TABLE  OUT_TAB_EM WITH KEY NAME = 'DELTA'.
      IF SY-SUBRC = 0.
         WRITE DELTA TO OUT_TAB_EM-VALUE.
         MODIFY OUT_TAB_EM INDEX SY-TABIX.
      ENDIF.
    ENDFORM.
    Max

  • How to pass Stages Guid dynamically in declarative workflow

    hello,
    How to pass Stages Guid dynamically in declarative workflow.
    Example For List we used to pass guid like this 
    System.Guid.Parse("{$ListId:Lists/Testlist;}")
    help me out to pass stage guid...
    any help would be appreciated!!!!
    Thanks regards, Vignesh.

    You need to make use of command line arguments. You can go through this link for example.
    http://www.freeos.com/guides/lsst/ch02sec14.html
    In your shell script(say test.sh) you can have
    exp fas/xxxxxx@fasbd001 file=audit_grn_28aug.dmp tables=audit_grn query=\"where org_grp_i=$1 \"$1 indicates it accepts the first argument from command line. if you want to pass 19, add that next to the script you're executing.
    From command line you can call this shell script say test.sh 19

  • How can i implement the default value for this variable?

    In one of our Stored procs,we have a variable RECS_TO_DELETE, which determines the number of records to delete from various DELETEs that happen within this proc.
    The value for RECS_TO_DELETE variable should be obtained from a configuration table sys_config
    select
    rec_num into RECS_TO_DELETE
    from sys_config
    where
    sys_code=55;
    But if something goes wrong with sys_config table or the above SELECT INTO, our client wants to makes sure that RECS_TO_DELETE should have a default value of 1000.
    In the code, how will i implement having this default value of 1000 for RECS_TO_DELETE variable  in case the above SELECT INTO fails for some reason.

    Hi,
    You have to assign a value before the execution...
    DECLARE
        RECS_TO_DELETE NUMBER(9) := 1000;
    BEGIN
        SELECT rec_num
        INTO   RECS_TO_DELETE
        FROM   sys_config
        WHERE  sys_code = 55;
        DBMS_OUTPUT.put_line(RECS_TO_DELETE);
    EXCEPTION
        WHEN NO_DATA_FOUND THEN
           DBMS_OUTPUT.put_line(RECS_TO_DELETE);
    END;
    /Regards,

  • Are there a dynamic way for evaluting variables in as3?

    Hi..!
    eval() is a usefull method or function in javascript.. Because we may define our variables via dynamic way..! There are following code is for understanding that how can define dynamic defining variables in javascript.. And Are there a dynamic way for evaluting variables in as3 like following javascript code?
    <script language="javascript1.2" type="text/javascript">
    var trainOfUfo = "...hi earthling...";
    var handleBlade = eval("train"+"Of" + "Ufo");
    alert(handleBlade);  //-- it appears in dialog box text field area "...hi earthling..."---
    </script>
    Gürkan Şahin
    Code Developer
    Turkey

    In AS3 you can use the bracket notation...
    var trainOfUfo = "...hi earthling...";
    var handleBlade = this["train"+"Of" + "Ufo"];
    AS2 supports the eval() function, but it was done away with in AS3

  • "Dynamic Declaration/Variable"

    Hi,
    first sorry for my bad english :)
    I have a Problem with Forms Builder 6
    I want to know if it possible to set dynamic declarations inside a loop
    loop_i := 1;
    WHILE loop_i < 10 LOOP
    go_item('GERAET' || to_char(loop_i) || '.Beginn'); --Geraet1.Beginn to Geraet10.Beginn... this works without problems
    if (':GERAET'||to_char(loop_i)||'.Beginn') is null then
    :GERAET || to_char(loop_i) || .Beginn := ('01-JAN-1234'); -- here is my problem
    END LOOP;
    My Problem is in this Line :GERAET || to_char(loop_i) || .Beginn :=
    I cant fill fields dynamic like this. Is there any way to fill Geraet1.Beginn to Geraet10.Beginn with this Loop? I dont know the syntax for declarations with " : " and a dynamic variable
    i hope you understand what i mean :)

    Use the Name_In() and Copy() built-ins (see the online doc)
    Francois

  • How to create popup link in OAF dynamically or declaratively.

    Can anybody please help how to create a link as popUp in OAF dynamically or declaratively?

    Step 1: Create an OAPopupBean. For example:
    OAPopupBean popupBean =(OAPopupBean)createWebBean(pageContext,POPUP_BEAN,null,"myPopup");
    //Set the following properties on the pop-up:
    popupBean.setID("myPopup");
    popupBean.setUINodeName("myPopup");
    String popupRegion= "/oracle/apps/fnd/framework/toolbox/labsolutions/webui/TestEmpDetailsRN" ;
    popupBean.setRegion(popupRegion);
    popupBean.setHeight("130");
    popupBean.setWidth("320");
    popupBean.setTitle("Test");
    popupBean.setType(EMBEDDED_POPUP); /* Embedded type */
    Step 2: Select the item (messageStyledText, image, link, or button) on which you want to enable the pop-up, and set the following properties, as shown in this example:
    OATableBean tableBean = (OATableBean)webBean.findChildRecursive("ResultsTable");
    OAImageBean image = (OAImageBean)webBean.findChildRecursive("UpdateImage");
    image.setPopupEnabled(true);
    image.setPopupRenderEvent("onClick");
    image.setPopupID("myPopup");
    Step 3: Add the pop-up as an indexed child of the region that contains the item on which the pop-up is enabled.
    Note: If you are enabling a pop-up on an item within a classic table, advanced table or HGrid, then you must add the pop-up and the item on which it is enabled to a layout and add the layout as the indexed child of the table.
    In this example, the pop-up is enabled on an image within a table, hence the pop-up is added as a second level indexed child of the table:
    OAStackLayoutBean stackLayoutBean = new OAStackLayoutBean();
    stackLayoutBean.addIndexedChild(popupBean);
    tableBean.addIndexedChild(stackLayoutBean);

  • What happens to dynamically declared variables when I'm not using them?

    Hello, I'm making a game using Flash Pro cc. But I wonder what happens to aTile, which is dynamically declared MovieClip variable through a loop. And each aTile gets the 2 EventListener's.
    for(var i:Number=0; i<pVector.length;i++){
        var aTile:ATile=new ATile();
        aTile.x=pVector[i].x;
        aTile.y=pVector[i].y;
        aTile.gotoAndStop(Math.ceil(Math.random()*Color));
        nVector.push(aTile);
        Spr.addChild(aTile);
        aTile.addEventListener(MouseEvent.CLICK,Clicked,false,0,true);
        aTile.addEventListener(Event.COMPLETE, stop,false,0,true);
         // the current function ends here. what happens to aTile now ?? Is it going to be garbage collected? By the way, this piece of code runs whenever a player starts a new level of my game. And I don't make use of the aTile variable in other functions. I use only the nVector variable. And does declaring a dynamic variable in a loop mean a multiple of them are created? For example, if I loop the piece of code above 5 times, does it mean 5 aTile variables are created? Or each time you declare
    var aTile:ATile=new ATile(); again, does it replace the 'old' aTile with the 'new' aTile and therefore only 1 aTile exists after the loop????

    I feel there is a gap in understanding of using variables by reference vs. by value. You should look it up.
    1. new instructs Flash to create a distinct instance that per se has absolutely nothing to do with aTile variable.
    2. REFERENCE to this new instance is assigned to variable aTile. aTile var is a temporary pointer to instance.
    3. It does not replace old tile - it replaces reference.
    4. If reference to the instance is not stored elsewhere - upon exiting of function this instance will be gced.
    5. By creating another reference to the instance you prevent it from GC. One of the ways you preserve instance is by adding it to display list when using addChild.
    You can look at this this way (it is a lame example but still it illustrates parts of the concept)
    Say you have
    1. basket;
    2. basket is small and can hold only one apple;
    3. table;
    4. an apple;
    5. apple can be placed into the basket or table;
    6. dog who love apples.
    7. Dog is trained not to take apples from baskets but table but is free to eat apples that are on the ground.
    So, once apple is in the basket or on the table - it is safe.
    If you move these entities into the realm of AS3, basket and table become declared variables, apple an instance and dog garbage collector.
    What this example demonstrates is that apple exists independently of basket or table. You can put apple to the basket OR on the table OR you can put apple into basket and place basket onto the table.
    1. Find apple instance (if you know whether apple is in the basket, on the table or in the basket on the table)
    2. Prevent dog from eating apple.
    3. Allow dog to eat it (destroy it when garbage collector kicks in) by assuring that apple is in neither basket or on the table.

  • How to use one Bex Variable for two purposes in one query?

    Hi,
    I want to prompt for a UOM in a query. Then I want to use that one UOM variable to do 2 tasks in the query:
    1. Perform a UOM conversion on one restricted key figure (no filtering)
    2. Filter in a second restricted key figure (no conversion)
    How would I use a variable (or two?) to do this? I do not want to have 2 UOM prompts.
    Thanks!
    Gregg

    Oh, it all seems so easy now!  Hindsight 20-20...
    Solution was to create a new input ready variable for Unit.
    1. Restrict the key figures which need restricting using new variable
    2. For conversions, in BI backend us T-code RSUOM and create new conversion type associated with new variable. Then for each key figure needing conversion, set the conversion parameter to use the new conversion type.
    Between both 1 & 2 above, the same variable is used & thus prompted only once.
    Solution works perfectly.... as it should. Hope this helps someone else!

Maybe you are looking for

  • Copying data from a Time Capsule to a different Mac

    After having searched the forums for quite a while and still not finding the correct answer, I decided to share my solution for this very specific scenario: I have a Time Machine backup onto a Time Capsule from a Mac. Let's call it Macintosh A. So, f

  • On my macbook pro i have to hold the alt/option button when starting up...

    otherwise windows xp is the default hardrive that starts.....how to change the default hardrive at start up to be the mac? it's just getting annoying always having to hold the alt/option button at start up

  • Can't figure out how to set a frame width

    Noob questions I suppose....our instructor has us creating a site using only framesets. I realize this isn't the best way to go, but we are leading our way up to CSS. If you look at my navbar, it needs to be 125 to be able to fit my buttons, but I ca

  • Sent emails are not listed on ipad 3rd generation 7.0

    my emails  are not listed in the sent mail list On my ipad 3 rd generation 7.0. Help

  • BO 3.2 and DB SQL Server 2008

    Dear All, We have installed MS SQL server 2008R2 on MS windows 2008R2. Now we are installing BOBJ data service 3.2 on another system with windows XP. While installing we are selecting the option connect to existing database. But after providing conne