Problem passing dynamically created variables

Hi,
I have a procedure in which i am creating an object dynamically and i am using that object in another package . I am calling first the procedure that creating the object and recompiling the package and calling to that package but i want to integrate them and instead of calling them individually want to call a single procedure to achieve the requirement . Here i am giving the details of the procedure and package please guide me ..
CREATE TABLE ip_lov_hdr
(table_id VARCHAR2(50) NOT NULL,
table_name VARCHAR2(30) NOT NULL,
col_name VARCHAR2(30) NOT NULL,
codetype VARCHAR2(2))
PCTFREE 10
INITRANS 1
MAXTRANS 255
ALTER TABLE ip_lov_hdr
ADD CONSTRAINT pk_lov_hdr PRIMARY KEY (table_id)
USING INDEX
PCTFREE 10
INITRANS 2
MAXTRANS 255
CREATE TABLE ip_lov_dtl
(table_id VARCHAR2(50) NOT NULL,
col_name VARCHAR2(30) NOT NULL)
PCTFREE 10
INITRANS 1
MAXTRANS 255
ALTER TABLE ip_lov_dtl
ADD CONSTRAINT pk_lov_dtl PRIMARY KEY (table_id, col_name)
USING INDEX
PCTFREE 10
INITRANS 2
MAXTRANS 255
ALTER TABLE ip_lov_dtl
ADD CONSTRAINT fk_lov_hdr FOREIGN KEY (table_id)
REFERENCES ip_lov_hdr (table_id) ON DELETE SET NULL
CREATE TABLE emp
(ename VARCHAR2(50),
empno VARCHAR2(9),
dept VARCHAR2(4))
PCTFREE 10
INITRANS 1
MAXTRANS 255
CREATE OR REPLACE
TYPE out_rec_lov AS OBJECT(ename VARCHAR2(50),empno VARCHAR2(9))
INSERT INTO emp
(ENAME,EMPNO,DEPT)
VALUES
('titu','111','10')
INSERT INTO emp
(ENAME,EMPNO,DEPT)
VALUES
('naria','222',NULL)
INSERT INTO emp
(ENAME,EMPNO,DEPT)
VALUES
('tiks','123','55')
INSERT INTO emp
(ENAME,EMPNO,DEPT)
VALUES
('tiki','221',NULL)
INSERT INTO emp
(ENAME,EMPNO,DEPT)
VALUES
('narayan',NULL,NULL)
INSERT INTO ip_lov_hdr
(TABLE_ID,TABLE_NAME,COL_NAME,CODETYPE)
VALUES
('emp_id','emp','ename',NULL)
INSERT INTO ip_lov_dtl
(TABLE_ID,COL_NAME)
VALUES
('emp_id','empno')
CREATE OR REPLACE
TYPE out_rec_lov AS OBJECT(ename VARCHAR2(50),empno VARCHAR2(9))
CREATE OR REPLACE
PROCEDURE p_recordtypevariable (tab_id IN VARCHAR2,err_msg OUT VARCHAR2)
   IS
      sqlstmt             VARCHAR2 (2000);
      col_str             VARCHAR2 (2000);
      i                   NUMBER := 0;
      l_table_name        ip_lov_hdr.table_name%TYPE;
      l_col_name          ip_lov_hdr.col_name%TYPE;
      l_codetype          ip_lov_hdr.codetype%TYPE;
      l_datatype          VARCHAR2 (100);
      invalid_tableid     EXCEPTION;
   BEGIN
      BEGIN
         SELECT a.table_name,
                a.codetype,
                a.col_name,
                b.data_type || '(' || b.data_length || ')'
           INTO l_table_name,
                l_codetype,
                l_col_name,
                l_datatype
           FROM ip_lov_hdr a, user_tab_columns b
          WHERE UPPER (a.table_id) = UPPER (tab_id)
            AND UPPER (a.table_name) = UPPER (b.table_name)
            AND UPPER (a.col_name) = UPPER (b.column_name);
      EXCEPTION
         WHEN NO_DATA_FOUND THEN
            RAISE invalid_tableid;
      END;
      col_str := l_col_name || ' ' || l_datatype;
      FOR rec IN  (SELECT b.col_name,
                          c.data_type || '(' || c.data_length || ')' datatype
                     FROM ip_lov_hdr a, ip_lov_dtl b, user_tab_columns c
                    WHERE UPPER (b.table_id) = UPPER (tab_id)
                      AND UPPER (a.table_id) = UPPER (b.table_id)
                      AND UPPER (a.table_name) = UPPER (c.table_name)
                      AND UPPER (b.col_name) = UPPER (c.column_name) )
      LOOP
         col_str := col_str || ',' || rec.col_name || ' ' || rec.datatype;
      END LOOP;
      sqlstmt := 'CREATE OR REPLACE TYPE out_rec_lov AS OBJECT(' || col_str || ')';
      dbms_utility.exec_ddl_statement(sqlstmt);
      dbms_utility.exec_ddl_statement('alter package pkg_lov_new compile');
   EXCEPTION
      WHEN invalid_tableid THEN
         err_msg := 'Table is not defined ';
      WHEN OTHERS THEN
         err_msg := SUBSTR (SQLERRM, 1, 500);
   END p_recordtypevariable;
