<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Iterate through a User Table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/iterate-through-a-user-table/m-p/11942844#M1965735</link>
    <description>&lt;P&gt;Hi everyone, hope someone can help. I would like to run through the lines of a user table, once I have two values from a recordset. Let's say I have one record with Code=1 and U_MyValue=1 and another with Code=1 and U_MyValue=2. How can I fetch then every record from the user table in order to update it?&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;public IRecordset getRecordsetFromSQL( String sql ) {
    IRecordset rs = null;
    try {
        rs = SBOCOMUtil.newRecordset(getICompany());
        rs.doQuery(sql);
    } catch ( SBOCOMException e ) {
        e.printStackTrace();
    }
    return rs;
}


public void updateUserTable() {
      try {
        String sql = "SELECT Code, [U_MyValue] FROM [@MYTABLE]";
        IRecordset rs = getRecordsetFromSQL(sql);
        IUserTables iUserTables = iCompany.getUserTables();
        IUserTable iUserTable = iUserTables.item("MYTABLE");
        rs.moveFirst();
        while ( !rs.isEoF() ) {
            String key= rs.getFields().item("Code").getValue().toString();
            String myValue= rs.getFields().item("U_MyValue").getValue().toString();
            
           
         // HERE I DON'T KNOW HOW TO FETCH EVERY RECORD IN ORDER TO UPDATE IT
            iUserTable.update();

            rs.moveNext();
        }
    } catch ( Exception ex ) {
        System.out.println(iCompany.getLastError().getErrorMessage());
    } 

}
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Thu, 25 Apr 2019 04:15:04 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2019-04-25T04:15:04Z</dc:date>
    <item>
      <title>Iterate through a User Table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/iterate-through-a-user-table/m-p/11942844#M1965735</link>
      <description>&lt;P&gt;Hi everyone, hope someone can help. I would like to run through the lines of a user table, once I have two values from a recordset. Let's say I have one record with Code=1 and U_MyValue=1 and another with Code=1 and U_MyValue=2. How can I fetch then every record from the user table in order to update it?&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;public IRecordset getRecordsetFromSQL( String sql ) {
    IRecordset rs = null;
    try {
        rs = SBOCOMUtil.newRecordset(getICompany());
        rs.doQuery(sql);
    } catch ( SBOCOMException e ) {
        e.printStackTrace();
    }
    return rs;
}


public void updateUserTable() {
      try {
        String sql = "SELECT Code, [U_MyValue] FROM [@MYTABLE]";
        IRecordset rs = getRecordsetFromSQL(sql);
        IUserTables iUserTables = iCompany.getUserTables();
        IUserTable iUserTable = iUserTables.item("MYTABLE");
        rs.moveFirst();
        while ( !rs.isEoF() ) {
            String key= rs.getFields().item("Code").getValue().toString();
            String myValue= rs.getFields().item("U_MyValue").getValue().toString();
            
           
         // HERE I DON'T KNOW HOW TO FETCH EVERY RECORD IN ORDER TO UPDATE IT
            iUserTable.update();

            rs.moveNext();
        }
    } catch ( Exception ex ) {
        System.out.println(iCompany.getLastError().getErrorMessage());
    } 

}
&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Apr 2019 04:15:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/iterate-through-a-user-table/m-p/11942844#M1965735</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-04-25T04:15:04Z</dc:date>
    </item>
  </channel>
</rss>

