SSIS question - loop through values in textfile

I am new to SSIS and am trying to create SSIS package.
I have value per line in a text file. There is a table consisting of records with each of the values in the text file. The SSIS package should generate text files for each of the value in the text file with the data from the table.
Details:
Text File – abcd.txt
10
11
12
13
Table
1
10
2
11
3
12
4
13
5
10
6
11
7
12
8
13
9
10
The SSIS package should create the following text files with the records that are associated with 10, 11,12 and 13:
10.txt
11.txt
12.txt
13.txt
Thanks in advance

The package looks like below
1. Add a data flow task to get contents from file onto a staging table (flat file source & oledb destination)
2. Execute SQL task to populate object variable with ID list from staging table
add a object variable in SSIS (@[User::IDList]), use query as below in execute sql task
SELECT ID FROM STagingTable
Set resultset option as FullResultSet and map index 0 to IDList variable in resultset tab
3. Add a ForEachLoop with ADO enumerator and map to IDList variable. Add another int variable ID to receive iterative values
4. Inside Loop add a data flow task with OLEDB Source pointing to table.
use query as
SELECT *
FROM Table
WHERE IDField = ?
map parameter0 to [User::ID] variable in parameter mapping
link to flat file destination and set connectionstring property to expression like below
"<your file folder path>\" + (DT_STR,10,1252) @[User::ID] + ".txt"
to make filename dynamic
execute the package and you'll get different files created for each ID value with related data
similar logic is also explained here with only different being data going to different tabs of excel
http://visakhm.blogspot.in/2013/09/exporting-sqlserver-data-to-multiple.html
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

