Fill JCO.Table with Model from TableView

Hi all,
i need to fill a JCO.Table to save some data in a BAPI. I already have the data in form of a DefaulTableViewModel.
Is there a simple way to fill the table with this data, or do I have to loop through the model and fill the table row by row?
Kind regards
Francisco

Hi Francisco,
there is no method which does it for you. I'm not that experienced in this field, but I think it seems hard to create the correct metadata from a HTMLB TableViewModel (for example the data field internal length as well as field types).
Also have a look here: JCO.table creation...
As you may have realized, the other way round - having a JCO.Table, creating a TableViewModel - works via HTMLB JCOTableViewModel.
Hope it helps
Detlev

Similar Messages

  • How to fill a table with data from columns & rows from a txt file

    I am trying to fill say:
    Myname     Myclass     Mycollege
    Mohan     MD     Stanford
    from a txt file into 3 columns of a table. I can easily do it into a textarea component by
    clicking a button:
    try{
    FileReader fr = new FileReader("F:/CreatorProjects1/stan.txt");
    BufferedReader br = new BufferedReader(fr);
    String s1="";
    String s="";
    stantxtarea.setValue(s);
    while((s=br.readLine())!=null) {
    s1 = s1+s;
    s1=s1+"\n";
    stantxtarea.setValue(s1);
    br.close();
    fr.close();
    } catch(Exception e) {
    e.printStackTrace();
    return null;
    All table components seem to need a database. I do not use any database. I run exe files that give output to txt files. How to solve it?
    I appreciate any help in this regard...
    dr.mohan rao

    there may be another way. This is some thing some thing I can recommend. You can create property type of ObjectListDataProvider in session or application based on the scope you required. Create web bean class with property you want to show in the column (say col1, col2, col2). Initialize the list property like similar below
    List dataList = new ArrayList();
    ObjectListDataProvider mytableprops = new ObjectListDataProvider();
    try {
    //start loop read data from your txt file
    //create instance of web bean for each line
    //add web bean instance into dataList
    //end of loop readind data from txt file
    oldpins.setList(dataList );
    oldpins.setObjectType(NotificationProfileBean.class);
    } catch (Exception ee1){;}
    return oldpins;
    Sri Thuraisamy

  • How can I fill a table of objects from cursor with select * bulk collect???

    Hi All, I have a TYPE as OBJECT
    create or replace type dept2_o as object (
    deptno NUMBER(2),
    dname VARCHAR2(14),
    loc VARCHAR2(13));
    I can fill a table of objects from cursor with out select * bulk collect...., row by row
    declare
    TYPE dept2_t IS TABLE of dept2_o;
    dept_o_tab dept2_t:=dept2_t();
    i integer;
    begin
    i:=0;
    dept_o_tab.extend(20);
    for rec in (select * from dept) loop
    i:=i+1;
    dept_o_tab(i):=dept2_o(
    deptno => rec.deptno,
    dname => rec.dname,
    loc =>rec.loc
    end loop;
    for k IN 1..i loop
    dbms_output.put_line(dept_o_tab(k).deptno||' '||dept_o_tab(k).dname||' '||dept_o_tab(k).loc);
    end loop;
    end;
    RESULT
    10 ACCOUNTING NEW YORK
    20 RESEARCH DALLAS
    30 SALES CHICAGO
    40 OPERATIONS BOSTON
    But I can't fill a table of objects from cursor with select * bulk collect construction ...
    declare
    TYPE dept2_t IS TABLE of dept2_o;
    dept_o_tab dept2_t:=dept2_t();
    begin
    dept_o_tab.extend(20);
    select * bulk collect into dept_o_tab from dept;
    end;
    RESULT
    ORA-06550: line 6, column 39;
    PL/SQL: ORA-00947: not enough values ....
    How can I fill a table of objects from cursor with select * bulk collect???

    create or replace type dept_ot as object (
    deptno NUMBER(2),
    dname VARCHAR2(14),
    loc VARCHAR2(13));
    create table dept
    (deptno number
    ,dname varchar2(14)
    ,loc varchar2(13)
    insert into dept values (10, 'x', 'xx');
    insert into dept values (20, 'y', 'yy');
    insert into dept values (30, 'z', 'zz');
    select dept_ot (deptno, dname, loc)
      from dept
    create type dept_nt is table of dept_ot
    declare
       l_depts dept_nt;
    begin
       select dept_ot (deptno, dname, loc)
         bulk collect
         into l_depts
         from dept
       for i in l_depts.first .. l_depts.last
       loop
          dbms_output.put_line (l_depts(i).deptno);
          dbms_output.put_line (l_depts(i).dname);
          dbms_output.put_line (l_depts(i).loc);    
       end loop;
    end;
    /

  • Filling dynamic table with dynamic structure en fields!

    Hello All,
    I have written the following code. Which is okay according the syntax check. But when I run the abap code it will give a syntax error. I want to insert data from database table into internal table. Because the tables that have to read are so many I decided to make a dynamic statement which can be used for all tables. Except it won't work as I wish.
    (LT_FIELDS) content is the dynamic fields which are defined earlier in the code and will change each loop.
    (TAB_X) content is the dynamic internal table which is defined earlier in the code and will change each loop.
    = structure of PA0002.
    (TAB_N) = T_PA0002.
    The code:
              SELECT (LT_FIELDS) FROM (TAB_X) INTO CORRESPONDING FIELDS OF .
              ENDSELECT.
    Can someone give me some advice how to solve this issue?
    During the run at the line "INSERT (TAB_N) FROM . " SAP creates an error like below.
                                                                                    K. tekst                                                                               
    Ein in einem SQL-Befehl genannter Tabellenname ist unbekannt.                                                                               
    Wat is er gebeurd?                                                                               
    Error in ABAP application program.                                                                               
    The current ABAP program "ZPF_R_MUTATIEOVERZICHT_MAIA" had to be terminated                 
         because one of the                                                                         
        statements could not be executed.                                                                               
    This is probably due to an error in the ABAP program.                                                                               
    Foutenanalyse                                                                               
    Es ist eine Ausnahme aufgetreten, die weiter unten näher erläutert wird.                    
        Die Ausnahme, der die Klasse 'CX_SY_DYNAMIC_OSQL_SEMANTICS' zugeordnet ist,                 
        wurde nicht abgefangen und führte deshalb zu einem Laufzeitfehler.                          
        Der Grund für die Ausnahme ist:                                                                               
    In einem SELECT-, UPDATE- oder DELETE-Befehl wurde ein ungültiger                           
        Tabellenname "T_PA0002" angegeben.                                                          
        Aus einem der folgenden Gründe tritt der Fehler erst zur Laufzeit auf:                      
        - der Tabellenname wurde dynamisch angegeben, oder                                          
        - die SELECT-Klausel, WHERE-Klausel, GROUP-BY-Klausel, HAVING-Klausel                       
          oder ORDER-BY-Klausel wurde dynamisch angegeben.

    I Just want to insert data into internal table T_PA0002 from database table PA0002.
    The internal table and database table can change during the runtime of the program. But Its always filling the internal table with data from database table.
    I made it this way because the data I need to extract from data base tables can change depending on the procedures in table T9VS2.
    So I can't know the structure or the table which has to be selected each procedure. Or I have to make a big program with a lot of if or Case statements in it. I want to avoid that! Dynamic table is much quicker to write and understand when it works.
    It wil reduce a lot of code!  I hope someone can give me a hint to solve the problem.

  • Updating Oracle table with info from Sybase query

    I hope this is the correct forum for this question.
    I am fairly new to Java and JDBC. I am trying to figure out what the best method for updating information in Oracle tables with data from a Sybase table. I would prefer to use Oracle’s transparent gateway but this is not an option my company will pay for so I am creating a java stored procedure and using JDBC to connect to the Sybase database.
    The process I think I need to go thru is
    1.     Query an Oracle table to get the records that need to be updated and the “key” information to query the Sybase table with.
    2.     Use that result to query the Sybase database to get the fields that need to be updated in the Oracle table for those records.
    3.     Update the records on the Oracle table with the data from the Sybase query.
    I know I can just do this procedurally, row-by-row, but I was wondering if anyone knows of a way to accomplish this with SQL and no loops. Is there a way to make a result set available as a “SQL table” for another JDBC query?
    Basically what I would like to do is:
    OraQuery = “ select sybinfo from sometable where updated_date = null”;
    Statement orastmt1 = OraConn.createStatement();
    ResultSet Orars1 = orastmt1.executeQuery (OraQuery);
    SybQuery = “select update_date, sybinfo from sybtable where sybinfo = Orars1.sybinfo”;
    Statement sybstmt = SybConn.createStatement();
    ResultSet Sybrs = sybstmt1.executeQuery (SybQuery);
    OraUpdate = “update (select update_date from sometable, Sybrs where sometable.sybinfo = Sybrs.sybinfo) set update_date = Sybrs.update_date”;
    Statement orastmt2 = OraConn.createStatement();
    ResultSet Orars2 = orastmt2.executeQuery (OraUpdate);
    This may not be possible but if anyone has done something similar and wouldn’t mind sharing I would appreciate it. If there is a “better” way of accomplishing this I am open to suggestions.
    Thanks

    you can try using cachedRowSet() for the Oracle side query.
    The rows in this could be populated using the sybase side query's resultset and then all of this could updated into Oracle in one shot.

  • Trying to populate a table with data from WebRowset

    Hi,
    I want to be able to populate my tables with data from WebRowsets that have been saved to files. Everything goes good until I get to acceptChanges(). At which point I get a NullPointerException.
    Here's the code...
    WebRowSet wrs = new WebRowSetImpl();
    FileReader reader = new FileReader(inputFile);
    wrs.readXml(reader);
    wrs.beforeFirst();
    CachedRowSet crs = new CachedRowSetImpl();
    crs.setSyncProvider("com.sun.rowset.providers.RIXMLProvider");
    crs.populate(wrs);
    crs.beforeFirst();
    crs.acceptChanges(con);
    Results in...
    java.lang.NullPointerException
    at com.sun.rowset.CachedRowSetImpl.acceptChanges(CachedRowSetImpl.java:867)
    at com.sun.rowset.CachedRowSetImpl.acceptChanges(CachedRowSetImpl.java:919)
    I'm using Java 1.5_02. I looked at the source code for CachedRowSetImpl, and the only thing I could think of is that maybe "provider.getRowSetWriter()" in the following snippet is returning null....
    public void setSyncProvider(String s)
    throws SQLException
    provider = SyncFactory.getInstance(s);
    rowSetReader = provider.getRowSetReader();
    rowSetWriter = (TransactionalWriter)provider.getRowSetWriter();
    Any ideas?? Thanks!

    I have the same problem after setting com.sun.rowset.providers.RIXMLProvider.
    Looks like a bug to me.
    By the way, why are you creating a new CachedRowSet and populate it with a WebRowset (which extends CachedRowSet)?

  • Fill internal table with mutliple entries for nested structure

    Dear ABAP Experts,
    I have a question related to fill internal tables with nested structures.
    I have a structure like this:
    BEGIN OF proto,
              sicht TYPE ysicht,
              version TYPE FAGLFLEXA-RVERS,
              BEGIN OF kons,
    kon TYPE YKONSEINHEIT,
              END OF kons,
              jahr TYPE CHAR04,
    END OF proto.
    Now I need to fill this structure with values (over an internal table), but how can I achieve that I save multiple datas für element "kon" für one single entry of structure "proto"?
    An example could be:
    sicht = '01'
    version = '100'
    kon = 1001 (first entry)
    kon = 1002 (second entry)
    usw... (n entry)
    jahr = '2008'
    Thanks in advance for every helpful answer.
    Regards
    Thomas

    BEGIN OF proto,
               sicht TYPE ysicht,
               version TYPE FAGLFLEXA-RVERS,
               kons TYPE STANDARD TABLE OF YKONSEINHEIT WITH NON-UNIQUE KEY TABLE_LINE,
               jahr TYPE CHAR04,
    END OF proto.
    DATA: ls_proto TYPE proto,
          lt_proto TYPE STANDARD TABLE OF proto,
          ls_kon
    ls_proto-sicht = '01'.
    ls_proto-version = '100'
    INSERT '1001' INTO TABLE ls_proto-kons.
    INSERT '1002' INTO TABLE ls_proto-kons.
    ls_proto-jahr = '2008'.
    INSERT ls_proto INTO TABLE lt_proto
    If you're going to use a more complicated inner table with several components, then you need to define a type for those components. 
    matt

  • Fill a table with a genil object

    Hello,
    I will fill a custom table with the class CL_CRM_GENIL_GEN_TABLE_OBJ. Could anyone explain me how to fill a table with this class?
    Thank and regards,
    Harris

    Hello,
    Thank you very much so far.
    I followed the instructions in the above link.
    I'm a little bit confused how to fill the table with values. The class CL_CRM_GENIL_GEN_OBJ offers me the method "Save". I can imagine, to use this method to fill my table with values.
    Could anyone describe how to proceed if I want to fill my table.
    Thank you very much so far.
    Best regards,
    Harris

  • Transport Table with Data from Development to Quality

    Hi
    Requirement:
    Transporting Table with Values from Development to Quality System.
    I have a Z* - table, appended one field at the end.
    I need to transport data along with the table structure from Development System to Quality System.
    In Development System, I have assigned the Transport request in Client 100(We can't add data to the table in this client).
    What needs to be done to migrate the new table structure with Values.
    Thanks in Advance
    Regards,
    Baburaj
    NOTE: the requirement is to transport table and table entries through a transport request.
    There should not be any manual update for the table in the target System (Quality System).

    Check the delivery class assigned to the table. Please see the documentation
    Delivery class
        The delivery class controls the transport of table data when installing
        or upgrading, in a client copy and when transporting between customer
        systems. The delivery class is also used in the extended table
        maintenance.
        There are the following delivery classes:
        o   A: Application table (master and transaction data).
        o   C: Customer table, data is maintained by the customer only.
        o   L: Table for storing temporary data.
        o   G: Customer table, SAP may insert new data records, but may not
            overwrite or delete existing data records. The customer namespace
            must be defined in table TRESC. (Use Report RDDKOR54 here).
        o   E: System table with its own namespaces for customer entries. The
    customer namespace must be defined in table TRESC. (Use Report
    RDDKOR54 here.)
    S: System table, data changes have the same status as program
    changes.
    W: System table (e.g. table of the development environment) whose
    data is transported with its own transport objects (e.g. R3TR PROG,
    R3TR TABL, etc.).
    or during client copy
    the data of client-specific tables is copied.
    Classes C, G, E, S: The data records of the table are copied to the
    target client.
    Classes W, L: The data records of the table are not copied to the
    target client.
    Class A: Data records are only copied to the target client if
    explicitly requested (parameter option). Normally it does not make
    sense to transport such data, but is supported to permit you to copy
    an entire client environment.
    or during installation, upgrade and language import
    behavior differs here for client-specific and cross-client tables.
    nt-specific tables
    Classes A and C: Data is only imported into client 000. Existing
    data records are overwritten.
    Classes E, S and W: Data is imported into all clients. Existing data
    records are overwritten.
    Class G: Existing data records are overwritten in client 000. In all
    other clients, new data records are inserted, but existing data
    records are not overwritten.
    Class L: No data is imported.
    Cross-client tables
    o   Classes A, L and C: No data is imported.
    o   Classes E, S, and W: Data is imported. Exisitng data records with
         the same key are overwritten.
    o   Classe G: Data records that do not exist are inserted, but existing
         data records are not overwritten.
    ehavior during transport between customer systems
    Data records of tables of delivery class L are not imported into the
    target system. Data records of tables of delivery classes A, C, E, G, S
    and W are imported into the target system (this is done for the target
    client specified in the transport for client-specific tables).
    se of the delivery class in the extended table maintenance
    The delivery class is also analyzed in the extended table maintenance
    (SM30). The maintenance interface generated for a table makes the
    following checks:
    o   You cannot transport the entered data with the transport link of the
        generated maintenance interface for tables of delivery classes W and
        L.
    o   When you enter data, there is a check if this data violates the
        namespace defined for the table in table TRESC. If the data violates
        the namespace, the input is rejected.
    Thanks,

  • I want to create a mail merge for address labels into a table, but when I fill a table with merge fields, it ends up creating multiple entries for the same address, rather than one table full of each address.

    ...but when I fill a table with merge fields, it ends up creating multiple entries for the same address, rather than one table full of each address. Please help.
    Thanks!

    That is a quirk of Pagesthat  it applies only one record per page.
    There is a way around this:
    http://www.freeforum101.com/iworktipsntrick/viewtopic.php?t=245&highlight=labels &mforum=iworktipsntrick
    Peter

  • Count total number of record of table with deletion from archiving object

    Does anyone know is there any SAP standard program to count the total number of record of the table with deletion from Archiving Object and display in repprt?

    Not sure of the question. Are you looking to get the sql "select count(*) from table" from using the TopLink expression framework or are you getting that SQL already and want something else?
    If you are looking just to get the count from a table/class, you can use a ReportQuery:
    ReportQuery rquery = new ReportQuery(ClassToQueryOn.class);
    rquery.addCount(); //equivalent to count(*);
    session.executeQuery(rquery);
    You can use a report query to return data instead of objects, and use selection criteria just like a normal read query.
    Best Regards,
    Chris

  • How to fill internal table with selection screen field.

    Hi all,
    i am new to sap . pls tell me how to fill internal table with selection screen field.

    Hi,
    Please see the example below:-
    I have used both select-options and parameter on the selection-screen.
    Understand the same.
    * type declaration
    TYPES: BEGIN OF t_matnr,
            matnr TYPE matnr,
           END OF t_matnr,
           BEGIN OF t_vbeln,
             vbeln TYPE vbeln,
           END OF t_vbeln.
    * internal table declaration
    DATA : it_mara  TYPE STANDARD TABLE OF t_matnr,
           it_vbeln TYPE STANDARD TABLE OF t_vbeln.
    * workarea declaration
    DATA : wa_mara  TYPE t_matnr,
           wa_vbeln TYPE t_vbeln.
    * selection-screen field
    SELECTION-SCREEN: BEGIN OF BLOCK b1.
    PARAMETERS : p_matnr TYPE matnr.
    SELECT-OPTIONS : s_vbeln FOR wa_vbeln-vbeln.
    SELECTION-SCREEN: END OF BLOCK b1.
    START-OF-SELECTION.
    * I am adding parameter value to my internal table
      wa_mara-matnr = p_matnr.
      APPEND wa_mara TO it_mara.
    * I am adding select-options value to an internal table
      LOOP AT s_vbeln.
        wa_vbeln-vbeln =  s_vbeln-low.
        APPEND  wa_vbeln TO  it_vbeln.
      ENDLOOP.
    Regards,
    Ankur Parab

  • How to Copy complete structure of a table with data from one database table to another databse table

    I need a sql query to copy structure of table with data from production table of ONLINEBTREKDB database to production table of Archive database.
    I tried this query
    select * into Archive.dbo.Production from ONLINEBTREKDB.dbo.Production p
    but problem is I am able to copy the table schema and data but not able to copy constraints(PK)
    Any Help?
    seema

    You've multiple options
    1. Use generate scripts wizard available in SQL management studio. This is particularly helpful when you want to script out lot of objects. You can also choose to script data as well inside this. This can be launched by right clicking the db, choosing tasks
    -> generate scripts and then selecting required options inside the wizard
    2. Use object explorer and right click and script out table. You can also use search functionality to find object you want inside object explorer
    http://visakhm.blogspot.in/2013/02/object-filtering-using-ssms-object.html
    3. Use query based on INFORMATION_SCHEMA views like TABLES,COLUMNS,CONSTRAINT_COLUMN_USAGE etc to generate the script
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Transfer a table with data from 1 client to another client

    Hi experts please focus on this issue.  what is table maintainance generator? what is the main advantages of it.
    how can we transfer a table with data from 1 client to another client.
    Thanks  in advance
    vamsi.

    Table maintenance generator can be generated via se11 on your table.
    The advantage is that the table can manaully be updated via SM30.
    If you want to transport to another client the table content, I think you can :
    - Generate a transport request in SM30 ( Transport button)
    - use SCC1 to transport from a client to another.
    Regards,
    Erwan

  • How to transport/move a table with data from development to Test to Production

    Hi,
    How to transport/move a table with data from development to Test to Production..? Export-Import a Delivery Unit does only the structure and not the data
    Reg
    Sri

    Hi Sri,
    You cannot transport Data via Transport route in HANA, you can only transport code changes/Structure via DU. For Data movement, you either have a do a export/import from a flat file or replication from a Source System to HANA.
    Thanks Much,
    Abhishek

Maybe you are looking for

  • Parent Refresh After Modal Close when using .show_modal method

    I followed the manaul ".show_modal" method in this thread: open Skillbuilders modal page from report My question ishow do I refresh the parent when the modal closes?

  • Material consumption posting date before MIGO

    Hi, I have one issue related to Material Consumption.... If material received and posted on 25.12.2011 then how come system is allowing to consume ( Mtype 261) on 12.12.2011.  As material stock on 12.12.2011 is Zero.  We have not allowed Negative Sto

  • How do i take a picture with my built in webcam?

    hey guys i have a macbook pro with a built in web cam...im sure theres a way to take a pic with it...does anyone know how? it would also be nice if i wouldn't have to download another program to do this... is there anyway i can take a picture and hav

  • Unable to collect 3.x data source replica in a request

    Hi, When i tried to collect a data source replica(3.x data source) in a request it is throwing an error. But when i tried to collect a data source replica which is migrated to 7.0 it is aloowing me to do. Please suggest me a solution.I want some data

  • Static LOV functions differently in 9.0.2 from 9.0.1

    In my previous Portal applications under IAS 9.0.1 I had several static LOV's that contained the following structure: DISPLAY VALUE RETURN VALUE Login User Name #PORTAL.wwctx_api.get_user This worked as expected, the user sees the display of 'Login U