Inserting multiple records in to database table using webdynpro abap

Hi all,
I have created a username inputfield,a button and a table
with one coloumn.
If i enter  names in the input field then the values should be
displayed in that table.
Even i have got the answer i am not able to insert
the values in to database(ztable) table.
i.e. only one value(1st) was inserted the second value was
not inserted ....
so kindly send me the coding to insert multiple records
into the database table......
by,
ranjith

hi Ranjith,
If you want to insert multiple records from the webdynpro view table to database table then try the following code.
DATA lo_nd_tablenode TYPE REF TO if_wd_context_node.
  DATA lo_el_tablenode TYPE REF TO if_wd_context_element.
  DATA ls_tablenode TYPE wd_this->element_tablenode.
  DATA it_tablenode LIKE STANDARD TABLE OF ls_tablenode.
  navigate from <CONTEXT> to <tablenode> via lead selection
  lo_nd_tablenode = wd_context->get_child_node( name = wd_this->wdctx_tablenode ).
  get element via lead selection
  lo_el_tablenode = lo_nd_tablenode->get_element(  ).
  get all declared attributes
  lo_nd_tablenode->get_static_attributes_table(
  IMPORTING
    table = it_tablenode ).
MODIFY databasetablename FROM TABLE  it_tablenode.
here it_tablenode is the internal table which holds the value from webdynpro view..
Regards,
Shamila.