Similar Messages

  • Loop through values in rows to find faulty data

    Hi all,
    We have a column which is supposed to have values in increasing order.(If it doesn't comply with this rule, we want to discard the row). How do I loop through rows for a particular column, in SQL or PL.SQL?
    Thanks.

    user12295995 wrote:
    If it doesn't comply with this rule, we want to discard the rowNot sure what you mean. It looks like you want to get rid of duplicates. If so, use:
    DELETE tbl WHERE ROWID NOT IN (SELECTMIN(ROWID) FROM tbl GROUP BY col)
    /If you want to identify gaps, use:
    with t as (
               select 1 id from dual union all
               select 2 id from dual union all
               select 3 id from dual union all
               select 4 id from dual union all
               select 5 id from dual union all
               select 11 id from dual union all
               select 12 id from dual union all
               select 13 id from dual union all
               select 21 id from dual union all
               select 22 id from dual union all
               select 23 id from dual
    select  '[' || (prev_id + 1) || ' - ' || (id - 1) || ']' gap
      from  (
             select  id,
                     lag(id) over(order by id) prev_id
               from  t
      where id > prev_id + 1
      order by id
    GAP
    [6 - 10]
    [14 - 20]
    SQL> SY.

  • Cannot loop through values in Node

    Hi Everyone,
    I am using a TreeNestedInTable UI.  I have 2 columns: a Master Column with a TextView Cell Editor, and a field called "Check" whereby one of the values in the Master Column can be selected.  The "checked" attribute of the Check column is mapped to a isChecked attribute in my Node that contains all the data being displayed in the TreeNestedInTable (IncidentAgent Node).
    I would like to loop through all the Check boxes ticked in this TreeNestedInTable and get the corresponding Value to write to a Test Node (to make sure that I am in fact reading all cheked rows).
    I do not seem to, however, get all the values checked.  Please see my code below and comment.  I am testing and so I put a button on the screen that should loop through all the values and see which ones are checked.  It should then write these checked valus to a node that is also linked to a table control on the screen.  The Idea is that each time you check a few values they should be displayed in this table control when the button is pressed.  This is not happening - the table stays blank.
    public void onActionSeeIACollection(com.sap.tc.webdynpro.progmodel.api.IWDCustomEvent wdEvent )
        //@@begin onActionSeeIACollection(ServerEvent)
           IWDMessageManager msgMgr = wdComponentAPI.getMessageManager();
           //New Element added each time:
           ITEST_IA_NODEElement newElement;
           //Incident Agent element:
           IIncidentAgentElement agentElement;
           //Loop through ALL the IncidentAgent Elements and see which ones hace got the "Check" value
           //flagged:
           for(int i=0;i<wdContext.nodeIncidentAgent().size();i++)
                //Get the currently processed element:
                agentElement = wdContext.nodeIncidentAgent().getIncidentAgentElementAt(i);
                //If the Check value is flagged, add it to the TEST_IA_NODE node:
                if(agentElement.getCheck())
                     newElement = wdContext.createAndAddTEST_IA_NODEElement();
                     newElement.setVALUE(agentElement.getVALUE());
                     msgMgr.reportSuccess(agentElement.getVALUE());
                }//end if
           }//end for
        //@@end

    Sure.  Thank you for your help.
    "Data Containing" Node:
    h1  IncidentAgent(Top Level Node)
         h2 RecursiveNode(Pointing to IncidentAgent as recursiveNode)
           h4 Check (boolean attribute)
           h4 ChildrenLoaded (boolean attribute for TreeNestedInTable)
           h4 Expanded (boolean attribute for TreeNestedInTable)
           h4 IsLeaf (boolean attribute for TreeNestedInTable)
           h4 NODE_ID (attribute)
           h4 PARENT_ID (attribute)
           h4 VALUE (attribute)
    Collection Cardinality: 0...N
    Selection Cardinality: 0...N
    Singleton: TRUE
    Node that should contain VALUE attribute from node above if Check attribute above is checked
    h1 TEST_IA_NODE
           h4 VALUE
    Collection Cardinality: 0...N
    Selection Cardinality: 0...N
    Singleton: TRUE

  • How Do I get SSIS To Stop Looping Through Excel Rows After Last Populated Record?

    I have a package that loops through many excel files. Each Excel File has about 5000 rows. My problem is that after the 5000th row SSIS keeps looping through all the rows after the last row. There are nothing in these rows. This is a complete bottleneck
    of my package because it takes forever when doing this. How do I stop this?
    Thanks

    Another way is to specify the range in select statement which can be done in two ways
    http://getsetsql.blogspot.in/2012/01/using-ssis-load-data-to-excel-sheet-at.html
    http://sqlserversolutions.blogspot.in/2009/02/selecting-excel-range-in-ssis.html
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Loop through Query String in ASP

    Hi,
    I am new to ASP and am trying to loop through values in a
    query string
    separated by a comma, for example:
    /site/search/results.asp?ids=19736a,20248a,14952a,19956a
    I need to construct SQL from this something like
    SELECT * FROM MyTable WHERE
    ID = 19736a OR
    ID = 20248a OR
    ID = 14952a OR
    ID = 19956a
    I am just unsure on how to separate all the values from the
    query string.
    Thanks for your advice.

    Oh, in the example below there is no space between the id
    numbers in the
    querystring.
    eg. ids=1,23,456,2
    If you do have spaces then you need to adjust the split
    accordingly
    eg. ids=1, 23, 456, 2
    you would use myIdArray=split(idStr,", ")
    note the space after the comma.
    just make sure you always use the same format in your
    querystring
    Justin
    "Justin Reid" <[email protected]>
    wrote in message
    news:e6osem$dfj$[email protected]..
    > You need to create an array of ids and then add them to
    your SQL.
    > Something like:
    > <%
    > If Request.QueryString("ids") <> "" Then
    > Dim idStr, cnt, varID
    > 'get the string of id'
    > idStr = Request.QueryString("ids")
    > 'create the array
    > myIdArray=split(idStr,",")
    > cnt=0
    > 'loop though the array and add to a new string
    > for i=o to ubound(myIdArray)
    > If cnt > 0 Then varID = (varID & " OR")
    > varID = (varID & " id = " & cStr(myIdArray(i)))
    > cnt=cnt+1
    > next
    > End If
    > %>
    >
    > Then simply add you new SQL segment to your recordset.
    > Something like
    >
    > SELECT * FROM MyTable WHERE" + Replace(varID, "'", "''")
    + "
    >
    > Hope that helps
    >
    > Justin
    >
    > "Shaun" <[email protected]> wrote in
    message
    > news:e6ole1$56v$[email protected]..
    >> Hi,
    >>
    >> I am new to ASP and am trying to loop through values
    in a query string
    >> separated by a comma, for example:
    >>
    >>
    /site/search/results.asp?ids=19736a,20248a,14952a,19956a
    >>
    >> I need to construct SQL from this something like
    >>
    >> SELECT * FROM MyTable WHERE
    >> (
    >> ID = 19736a OR
    >> ID = 20248a OR
    >> ID = 14952a OR
    >> ID = 19956a
    >> )
    >>
    >> I am just unsure on how to separate all the values
    from the query string.
    >>
    >> Thanks for your advice.
    >>
    >
    >

  • SSIS - Loop through files from a file path based on the value in the variable

    Experts,
    I have a requirement where I'll be loading multiple files in to a SQL server table and archive the files when loaded. However, the challenge is , the file path should be dynamic based on the value of a variable (say, @ProductName).
    For example: If I am running the package for variable @ProductName="Product", the file path would be "\\....\Src\Product", in that case the ForEachLoop will loop through all the files in that folder, load them to the table and Archive
    the files to the "\\....\Src\Product\Archive" folder.
    Similarly, if the @ProductName="Product_NCP", the foreachloop container should loop through files in the "\\....\Src\Product_NCP" folder, load them to the table and archive them to the ""\\....\Src\Product_NCP\Archive"
    folder.
    Any suggestions? I should be able to run the package manually just by passing the "@Product" value, create Archive folder if it doesn't exist, load the data and archive the files.

    Yes
    1. Have a variable inside SSIS to get folder path. Set path based on your rule using an expression
    like
    (@[User::ProductName] == "Product" ? "\\....\Src\Product" : (@[User::ProductName] == "Product_NCP" ? \\....\Src\Product_NCP:..))
    similary archive
    (@[User::ProductName] == "Product" ? "\\....\Src\Product\Archive" : (@[User::ProductName] == "Product_NCP" ? "\\....\Src\Product_NCP\Archive" :..))
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Forms 6i loop through datablock question

    I am writing a piece of code to loop through items with in a datablock to programmatically set the width between each field.
    I created my data block through the wizard, but then manually added some fields. I have them listed in the order I expect them to be navigated, which is the order I expect them to appear on the screen.
    When I am looping through the data block, I was assuming that next_item would go to the next navigable item, and it doesn't.
    For example, I have items received_today, worked_today, total_waiting, total_for_today, total_calls, total_priority.
    When the code loops through the data block, it actually loops in this order: received_today, worked_today, total_callbacks, total_priority, total_waiting, total_for_today.
    I even set the next navigation item property for each item, but that didn't help.
    My questions:
    1. Is there a way to control what order the data block loops through items?
    2. Why does this line get_item_property(get_block_property(block_name, FIRST_ITEM), x_pos); sometimes return null? (in my "proof of concept" form it returns a value, but the form I am modifying does not)
    Following is my code:
    PROCEDURE set_x_y_positions IS
         current_x_position pls_integer;
         current_y_position pls_integer;
      block_name varchar2(30) := 'BLOCK22';
      CurrentItem varchar2(30);
    BEGIN
      go_block(block_name);
      current_x_position := get_item_property(get_block_property(block_name, FIRST_ITEM), x_pos);
      current_y_position := get_item_property(get_block_property(block_name, FIRST_ITEM), y_pos);
          go_block(block_name);
      loop
           BEGIN
                if :system.cursor_item <> (block_name || '.' || get_block_property(block_name, FIRST_ITEM))
                     and get_item_property(:system.current_item, displayed) = 'TRUE' then            
                  SET_ITEM_PROPERTY(:system.current_item, x_pos, current_x_position + 38);
                  current_x_position := get_item_property(:system.current_item, x_pos);
                end if;
                if :system.cursor_item = 'BLOCK22.INTERNATIONAL' THEN--block_name || '.' || get_block_property(block_name, LAST_ITEM) then
                          exit;
                else
                     next_item;
                end if;
           END;
      end loop;
    END;I am using Forms 6i version 6.0.8.26.0
    Thank you!
    Katia

    I do have an exit, and yes it does run well.
         if :system.cursor_item = 'ATS_MON_REPORTING_QUEUES_VW.INTERNATIONAL' THEN--block_name || '.' || get_block_property(block_name, LAST_ITEM) then
                          exit;
                else
                     next_item;
                end if;That redundant go_block is there because I had some output going to a dummy field in another block, so I had to make sure it was navigating back to the block. But yes, in this code example, that go_block is redundant.
    Thank you, adding the
    current_x_position := get_item_property(block_name||'.'|| get_block_property(block_name, FIRST_ITEM), x_pos);
      current_y_position := get_item_property(block_name||'.'|| get_block_property(block_name, FIRST_ITEM), y_pos); worked perfectly.

  • How to loop through a collection of records which is return value of func.

    Hi all.
    Have this situation:
    - Stored function (member of pkg procedure) that returns a collection of records.
    Package Spec:
    =========
    type tipo_pvt is table of s08_plan_venta_totalizado_r % rowtype;
    rc_pvt tipo_pvt;
    (s08_plan_venta_totalizado_r is a view).
    Package Body:
    =========
    select col1
    ,col2
    ,etc
    bulk collect into rc_pvt
    from s08_lista_precio_producto_r lpp
    ,s03_producto_r prd
    where condition;
    return rc_pvt;
    Once collection is loaded and returned (i know it loads records). I just want to loop through every record on a pl/sql procedure on the client (forms6i procedure), but it gives me the error: ORA-06531 Reference to uninitialized collection:
    On the forms6i client procedure i have something like:
    procedure p_carga_plan_venta_inv (p_id_plan_venta in number) is
    v_contador integer;
    v_mensaje varchar2(10);
    rc_pvt sk08_gestiona_plan_venta.tipo_pvt; (sk08_gestiona_plan_venta is package name)
    begin
         rc_pvt := sk08_gestiona_plan_venta.tipo_pvt();
         rc_pvt := sk08_gestiona_plan_venta.f_genera_plan_venta_inv (:pvv.lip_id_lista_precio
    ,:pvv.ems_id_sucursal
                                            ,:control4.v_metodo_calculo
    ,:pvv.unm_co_unidad_monetaria
    ,:pvp.fe_fin_periodo) ;
    -- previous statement dos not fail BUT THIS:
    message('rc_pvt.count= '||rc_pvt.count);pause;
    DOES FAIL
    end;
    So my question is : since i have already returned the collection, how come is not initialized....?
    Do i have to extend it first? In this case i have to return the number of records in the collection.....
    Look what happen when done from sqlplus:
    declare
    rc_pvt sk08_gestiona_plan_venta.tipo_pvt;
    begin
    rc_pvt := sk08_gestiona_plan_venta.tipo_pvt();
    rc_pvt :=
    sk08_gestiona_plan_venta.f_genera_plan_venta_inv (8713171
    ,null
    ,'m'
    ,'BS.F'
    ,to_date('28/02/2001','dd/mm/yyyy'));
    end;
    SQL> /
    Registros en la coleccion =6
    Procedimiento PL/SQL finalizado con éxito.
    SQL>
    I put a dbms_output.put_line on stored function .....
    Please help ....!
    Apparently it fails when calling the stored function:
    rc_pvt := sk08_gestiona_plan_venta.f_genera_plan_venta_inv (:pvv.lip_id_lista_precio
    ,:pvv.ems_id_sucursal
    ,:control4.v_metodo_calculo
    ,:pvv.unm_co_unidad_monetaria
    ,:pvp.fe_fin_periodo) ;
    I don't undestand since this function return the appropiate type. It seems the collection is empty, although having test that on sqlplus works ...
    rc_pvt := sk08_gestiona_plan_venta.f_genera_plan_venta_inv (:pvv.lip_id_lista_precio
    ,:pvv.ems_id_sucursal
    ,:control4.v_metodo_calculo
    ,:pvv.unm_co_unidad_monetaria
    ,:pvp.fe_fin_periodo) ;
    function f_genera_plan_venta_inv (p_id_lista_precio in number
    ,p_id_sucursal in number
    ,p_tipo_nivel_inv in varchar2
    ,p_co_unidad_monetaria in varchar2
    ,p_fe_fin_periodo in date) return tipo_pvt;
    for some reason it works on plus:
    SQL> declare
    2 rc_pvt sk08_gestiona_plan_venta.tipo_pvt;
    3 begin
    4 rc_pvt := sk08_gestiona_plan_venta.tipo_pvt();
    5 rc_pvt :=
    6 sk08_gestiona_plan_venta.f_genera_plan_venta_inv (8713171
    7 ,null
    8 ,'m'
    9 ,'BS.F'
    10 ,to_date('28/02/2001','dd/mm/yyyy'));
    11 --
    12 dbms_output.put_line('Registros en la coleccion = '||rc_pvt.count);
    13 for i in 1 .. rc_pvt.count loop
    14 --
    15 dbms_output.put_line('En '||i||rc_pvt(i).prd_co_producto);
    16 end loop;
    17 end;
    18 /
    Registros en la coleccion =6
    Registros en la coleccion = 6
    En 1PT.REF.PET.KO05
    En 2PT.REF.PET.LM15
    En 3PT.ALM.VDR.001
    En 4PT.REF.GRN.CN
    En 5PT.REF.GRN.KO
    En 6PT.REF.GRN.LM
    Procedimiento PL/SQL finalizado con éxito.
    Don't understand why it works on plus8 (same version that comes with 6i).
    Can't loop through records on forms...? WHY ...?
    Edited by: myluism on 02-abr-2012 14:40

    Forms 6i is an antique ... write your code to run on the server.
    Multiple examples of how to loop through an array loaded with bulk collect can be found here.
    http://www.morganslibrary.org/reference/array_processing.html
    The main library page is:
    http://www.morganslibrary.org/library.html

  • Question on how to loop through a variable amount of objects

    I have a csv file which I am parsing with powershell and it works perfectly. I would like to speed it up. Currently, I call a line that is customized for each groups list of subnets.
    I have about 30 groups.
    Some groups have one subnet, some have 5 subnets.
    I want to set up some sort of loop to parse everything while executing a single Import-CSV. Currently I call Import-CSV once per group. It takes me about 2-4 minutes to parse the entire file depending on the speed of the machine.
    The csv file has about 30,000 rows. I am not concerned about running out of resources. This is as much a learning challenge as a desire to make better powershell scripts.
    Below is a portion of the one liner that would parse the entire csv file looking only for those items that match, and writing them out to that groups specific csv file.
    Example #1
    Import-Csv $HostList |  Where-Object {$_."IP Address" -Match "^192.1.*" -or $_."IP Address" -Match "^192.2.*" -or $_."IP Address" `-Match "^192.3.*"  .....}| do more stuff...
    Example #2
    Import-Csv $HostList |  Where-Object {$_."IP Address" -Match "^192.7.*" ....}| do more stuff...
    The example above is just a snippet from code that works perfectly.
    The problem I am asking for help with is, when I loop through the items I am matching against (subnets), if one group has 3 items to match against, another has 1, another has 7, how do I set up such a loop?
    Am I using some sort of 'while'  $_."IP Address" or...?
    Do I create a big 30,000 array (Does PS even use arrays?)
    I would love to know what this type of looping is called, and what I can read with examples on how to understand approaching this challenge..
    Thank you for any help.
    -= Bruce D. Meyer

    The reason for the parsing (I thought I explained it, must have been too vague) is I have about 30 agencies in a csv file.
    Each agency can be determined by their subnet(s) and domain(s)
    I need to put all lines in the csv relating to each agency in their own separate csv file to distribute to them so I am not sharing agency 'A' info with the other 29 agencies.
    I get the regex comment. Thank you. For some reason I am rather hesitant to use PCRE under windows. I'll see how it works.
    Your comment on "Reloading a large file repeatedly takes more time", is the exact reason why I asked the question. I want to get away from that.
    I appreciate your quick reply, I think your example will work nicely. 
    -= Bruce

  • 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..getProperties --Simple question!

    Hello,
    I like to use System.getProperties() and display the name and value of each property by loop through all properties (without specify the name for a particular property).
    It sounds very simple but I cannot find any example code in Java's online documentation.
    Thanks for any help

    Try these lines of code:
    public class test
        public static void main (String args[])
            java.util.Properties systemProps = System.getProperties();
            String name = "";
            String value = "";
            for (java.util.Enumeration names = systemProps.propertyNames(); names.hasMoreElements() ;) {
                name = (String)names.nextElement();
                value = systemProps.getProperty(name);
                System.out.println("property '"+name+"' has value '"+value+"'");
    }

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

  • Looping through char values

    This seems simple, but I'm having a brain fart today.
    As part of a method, I concat two strings - I need to put a placeholder between them that is guaranteed not to exist in either of the other strings. My idea was to simply loop through some ints, and use that as an ascii value. I'm missing the actual assignment. Can someone please fill in the blank or suggest another method?
    for (int x=33;x<127;x++){
    //set a new char who's ascii value is x
    Thanks in advance

    Actually for single digit conversion this works, as int and char are both 32 bit integral primitive data types;-
    charAlphabetArray[0] = 65;
    charAlphabetArray[1] = 66;
    charAlphabetArray[2] = 67;
    charAlphabetArray[3] = 68;
    however this doesn't, you will get (something like this) "possible loss of precision found char required int"
    for (int i=65; i<91; i++) charAlphabetArray = i;
    IMO, its a compiler inconsistency

  • I need to loop through 1 table and read another until a value changes

    i need to read a table and sum the quantity field until a reason code changes.  how do I go about doing this?

    sort itab by reasoncode.
    Loop at itab.
    quantiy = quanity  + itab-quantity.
    at end of reasoncode.
    jtab-reasoncode = itab-reasoncodee.
    jtab-sum = quantity.
    append jtab.
    clear quantity.
    endat
    endloop.
    or
    sort itab  by reasoncode.
    loop at itab.
    at end of reasoncode.
    sum.
    jtab = itab.
    append jtab.
    endat.
    endloop.
    or
    let us say itab and jtab are two tables and you want to loop through itab and read jtab for reasoncodes.
    if jtab has only one entry for each entry in itab then use read else use loop.
    loop at itab.
    loop at jtab where reasoncode = itab-reasoncode.
    quantiy = quantiy + jtab-quanity.
    endloop.
    endloop.
    or
    loop at itab.
    read table jtab with key reasoncode = itab-reasoncode.
    if sy-subrc eq 0.
    endif
    endloop.

  • Questions reg Looping through a Node inside a Currently Selected Node.

    i have the following context structure in my WD application.
    Parent Customer Node  A<Cardinality 1.n & Selection 1.n & Singleton True>
          Child Addresses Node B<Cardinality 1.n & Selection 1.n & Singleton True>
                  Child Attribute B.City
          Child Attribute A.Name
          Child Attribute A.Age
    For the currently selected Parent Customer Element, i want to read the all the addresses this customer has. How to read all the addresses of the customer and loop through it & show it.
    Any inputs are appreciated.

    Hello Saravanan,
    Please use the Singleton Concept.
    Refer the following links.
    http://help.sap.com/saphelp_nwce711core/helpdata/en/47/be673f79c8296fe10000000a42189b/frameset.htm
    http://wiki.sdn.sap.com/wiki/display/WDJava/SupplyFunctionin+Webdynpro
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/60086bd5-9301-2b10-6f97-a14366a5602b/
    if you have doubt in implementation then let us know.
    Regards
    Nizamudeen SM

Maybe you are looking for

  • Documents not appearing in Pages/Numbers

    I've uploaded a number of documents from my MacBook Air (OS X 10.7.2), when I open Pages or Numbers on my iPhone 4S (iOS 5), none of the documents show up, or I just don't know how to access them. Thoughts?

  • Variable Authorization Issue..

    Hi,    i created narly 20 variables. When user trying to save the Query with new Variables. he is getting " You do not have Authorizations to add or create. How can i restrict Users to use these Variables. What r u the spets i need to take care.? Cou

  • My apps keep crashing after the 7.1 update. Help, please?

    After the update, I have noticed that my apps keep crashing even after I have updated the said apps. It's getting worse and, frankly, very annoying. How do I resolve this issue? Please help.

  • ALV user Tracking Report

    Hi experts, can any body tell me how can i make a ABAP  ALV Report which give number of user login in into the system for how long time with all details based on the user specified date,username,tcode  and time on selection screen for example - .user

  • Problem with Tiger page in Discussions when logged in

    This problem only shows in Firefox (my usual browser) not other browsers and only when I am logged in to Discussions, not when logged out. I have not seen it on any other page in Discussions. It is recent. If I go to the top page in Discussions for T