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

Similar Messages

  • Setting a Filter on a dynamically created Table

    Hi All,
    I am currently working on a Database to automatize some process. Quick explanation:
    The User can import a CSV (Text) File via a DialogBox, which gets imported into a Table. After this, the content has to be filtered, setting conditions on 4 different rows. The new Table gets exported into a new CSV (It has to be CSV, since it later gets imported
    into SAP)
    I am having some trouble with filters though:
    How can I set a Filter on a dynamically created Table (using VBA)?
    Best case would be to save the filter into my Import spec, but Access doesn't seem to have this option (?)
    Can somebody help?
    Thanks in advance
    Regards
    Alex

    Thanks for the fast reply! Sorry, I am not really proficient at Access. How do I do a query on a dynamically created Table? Do I have to save the Table into a Variable. Or what's the way to import it?
    Hi Alex,
    I never use the Import functionality, nor DoCmd.TransferText.
    To import data from a csv-file I made my own Import functionality. In fact it is just reading an external file, line by line, and each line field by field using the field separator. In my opinion that is far more versatile than the standard functionality.
    But you can use the standard functionality of Access to import a csv-file into a table.
    Having the data in a table, you can generate the appropriate query for the output in a VBA procedure:
            sql_string = "SELECT Field1, Field2, ... FROM MyTable WHERE Field1 = ... AND Field2 = ... ORDER BY Field3"
    and make a recordset of it:
            Set cur_set = CurrentDb(sql_string)
    The output csv-file is then filled by opening a file for Write, loop through all the records, concatenate for each record all the wanted fields using the field separator, and write the result line to the csv-file.
    Most important is to understand this process. After that it should be possible to build it. And if you have further questions, just ask.
    Imb.

  • Accessing Dynamically created Button

    Hi,
    Can someone give me an example how to access dynamically created button? 
    I know how to create a button dynamically but don't know how to access from AS3.
    Thanks!

    Hi,
    Please go through following links.
    1) http://www.daveoncode.com/2009/05/20/objectcollector-accessing-dynamic-generated-flex-obje cts-by-id/
    2) http://stackoverflow.com/questions/6740813/flex-assigning-events-to-dynamically-created-bu ttons
    3) http://www.justskins.com/forums/adding-click-event-to-35785.html
    Thanks and Regards,
    Vibhuti Gosavi | [email protected] | www.infocepts.com

  • Need help on selection of records in dynamically created table

    hi,
    Ia m able to bind the onleadSelect event to the dynamially created table .
    But i was not able to select the table records.
    default first record was only selected.
    can u help me out to find the way.
    i am pasting the code for reference.
    can u suggest me the right direction.
    i want the selected record in the table to be dispalyed in another view thru this action event.
    but only the forst record is now getting selected by default.
    here the code.
    IWDNode node =wdContext.currentContextElement().node().getChildNode(nodename,0);
    for (int l = 0; l < node.size(); l++) {
    int ele = node.getLeadSelection();
    IWDNodeElement element= node.getElementAt(ele);
    table.setOnLeadSelect(wdThis.wdGetObjectSelectedAction());

    Hi,
      <a href="/people/sap.user72/blog/2005/05/09/have-you-played-blindfold-chess's</a> how to create a dynamic table, though I think you have already done this.
      Do look at the comment that Armin Reichert has put in. Now in the source code that he has provided, the last line should be
    table.setOnLeadSelect(wdThis.wdGetLeadSelectAction());
    Have you done something similar to this?
    Have you set the initializeLeadSelect property of the datasource node to true?
    Regards,
    Satyajit.
    Message was edited by: Satyajit Chakraborty

  • Formatting value in the dynamically created table

    Hi,
    I have created table dynamically.
    In that, if the columns going to be number datatype,
    <af:convertNumber pattern="##########"/> , i want to apply this pattern,
    if the column going to be date,
    <af:convertDateTime pattern="DD/mm/yyyy" /> , i want to apply this pattern.
    Code Snippet for dynamically created UI table,
    <af:table rows="#{bindings.DynamicVO.rangeSize}"
    fetchSize="#{bindings.DynamicVO.rangeSize}"
    emptyText="#{bindings.DynamicVO.viewable ? 'No data to display.' : 'Access Denied.'}"
    var="row" rowBandingInterval="0"
    value="#{bindings.DynamicVO.collectionModel}"
    selectedRowKeys="#{bindings.DynamicVO.collectionModel.selectedRow}"
    selectionListener="#{bindings.DynamicVO.collectionModel.makeCurrent}"
    rowSelection="single" id="t1">
    <af:forEach items="#{bindings.DynamicVOIterator.attributeDefs}" var="def">
    <af:column headerText="#{def.name}" sortable="true" rendered="#{def.hints.displayHint!='Hide'}"
    sortProperty="#{def.name}" id="hisc1">
    <af:outputText value="#{row[def.name]}" id="othis1">
    </af:outputText>
    </af:column>
    </af:forEach>
    </af:table>
    How to apply the pattern for the ouput text dynammically depending on the data type.
    My Jdeveloper version is 11.1.1.3.0
    Reg,
    vini

    Any help on the above scenario?

  • Problem in using CREATE TABLE with Execute Immediate

    I'm trying to create a table using Native Dynamic SQL. the code of the pl/sql block is
    BEGIN
    EXECUTE IMMEDIATE 'create table demo (ddate date)';
    END;
    The problem is that the above block is executed successfully as an anonymous PL/SQL block. The same block when written in a procedure it gives an error
    "ORA-01031 Insufficient privelages"
    at the time of execution. The procedure is complied successfully.
    null

    Your user needs direct system privs to create tables. You are receiving your privs properly by the role RESOURCE. Connect as system and grant CREATE TABLE directly to your user - that should do it.
    Regards
    Peter Larsen

  • 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.

  • Accessing Dynamic Internal table fields

    Hello All,
    I have one internal table ep_tabx having 138 columns whose data is getting displayed
    by using function module reuse_alv_grid_display.
    Now my query is, i have created one custom button on the appl toolbar to download ep_tabx data.
    IF the user changes the the layout of the output at runtime and then presses that custom button
    then i have created one dynamic internal table using call method cl_alv_table_create=>create_dynamic_table suppose <dyn_table> whose struc will be that of
    dynamic fieldcatalog returned by using FM REUSE_ALV_GRID_LAYOUT_INFO_GET.
    And then I have put a loop on the int table ep_tabx and move corresponding to the int table
    <dyn_table>. But when i download the <dyn_table> data through GUI_DOWNLOAD the
    date fields data is not getting downloaded correctly. I have 4 date fields in my ep_tabx.
    In the alv grid output the date is getting displayed like 08/30/2004(ie mon/date/yr) but in download
    file it comes like 20040830(ie yr/mon/date and that too without /).How to access the dynamic
    internal tables fields separately so asto convert them in the pgm before the download.
    Kindly Help.
    Thanks in advance.
    Mansi

    Hi,
    Search in SDN you would get loads of info on accessing dynamic itab's .
    in order to convert your date format use WRITE stmt to convert the value in your itab before passing it to download FM.
    Regards,
    Raghavendra

  • How to create table field inside the dynamically created table?

    Hi, All!
    I have created dynamic internal table (using field catalog and CALL METHOD cl_alv_table_create=>create_dynamic_table )
    and put this table  into FM REUSE_ALV_GRID_DISPLAY. ALV grid work. Now I need to color rows of my ALV, therefore  I have to insert new column with name "COLORS" and type lvc_t_scol. I  see three ways to do it , but all ones are unsuccessful:
    1. Insert column into field catalog. FM REUSE_ALV_FIELDCATALOG_MERGE does not return info about "COLORS" I guess because COLORS is a table.
    2. Insert column into field catalog manually. It provides a short dump during dynamic table creating or during call of REUSE_ALV_GRID_DISPLAY.
    3. Create dyn table first, then add new field . I could not find a way how to do it :(((((((
    Can somebody help me?
    Tatiana

    Hi,
    Here is the solution for this problem, Sample code:
    *& Report  ZCHA_ALV_GRID_CELL_COLOR                                    *
    REPORT  ZCHA_ALV_GRID_CELL_COLOR                .
    TABLES:MARA.
    DATA: W_CONTAINER         TYPE SCRFNAME VALUE 'ALV_CONTAINER',
          W_GRID              TYPE REF TO CL_GUI_ALV_GRID,
          W_CUSTOM_CONTAINER  TYPE REF TO CL_GUI_CUSTOM_CONTAINER.
         W_EVENT_RECEIVER    TYPE REF TO LCL_EVENT_RECEIVER.
    *layout
    DATA: WA_LAYOUT           TYPE LVC_S_LAYO.
    *field catalog
    DATA: IT_FIELDCAT_WRT_OFF TYPE LVC_T_FCAT,
          WA_FIELDCAT_WRT_OFF TYPE LVC_S_FCAT.
    DATA:BEGIN OF IT_MARA OCCURS 0,
         MATNR LIKE MARA-MATNR,
         MAKTX LIKE MAKT-MAKTX,
         CELLCOLORS TYPE LVC_T_SCOL,
         END OF IT_MARA.
    SELECT P~MATNR
           Q~MAKTX
           INTO CORRESPONDING FIELDS OF TABLE IT_MARA
           FROM MARA AS P INNER JOIN
                MAKT AS Q ON
                PMATNR = QMATNR.
    CALL SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'STATUS'.
    SET TITLEBAR 'xxx'.
      IF NOT W_CONTAINER IS INITIAL.
        CREATE OBJECT W_CUSTOM_CONTAINER
                 EXPORTING CONTAINER_NAME = W_CONTAINER.
        CREATE OBJECT W_GRID
                 EXPORTING I_PARENT = W_CUSTOM_CONTAINER.
      ENDIF.
      CLEAR IT_FIELDCAT_WRT_OFF.
      REFRESH IT_FIELDCAT_WRT_OFF.
      WA_FIELDCAT_WRT_OFF-FIELDNAME = 'MATNR'.
      WA_FIELDCAT_WRT_OFF-COL_POS   = '1'.
      WA_FIELDCAT_WRT_OFF-OUTPUTLEN = '35'.
      WA_FIELDCAT_WRT_OFF-SCRTEXT_L = 'Material No'.
      APPEND WA_FIELDCAT_WRT_OFF TO IT_FIELDCAT_WRT_OFF.
      CLEAR WA_FIELDCAT_WRT_OFF.
      WA_FIELDCAT_WRT_OFF-FIELDNAME = 'MAKTX'.
      WA_FIELDCAT_WRT_OFF-COL_POS   = '2'.
      WA_FIELDCAT_WRT_OFF-OUTPUTLEN = '45'.
      WA_FIELDCAT_WRT_OFF-SCRTEXT_L = 'Material Desc'.
      APPEND WA_FIELDCAT_WRT_OFF TO IT_FIELDCAT_WRT_OFF.
      CLEAR WA_FIELDCAT_WRT_OFF.
      DATA LS_CELLCOLOR TYPE LVC_S_SCOL.
      READ TABLE IT_MARA INDEX 5 .
      LS_CELLCOLOR-FNAME = 'MATNR'.
      LS_CELLCOLOR-COLOR-COL = '3'.
      LS_CELLCOLOR-COLOR-INT = '1'.
      APPEND LS_CELLCOLOR TO IT_MARA-CELLCOLORS.
      MODIFY IT_MARA INDEX 5.
      WA_LAYOUT-CTAB_FNAME = 'CELLCOLORS'.
      CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
          IS_LAYOUT       = WA_LAYOUT
        CHANGING
          IT_FIELDCATALOG = IT_FIELDCAT_WRT_OFF
          IT_OUTTAB       = IT_MARA[].
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM.
        WHEN 'BACK'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    Try to assign appropriate points.
    Regards,
    Suman

  • Problem with dynamic internal table updation

    Hello Folks,
      I created  a dynamic internal table
    CALL METHOD cl_alv_table_create=>create_dynamic_table
          EXPORTING
            it_fieldcatalog           = i_fieldcat
          IMPORTING
            ep_table                  = i_dyntab
          EXCEPTIONS
            generate_subpool_dir_full = 1
            OTHERS                    = 2.
    ASSIGN i_dyntab->* TO <f_dyntable>.
    and created a work area
    CREATE DATA wg_f_split LIKE LINE OF <f_dyntable>.
        ASSIGN wg_f_split->* TO <f_wg_dyntable>.
    My requirement is that , i have to loop a normal internal table and append those records to the filed symbol internal table.
    READ TABLE i_normal_itab INTO wg_split INDEX wl_rows-index.
          IF sy-subrc EQ 0.
            ASSIGN wg_split to <f_wg_dyntable>.
             APPEND <f_wg_dyntable> to <f_dyntable>.
           endif.
    here i am geeting dump as "MOVE src TO dst" ... i can get the data in the work area FSymbol but cannot append it in Internal table Field Symbol.. Please help..
    <Added code tags>
    Edited by: Suhas Saha on Aug 3, 2011 10:52 AM

    Hello Sandra,
    Thanks for the reply..
    First i tried  appending the normal work area to the fieldsymbol  internal table.
      append wg_split to <f_dyntable>
    This is hiting dump the same dump and so i created a fieldsymbol work area. ( <f_wg_dyntable>.)and tried to append the field symbol internal table with this work area. which is again giving the dump
    APPEND <f_wg_dyntable> to <f_dyntable>. ( Again a Dump)
    Edited by: Charan-SAP on Aug 2, 2011 9:40 PM
    Edited by: Charan-SAP on Aug 2, 2011 9:42 PM

  • OID users ( EUS) problem with grant create table with admin

    Hi,
    We activated enterprise users in the OID.
    There is a role APP_ADMIN that has the following grants:
    create user
    drop user
    create table with admin option
    this is for an application that creates BI schemas, so it needs to be able to create other users.
    I have granted these to a local role, and the user has access to the local role, thanks to the OID setup.
    The create and drop user work.
    however, the grant create table to another user does not work.
    Is there an issue with 'with admin option' grants in Enterprise user security?
    Regards,
    Peter

    If I grant
    grant create table to test_role with admin option;
    it does not work
    if I grant
    GRANT GRANT ANY PRIVILEGE to test_role WITH ADMIN OPTION;
    it does work.
    The test command as user with test_role is:
    grant create table to test_usr;
    very strange!
    If the user is a standard user and I create role test_role
    and grant create table to test_role with admin option it works.
    but if I convert the user to an EUS user and the same privilege is given to the role ( role is granted to a global role to an enterprise role)
    it doesnt work
    Edited by: Peter on Dec 7, 2012 2:36 PM

  • Dynamically create Table partition

    Hi all,
    Anybody having script to add partition to a table using plsql.My requirment is to create partition for every month ( time_id , from time attribute table ) dynamically.
    Thanks in Advance
    Ramesh K C R

    Just build you SQL statement to create partition in a VARCHAR2 variable
    and use EXECUTE IMMEDIATE to run it.
    Take care to have been granted directly privileges to run CREATE TABLE, ALTER TABLE (not through a role) or create you code with AUTHID CURRENT_USER clause.

  • 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;
    /

  • Accessing dynamically created movieclips

    I have an application that I am adding movieclips to a
    container movieclip through a for loop and repeatedly calling
    myClip.addChild(theNewClip). Now I have a dozen clips in my
    container and it seems like the only way to access the clip is to
    use the getChildByName() method and cast it into a temporary clip
    so I can get at the its properties.
    Is this the best and/or only way to do this? Does the old AS2
    myContainer["theName"].property not work with dynamically created
    movieclips? It doesn't seem to work for me anymore.
    Anyway I am getting the clips now, but I was hoping someone
    could show me a better way to access a dynamically created movie
    clip.

    In AS3, this is probably not much better, but you can
    generically loop through all movie clips:

  • Access dynamically created JTextField

    i need to create an unknown number of JTextField in my GUI, and this number depends on a user-input value.
    Subsequently, i will need to read the strings from the JTextField. This is how I dynamically created my JTextField:
    while (i < num-1) {
    rangePanel.add(new JTextField("0")); // 0 is merely a default value
    how can i access the created JTextFields?
    thanx

    Is this the preferred style?
    I currently have an array of JTextFields but am having real grief (input on screen not availble fro getText(), etc.), code fragment:
    JTextField [] tf = new JTextField[10];
    for (i=0, i<10; i++) {
    ft[i] = new JTextField(15);
    user enters data on screen...
    String str = tf[0].getText() returns blank. Also <tab>ing jumps between first position and where ever mouse originally landed in field.

Maybe you are looking for

  • IPhone 4 voice call issues

    My iPhone 4 sometimes goes into Facetime in the middle of a voice call. I don't have a screen protector that might block the proximity sensor. I have done a full reboot and am on the latest iOS. Any ideas what is wrong?

  • Retrieving and using nested xml

    If my xml is in the form of multiple nested "nodes?" then how can i go about serilizing them and retrieving them properly? Example, if my xml looked like this: <data> <value>value1</value> <value>value2</value> <value>value3</value> </data> then disp

  • Computer Self-Rebooting After 10.6.5 Update

    This morning, my computer prompted me to update to 10.6.5. Since then, the computer has self-rebooted twice when idle. I have never run into this behavior before with any version of Mac OS. Any suggestions on what to do at this point would be greatly

  • HT1414 what to pick? ipod or ipad? i am also tempted by the amazon kindle fire hd.

    Hey, I am very confused. For a present, my relatives asked me to pick whatver i want, and i really want an apple device of my own. What do i pick? i really dont need a phone, i alredy have a samsung galaxy.

  • Sharing images between multiple help outputs

    Hi Everyone, Question: does anyone know if it is possible to have an image repository that sits outside of the help SSL such that multiple Webhelp systems can reference a common image repository? I'm using Rh10 to write help in English which then get