Similar Messages

  • How to insert new record in the database table using the Jdeveloper

    Hi Masters
    I am new Bee in j2EE developing side and i ahve oracle jdeveloper 9i version is 9.0.4
    And now I wann to know that how can i create the web application that will enter the Data in the HTML FORM and save that data into the Table emp plz tell me step by step
    thx in advance

    the steps to follow -
    download JDeveloper 10.1.2 from OTN (9.0.4 is very old and has some features that won't be in the next releases).
    Then follow the ADF Workshop from the JDeveloper home page on OTN.
    (If you have to use 9.0.4 then look for the archives of JDeveloper on OTN)
    for example:
    http://www.oracle.com/technology/products/jdev/viewlets/viewlet-archive0903.html

  • How to Insert a record in a database table in debugging mode in production

    Hi,
    How to Insert a record in a database table in debugging mode in production ?
    Waiting for kind response.
    Best Regards,
    Padhy
    Moderator Message : Duplicate post locked.
    Moderator message : Warning. Don't create multiple threads for same question.
    Edited by: Vinod Kumar on May 12, 2011 11:02 AM
    Edited by: Vinod Kumar on May 12, 2011 11:04 AM

    Hi Senthil,
    Regards,
    Phani Raj Kallur
    Message was edited by: Phani Raj Kallur

  • Locking multiple records in a database table at a time

    Hi Experts,
       I have a requirement to lock multiple records in the database table for writing. I have created lock object in SE11. But with this we have only 2 possibilities either lock entire table or lock a single record at a time.
       My requirement is, i have table with key field PROJECTID. I want more than one project to be locked, but not the complete table. I dont have any other field in the table to compare.
    Thanks in advance..
    Regards,
    Asrar

    Hi ,
    Try with FOR UPDATE in the SELECT sentence.
    SELECT FOR UPDATE *
        INTO Internal_Table
      FROM Table
    WHERE Conditions.
    UPDATE "Table_name" FROM TABLE  Internal_Table.
    COMMIT WORK.
    This sentence blocks only the records that satisfy of the WHERE conditions (not the entire table) and unlocks after commit work.
    Hope this information is help to you.
    Regards,
    José

  • Can you use ESB to insert multiple records into a Database

    We have an XML file that has a Parent/Child relationship.
    In situation 1 we have a single parent record in the xml file. We can insert the record into the database successfully.
    In situation 2 we have a parent and a an associated child record. By using a filter expression to identify the existence of the child record we can route to the first DB Adapter to insert the parent then to the second DB Adapter to insert the child.
    Is this final scenario logical and also possible.
    Situation 3 we have multiple child records associated to a single parent. So we would first insert the parent record then insert all the child records.
    Thanks

    I use PL/SQL for this if you are using Oracle.
    Have a look at this post, it is for AQ but the concept can be used for PL/SQL
    Re: Can I pass a pl/sql table as a parameter from a database adaptor
    I will send you an example
    cheers
    James

  • Inserting multiple records into a database from a table

    I have a dynamic table with rows upto 10. i am trying to insert all the records in these rows into a database ( msaccess)
    table name: Table1 ( in my form )
    Database table : movies_comments ( as posted in stefan's forums ).
    table columns: username, movieid, comments
    i am using the following code.
    Database.ExecSQL() function is as posted in stefcamerons forums.
    var tlength = xfa.resolveNode("form1.#subform[0].Table1.Row1[*]").length;
    xfa.host.messageBox("tlength is :" +tlength);
    for ( var i = 1; i <= tlength; i++)
    var username = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].user_name").rawValue;
    var movieID = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].movie_id").rawValue;
    var commentS = xfa.resolveNode("form1.#subform[0].Table1.Row1["+i+"].comment_").rawValue;
    Database.ExecSQL("INSERT INTO movie_comments (username, movieId, comment) VALUES ('username','movieID', 'commentS');");
    i am trying to insert multiple records using the code above. But i am getting error
    GeneralError: Operation failed.
    XFAObject.resolveNode:1:XFA:form1[0]:#subform[0]:Button1[0]:click
    SOM expression returned list when single result was expected
    suggest me an alternate way to insert multiple records from a table into a database.
    thank Q

    figured it out. I changed the ...OR (alternative names = colname) in the recordset to ...OR (alternative names LIKE %colname%). Works like a charm now- the result of a good night's sleep.

  • How to insert multiple rows in the database table with the high performance

    Hello everybody,
    I am using the struts,jsp and spring framework. In my application there are 100s of rows i have to insert into the database 1 by 1. I am using usertransaction all other things are working right but i am not getting the real time performance.
    Can anyone tell me the proper method to insert multiple records and also with fast speed

    I don't know much about Spring etc, but if the jdbc Statemenet.addBatch(), Statement.executeBatch() statements let you bundle a whole lot of sql commands into one lump to execute.
    Might help a bit...

  • How to insert null record (some col) in table using loop

    Hi,
    How to insert null record (for some columns) in table using loop.
    sample data of x_tab
    order_id order_name
    231 xxx
    123
    345
    111 vvvv
    Thanks,
    Lakshman
    Edited by: kolipaka on Jul 5, 2012 1:37 PM

    You have a table
       CREATE TABLE tab (
          col1  NUMBER,
          col2  NUMBER,
          col3  NUMBER,
          col4  NUMBER
          col5  NUMBER)Now you insert:
       INSERT INTO tab (col2, col4) VALUES (5, 7);col1, col3 and col5 are NULL by default (there is no DEFAULT clause for these columns so they are NULL).

  • How to update the database table using webdynpro??

    Hi,
    Can anybody helm me in updating database table....by entering the values on the output screen of webdynpro component??should i use any commit statement in function module ,which i used to update.

    hi martina....
    consider you are having two input fields bound to attr1 and attr2.
    now after pressing the save button:
    just read teh two attributes to field1, field2 using code wizard. then
    <db name>-<fieldname1> = <field1>.
    <db name>-<fieldname2> = <field2>.
    insert <dbname>.
    ---regards,
       alex b justin

  • INSERTING A RECORD IN THE Z-TABLE USING PBI IN SCREE PROGRAM.

    Hi Experts!,
                     I have created a z table with some fields and also I have created the screen for the input. I want to store the the record when I click on  Submit button and clear the screen while I click on reset buttons which is present in the screen.
    Could any one help with codes!!!
    points will be rewarde for useful one's.
    Thanks in advance,
    Sunil

    Hi Khanna,
                Thankx for solving my issue, but I need some more help from you, In the same porogram, I need to generate a system generated new number for every record which is stored in the table. The following is the prg:
    INCLUDE MZFIRSTPAGETOP                          .    " global Data
    TABLES: ZCHP_CUST_INFO.
    *DATA: OKCODE LIKE SY-UCOMM.
    DATA:   CNAME LIKE ZCHP_CUST_INFO-CREATED_BY,
            REQTYP LIKE ZCHP_CUST_INFO-REQUEST_TYPE,
            DESC LIKE ZCHP_CUST_INFO-SHORT_TEXT,
            PRIO_TYPE LIKE ZCHP_CUST_INFO-PRIORITY_TYPE,
            EFFECTIVE_DATE like ZCHP_CUST_INFO-REQUIRED_STR_DAT,
            COMM_TYP like ZCHP_CUST_INFO-MODE_OF_COMM,
            COMM like ZCHP_CUST_INFO-ADDRESS,
            REF_NUM LIKE ZCHP_CUST_INFO-REQ_NUM.
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'FOR1000'.
      SET TITLEBAR '1000'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    INCLUDE MZFIRSTPAGEO01                          .  " PBO-Modules     *
    INCLUDE MZFIRSTPAGEI01                          .  " PAI-Modules     *
    INCLUDE MZFIRSTPAGEF01                          .  " FORM-Routines   *
    *&      Module  USER_COMMAND_1000  INPUT
          text
    MODULE USER_COMMAND_1000 INPUT.
    CASE SY-UCOMM.
      WHEN 'SUBMIT'.
            ZCHP_CUST_INFO-CREATED_BY = CNAME.
            ZCHP_CUST_INFO-REQUEST_TYPE = REQTYP.
            ZCHP_CUST_INFO-PRIORITY_TYPE = PRIO_TYPE.
            ZCHP_CUST_INFO-SHORT_TEXT = DESC.
            ZCHP_CUST_INFO-CREATED_ON = EFFECTIVE_DATE.
            ZCHP_CUST_INFO-MODE_OF_COMM = COMM_TYP.
            ZCHP_CUST_INFO-ADDRESS = COMM.
    INSERT ZCHP_CUST_INFO.
    COMMIT WORK.
    *GENERATING A REF_NUMBER.
    CALL FUNCTION 'NUMBER_GET_NEXT'
    EXPORTING
    nr_range_nr = '01'
    object = 'ZCHP_CUST_INFO'
    QUANTITY = '1'
    SUBOBJECT = ' '
    TOYEAR = '0000'
    IGNORE_BUFFER = ' '
    IMPORTING
    number = ZCHP_CUST_INFO-REQ_NUM " specify ur wa field
    QUANTITY =
    RETURNCODE =
    EXCEPTIONS
    interval_not_found = 1
    number_range_not_intern = 2
    object_not_found = 3
    quantity_is_0 = 4
    quantity_is_not_1 = 5
    interval_overflow = 6
    buffer_overflow = 7
    OTHERS = 8.
    INSERT ZCHP_CUST_INFO.
    COMMIT WORK.
    WHEN 'RESET'.
           CLEAR: CNAME,REQTYP,PRIO_TYPE,
    DESC,EFFECTIVE_DATE,COMM_TYP,COMM.
      WHEN 'CANCEL'.
            LEAVE PROGRAM.
    ENDCASE.
    ENDMODULE.                 " USER_COMMAND_1000  INPUT
    Thanks and regards,
    Sunil

  • Inserting Multiple Rows into Database Table using JDBC Adapter - Efficiency

    I need to insert multiple rows into a database table using the JDBC adapter (receiver).
    I understand the traditional way of repeating the statement multiple times, each having its <access> element. However, I am just wondering whether this might be performance-inefficient, as it might insert records one by one.
    Is there a way to ensure that the records are inserted into the table as a block, rather than record-by-record?

    Hi Bhavesh/Kanwaljit,
    If we have multiple ACCESS tags then what happens is that the connection to the database is made only once. But the data is inserted row by row.
    Why i am saying this?
    If we add the following in JDBC Adapter..logSQLStatement = true. Then incase of multiple inserts we can see that there are multiple
    <i>Insert into tablename(EMP_NAME,EMP_ID) VALUES('J','1000')
    Insert into tablename(EMP_NAME,EMP_ID) VALUES('J','2000')</i>
    Doesnt this mean that rows are inserted one by one?
    Correct me if i am wrong.
    This does not mean that the transaction is not guaranted. Either all the rows will be inserted or rolled back.
    Regards,
    Sumit

  • Insert Multiple records using Database adapter with Stored procedure func

    Hi All,
    I want to insert multiple records on a database using a stored procedure. I wanted to insert those records using a Database Adapter and the Database adapter should be invoked by a Mediator.
    Can somebody suggest me with ideas whether it can be acheived with OOB capabtilities in SOA suite or not?
    Thanks for your help in advance.
    Thanks,
    Shiv

    The use case you want to achieve is feature supported by the DBAdapter and it is possible to invoke the same from mediator.
    Please have a look at the oracle documentation and you should be able to get the necessary information.
    The below links should help you as well:
    http://download.oracle.com/docs/cd/E15523_01/integration.1111/e10231/adptr_db.htm
    http://blogs.oracle.com/ajaysharma/2011/03/using_file_adapter_database_adapter_and_mediator_component_in_soa_11g.html
    There are some video tutorials as well :)
    http://www.youtube.com/watch?v=dFldS-fDx70 This should also help
    Thanks,
    Patrick

  • How i can Insert selected records in database table using check box.

    Hi Friends,
    I have non database block, which displayed multiple records, now I add a Check Box to this block and now I want to insert the records in a database table which I checked. So when I press a button, all the checked records are inserted in the table.
    Please send me the code of this solution.
    Thanks in advance.
    Shahzad

    I have almost the exact scenario but instead of inserting into the DB, I want to find the Checked records and process them in PL/SQL script.
    I currently have a cursor that looks for all the checked records. It's only getting the first record, so I figured I need to loop through the block looking for checked records.
    Also can I save them to a temp or PL/SQL table to process later?

  • Insert multiple records into Oracle using Java

    Hi,
    Has anyone tried to insert multiple records into an Oracle table from Java? I have my data in a Java collection.Can I send a Java Collection to an Oracle Package as a PL/SQL Table Type? My problem is I dont want to instantiate a CallableStatement object everytime I do an insert. Instead I want to do that only once and then insert multiple records in one operation.
    Any suggestions will be appreciated,
    Thanks,
    Alex

    Hi Mensa,
    I went thru the code example in your book in chapter 8 (downloaded it from OTN). It looks like the java code for "public class myPLSQLIndexTab" might be a java stored procedure stored in the oracle database?
    Pardon my ignorance because I've never worked on java code in the oracle database itself but how would I call such a program outside the oracle database? For example say I have a batch job that downloads data from a webservice and that batch job is written in java and its sitting on a batch server somewhere on the network. But the java program that inserts data into the database is sitting in the oracle database (also somewhere in the same network). How can the java code sitting on the batch server talk to the java code sitting on the oracle server? Is it the same as calling a pl/sql package using CallableStatement?
    Thanks
    Alex

  • Insert multiple records into database through internal table

    Hi
      please help me how to insert multiple records into database through internal table

    Hi,
    Welcome to SCN.
    Press F1 on INSERT statement and you will teh syntax as well the docu for the same.

Maybe you are looking for

  • How to Map XML data with XSD Schema in JAXB

    Hello, I am very much new to JAXB. I am in need of someone help to go further in my dev. I am having an XSD and i could able to do marshall and unmarshall using JAXB. My problem is... Consider followings are my Schema... - <person id="general" help="

  • W540 docking in linux

    I have got Lenovo w540 and running Mint 16. When I dock the laptop into the docking station, everything freezes, including the laptop's own keyboard. How should I go along about finding out what is wrong? Seems like it understands that it has been in

  • Import a DVD to FCE

    How can I import a DVD onto OS X 10.5.8 Intel MacBookPro to edit in Final Cut Express?  I have MPEG Streamclip and Handbrake but I can't seem to import the file to MP4.  I have it as M4V but I cannot transfer this over to MP4.  This is a commercial m

  • Webservice , URL & URL Variable

    hi all , i got a problem with my project and its regarding connectinng to a webservice page for methods interacting with my SQL server database and URL variable. (Front end is chinese checker Game ) Is there any related problems with sending URL vari

  • IPTV Multicast address range

    Does anybody know what the multicast IP range is for Cisco IPTV? I need to setup an access-list to for an RP to be used just for IPTV.