CREATE OR REPLACE
PACKAGE pkg_lov_new
AS
TYPE listtable IS TABLE OF out_rec_lov index by binary_integer;
PROCEDURE p_getlov (
tab_id IN VARCHAR2,
col_value IN VARCHAR2,
outlist OUT listtable,
err_msg OUT VARCHAR2);
END;
CREATE OR REPLACE
PACKAGE BODY pkg_lov_new
AS
  PROCEDURE p_getlov (
      tab_id                     IN VARCHAR2,
      col_value                  IN VARCHAR2,
      outlist                    OUT listtable,
      err_msg                    OUT VARCHAR2)
   IS
      query_str           VARCHAR2 (2000);
      col_str             VARCHAR2 (2000);
      TYPE cur_typ IS REF CURSOR;
      c                   cur_typ;
      i                   NUMBER := 0;
      l_table_name        ip_lov_hdr.table_name%TYPE;
      l_col_name          ip_lov_hdr.col_name%TYPE;
      l_codetype          ip_lov_hdr.codetype%TYPE;
   BEGIN
      BEGIN
         SELECT table_name,
                codetype,
                col_name
           INTO l_table_name,
                l_codetype,
                l_col_name
           FROM ip_lov_hdr
          WHERE UPPER (table_id) = UPPER (tab_id);
      EXCEPTION
         WHEN NO_DATA_FOUND THEN
            NULL;
      END;
      col_str := l_col_name;
      FOR rec IN  (SELECT col_name
                     FROM ip_lov_dtl
                    WHERE table_id = tab_id)
      LOOP
         col_str := col_str || ',' || rec.col_name;
      END LOOP;
      IF l_codetype IS NULL THEN
         query_str :=    'select out_rec_lov('
                      || col_str
                      || ') from '
                      || l_table_name
                      || ' where '
                      || l_col_name
                      || ' like :col_value';
         BEGIN
            OPEN c FOR query_str USING col_value;
            LOOP
               FETCH c INTO outlist (i);
               i := i + 1;
               EXIT WHEN c%NOTFOUND;
            END LOOP;
            CLOSE c;
         EXCEPTION
            WHEN OTHERS THEN
               err_msg := SUBSTR (SQLERRM, 1, 500);
         END;
      ELSE
         query_str :=    'select out_rec_lov('
                      || col_str
                      || ') from '
                      || l_table_name
                      || ' where code_type =:l_codetype and '
                      || l_col_name
                      || ' like :col_value';
         BEGIN
            OPEN c FOR query_str USING l_codetype, col_value;
            LOOP
               FETCH c INTO outlist (i);
               i := i + 1;
               EXIT WHEN c%NOTFOUND;
            END LOOP;
            CLOSE c;
         EXCEPTION
            WHEN OTHERS THEN
               err_msg := SUBSTR (SQLERRM, 1, 500);
         END;
      END IF;
   EXCEPTION
      WHEN OTHERS THEN
         err_msg := SUBSTR (SQLERRM, 1, 500);
   END p_getlov;
END pkg_lov_new;
/Regards,
Dhabas
Edited by: Dhabas on Dec 30, 2008 5:52 PM

