How to read variable in CMOD code !

Experts,
in my one of the query, there is a variable, which takes 2 dates. so the variable is type "interval"
so, when you run the report, user needs to enter value something like this.."mm/dd/yyyy  - mm/dd/yyyy"
Now, i have writtn a code in CMOD, by reading this variable.
But i dont know how to read 2nd date from the variable.
READ TABLE   i_t_var_range
             WITH KEY   vnam = 'VARIABLE'
             INTO       l_var_range.
          First Date = l_var_range-low.
          Second Date = l_var_range-high.
Does this low and high thing is correct?
if i do debug, i could see the low values. but i coud see the same low values in High too.
whats the problem ?
please help

Hi ,
There are some scenarios for using CMOD, for variables in report.
And as per I understand for you issue, please find my comments
Scenario : You want to use the values enter by user in some other variable in the same report.
Please make sure that properties of both the variables are same.
Use below code:
DATA: l_s_range TYPE rsr_s_rangesid.
DATA: loc_var_range LIKE rrrangeexit.
   WHEN 'New Variale'.
        IF i_step = 2.
          LOOP AT i_t_var_range INTO loc_var_range
                  WHERE vnam = 'Varaible in which user has entered value'.
            CLEAR l_s_range.
            l_s_range-low  =   loc_var_range-low  .
            l_s_range-high =   loc_var_range-high .
            APPEND l_s_range TO e_t_range.
          ENDLOOP.
        ENDIF.
Thanks
Mayank
Edited by: Mayank Chauhan on Feb 8, 2011 11:45 AM
Edited by: Mayank Chauhan on Feb 8, 2011 11:46 AM
Edited by: Mayank Chauhan on Feb 8, 2011 11:47 AM

