Loop through table(table is created dynamically)

Hi all,
I have a table that is created dynamically.It has got 3 columns and 8 rows.In first row - first column,I have a value that is set dynamically.Now, How can I loop through this table and get this value?
The table context node and value attributes are also created dynamically.
Table node is "TimesheetData" and value attribute is col1.Value,col1.Value and col3.Value
TimesheetData
col1.Value
col2.Value
col3.Value
Again.... this node and attributes are not there in my view context by default, its getting created and binded dynamically here.
Thanks Kukku

Hi,
Following is the code to iterate through the elements
//Table node is "TimesheetData" and value attribute is col1.Value,col1.Value and col3.Value
for(int x=0;x<wdContext.getChildNode("TimesheetData",0).size(); x++)
            IWDNodeElement nodeElement = wdContext.nodeTimesheetData().getElementAt(x);
            String value1 = (String) nodeElement.getAttributeValue("col1");
            String value2 = (String) nodeElement.getAttributeValue("col2");
            String value3 = (String) nodeElement.getAttributeValue("col3");
Regards
Ayyapparaj

Similar Messages

  • How do I loop through tables, not columns in a table?

    Sorry if this is a long one. My problem is actually quite simple. I am trying to write either an ad hoc PL/SQL block or a stored procedure to loop 18 times (thru 18 tables) and perform a SQL query on those tables, returning 18 resultsets. I would like the results to show up on the screen (or in a spool file, whatever).
    So far I have tried 3 different approaches, none of which have worked.
    1. I tried to assign the select query to a variable (qry) and use EXECUTE IMMEDIATE qry. This forced me thru a variety of errors to declare variables and assign the result to them--EXECUTE IMMEDIATE qry into nm0, nm1, nm2...
    The problem with that was the resultset returned more than the variable was built for as there might be no rows returned, or it might be a thousand rows of data. So I tried changing the variables to VARRAYS, but it gave me a type mismatch as the underlying columns were NUMBER and VARCHAR2.
    DECLARE
         ctr number;
         TYPE NUMLIST IS VARRAY (1000) OF NUMBER;
         TYPE VARLIST IS VARRAY (1000) OF VARCHAR2(15);
         nm0 NUMLIST NOT NULL DEFAULT 1;
         nm1 VARLIST;
         nm2 NUMLIST NOT NULL DEFAULT 1;
         nm3 VARLIST;
         nm17 NUMLIST NOT NULL DEFAULT 1;
         qry VARCHAR2(2000) := 'klx_uln_p000_cells';
    BEGIN
    FOR ctr IN 1..17 LOOP
         IF ctr &lt; 10 THEN
              qry := 'SELECT
              A.DIM_0_INDEX,
              S0.SYM_NAME,
              A.DIM_1_INDEX,
              S1.SYM_NAME,
              A.DIM_2_INDEX,
              S2.SYM_NAME,
              A.DIM_3_INDEX,
              S3.SYM_NAME,
              A.NUMERIC_VALUE,
              B.NUMERIC_VALUE
              FROM
              KHALIX.klx_uln_p00'||ctr||'_cells A,
              KHALIX.klx_ucn_p00'||ctr||'_cells B,
              KHALIX.KLX_MASTER_SYMBOL S0,
              KHALIX.KLX_MASTER_SYMBOL S1,
              KHALIX.KLX_MASTER_SYMBOL S7
              WHERE
              A.DIM_0_INDEX=B.DIM_0_INDEX AND
              A.DIM_1_INDEX=B.DIM_1_INDEX AND...
              A.DIM_7_INDEX=S7.SYM_INDEX';
         ELSE
              qry := 'SELECT
              A.DIM_0_INDEX...
              A.DIM_7_INDEX=S7.SYM_INDEX';
         END IF;
         BEGIN
         dbms_output.put_line('SELECT FOR KLX_ULN_P00'||ctr||'_CELLS');
         dbms_output.put_line(nm16);
         dbms_output.put_line(nm17);
         EXECUTE IMMEDIATE qry into nm0,nm1,nm2,nm3,nm4,nm5,nm6,nm7,nm8,nm9,nm10,nm11,nm12,nm13,nm14,nm15,nm16,nm17;
    --     dbms_output.put_line(qry);
         dbms_output.put_line(nm16);
         dbms_output.put_line(nm17);
         EXCEPTION
              WHEN NO_DATA_FOUND THEN
                   dbms_output.put_line('No data found for Query '||ctr);
         END;
    END LOOP;
    EXCEPTION
         WHEN NO_DATA_FOUND THEN
              dbms_output.put_line('No data found for Query '||ctr);
    END;
    2. So then I used REF CURSOR to create a stored procedure and return the values. That allowed me to run my query AND tokenize the tablenames with a counter so that it would loop through the different tables! However, I still could not get it to display the results without going to SQL Plus and typing 'print c;'.
    3. So, finally I tried to create a looping wrapper around the ref cursor to have some variable (ctr) increment so my query would get performed on table0_cells through table17_cells. This, too, did not work.
    If I manually go to SQL Plus and type:
    variable ctr number
    begin
    :ctr := 1;
    end;
    exec dupe_find(1,:c);
    it will execute for the first table (klx_uln_p001_cells) and I can then type 'print c' to see what was returned. But when I try putting this within a wrapper PL/SQL block with a Loop to make ctr go from 0 - 17 (to loop through table_names klx_uln_p000_cells to klx_uln_p017_cells), it does not work.
    Help! It should be very simple to loop through tables, shouldn't it? I just want a script that will loop through tables, perform a query on each table and display the results. For some reason, I can only find documentation examples on looping through columns that are all in the same table.
    Dave

    Here's a working example using your first strategy ...
    create table t1 (id number);
    create table t2 (id number);
    insert into t1 values (100);
    insert into t1 values (101);
    insert into t2 values (200);
    insert into t2 values (201);
    declare
    v_table_name user_tables.table_name%type;
    type ttab_id is table of t1.id%type index by binary_integer;
    tab_id ttab_id;
    begin
    for i in 1 .. 2 loop
    v_table_name := 't' || i;
    execute immediate 'select id from ' || v_table_name
    bulk collect into tab_id;
    dbms_output.put_line('query from ' || v_table_name);
    for j in 1 .. tab_id.count loop
    dbms_output.put_line(tab_id(j));
    end loop;
    end loop;
    end;
    There are many other ways to do this (especially if you need to do more than just print out the data).
    Richard

  • HELP! FOR LOOP TO SCROLL THROUGH TABLE AND CREATE DATABASE LINK

    Hi,
    Here's the scenario, not much of a PL programmer, just basic SQL so really need some help people!
    I have 2 tables. 1 contains list of DB's and the other contains rules to follow.
    I need to create a loop that goes through the table containing the DB's and on each row a DB link is created (Only 1 link allowed!)
    Once created, the schema currently logged in with also has an account on the linked DB in order to run scripts- The scripts are stored centrally hence the requirement for the link to the target DB.
    There are numerous scripts that need to be executed and can all be called from 1 script, once executed the loop exists and the database link needs to be dropped.
    Once dropped, the first loop continues, creating a DB link for the next DB listed in the table (and all the scripts are fired again)
    This continues against all the DB's listed in the table.

    Hi BlueShadow,
    Thanks again for the response, you've hit the nail on the head. SQL scripts on a unix server, a loop goes through a table 1 at a time. Each row gets a link created and then all the scripts stored on the server are executed against the db linked to. So I'm assuming this is a loop within a loop.
    1 loop to go through the table to create the link and then another loop within once connected to execute all the scripts against the connected DB. Once the scripts are run, the loop exits and moves onto the next server and so on until all the servers have the scripts are run.
    It's PL/SQL scripts we're after and not shell scripts as this would free us from the OS constraints.
    We have to drop the links due to security. Any idea on o

  • Loop through tables based on data dict values

    Hi,
    I working on an old v7.3.4 database that I'm not familiar with and I want to loop through the tables and count the occurrence of a field value based on table names i've retrieved from the data dictionary. None of the tables have relational keys defined.
    In a cursor I can loop thru all_tab_columns and load variables with the table, column names, and the datatype, but then I want to use these values in a second nested cursor to loop through each table found by the first cursor.
    When I do :
    Select var_colname from var_tabname
    i get
    The following error has occurred:
    ORA-06550: line 23, column 10:
    PLS-00356: 'V_TABNAME' must name a table to which the user has access
    ORA-06550: line 22, column 5:
    PL/SQL: SQL Statement ignored
    ORA-06550: line 22, column 12:
    PLS-00320: the declaration of the type of this expression is incomplete or malformed
    ORA-06550: line 27, column 7:
    PL/SQL: SQL Statement ignored
    so it would seem I can't use a variable to substitute the table name in the 'from' clause. Does anyone know of a way round this ?
    Thanks in advance

    Hi,
    You will have to use dynamic sql to create your second cursor.
    DECLARE
         v_sql_query VARCHAR2(400);
         TYPE cur_typ IS REF CURSOR;
         c1 cur_typ;
         mYRec MyTable%rowtype;
    BEGIN
         v_sql_query := 'select * from MyTable';
         OPEN c1 FOR v_sql_query;
              LOOP
              FETCH c1 INTO mYRec;
                   EXIT WHEN c1%NOTFOUND;
                   EXIT WHEN c1%NOTFOUND IS NULL;
    /*processing here*/
              END LOOP;
         CLOSE c1;
    END;
    Regards

  • Loop through table

    is it possible to loop through the xml table in the report?
    i use xml as datasource. can i create my own function to find the specified value i need.
    how to create sql expression in cr4e?
    thanks,

    Note that SQL and XML are incompatible considerations.
    You sound as if you're looking for data pre-/post- processing, which CR4E is not designed to do.  It'll filter data, link disparate recordsets, but looping across XML isn't something it's specifically designed to do.
    If you can give some indication of what your ultimate task is, then there may be more options.
    Sincerely,
    Ted Ueda

  • Looping through table in ADOBE TABLE...HOW?

    Hi,
    I'm having a problem with writing scripts on looping through a dynamic table in adobe and disabling certain cell in the table.
    can some one write me the script to help me out...please.... here is my email add. [email protected]
    Regards,
    Vinod

    Hi Denise
    You can use tableView for this which is available in htmlb.
    There is a attribute in tableView called visibleRowCount.
    The integer value that u give for this attribute , only that number of rows will be visible on your BSP page.
    This is the sample code :
          <htmlb:tableView id              = "tb1"
                           headerText      = "Communication"
                           headerVisible   = "true"
                           design          = "alternating"
                           visibleRowCount = "4"
                           fillUpEmptyRows = "true"
                           table           = "<%= itab %>" >
                    <htmlb:tableViewColumn
                     columnName     = "CURRENT_STATE"
                     title          = "CURRENT STATE"
                     edit           = "TRUE" />
    .                     </htmlb:tableView>
    Here tableview id  and table is mandotory field.
    Give as many tableViewColumn as u have column in your internal table ( Here CURRENT_STATE is the name of the Column that I have in my internal table).
    Here visibleRowCount is 5, so only 5 rows will be visible at a time .For other entries u have to click on
    my click handler which is like a footer in a tableView, and next 5 entries will become visible and like that.
    Before implementing this, fill your internal table
    in OnCreate in Flow logic ( in do_init in case of MVC).

  • Loop through table's rows

    Hi folks,
    I have a table with multiple rows which each one of them contains one dropdown list.
    In my code I want to loop through this table rows and check each dropdown list's selected-item.
    How can I do this in code(JavaScript).
    Thank you,
    Yair

    Check this thread,
    it has solutions for JavaScript ind FormCalc.
    http://forums.adobe.com/message/3345384#3345384

  • Loop through table in XI

    Hi Guys,
    I have scenario where i call a BAPI and get return parameter as a table. I want to loop through this table in XI/BPM. Can i get some help on how to loop thorugh table in XI?

    Hi yashpal,
    Bloack Step in a BPM is used to process a sequence of steps repeatedly  for different information.
    The block step can be processed using FOR EACH and PAR FOR EACH. For each will process the info one after the other and PAR FOR EACH will do it in parallel.
    For more info on the Block Step Type in particular and the BPM in XI , check these links,
    http://help.sap.com/saphelp_nw04/helpdata/en/f6/e1283f2bbad036e10000000a114084/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/62/dcef46dae42142911c8f14ca7a7c39/content.htm
    http://help.sap.com/saphelp_nw04/helpdata/en/3c/831620a4f1044dba38b370f77835cc/content.htm
    Hope this helps,
    Regards,
    Bhavesh

  • Question about Looping through tables in Adobe Form

    Hello,
    We have an adobe form which is to be filled offline. It consists of a table. Table can have repeating rows and user can add\remove rows as they wish.  The cardinality of the context node where we need to bind this table data is set to 1…n
    We want to know the process to get all the values in the table back into our context node once the form is uploaded. I assume we need to loop through the table, and add elements to the context node.  Can someone please let us know if we’re on the right track, and provide some sample code if possible?
    <b>We can’t figure out a way to loop through a table inside an Adobe form.</b>
    We are using Web Dynpro Java with Adobe Livecycle Designer 7.1
    Your help is much appreciated.
    Thanks,
    Rob.

    Try using...
    for (z = 0; z < 16; z++) {
         this["cb"+z].setStyle("styleName", "cssCBstyle");
    That is the way to target them.  I haven't dealt with setting styles, so I can't answer for that aspect working or not.

  • Modify the structure of internal table which created dynamically!!!

    HI All,
    I am creating internal table dynamically using the below syntax.  Now I need to remove few of the fields from the internal table structure. Could you please help me how to go ahead in these cases?
    * Create table dynamically for local data
      CREATE DATA gv_table_l TYPE TABLE OF (<fs_tabname>).
      CREATE DATA gv_wa_l    TYPE (<fs_tabname>).
      ASSIGN gv_table_l->*   TO <fs_local_tab>.
      ASSIGN gv_wa_l->*      TO <fs_local_wa
    >.
    Please let me know if you have any thoughts.
    Thanks,
    Raghu.

    Hi ,
    check this wiki
    [Internal Table|http://wiki.sdn.sap.com/wiki/display/Snippets/Howtocreateinternaltable+dynamically]
    in your case ...
    1.Get filed list based on the type ...make use of  "cl_abap_datadescr=>describe_by_type('MARA'), check for syntax or sample programs...
    2.Delete fields which you dont want to be in your internal table....
    3.Create internal table using method " CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE" ref attached link for sample code by Pinaki...
    regards
    Prabhu

  • Loop through table (beginner question)

    Hello,
    I been reading and reading but can´t seem to do what I want to do.
    I do a lot of forms in Livecycle but can´t seem to understand even the most easy loop.
    Lets say I have a table with two columns and ten rows. Textfields in column A is called Cell1 and in column B Cell2.
    I want to look through all the rows for this:
    If(Cell1.rawValue !== null)
    Cell2.fontColor = "255,0,0";
    else
    Cell2.fontColor = "0,0,0";
    If anyone can help me with this I would be very happy. Mayvbe I can start to understand this since it seems like I´m missing out on some very handy functions,.
    / Anders
    Sweden

    Thank you so much
    And if I would like to limit the loop I write as follows?
    for (var a=0;a<10;a++){    
      if (Row.item(a).Cell1.rawValue!==null)       
        Row.item(a).Cell2.fontColor = "255,0,0";    
      else          
    Row.item(a).Cell2.fontColor = "0,0,0"; }
    Thanks again.
    / Anders
    Sweden

  • Create dynamic field names

    I'm creating a PDF form using iText which takes information from a webpage which has multiple order entries. On my PDF i need to loop through this list and create individual PdfFormFields. The problem is I do not know how many items are ordered. How can I create different form fields?
    i.e.
    for(int i=0; i<orderVector.size(); i++) {
    PdfFormField qty = text.getTextField();
    // each time it loops i need qty to be a different name like qty1, qty2....
    // how do I accomplish this?
    Thanks for you help.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

    How can I create different form fields?You can't dynamically set variable names. But the good news is that you don't
    have to.PdfFormField[] qtyArr = new PdfFormField[orderVector.size()];
    for(int i = 0; i < orderVector.size(); i++) {
        qtyArr[i] = text.getTextField();
    }This creates just the right number of form fields, referred to as qtyArr[0], qtyArr[1], etc.
    Is there some reason why you are using Vector and not ArrayList?

  • Looping through folders and subfolders

    Hi,
    I'm about to create a script to check some tifs and jpgs for the right height and width, resolution and so on.
    I could get it to work if I see the files in the content panel (looping through the files by app.document.getSelection ...
    The script needs to check many files in different subfolders (all in one parent folder), so I don't like to use a collection to reveal all files of all subfolders first and then start the script.
    My plan is to choose the parent folder in the folder panel and the script should  loop through each file of each subfolder ...
    So maybe there's someone who knows a solution for this problem, it would be great!
    Thanks a lot,
    Sebastian.

    Wow,
    That was fast, I'll test it tommorow in the morning, thanks a lot so far!
    Hopefully I'll be able to get our scripts together...
    Thanks
    Sebastian
    Am 05.08.2012 um 20:13 schrieb Paul Riggott <[email protected]>:
    Re: looping through folders and subfolders
    created by Paul Riggott in Bridge Scripting - View the full discussion
    This should get you started...
    #target bridge  
    var folders =[];
    folders = FindAllFolders(Folder(app.document.presentationPath), folders);
    folders.unshift(Folder(app.document.presentationPath));
    for(var a in folders){
    var fileList = folders[a].getFiles(/\.(jpg|tif)$/i);
    for(var p in fileList){
    var thumb = new Thumbnail(fileList[p]);
    var height = thumb.core.quickMetadata.height;
    var width = thumb.core.quickMetadata.width;
    var Resolution = thumb.core.quickMetadata.xResolution;
    if(Resolution ==0) Resolution =72;
    //do your processing here
    //$.writeln(decodeURI(thumb.spec) + "," + height + "," + width + "," + Resolution);
    function FindAllFolders( srcFolderStr, destArray) {
    var fileFolderArray = Folder( srcFolderStr ).getFiles();
    for ( var i = 0; i < fileFolderArray.length; i++ ) {
      var fileFoldObj = fileFolderArray[i];
      if ( fileFoldObj instanceof File ) {  
      } else {
             destArray.push( Folder(fileFoldObj) );
      FindAllFolders( fileFoldObj.toString(), destArray );
    return destArray;
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page: http://forums.adobe.com/message/4599891#4599891
    To unsubscribe from this thread, please visit the message page at http://forums.adobe.com/message/4599891#4599891. In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Bridge Scripting by email or at Adobe Forums
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/message/2936746#2936746.

  • How do I go about this? Creating table while looping through dates?

    How do I do this? Creating table while looping through dates?
    I have a table with information like:
    ID---Date---Status
    1-------04/23-----Open
    1-------04/25-----Open
    2-------04/24-----Closed
    3-------04/26-----Closed
    What I want to do is create another table based on this per ID, but have all the dates/statuses on the same line as that ID number (as additional columns). The problem is that the number of columns needed is to be dynamically decided by the number of dates.
    To illustrate my example, I'm looking to achieve the following:
    ID---04/23 Status---04/24--Status---04/25--Status---04/26--Status
    1----Open--------------<null>-------------Open---------------<null>
    2----<null>------------Closed-------------<null>-------------<null>
    3----<null>------------<null>-------------<null>-------------Closed
    What would be the best way to go about this?
    Can someone please point me in the right direction?
    Would I need to do some looping?
    Thanks in advance!

    thedunnyman wrote:
    How do I do this? Creating table while looping through dates?
    I have a table with information like:
    ID---Date---Status
    1-------04/23-----Open
    1-------04/25-----Open
    2-------04/24-----Closed
    3-------04/26-----Closed
    What I want to do is create another table based on this per ID, but have all the dates/statuses on the same line as that ID number (as additional columns). The problem is that the number of columns needed is to be dynamically decided by the number of dates.
    To illustrate my example, I'm looking to achieve the following:
    ID---04/23 Status---04/24--Status---04/25--Status---04/26--Status
    1----Open--------------<null>-------------Open---------------<null>
    2----<null>------------Closed-------------<null>-------------<null>
    3----<null>------------<null>-------------<null>-------------Closed
    What would be the best way to go about this?
    Can someone please point me in the right direction?
    Would I need to do some looping?
    Thanks in advance!I hope you are asking about writing a query to DISPLAY the data that way ... not to actually create such a massively denormalized table ....

  • How to create Dynamic internal table with columns also created dynamically.

    Hi All,
    Any info on how to create a dynamic internal table along with columns(fields) also to be created dynamically.
    My requirement is ..On the selection screen I enter the number of fields to be in the internal table which gets created dynamically.
    I had gone thru some posts on dynamic table creation,but could'nt find any on the dynamic field creation.
    Any suggestions pls?
    Thanks
    Nara

    I don't understand ...
    something like that ?
    *   Form P_MODIFY_HEADER.                                              *
    form p_modify_header.
      data : is_fieldcatalog type lvc_s_fcat ,
             v_count(2)      type n ,
             v_date          type d ,
             v_buff(30).
    * Update the fieldcatalog.
      loop at it_fieldcatalog into is_fieldcatalog.
        check is_fieldcatalog-fieldname+0(3) eq 'ABS' or
              is_fieldcatalog-fieldname+0(3) eq 'VAL' .
        move : is_fieldcatalog-fieldname+3(2) to v_count ,
               p_perb2+5(2)                   to v_date+4(2) ,
               p_perb2+0(4)                   to v_date+0(4) ,
               '01'                           to v_date+6(2) .
        v_count = v_count - 1.
        call function 'RE_ADD_MONTH_TO_DATE'
            exporting
              months        = v_count
              olddate       = v_date
            importing
              newdate       = v_date.
        if is_fieldcatalog-fieldname+0(3) eq 'ABS'.
          concatenate 'Quantité 0'
                      v_date+4(2)
                      v_date+0(4)
                      into v_buff.
        else.
          concatenate 'Montant 0'
                      v_date+4(2)
                      v_date+0(4)
                      into v_buff.
        endif.
        move : v_buff to is_fieldcatalog-scrtext_s ,
               v_buff to is_fieldcatalog-scrtext_m ,
               v_buff to is_fieldcatalog-scrtext_l ,
               v_buff to is_fieldcatalog-reptext .
        modify it_fieldcatalog from is_fieldcatalog.
      endloop.
    * Modify the fieldcatalog.
      call method obj_grid->set_frontend_fieldcatalog
           exporting it_fieldcatalog = it_fieldcatalog.
    * Refresh the display of the grid.
      call method obj_grid->refresh_table_display.
    endform.                     " P_MODIFY_HEADER

Maybe you are looking for