Tell me creation ,deleted and updates of dropdownbyindex

hi
my name is praveen
my question iam designing a form related to webdynpro
in that iam creating two dropdownbyindex in that
1.userid2.Material id
sub: i require code samples and binding
i have to select the items form those and
1button:insert
2button:Retrieve
3buttton:delete
4thbutton:update
i have to click those buttons so that i can display in smae page in same table those upadates.
please tell me my questin to answer very immediately
because we are facing about code samples

Hi Praveen,
Go to layout of the view Create dropdownbyindexUI element
Create a node_userid having the attribute user_id and bind that attribute to texts property of the dropdown
write this code in doinit to populate values to the node
If all user ids are in an vector userid_vec
for (int i =  0; i <userid_vec.size; ++i)
    IPrivateApplicationView.Inode_useridElement element = wdContext.createnode_useridElement();
    element.setAtt1(userid_vec.ElementAt(i));
    wdContext.nodenode_userid().addElement(element);
bind an action to property onSelect. you can access the index of the selected element in the event handler in implementation
wdContext.nodenode_userid().getLeadSelection();
Link the onAction property of button to an action
Create an element of the node to which you should add these values
IPrivate<view name>.I<node name>Element element = wdContext.create<node name>Element();
element.set<attribute name>(wdContext.nodenode_userid().getElementAt(wdContext.nodenode_userid().getElementAt(wdContext.nodenode_userid().getLeadSelection()).getAttributeValue(" user_id").toString());));
wdContext.node<node name>().addElement(element);
Like this for deleting you can loopthrough the node from which you have to delete and identify the element
int index = 0;
for(int i = 0;i<wdContext.node<node name>().size;i++)
wdContext.node<node name>().get<node name>Elementat(i).getAttributevalue("user_id").equals(<Selected element>)
index = i;
Once you get the element you can remove it from table
wdContext.node<node name>().removeElement(wdContext.node<node name>().get<node name>ElementAt(index)
For update you once you get the index you can go to the element and modify it
What do you mean by retreiving the element?
Hope this helps you
Regards
Rohit

Similar Messages

  • Insert,  Delete and Update options in Table control

    Experts,
    I have writen code for Insert,  Delete and Update options in Table control. They are not working properly...
    can any one send the code for the above please...
    Thanks in advance..

    Hi,
    Following steps will help you.
    1.TOP-INCLUDE
    DATA: ITAB1 LIKE KNA1 OCCURS 0 WITH HEADER LINE.
    DATA: ITAB2 LIKE KNA1 OCCURS 0 WITH HEADER LINE.
    DATA: WA LIKE KNA1.
    DATA: ANT TYPE I,CUR TYPE I.
    DATA: OK_CODE TYPE SY-UCOMM.
    CONTROLS: TABCTRL TYPE TABLEVIEW USING SCREEN 100.
    IN FLOWLOGIC
    PROCESS BEFORE OUTPUT.
    LOOP AT ITAB1 CURSOR CUR WITH CONTROL TABCTRL.
    ENDLOOP.
    PROCESS AFTER INPUT.
    MODULE CLEAR_DATA.
    LOOP AT ITAB1.
    MODULE MOVE_DATA.
    ENDLOOP.
    ADD “OK_CODE” IN ELEMENT LIST. CLICK ON LAYOUT AND  ADD TABLE CONTROL(name it as TABCTRL) AND PUSHBUTTONS AS FOLLOWS.
    SELECT THE FIELDS FROM PROGRAM. SAVE CHECK AND ACTIVATE.
    CLICK ON FLOWLOGIC EDITOR FROM APPLICATION TOOL BAR.
    DOUBLE CLICK ON MODULE “CLEAR_DATA”.
    write the in this module as below.
    CLEAR ITAB2. REFRESH ITAB2.
    DOUBLE CLICK ON MODULE “MOVE_DATA”.
    write the code in this module as below.
    APPEND ITAB1 TO ITAB2.
    ACTIVATE PAI AND WRITE THE CODE AS BELOW.
    CASE OK_CODE.
    WHEN 'FETCH'.
    SELECT * FROM KNA1 INTO TABLE ITAB1 UP TO 20 ROWS.
    TABCTRL-LINES = SY-DBCNT.
    WHEN 'ADD'.
    GET CURSOR LINE CNT.
    CNT = TABCTRL-TOP_LINE + CNT - 1.
    CLEAR WA.
    INSERT WA INTO ITAB1 INDEX CNT.
    WHEN 'MODIFY'.
    GET CURSOR LINE CNT.
    READ TABLE ITAB2 INDEX CNT.
    LOOP AT ITAB2.
    MODIFY KNA1 FROM ITAB2.
    ENDLOOP.
    SELECT * FROM KNA1 INTO TABLE ITAB1.
    WHEN 'EXIT'.
    LEAVE PROGRAM.
    ENDCASE.
    SAVE,CHECK AND ACTIVATE ALL.
    CREATE TCODE AND EXECUTE.
    contact if u hv any issues regarding this code.
    reward points,if it is useful.
    Thanks,
    Chandu.

  • Deleting and updating records in a database table

    dear all ,
    i have created a databse table to which i have to update and delete records thru my program whixh i am unable to do so plz help me.

    Hi Sonu,
    To delete and update the records in your database table, you can create a Function Group and all the necessary function modules for it. This will a good approach as this will separate the database interface logic and the business logic. You need to use the DELETE and UPDATE ABAP keywords to delete and update the records of the database tables. Have a look at the ABAP Keyword documentation for a complete details of the usage.
    Have a look at the following link:
    DELETE
    http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb3aef358411d1829f0000e829fbfe/frameset.htm
    UPDATE
    http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb3aef358411d1829f0000e829fbfe/frameset.htm
    Hope this will help.
    Thanks,
    Samantak.

  • How can I  delete and update records using where conditions?

    I want to delete and update the coherence records with some conditions, I describe it to use SQL as follows:
    delete from "contacts" where getStreet() = "dsada";
    update contacts set getStreet() = "dddd" where getCity() = "ssss";
    Can I use the filter like query to achieve this requirement as follows:
    ValueExtractor::View vHomeStateExtractor = ChainedExtractor::create(
    ChainedExtractor::createExtractors("getHomeAddress.getState"));
    Object::View voStateName = String::create("MA");
    Set::View setResults = hCache->entrySet(
    EqualsFilter::create(vHomeStateExtractor, voStateName));
    I know I can use get and put to achieve this requirement , but it Requires a two-interaction between the client and coherence server. Does it have And another way?
    Thanks very much, and please Forgive my English is not very good.

    Hi,
    You have a couple of options for updating or deleting using a Filter.
    For deleting you can use an Entry Processor and the cache invokeAll method. Using "out of the box" Coherence you can use the ConditionalRemove entry processor. I'm a Java person so the C++ below might not be exactly right but you should get the idea.
    ValueExtractor::View vHomeStateExtractor = ChainedExtractor::create(
    ChainedExtractor::createExtractors("getHomeAddress.getState"));
    Object::View voStateName = String::create("MA");
    hCache->invokeAll(EqualsFilter::create(vHomeStateExtractor, voStateName),
    ConditionalRemove::create(AlwaysFilter.getInstance());For update you would either need to write custom Entry Processor implementations that perform the updates you require or you can use out of the box POF or Reflection ValueUpdaters that update specific fields of the entries in the cache. These valueUpdaters would be wrapped in an UpdaterProcessor so the call would be very similar to the code above.
    JK

  • Read-through/write-behind and queued deletes (and updates)

    Hi,
    If I am changing the state of objects in a cache and using the write-behind and read-through mechanism what happens when I have deleted or updated an object in the cache but the change has not yet been committed to the database?.
    If I delete and object in the cache and the delete DB operation is being queued and during this time try and perform a get against the key for the object is the value read through from the database or is it ignored since the database delete is pending?
    For updates I presume that the value in the cache will be used - as the value exists in the cache and a read-through from the database will not be triggered.
    Can you clarify the behavior of Coherence under these circumstances, particularly that of a pending delete.
    Thanks,
    Dave

    Hi Dave,
    If I am changing the state of objects in a cache and
    using the write-behind and read-through mechanism
    what happens when I have deleted or updated an object
    in the cache but the change has not yet been
    committed to the database?.
    If I delete and object in the cache and the delete DB
    operation is being queued and during this time try
    and perform a get against the key for the object is
    the value read through from the database or is it
    ignored since the database delete is pending?I seem to remember a forum post mentioning that the removes from a write-behind cache are performed synchronously (they are done as part of the backingMap.remove(key)) operation so even if there are were pending updates in the write-behind queue. If I remember correctly, then the above mentioned problem cannot happen.
    >
    For updates I presume that the value in the cache
    will be used - as the value exists in the cache and a
    read-through from the database will not be
    triggered.
    Exactly.
    Best regards,
    Robert

  • Delete and update records in Stored procedures

    I AM NOW STUDYING A STORED PROCEDURE ,AND I ENCOUNTER SOME PROBLEM WITH
    UPDATE AND DELETE SOME RECORD WHICH ONE IS UPDATED OR DELETED,
    THIS IS MY CODE:
    PACKAGE table_of_array IS
    type emp_rec is record(
         empno emp.empno%type,
         ename emp.ename%type,
         sal          emp.sal%type,
         deptno emp.deptno%type
    type arr is table of emp_rec
    index by binary_integer;
    procedure get_data(a in out table_of_array.arr);
    procedure do_insert(a in out table_of_array.arr);
    procedure do_update(a in out table_of_array.arr);
    procedure do_delete(a in out table_of_array.arr);
    END;
    PACKAGE BODY table_of_array IS
    procedure get_data(a in out table_of_array.arr)
    is
    i number:=0;
    begin
         for cur in (select empno,ename,sal,deptno from emp) loop
              a(i):=cur;
              i:=i+1;     
         end loop;
    end;
    procedure do_insert(a in out table_of_array.arr)
    is
         i number:=0;
         cnt number:=a.count;
    begin
         for i in 1..cnt loop
              insert into emp(empno,ename,sal,deptno)
              values(a(i).empno,a(i).ename,a(i).sal,a(i).deptno);
         end loop;
    end;
    procedure do_update(a in out table_of_array.arr)
    is
    begin
         /* WHICH RECORD AND ITEM HAD BEEN UPDATED */
    end;
         procedure do_delete(a in out table_of_array.arr)
         is
         begin
         /* WHICH RECORD HAD BEEN DELETED */      
         end;
    END;

    when you want to update, delete or insert records with a stored procedure you have to provide a procedure that locks the records
    i'll send you an example of an update procedure and a lock procedure
    PROCEDURE p_upd_devices ( resultset IN devtab) IS
    BEGIN
    FOR i IN 1..resultset.COUNT LOOP
              IF resultset(i).zone <> resultset(i).zone_ref THEN
              p_update_zone(resultset(i).zone, resultset(i).mdv_seq);
              END IF;
         END LOOP;
    EXCEPTION WHEN OTHERS THEN
    mecoms_general.logging(0, sqlerrm, 'pck$fill_error_devices.p_upd_devices');
    END; -- p_upd_devices
    PROCEDURE p_update_zone (pi_zone in metering_devices.zne_code%type, pi_device in metering_devices.seq%type) IS
    PRAGMA AUTONOMOUS_TRANSACTION;
    BEGIN
              UPDATE metering_devices
                   SET zne_code = pi_zone
                   WHERE seq = pi_device;
                   commit;
    EXCEPTION WHEN OTHERS THEN
    mecoms_general.logging(0, sqlerrm, 'pck$fill_error_devices.p_update_zone');
    END;
    PROCEDURE p_lock_devices( resultset IN OUT devtab) IS
    BEGIN
    null;
    END;

  • MDM Tuples deletion and update.

    Hi Experts,
    I have a serious problem related to MDM 7.1 we have 3 main tables in repository i.e staging area wf_projects and material. The problem is that using generated web services we are not able to delete the tuples if they are not direct inside the main table. Like lets say main table is parent and there is one child tuple and in side child tuple there is grand child tuple now using a webservice we are not able to delete the grand child or update the grand child. if i am using a update service its updating the fields which are changed and the fields which i have deleted are not getting deleted from particular tuple i.e lets say i have 5 fields in tuple. i changed 2 fields and deleted 3 fields now i am executing the update service the changed fields are getting change that is fine but the fields i have deleted are not getting deleted. Please help and let me know if more explanation is needed.
    Thanks & Regards
    Jeetendra Choudhary

    Hi Jeetendra,
    1) To delete a complete tuple record is not supported by MDM webservices.
    2) To delete a perticular field value in MDM, using update webservice, you have to set the parameter "ApplyNullValuesToMDM" to true in the configuration parameters of the webservice.
    hope this helps,
    let me know if this works..
    Cheers,
    Sudheer.

  • Simple insert, delete and update not working after oracle 10g installation

    Hello,
    I made a new installation of Oracle 10g (10.2.0.1.0) and created a schema . Now i try to insert or update data using simple queries, but unfortunately nothing happens. I tried inserting or updating data even via sqlplus, but unfortunately the same result. Query takes infinite time to end, so i had to manually end it every time... No errors... No warnings... but takes long time... I have given all the required permissions to the schema but the same result. Can somebody help me figure out the problem?
    Tried creating a new table and the insert and delete are working fine... think the problem is with this table... Imported the rows of the table from another online database. I dont understand how this might be a problem.
    Edited by: user13333704 on Mar 15, 2011 1:26 AM

    However how do you generate awr reports and how to find the session wait?TO generate the AWR report
    sql> ?/rdbms/admin/awrrpt
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14211/autostat.htm#BABDHAGF
    The event column in v$session , in v$active_session_wait will show you the session wait event.What the session was actually waiting for.
    HTH
    Anand

  • Unable to delete and update an ms access db

    Hi,
    I am presently working on a project in dreamweaver 8 which is
    connected to an ms access db. I am completely new to both
    applications but i have been able to connect to my database and
    display information. As it is now i have both a delete button and
    an edit button in a dynamic table which i created. How do i make
    these buttons work. When the user clicks delete a message should
    come up confirming the deletion. If anyone can assist me it will be
    greatly appreciated. I have searched the internet for blocks of
    code but cannot interpret the codes due to my lack of programming
    knowledge. The following is the sample code for the delete button.
    I dont know how to make the edit button work here also. I

    I do not think that everything is already set as the password, the new e-mail. Now I have to update the application with no.
    And a warning, as it!! Your Apple ID has been disabled!!.
    If possible, you may be able to check my ID.
    And to the point. So let me do the right thing.
    ..............................................Thanks again......................................................

  • Deleting and updating database table

    hi all,
    i have to update the database table based on my internal table(both having same structure).
    my database has 2 records having a key field 1 and 2 respectively.(2 records)
    and my internal table has records with key fields 3, 4 and 5 respectively(3 records) .
    i want to delete all data from database table first..
    then i want to insert all the three records in the database table..
    finally i want my database to have 3 records with key fields 3, 4 and 5 respectively that are in the internal table
    what should be the correct way?

    Hi ,
    to delete all the records from dbtab
    DELETE dbtab.
    to update the database by using internal table
    -MODIFY dbtab       FROM TABLE itab.
    but as per my knowledge structures of internal table and database table should be same
    if the database table is a Ztable please change the structure of database table as you said
    Put fields 3,4and 5 as key fields
    Thanks & Regards,
    Sateesh.

  • Delete and update contents in a CSV File

    Hi All,
    I am new to java . I am able to read the records from CSV file using BufferedReader and I am getting output like this
    "100,a100,1b100" -->1st record
    "200,b200,dc300" -->2nd record
    "400,f344,ce888" -->3rd record.
    Now I need some help in below requirements.
    1.How to delete a specfic record?
    2.If record already exists how to update the existing record with new values?
    Please share your ideas or give me some code snippet..
    Thanks in Advance

    Or if each record is the same length and you are not inserting -
    just modifying values in existing ones - you can use a
    RandomAccess file.
    http://java.sun.com/j2se/1.4.2/docs/api/java/io/RandomAccessFile.html

  • Mavericks Mail slow - deletes and updates

    I have two exchange accounts and a gmail account in mail.  Until the Mavericks update, I had to force quit mail at least once per day.  That hasn't happened yet.  HOWEVER, If the focus is in the message in the preview pane and not on the message header in the message list, delete doesn't work at all.  If I click on the header, it will eventually delete, but takes a few seconds. 
    Any others with this issue?

    Hello there, SeamusMcG.
    The following Knowledge Base article offers some pointers for determining what may be causing the slowness:
    OS X Mavericks: If your Mac runs slowly
    http://support.apple.com/kb/PH13895
    Thanks for reaching out to Apple Support Communities.
    Cheers,
    Pedro.

  • Selected Column insert, delete and updation at replication end

    Hello,
    In GoldenGate, is there a way to get a timestamp column at target table to get updated for some selected columns from source table only. For eg.
    At source - Table Temp_Source , columns - Emp_Id (PK), Emp_Name, Department, Address
    At target - Table Temp_Target, columns - Emp_Id (PK), Emp_Name, Department, Last_Update
    The Last_Update column takes timestamp for last updation made at source table which is replicated at target end.
    Now I just want the changes made in EMP_Id, EMP_Name , Department columns to be replicated at target table and also the Last_Update to get updated for changes made in these columns only. The changes made in Address column should not affect Last_Update at target end.
    The extract or replication script for this should work for insert, update and delete scenarios for specified columns. Using COLS creates problem in insertion as it Abends the replication process.
    Is there any way I can achieve this functionality??

    At target end I have written the following code in Replication process -
    GetUpdates
    IgnoreInserts
    IgnoreDeletes
    Map <source table>, target <target table>, COLMAP (USEDEFAULTS, LAST_UPDATE = @IF((EMP_ID <> BEFORE.EMP_ID OR EMP_NAME <> BEFORE.EMP_NAME OR DEPT <> BEFORE.DEPT), @getenv("GGHEADER", "COMMITTIMESTAMP"),REFRESH_TIMESTAMP));
    But this code entertains only the Primary Key changes i.e. EMP_ID, I want the Last_update to get updated for changes in EMP_NAME and DEPT even but not for Address column change at source end.

  • ITunes will not boot.  I've deleted and updated to the newest release.  When I click on the icon, nothing happens.

    iTunes software will not boot from my PC.  I deleted the program and re-loaded.  But, it still will not load the program.  When I double click, nothing happens

    Repair permissions, restart your computer & try again. 

  • BUSINESS PARTNER CREATION AND UPDATION

    DEAR EXPERTS
    PLEASE TELL HOW TO CREATE AND UPDATE BUSINESS PARTNER LIST.
    THANKS IN ADVANCE.

    Hi Preeti,
      If you want to create BP go to transaction BP and click on create button. For updating the BP select an existing record and you can go to edit mode and you can update.
    If you want to create and update a BP through coding then you have to use the below FM's
    For Create
    BUPA_CREATE_FROM_DATA 
    For Updation
    BUPA_ADDRESS_CHANGE
    BUPA_BANKDETAIL_CHANGE
    BUPA_CENTRAL_CHANGE
    BUPA_CENTRAL_CI_CHANGE
    BUPA_CENTRAL_EXTINCL_CHANGE
    BUPA_IDENTIFICATION_CHANGE
    BUPA_INDUSTRYSECTOR_CHANGE
    BUPA_ROLE_CHANGE
    Hope this helps you.
    Regards,
    Lakshmi.Y

Maybe you are looking for