Similar Messages

  • How to Read Variable Values in WAD 7.0 Using JavaScript

    I found a how to: How to Read Variable Values in WAD 7.0 Using JavaScript on SDN.
    I get a Javascript error:
    bics.getElementsByTagName is not a function
    vars = bics.getElementsByTagName("VARIABLES")[0]; // <VARIABLES>
    Thats my script:
    function currency()
    var varnm = "SFS_CP_CURR"; // Name of the variable to be read
    root = document.childNodes[0]; // <HTML>
    body = root.getElementsByTagName("BODY")[0]; // <BODY>
    xml = body.getElementsByTagName("XML")[0]; // <XML>
    bics = xml.childNodes[0]; // <BICS_VIEW>
    vars = bics.getElementsByTagName("VARIABLES")[0]; // <VARIABLES>
    varl = vars.getElementsByTagName("VARIABLE"); // gives no. of variable in DP
    for ( i = 0; i <= varl.length; i++ ) // Loop one by one
    vari = vars.getElementsByTagName("VARIABLE")<i>;
    varnam = vari.attributes[0].text; // get variable name
    mem = vari.getElementsByTagName("MEMBER")[0];
    varval = mem.attributes.getNamedItem("name").value; // read variable value
    if (varnam == varnm) //check varname in loop needs to be read
    if (varval == "ZMON") // check for value1 and fire command1
    SFS_CP_M();
    if (varval == "ZKON") // check for value2 and fire command2
    SFS_CP_K();
    break;
    Where's the mistake?

    I'm afraid I haven't made my question understood clearly.
    What I am looking for is a method to get the value of variable inside excel (e.g. put it into a cell / range of a worksheet, so that we can reference it and use it as an input for planning function execution).
    Please advice.
    Thanks in advance,
    Shady

  • How to read the html source code of a webpage.

    How can I read the html source code of a webpage with a java application?
    Is there a good idea?

    >
    How can I read the html source code of a webpage
    with a java application?
    Is there a good idea?
    I don't know if this is a good idea, but it works.
    1) Use a URL to obtain the document's location
    2) Use a URLConnection to open a connection between your computer and the
    document server
    3) Connect to the server
    4) Get the InputStream of said connection
    5) Associate the Input Stream with a Buffered Input Stream
    At this point you can use a loop to read lines from the BufferedInput Stream and append them to a TextArea or other suitable text component.

  • How to read the Java source code (in Netbeans)

    I use OS X10.5.5, NetBeans 6.1 and JSE 6 on a 64 bit mac.
    When I downloaded NB6.1 it had JSE 5 as it's default (and only) java platform. I ran Software Update to get Java 6 from Apple, used the Java Prefrences utitlity to set JSE6 as default. In NB I added the JDK6 platform, registered the JDK6 javadocs and noticed that I also have the option of registering the Java source code.
    I have three questions:
    1) How do I make JDK6 the default in NetBeans. The JDK5 keeps being default after I did the steps above and I don't see anywhere to change that.
    2) How do I read the Java 6 source code? I can see sun provides [source code| http://download.java.net/jdk6/] for their supported platforms. I dont see Apple doing the same for its JDK port. What would I need to do to get to read the java SE6 sources? or is it actually hiding somewhere in the /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home hierarchy?
    3) Where does the JVM look for the binary code to run when I make a call to, say java.util.ArrayList or any other library. In my naivety I would have assumed it would be a .class file somewhere in the java Home folder, but I don't see anything like it.
    thanks in advance,
    chris

    This is taken from the help included with netbeans. In response to question 1.
    By default, the IDE uses the version of the Java SE platform (JDK) with which the IDE runs as the default Java platform
    for compilation, execution, and debugging. You can view your IDE's JDK version by choosing Help > About and clicking the
    Detail tab. The JDK version is listed in the Java field.
    You can run the IDE with a different JDK version by starting the IDE with the --jdkhome jdk-home-dir switch on the command line
    or in your IDE-HOME/etc/netbeans.conf file. For more information, see IDE Startup Parameters.
    In the IDE, you can register multiple Java platforms and attach Javadoc and source code to each platform. For example, if you
    want to work with the new features introduced in JDK 5.0, you would either run the IDE on JDK 5.0 or register JDK 5.0 as a
    platform and attach the source code and Javadoc to the platform.
    In  , you can switch the target JDK in the Project Properties dialog box. In  , you have to set the target JDK in the Ant script itself,
    then specify the source/binary format in the Project Properties dialog box.
    To register a new Java platform:
    Choose Tools > Java Platforms from the main window.
    Click New Platform and select the directory that contains the Java platform. Java platform directories are marked with a  
    in the file chooser.
    Use the Sources and Javadoc tabs to attach Javadoc documentation and source code for debugging to the platform.
    Click Close.
    To set the default Java platform for a standard project:
    Right-click the project's root node in the Projects window and choose Properties.
    In the Project Properties dialog box, select the Libraries node in the left pane.
    Choose the desired Java platform in the Java Platform combo box.
    Switching the target JDK for a standard project does the following:
    Offers the new target JDK's classes for code completion.
    If available, displays the target JDK's source code and Javadoc documentation.
    Uses the target JDK's executables (javac and java) to compile and execute your application.
    Compiles your source code against the target JDK's libraries.
    If you want to register additional Java platforms with the IDE, you can do so by clicking the Manage Platforms button.
    Then click the Add Platform button and navigate to the desired platform.
    To set the target Java platform for a free-form project:
    In your Ant script, set the target JDK as desired in the javac, java, and javadoc tasks.
    Right-click the project's root node in the Projects window and choose Properties.
    In the Sources panel, set the level of JDK you want your application to be run on in the Source/Binary Format combo box.
    When you access Javadoc or source code for JDK classes, the IDE searches the Java platforms registered in the
    Java Platform Manager for a platform with a matching version number. If no matching platform is found, the IDE's default platform is used instead.
    See Also
    Managing the Classpath
    Declaring the Classpath in a Free-Form Project
    Stepping Through Your Program
    Legal Notices

  • How to read variable file name into ODI

    Hello everyone,
    I apologize in advance if this has already been answered - I've done searches both on Google and this OTN area and have not found an answer to my query.
    I would like to do the following via ODI:
    1) rename a file in a specific directory
    2) process the file
    2) move the file to a backup directory
    3) rename the file again
    The file name is going to change everytime this process runs, as date is appended to it. I could create a variable with a system date in it and concatenate that into the filename before processing it, but I am not sure when they will run the ODI routine. Therefore, I would prefer to play it safe by doing something like a wildcard search in DOS.
    Example:
    Filename = TestFile12072010.csv
    I would like to:
    1) rename TestFile12072010.csv to TestFile.csv
    2) process the file
    3) move the file to another directory
    4) rename the file to TestFile<processdate>.csv
    I was hoping to do the first step using a DOS command that reads in TestFile*.csv. Note: I would expect there to be only 1 file with this naming convention and file extension in the directory.
    I have tried creating a stored procedure that uses the Operating System type, but it runs without stopping. I have also tried ODIFileCopy and OS Command. Obviously, I am doing something wrong since I am getting errors.
    Any guidance would be much appreciated! :)
    Thanks!
    -OS

    Issue was due to a syntax error. Case closed.
    Thanks!
    -OS

  • How to use same CMOD code for 2 Diff. variableS?

    Experts,
    I have written some code under CMOD. Now, i have another query which i could use the same CODE, but diff. variable
    ( In the CMOD code, i am passing one User input variable ). For the 2nd query i have to pass different User Input variable.
    How OR what should i wright to tell CMOD, that IF its Query # 1 then use ABC variable and if Query # 2 then use XYZ .
    thanx

    Dear Hon Bon,
    Let us have a small example on ur scenario.
    Lets take the requirement as to calculate Month from Date. (In both the queries).
    Query 1: Input variable for Date is say  'ZDATE1'.
    Query 2: Input variable for Date is say  'ZDATE2'.
    Now let the CMOD variable be ZVAR_CALMONTH.
    when 'ZVAR_CALMONTH'.
        clear: lwa_var_rng,
               lwa_range.
        loop at i_t_var_range into lwa_var_rng where vnam = 'ZDATE1' or vnam = 'ZDATE2'.
          concatenate lwa_var_rng-low+0(4)
                      lwa_var_rng-low+4(2)
                 into lwa_range-low.
          lwa_range-sign = 'I'.
          lwa_range-opt  = 'EQ'.
          append lwa_range to e_t_range.
          clear lwa_range.
        endloop.
    Now when you execute the Query1,  the above code will work for 'ZDATE1' variable,
    if you execute the Query2,  the above code will work for 'ZDATE2' variable.
    So, the key point is,
    1. You need not worry about which query is getting executed. Whatever the query, the particular user entry variable of that query will be taken care.
    2. This method works only if the cmod variable (ZVAR_CALMONTH) is used in both the queries (Ofcourse its ur requirement).
    3. If queries have both the user entry variables then the cmod will work differently(it ll get data from both the user variables).
    You shall try ur code in the above example by replacing the code and the variable names and try playing around it.
    Hope this helps.
    Regards,
    Guru

  • How to read a variable within a VC code.  I am using BADI based VC code.

    How to read a variable within a VC code.  I am using BADI based VC code.
    Lets say I have a variable for a fiscal period that holds cumulative month.
    If user enters 03/2014 in that variable, it will have month starting from Jan till March.
    Within VC code I would like to read the last month which is
    03/2014 and based on this month I would like to do some calculation on all the records using the last month.
    Since VC code runs for one record at a time and there is no way I can store this value.
    Is there a way to go about it....any suggestions would be of great help.
    Thanks.

    Any suggestions would be highly appreciated.
    Thanks!

  • Unable to debug/correct the CMOD code for a variable used in a query

    unable to debug/correct the CMOD code for a variable used in a query
    i am using the data in a DSO in a query and using a custom coding variable in that query , but this data not coming in that query ..
    can anyone suggest how to debug that cmod code for the variable?
    code is written in CMOD tocde for the variable.

    belowis the code that i have written for a custom coding for a variable
    *******Start***
    IF i_step = 2.
      CASE i_vnam.
        WHEN 'IC_COMPCD'.
         TYPES:       BEGIN OF gt_itab_DyAuthTable,
                           username  TYPE /bic/afiop_o1200-/BIC/IC_USER,
                           companycode TYPE /bic/afiop_o1200-COMP_CODE,
                      END OF gt_itab_DyAuthTable,
                      BEGIN OF gt_itab_Cocd_all,
                            companycode TYPE /BI0/MCOMP_CODE-COMP_CODE,
                      END OF gt_itab_Cocd_all.
          DATA: gi_itab_DyAuthTable TYPE STANDARD TABLE OF gt_itab_DyAuthTable,
                wa_itab_DyAuthTable TYPE gt_itab_DyAuthTable.
           DATA: gi_itab_Cocd_all TYPE STANDARD TABLE OF gt_itab_Cocd_all,
                wa_itab_Cocd_all TYPE gt_itab_Cocd_all.
          SELECT /BIC/IC_USER
                 COMP_CODE FROM /bic/afiop_o1200
            INTO CORRESPONDING FIELDS OF TABLE gi_itab_DyAuthTable
            WHERE /bic/ic_user = sy-uname.
          LOOP AT gi_itab_DyAuthTable INTO wa_itab_DyAuthTable.
            IF wa_itab_DyAuthTable-companycode EQ '*'
              OR
              wa_itab_DyAuthTable-companycode EQ ' '.
              SELECT COMP_CODE FROM /BI0/MCOMP_CODE
                  INTO CORRESPONDING FIELDS OF TABLE gi_itab_Cocd_all.
              LOOP AT gi_itab_Cocd_all INTO wa_itab_Cocd_all.
                l_s_range-low    = wa_itab_Cocd_all-companycode.
                l_s_range-sign   = 'I'.
                l_s_range-opt    = 'EQ'.
                APPEND l_s_range TO e_t_range.
              ENDLOOP.
          to exit the loop if any one value is */space/all for a user's compcode values
            EXIT.
            ENDIF.
          ENDLOOP.
           if control is here means, the comp codes values didnt have */space
              LOOP AT gi_itab_DyAuthTable INTO wa_itab_DyAuthTable.
                l_s_range-low    = wa_itab_DyAuthTable-companycode.
                l_s_range-sign   = 'I'.
                l_s_range-opt    = 'EQ'.
                APPEND l_s_range TO e_t_range.
              ENDLOOP.
      Endcase.
    Endif.

  • How to access a JAVA Script variable in JSP Code

    How to access a JAVA Script variable in JSP Code. I have been unable todo this.
    Plz Suggest a way.
    Thanks
    Soumya

    try to do this code
    String s=request.getParameter("javascriptvariablename");

  • How to declare variables in standard text  - so10 t.code

    Hello Friends,
             How to declare variables in standard text  - so10 t.code? Your response will be appreciated much.
    Thanks
    Sri

    For Script & Smartform  Text - &VAR&

  • How can we  use java variable in javascript code on JSP page?

    How can we use java variable in javascript code on JSP page?
    Pls help

    Think about it:
    JSP/Java is executed on the Server and produces HTML+JavaScript.
    Then that HTML+JavaScript is transfered to the client. The client now interpretes the HTML+JavaScript.
    Obviously there's no way to access a Java variable directly from JavaScript.
    What you can do, however, is write out some JavaScript that creates a JavaScript variable containing the value of your Java variable.

  • How to read a whole text file into a pl/sql variable?

    Hi, I need to read an entire text file--which actually contains an email message extracted from a content management system-- into a variable in a pl/sql package, so I can insert some information from the database and then send the email. I want to read the whole text file in one shot, not just one line at a time. Shoud I use Utl_File.Get_Raw or is there another more appropriate way to do this?

    how to read a whole text file into a pl/sql variable?
    your_clob_variable := dbms_xslprocessor.read2clob('YOUR_DIRECTORY','YOUR_FILE');
    ....

  • How to Read and Generate XML file from java code.

    hi guys,
    how to read the xml file (Condition :we know only DTD or Shema only).
    How to Generate the new xml file ?(using Shema )
    And one more how directly Generate the xml from DB?
    Pleas with code or any URL

    Using XMLbeans you can generate Java objects from an XSD schema (perhaps DTDs aswell)
    Then you can create an instance of the Document object and ask it to write itself.
    This will create an XML document complient to the schema.
    XMLBeans generates a "type" safe DOM where you can only ever have a structure compilent to you schema.
    matfud

  • How to read the source code

    Hi,
    I want to know how to read the source code of web dynpro java from the source folder i.e. without loading the project in NWDS. Please answer me as soon as possible.
    Thanks & Regards,
    Aniruddha

    Hi,
    If you are using DC's then you can find the .Java files in the path
    <project Name>\_comp\gen_wdp\packages\<Pacjage>\<ComponentName>\..
    In the above path you can find the Java files of the controllers.
    Thanks,
    Raju Bonagiri

  • Code for how to read an integer array from the command prompt...

    hello,
    Could anyone give me the code for how to read an integer array from the command prompt...its very urgent!..

    If you are using a recent version of Java (5 or later) you can use Scanner:
    http://java.sun.com/javase/6/docs/api/java/util/Scanner.html
    That page has some example code on it, too.