CREATE TABLE ip_lov_hdr
(table_id VARCHAR2(50) NOT NULL,
table_name VARCHAR2(30) NOT NULL,
col_name VARCHAR2(30) NOT NULL,
codetype VARCHAR2(2))
PCTFREE 10
INITRANS 1
MAXTRANS 255
ALTER TABLE ip_lov_hdr
ADD CONSTRAINT pk_lov_hdr PRIMARY KEY (table_id)
USING INDEX
PCTFREE 10
INITRANS 2
MAXTRANS 255
CREATE TABLE ip_lov_dtl
(table_id VARCHAR2(50) NOT NULL,
col_name VARCHAR2(30) NOT NULL)
PCTFREE 10
INITRANS 1
MAXTRANS 255
ALTER TABLE ip_lov_dtl
ADD CONSTRAINT pk_lov_dtl PRIMARY KEY (table_id, col_name)
USING INDEX
PCTFREE 10
INITRANS 2
MAXTRANS 255
ALTER TABLE ip_lov_dtl
ADD CONSTRAINT fk_lov_hdr FOREIGN KEY (table_id)
REFERENCES ip_lov_hdr (table_id) ON DELETE SET NULL
CREATE TABLE emp
(ename VARCHAR2(50),
empno VARCHAR2(9),
dept VARCHAR2(4))
PCTFREE 10
INITRANS 1
MAXTRANS 255
CREATE OR REPLACE
TYPE out_rec_lov AS OBJECT(ename VARCHAR2(50),empno VARCHAR2(9))
INSERT INTO emp
(ENAME,EMPNO,DEPT)
VALUES
('titu','111','10')
INSERT INTO emp
(ENAME,EMPNO,DEPT)
VALUES
('naria','222',NULL)
INSERT INTO emp
(ENAME,EMPNO,DEPT)
VALUES
('tiks','123','55')
INSERT INTO emp
(ENAME,EMPNO,DEPT)
VALUES
('tiki','221',NULL)
INSERT INTO emp
(ENAME,EMPNO,DEPT)
VALUES
('narayan',NULL,NULL)
INSERT INTO ip_lov_hdr
(TABLE_ID,TABLE_NAME,COL_NAME,CODETYPE)
VALUES
('emp_id','emp','ename',NULL)
INSERT INTO ip_lov_dtl
(TABLE_ID,COL_NAME)
VALUES
('emp_id','empno')
CREATE OR REPLACE
TYPE out_rec_lov AS OBJECT(ename VARCHAR2(50),empno VARCHAR2(9))
CREATE OR REPLACE
PROCEDURE p_recordtypevariable (tab_id IN VARCHAR2,err_msg OUT VARCHAR2)
IS
sqlstmt VARCHAR2 (2000);
col_str VARCHAR2 (2000);
i NUMBER := 0;
l_table_name ip_lov_hdr.table_name%TYPE;
l_col_name ip_lov_hdr.col_name%TYPE;
l_codetype ip_lov_hdr.codetype%TYPE;
l_datatype VARCHAR2 (100);
invalid_tableid EXCEPTION;
BEGIN
BEGIN
SELECT a.table_name,
a.codetype,
a.col_name,
b.data_type || '(' || b.data_length || ')'
INTO l_table_name,
l_codetype,
l_col_name,
l_datatype
FROM ip_lov_hdr a, user_tab_columns b
WHERE UPPER (a.table_id) = UPPER (tab_id)
AND UPPER (a.table_name) = UPPER (b.table_name)
AND UPPER (a.col_name) = UPPER (b.column_name);
EXCEPTION
WHEN NO_DATA_FOUND THEN
RAISE invalid_tableid;
END;
col_str := l_col_name || ' ' || l_datatype;
FOR rec IN (SELECT b.col_name,
c.data_type || '(' || c.data_length || ')' datatype
FROM ip_lov_hdr a, ip_lov_dtl b, user_tab_columns c
WHERE UPPER (b.table_id) = UPPER (tab_id)
AND UPPER (a.table_id) = UPPER (b.table_id)
AND UPPER (a.table_name) = UPPER (c.table_name)
AND UPPER (b.col_name) = UPPER (c.column_name) )
LOOP
col_str := col_str || ',' || rec.col_name || ' ' || rec.datatype;
END LOOP;
sqlstmt := 'CREATE OR REPLACE TYPE out_rec_lov AS OBJECT(' || col_str || ')';
dbms_utility.exec_ddl_statement(sqlstmt);
dbms_utility.exec_ddl_statement('alter package pkg_lov_new compile');
EXCEPTION
WHEN invalid_tableid THEN
err_msg := 'Table is not defined ';
WHEN OTHERS THEN
err_msg := SUBSTR (SQLERRM, 1, 500);
END p_recordtypevariable;
CREATE OR REPLACE
PACKAGE pkg_lov_new
AS
TYPE listtable IS TABLE OF out_rec_lov index by binary_integer;
PROCEDURE p_getlov (
tab_id IN VARCHAR2,
col_value IN VARCHAR2,
outlist OUT listtable,
err_msg OUT VARCHAR2);
END;
CREATE OR REPLACE
PACKAGE BODY pkg_lov_new
AS
PROCEDURE p_getlov (
tab_id IN VARCHAR2,
col_value IN VARCHAR2,
outlist OUT listtable,
err_msg OUT VARCHAR2)
IS
query_str VARCHAR2 (2000);
col_str VARCHAR2 (2000);
TYPE cur_typ IS REF CURSOR;
c cur_typ;
i NUMBER := 0;
l_table_name ip_lov_hdr.table_name%TYPE;
l_col_name ip_lov_hdr.col_name%TYPE;
l_codetype ip_lov_hdr.codetype%TYPE;
BEGIN
BEGIN
SELECT table_name,
codetype,
col_name
INTO l_table_name,
l_codetype,
l_col_name
FROM ip_lov_hdr
WHERE UPPER (table_id) = UPPER (tab_id);
EXCEPTION
WHEN NO_DATA_FOUND THEN
NULL;
END;
col_str := l_col_name;
FOR rec IN (SELECT col_name
FROM ip_lov_dtl
WHERE table_id = tab_id)
LOOP
col_str := col_str || ',' || rec.col_name;
END LOOP;
IF l_codetype IS NULL THEN
query_str := 'select out_rec_lov('
|| col_str
|| ') from '
|| l_table_name
|| ' where '
|| l_col_name
|| ' like :col_value';
BEGIN
OPEN c FOR query_str USING col_value;
LOOP
FETCH c INTO outlist (i);
i := i + 1;
EXIT WHEN c%NOTFOUND;
END LOOP;
CLOSE c;
EXCEPTION
WHEN OTHERS THEN
err_msg := SUBSTR (SQLERRM, 1, 500);
END;
ELSE
query_str := 'select out_rec_lov('
|| col_str
|| ') from '
|| l_table_name
|| ' where code_type =:l_codetype and '
|| l_col_name
|| ' like :col_value';
BEGIN
OPEN c FOR query_str USING l_codetype, col_value;
LOOP
FETCH c INTO outlist (i);
i := i + 1;
EXIT WHEN c%NOTFOUND;
END LOOP;
CLOSE c;
EXCEPTION
WHEN OTHERS THEN
err_msg := SUBSTR (SQLERRM, 1, 500);
END;
END IF;
EXCEPTION
WHEN OTHERS THEN
err_msg := SUBSTR (SQLERRM, 1, 500);
END p_getlov;
END pkg_lov_new;
/

