title: How to set multiple data in JCO Table using RFC?
body: <p>I want to add multiple data in my <code>JCO Table</code> using RFC to SAP server.</p>
  
  <p>Below is my Code. </p>
  
  <p><strong>But problem is only last raw will be set to sap.</strong> </p>
  
  <p>What I am missing?</p>
  
  <p>I am using one function for sync data with SAP.</p>
  
  <pre><code>JCO.Function function = null;
  JCO.Repository mRepository;
  
  public String updateCustomerToSAP(String bapi){
  
      String message = null;
      Connection conn = new Connection();
      JCO.client mConnection = conn.open();
      JCO.Table GETZPRTL_VISIT = null;
      mConnection.connect();
  
      try{
          function = this.createFunction(bapi);
          if(function == null){
              // Not fount
          }else{
              GETZPRTL_VISIT = function.getTableParameterList().getTable("CUSTOMER_VISIT");
  
              for(int i = 0 ; i &lt; 10 ; i++){
                  GETZPRTL_VISIT.appendRow();
                  GETZPRTL_VISIT.setValue("0001 "+i,"ID");
                  GETZPRTL_VISIT.setValue("john_ro "+i,"USER_NAME");
                  GETZPRTL_VISIT.setValue("John "+i,"FIRST_NAME");
                  GETZPRTL_VISIT.setValue("Martin "+i,"LAST_NAME");
                  GETZPRTL_VISIT.setValue("john.martin@gmail.com "+i,"EMAIL");
              }
  
              // Above data is just for and example. I fetch those data from ArrayList and all data are diffrent.
  
              function.getImportParameterList().setValue("Data1","USER_ID");
              function.getImportParameterList().setValue("type goes here","TYPE");
              function.getImportParameterList().setValue("reason goes here","REASON");
              function.getImportParameterList().setValue("final status","STATUS");
              function.getImportParameterList().setValue("0001","NUMBER");
  
              mConnection.execute(function);
              message = (String) function.getExportParameterList().getValue("MESSAGE");
  
          }
      }catch(Exception e){
  
      }
      conn.disconnect();
  
      return message;
  } 
  
  public JCO.Function createFunction(String name) throws Exception{
      try{
          IFunctionTamplate ft = mRepository.getFunctionTamplate(name.toUpperCase());
  
          if(ft == null)
              return null;
          return ft.getFunction();
  
      }catch(Exception e){
          throw new Exception("Problem retriving JCO.Function object"+ e);
      }
  }
  </code></pre>
  
  <p>Here <strong>CUSTOMER_VISIT</strong> is <strong>Table</strong> which is inside of my RFC.</p>
  
  <p><strong>Structure Example</strong></p>
  
  <pre><code>USER_ID
  TYPE
  REASON
  STATUS
  NUMBER
  CUSTOMER_VISIT    &lt;= This is Table inside function module.
  </code></pre>
  
  <p><strong>CUSTOMER_VISIT</strong> Table Structure</p>
  
  <pre><code>ID
  USER_NAME
  FIRST_NAME
  LAST_NAME
  EMAIL
  </code></pre>