Maybe you are looking for

  • How can I export swf that calls a flv to avi?

    I have a Flash movie that uses Actionscript 2.0 to trigger animations.  The swf and flv files are separate though - the flv is called by the swf.  There are cues in the flv that fire Actionscript events.  How can I get the whole thing to export?  I c

  • Freight Charges in Service PO

    Hello All For the Service Po, one main service line is maintained  with 1 (AU) & one Sub Services line is maintain ( Qty u2013 5 Ea ) & freight charges are maintain at item level ( Pricing Procedure) (Freight condition is Header, item & Group Conditi

  • Solaris Express Zone install error with SUNWiiimr and SUNWcnetr

    Hi all, I got these errors when installing a new zone on a Solaris Express 1/08 (5.11) on a x64 box: Installation of these packages generated errors: SUNWiiimr Installation of these packages generated warnings: SUNWcnetr The zone creation log shows:

  • Why does my iphone 4 keep rebooting itself uncontrollably

    i left my iphone 4 in my car in sub zero temperatures for a few hours while skiing and when i came back it started acting all weird and refused to turn on. so thinking it was just cold and needed some time to reheat itself, i wernt home and plugged i

  • Comparing performance of two simple workbooks

    Hello guys, i split one planning query with actual and budget columns into two separate queries (one shows only the actual columns, the other only the budget (entry-ready) columns). Then I created two simple workbooks, one with the large planning que