Similar Messages

  • Dynamically creating variable names in javascript

    Hi.
    I have to create variable names dynamically in JavaScript.
    My JSP file accesses information from Database and forms a String corresponding to the information received.
    This String is passed to a JAvaScript function that should CREATE a variable with that NAME.
    For Ex:
    My database access resulted in a single row...
    id name sal
    34 John Smith 38000
    the resulting VARIABLE NAME should be Menu34. 34 comes from the database result.
    Is there any function to dynamically create a variable name in JavaScript?
    Thanks in advance.

    The JSP is printing the contents of an HTML page, and Javascript code can be part of that output...
    So you would just write out the stuff, something like this....
    <script>
    <% while(rs.hasNext()) { %>
    var Menu<%= rs.getInt("id") %> = '<%= rs.getString("name") %>';
    <% } %>
    </script>
    In the browser, it'll just look like another long list of Javascript variables.

  • Problem with dynamically created columnchart (FB 4 and 4.5)

    I have an application (written in FB4 but I've imported to FB4.5 with no difference in behaviour) which dynamically creates cartesian charts. The total column values should be the same but the user can group them according to different fields. This works fine except for one of the possible grouping options. When that is used, I can see that all the data is present in the dataprovider, but one of the groups is just not shown - or rather when you hover over the column it shows "0" as the value for that group.
    This is the code I run when the HTTP query comes back:
    private function gotGroupHistory():void{
        if (hsGroupHistory.lastResult.list.item is mx.utils.ObjectProxy) {
            histModelSource = new ArrayCollection;
            histModelSource.addItem(hsGroupHistory.lastResult.list.item);
        } else {
            histModelSource = hsGroupHistory.lastResult.list.item;
        var grouparray:Array=new Array();
        var cset:ColumnSet = new ColumnSet;
        cset.type="stacked";
        var csplan:LineSeries=new LineSeries();
        csplan.displayName="Target";
        csplan.yField="plan";
        for each(var thisitem:String in chartgroups) {
            var cs:ColumnSeries=new ColumnSeries();
            cs.yField=thisitem;
            cs.displayName=thisitem;
            cset.series.push(cs);
            columnchart1.series=[cset];
            columnchart1.series.push(csplan);
            columnchart1.invalidateSeriesStyles();
            columnchart1.series=columnchart1.series;
            legend1.dataProvider=columnchart1;
    As I said everything appears to be correct - the data provider has the data for all the groups but just 1 of them is not displayed. The legend also shows the name of the missing group. I really cannot figure out what is going on. Can anyone suggest my next line of investigation please?
    Thanks
    Martin

    This problem is solved after updating to IOS 7.

  • Dynamically create variables and names

    Hi,
    I am dealing with some software that will send
    me string variables and their values. I have
    to process each variable it sends me to get
    its value. The problem is I dont know how many
    its going to send me in advance, so I cant
    hard code the varible names into my class.
    At run time I will get a int. value as to the
    number of variables. An array won't work and
    a vector wont work cause I need to process
    each variable by its name. I also know that
    each variable name will be some alpha characters
    followed by a number. For example:
    int 6
    test1
    test2
    test3
    test4
    test5
    test6
    The next time it could be 50 ...or 1 or any number....
    Is there anyway I can get my class to dynamically
    delcare String variables and their names?.......

    Just use some kind of collection. If you know the alpha characters at compiletime you can use an array - instead of test1 to test6 as in you example, you'd get test[0] to test[5]. (or test[1] to test[6] if you want the numbers to match - just create the array one bigger than needed and leave the [0] unused.) If you don''t know the alpha characters you can use a HashMap or some similar collection, and use the strings "test1", "test2" etc. as keys.
    You can also make your own class to handle this, for example by wrapping some code around an array to simplify access to your Strings.

  • OMB PLUS - Problem passing Unix environment variables to OMBPlus

    Due to a requirement to encapsulate deployment of OWB applications, we currently start OMBPlus.sh from our own wrapper ksh script (deploy.ksh) in order to get the new / changed application into the target control center etc.
    We now have a new requirement that means we need to pass the content of the Unix environment across to OMBPlus.sh (and from thence into our deployment tcl scripts).
    No problem, if you believe the tcl documentation. The entire Unix environement gets dumped into a hash array called 'env', so you can get the variable's value out just by saying $env(unix_valraible).
    Sounds great, it should work a treat.
    Except OMBPlus only silghtly resembles tclsh.
    The 'env' that gets into OMBPlus bears practically no resemblance to the 'env' that existed before OMBPlus.sh got invoked.
    Does anyone have:
    a decent explanation for why the env gets scrambled (and how to avoid it) ?
    or an alternative method of getting the Unix environment varaible values into OMBPlus ?
    Please do not propose passing them all on the command line because (would you beleive it) the values are database passwords !
    Edited by: user10466244 on 23.10.2008 09:28

    Unfortunately, the java implementation of TCL that Oracle used as the basis for OMB+ is NOT a fully-featured implementation. Just try using packages...
    However, and understanding why you don't want to hard-code passwords into a file, you can always edit the setowbenv.sh file in your owb/bin/unix directory to grab your specific shell environment variables and propogate them to the java session.
    towards the bottom of this env file you will see a section that looks something like:
    JDK_HOME=../../../jdk
    OWB_HOME=/owb
    ORA_HOME=/owb
    OEM_HOME=/owb
    IAS_HOME=/owb
    ORACLE_HOME=/owb
    CLASSPATH=Personalties.jar:../admin:$MIMB_JAR:
    CLASSPATH_LAUNCHER="-classpath ../admin:../admin/launcher.jar:$CLASSPATH: -DOWB_HOME=$OWB_HOME -DJDK_HOME=$JDK_HOME -DORA_HOME=$ORA_HOME -DOEM_HOME=$OEM_HOME -DIAS_HOME=$IAS_HOME -Doracle.net.tns_admin=$ORA_HOME/network/admin Launcher ../admin/owb.classpath"
    export ORA_HOME
    export OWB_HOME
    export JDK_HOME
    export OEM_HOME
    export IAS_HOME
    export ORACLE_HOME
    You could add in the environment variables that you want propogated, include them into the CLASSPATH_LAUNCHER, and then they will turn up in your OMB+ session env array.
    e.g., to propgate an environment variable called MY_DATABASE_PASSWORD you would:
    JDK_HOME=../../../jdk
    OWB_HOME=/owb
    ORA_HOME=/owb
    OEM_HOME=/owb
    IAS_HOME=/owb
    ORACLE_HOME=/owb
    CLASSPATH=Personalties.jar:../admin:$MIMB_JAR:
    CLASSPATH_LAUNCHER="-classpath ../admin:../admin/launcher.jar:$CLASSPATH: -DOWB_HOME=$OWB_HOME -DMY_DATABASE_PASSWORD=${MY_DATABASE_PASSWORD} -DJDK_HOME=$JDK_HOME -DORA_HOME=$ORA_HOME -DOEM_HOME=$OEM_HOME -DIAS_HOME=$IAS_HOME -Doracle.net.tns_admin=$ORA_HOME/network/admin Launcher ../admin/owb.classpath"
    export ORA_HOME
    export OWB_HOME
    export JDK_HOME
    export OEM_HOME
    export IAS_HOME
    export ORACLE_HOME
    So now you have no protected data hardcoded, it will pick up your specific environment variables at runtime, and when you start OMB+ you will be able to:
    array get env MY_DATABASE_PASSWORD.
    cheers,
    Mike

  • Problem in Dynamically create Group ui element

    Hi everyone,
    I was trying to create group UI element  dynamically in Webdynpro ABAP. I was getting Error :Access via 'NULL' object reference not possible.
    I have gone through the following procedure
    Create component with window and view
    In view layout Method: WDDOMODIFYVIEW and done the following code
      Source Code
    if first_time  = ABAP_TRUE.
    data:lr_container type REF TO CL_WD_UIELEMENT_CONTAINER,
          lr_flowdata TYPE REF TO cl_wd_flow_data,
          lr_group TYPE REF TO cl_wd_group,
          object type REF TO IF_WD_VIEW_ELEMENT.
    CALL METHOD view->get_root_element
       receiving
         root_view_element = object.
    lr_container ?= object.
    CALL METHOD cl_wd_group=>new_group
       EXPORTING
         design                   = 01
         enabled                  = ABAP_TRUE
         has_content_padding      = ABAP_TRUE
         id                       = 'GRP1'
         view                     = VIEW
         visible                  = 02
       receiving
         control                  = lr_group.
    CALL METHOD lr_container->add_child
       EXPORTING
         the_child = lr_group.
    CALL METHOD cl_wd_flow_data=>new_flow_data
       EXPORTING
         element     = lr_group
       receiving
         control     = lr_flowdata.
    endif.
    To get Group ui element dynamically what i have to do rather than the above code
    Thanks in Advance
    Sreenivas P

    Hi Sreenivas,
    Try to debug and find what line the error occurs and return it to us.
    If the error occurs in
    CALL METHOD view->get_root_element
       receiving
         root_view_element = object.
    or in
    lr_container ?= object.
    you will need to check content of object.
    Best regards

  • Dynamically create variables when read from txt file

    hi,
    need a little help on this one.
    im reading in the name of user defined classes from a text file into a string array. once i have them all read in i want to be able to declare instances of each class, but how?
    i have the string array with the names and i know that il have to use a loop with a counter to give each instance a unique name but im stomped on how to do the rest.
    anyone have any ideas?
    many thanks in advance.

    im getting it in the following line:
    Class cls = Class.forNames(behList[ i ]);
    behList is a list of names, im trying to loop through
    it and create an instance of each object in the list
    using
    Object x = cls.newInstance();
    but it never gets to this line cos of the top one.
    any ideas?stupid bb codes...
    now are you sure you got that error by java and not Eclipse(or another IDE)
    cause afaik, if the VM cant find the class, it will throw a ClassNotFoundException...

  • Problem accessing dynamically created table line

    Hi everyone.
    I'm unable to solve the following problem:
    In an offline scenario I have a table which contains one line at creation time. The form offers a button to add lines to the table using javascript and the instanceManager of the table.
    If the added lines are beeing filled by the user I can extract that data without a problem.
    But I cannot acces the newly generated fields with java script.
    I'm not sure, what the problem is. Here is the code, which should do the job:
    xfa.resolveNode("xfa.form.data.Inhalt.CONTACTS.DATA.NAMEV[" + position + "]").rawValue = 'Andreas';
    This works fine, for the table line, that exists right from the beginning(position = 0), but not for any added line.
    I keep getting this error: xfa.resolveNode("xfa.form.data.Inhalt.CONTACTS.DATA.NAMEV[" + position + "]") has no properties
    What am I doing wrong?
    Thanks for any hints,
    Andreas.

    Solved the problem now and it was fairly easy looking at it now.
    I don't know, why the above mentioned adressing does not work, but it works like this:
    var tab = xfa.resolveNodes("xfa.form.data.Inhalt.CONTACTS.DATA[*]");
    // get the last position
    var last = xfa.resolveNodes("xfa.form.data.Inhalt.CONTACTS.DATA[*]").length - 1;
    // fill values
    tab.item(last).NAME1.rawValue = "Andreas";
    Edited by: Andreas Heckele on May 17, 2010 11:07 AM

  • Dynamically create (global) variables

    Hi,
    Is it in anyway possible to dynamically create variables, like you can do in Forms:
    DEFAULT_VALUE('test', v_test);
    with v_test holding the variable, like 'GLOBAL.TEST'. Forms would then create me the variable as it doesn't exist yet, assigning the given value.
    Like this I could read my variables' names from a DB table, dynamically create them, and assign their values. Inside the report I would then use them as lexical references.
    I know I can create parameters inside the report achieving the same, but we need the table-approach for our translations. Getting rid of the parameters' overhead would be great!
    Any suggestions appreciated,
    K.

    Where the lov is attached set the VALIDATE FROM LIST property to YES and craate one trigger for each field called WHEN-VALIDATE-ITEM and use the code as below...
    IF GET_ITEM_PROPERTY('FORM_FIELD_NAME',ITEM_IS_VALID)='FALSE' THEN
      :FORM_FIELD_NAME:=:GLOBAL.EmpCode;
    END IF;
    Don't forget to set NULL for global variable in KEY-LISTVAL trigger after assigning value to the form's field.
    HTH.
    -Ammad
    Edited by: Ammad Ahmed on Nov 8, 2010 4:33 PM

  • Inventory forecast help - dynamically creating formulas?

    Post Author: ddenise
    CA Forum: Formula
    I am writing a report that reconciles sales orders to inventory - essentially, group sales orders by the scheduled production date, list out all the parts that are needed and forecast the impact on inventory, highlighting any areas where inventory is foretasted to go negative. The results right now look like this:                               Part          In Inventory          Needed         Inventory RemainingOrder Number 567     Product Number 311187          Part Number 8111234          100                  5                  95          Part Number 8111235      Product Number 311189          Part Number 8111234          100                 6                  94
              Part Number 8112235 You can see the problem is that once I calculate "Inventory Remaining", the next instance of part 8111234, should have an "In Inventory" value of 95, NOT 100, but 100 is what is stored in the database.  The next time that part number is used, the database value is pulled and 100 is displayed.  A running total or summary won't work because they cannot be used on 2nd pass formulas/variables; "Inventory Remaining" is a formula evaluated on the 2nd pass.The result that I NEED to come out would be:                                Part          In Inventory          Needed         Inventory Remaining
    Order Number 567
         Product Number 311187
              Part Number 8111234          100                  5                  95
              Part Number 8111235
          Product Number 311189
              Part Number 8111234          95                  6                  89
              Part Number 8112235  So.... I am thinking that I need to create a formula that does the following while records are printed:Check to see if a variable whose name is equal to the part number that is being printed (in this case "8111234") and if it doesn't exist, then create it, setting it's value to what is in the database (in this case "100")Use the variable's current value, subtract the quantity of those parts that are needed for the current record being printed and updated the variable's value to this difference.If the variable does already exisit, then use it's current value to display in the "In Inventory" column and,Use the variable's current value, subtract the quantity of those parts
    that are needed for the current record being printed and updated the
    variable's value to this difference.What this would do is essentially, dynamically create variables that can be used for display and other evaluation and update the particular variable that is related to the part number that is being printed. Has anyone done anything like this before?  I'm sure I'm not the first to encounter this situation.  Also, if there are other ways to solve this problem that Crystal can handle, please advice - I cannot seem to find any other solution. Regards,  

    XtrmeMelissa wrote:
    Haha! I got all the formulas down except for the boxes but thank you so much!
    I do have a new problem that just arrived, how can I get it to clear itself after I'm finished? So that it acts like a calculator and the columns are automatically cleared and the bars on hand turns into the total bars amount?
    It sounds very difficult
    Melissa
    Message was edited by: XtrmeMelissa, sorry about this! Boss brought up something new
    Melissa,
    I anticipated that problem and that's why I proposed the structure that I did.
    Good luck,
    Jerry

  • Creating variable names?

    hi all
    is it possible to dynamically create variable names so you can keep track of them?
    I have to generate the following code a number of times depending on a number the user has input. So ideally Id like to create
    variables whose names i can keep track of for later reuse
    eg horHatch1, horHatch2.... without hardcoding them in. is this possible?? are there any better ways of accomplishing this task?
    this code just draws and adds labels on an x axis.
    thanks
    Line2D.Double horHatch1 = new Line2D.Double(horAxis.getP1().getX() + horInterval,
                                                    horAxis.getP1().getY() - HatchLength/ 2,
                                                    horAxis.getP1().getX() + horInterval,
                                                    horAxis.getP1().getY() + HatchLength/2);
        graphics.draw(horHatch1);

    hi
    i used the following code
    but i need to convert Line"d to Line2d.Double as explained below
    for(int i=1; i<x+1; i++)
    Line2D.Double horHatch1 = new Line2D.Double(horAxis.getP1().getX() + horInterval*i,
                                                    horAxis.getP1().getY() - HatchLength/ 2,
                                                    horAxis.getP1().getX() + horInterval*i,
                                                    horAxis.getP1().getY() + HatchLength/2);
        graphics.draw(horHatch1);
         v.addElement(horHatch1);
    Add text to hatches
        decorateVerticalLine(graphics, horHatch1, "M");
        decorateVerticalLine(graphics, horHatch2, "T");
    decorateVerticalLine(graphics, (Line2D)v.elementAt(i), names.elementAt(nColumn).toString());
    //compiler complains that (Line2D)v.elementAt(i) is not of type java.awt.geom.Line2D.Double  but of   java.awt.geom.Line2Di tried :
    horizontalAxisTicks[i] =((Double)(Line2D)v.elementAt(i)).doubleValue()).getX1();
    but this isnt correct i dont think.
    thanks

  • Creating variables using set()

    Does the set() function for dynamically creating variables
    have a substitute in AS3?
    This is a generic example written in AS2:

    You're welcome. Until your posting, I didn't know there was
    such a thing as set, so as often happens, I learn new things here.
    My approach normally would have been along the lines of the = one.
    If you're ever wondering about other changes, in the AS3 help
    docs you can search on "Migration" and one of the few choices there
    is titled as such wrt AS2. It tabulates the status of most of the
    AS2 code elements and identifies alternatives for AS3 when
    applicable.
    Also, there's this offering you might find useful...
    http://www.actionscriptcheatsheet.com/downloads/as3cs_migration.pdf

  • Passing variables from a dynamically created textinput in AS2?

    Hey everyone,
    I have a contact form in my flash file with name/email/message fields which a user can fill out and then click send, which passes these to a php script which then emails the information that they entered. This works fine when the text inputs are manually placed on the stage and all the information is passed to the php script and emailed to me. I am just updating it so the textinputs are created via AS2 so that I can style them more easily etc. This is fine however when created via script they no longer get passed to my php file. I am creating the textinput using the following code (which works fine):
    var my_fmt:TextFormat = new TextFormat();
    my_fmt.bold = false;
    my_fmt.font = "Arial";
    my_fmt.color = inputcol;
    contact_form.createTextField("contact_name", getNextHighestDepth(),112.6, 27, 174, 20);
    contact_form.contact_name.wordWrap = true;
    contact_form.contact_name.multiline = false;
    contact_form.contact_name.border = true;
    contact_form.contact_name.borderColor = inputcol;
    contact_form.contact_name.type = "input";
    contact_form.contact_name.setNewTextFormat(my_fmt);
    contact_form.contact_name.text = "";
    FYI I am creating this outside the movieclip containing the form (called contact_form) and then adding it into that mc specifically because I thought this may be necessary as doing it within the mc itself (using this.createTextField....) didn't work, however both seem to have the same effect.
    I am then doing various checks on the input box contents (to make sure it's not empty etc), this also works fine and gives me the relevant error if it is empty so it's accessing it correctly. I then use the following code to submit the variables and check_status checks the success/failure of the php script and alerts the user accordingly:
    loadVariables("http://www.makeaportfolio.com/send_email.php?flashmo=" + random(1000), this, "POST");
    message_status.text = "sending....";
    var interval_id = setInterval(check_status, 400);
    This works fine however does not pick up the value of the dynamically created text input (however does pick up all the text inputs that are manually added to the stage). I am rather confused as to why it's not picking this up and am not sure how I set it to do so, i would be immensely grateful if someone could point me in the right direction?
    Thanks so much for your help as ever,
    Dave

    Hi kglad,
    I'm sorry but i still don't understand what you mean? They are all text inputs which are defined in AS2 (you can see the code in my first post), the values (inputtext.text) are surely set by the user when they enter information into the input boxes. Accessing these works fine within my flash file, they just don't get passed to my php file. I got round this by manually creating duplicate textinputs on the stage for each dynamically created textinput which are all hidden, then assigning the values of the dynamically created inputs to the manually created inputs before loading the php file. This works fine as it picks up the manually placed inputs as local. I assume it's something to do with the scope of the dynamically created inputs but I cannot work out how you would ensure they would be picked up as even when you explicitly create them within the relevant mc it doesn't pick them up. As I say i've managed to get it working in a rather convoluted way which is good but would be most interested to understand why the other method doesn't work.
    Thanks so much for your help,
    Dave

  • Assigning a 'dynamically created sequence' value to a variable

    in my procedure i am creating a sequence on the fly, i am preparing the name with some passed parameters like below
    v_seq_name := 'seq_'||loadid||v_table_name;
    execute immediate 'CREATE SEQUENCE '||v_seq_name||' MINVALUE 1 MAXVALUE 999999999999999999999999999 START WITH 1 increment by 1 cache 20';
    and now after doing some operations i need to assign the current value of sequence to a number variable i tried following but not working
    1) v_curr_value : = v_seq_name.currval ;
    2) select v_seq_name||'.nextval' into v_curr_value from dual;
    can you please suggest me how i can get the value in plsql block.

    DIVI wrote:
    in my procedure i am creating a sequence on the fly, i am preparing the name with some passed parameters like below
    v_seq_name := 'seq_'||loadid||v_table_name;
    execute immediate 'CREATE SEQUENCE '||v_seq_name||' MINVALUE 1 MAXVALUE 999999999999999999999999999 START WITH 1 increment by 1 cache 20';
    and now after doing some operations i need to assign the current value of sequence to a number variable i tried following but not working
    1) v_curr_value : = v_seq_name.currval ;
    2) select v_seq_name||'.nextval' into v_curr_value from dual;
    can you please suggest me how i can get the value in plsql block.Well, you haven't given the error you are getting but I guess the procedure isn't compiling? You need to execute immediate any reference to the sequence.
    Having said that, your architecture is probably wrong if you are dynamically creating things in a procedure.
    Why do you need to create them dynamically?

  • Passing values to dynamically created internal table

    Hi,
    I have the flat file data as
    f1,f2,f3........so on
    where f1 f2 and f3 are field names.
    I have a variable var which contains the data
    V1,0001,0002.........so on
    data: var type string.
    The value of field f1 is v1
    The value of field f2 is 0001
    The value of field f3 is 0002.......so on
    FIELD-SYMBOLS:     <fs_1> TYPE STANDARD TABLE
    I have dynamically created an internal table for fields f1  f2 f3 ...... using 
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog           = lt_fieldcatalog
        IMPORTING
          ep_table                  = <fs_data>
        EXCEPTIONS
          generate_subpool_dir_full = 1
          OTHERS                    = 2.
      IF sy-subrc <> 0.
      ENDIF.
    ASSIGN <fs_data>->* TO <fs_1>.
    Now for <fs_1> I have to pass the corresponding values of the fields f1 f2 f3 .
    How can i solve this.
    Thanks and regards ,
    Parvatha Reddy

    Hi,
    There is no data in <fs_1>.
    I need to pass the data form the string var to the fields of <fs_1>..
    I understand that you want to populate the internal table <fs_1>.
    for that you fist need work area.. use below statement to create work area..
    DATA: new_line TYPE REF TO data.
    CREATE DATA new_line LIKE LINE OF <fs_1>.
    ASSIGN new_line->*  TO <fs_2>.
    <fs_2> is not your work aread...
    to assign value to each field of you work aread <fs_2>. use statement
    ASSIGN COMPONENT 1 OF STRUCTURE <fs_2> TO <fs_3>.
    <fs_3> = f1 .
    now <fs_3> will point to the first field of work area <fs_2>, f1 is value from your string .. repeat above for each field in workarea, by increasing the component number. Once your work area is filled
    append it to table.
    append <fs_2> to <fs_1>
    apologies if I am not getting the requiremnt correctly..

Maybe you are looking for

  • Prepayment request and final invoice

    Can anyone help with a question about posting payments to a prepayment request and then reconciling the final invoice. We create a sales order and then a prepayment request for 100% of the sales order. The customer then pays for the goods. We put in

  • Time Stamp, read from filename and change automatically

    Hi, while converting to an format (video monkey) which can be read by iMovie the files lost the propper time stamp. However, date and time is still part of the filename. Is there an option to change date and time within iMovie or any other app based

  • I get a black frame at the head using image sequence every time

    I am using tif frames number 1-xxxxxxxx and each conversion adds black frames to the Qtime movies when there are none in any of my sequences.

  • Notification setting in HumanTask

    Hi All, Can anybody plz tell me how to change the Notification Setting in Jdeveloper for the adhoc serial routing?Actually I have done like this way: Task Status Receipents Notification Header Assign Assignes ur task is assigned Update Owner ur task

  • REGARDING THE DISCOVERER CERTIFICATION DETAILS

    HI . THIS IS VARUN . I WANT ORACLE DISCOVERER CERTIFICATION DETAILS. SO CAN ANYONE HELP ME RAGARDING THIS MATTER. I WILL BE REALLY THANKFUL TO THEM . PLEASE REPLY BACK TO ME WITH COMPLETE DETAILS LIKE PRICE,DURATION,TOPICS ETC. THANK YOU