How to delete particular child element

hi
i have one xml document like this;how to delete particular element ;i want to delete say playerid = 9;
and also i want to update the particular element, IndianPlayer(child nodes(name,age)) say playerid = 5 with name=agarkar and age=27;
<India>
<IndianPlayer PlayerId="1">
<Name>Sachin</Name>
<Age>31</Age>
</IndianPlayer>
<IndianPlayer PlayerId="2">
<Name>Saurav</Name>
<Age>32</Age>
</IndianPlayer>
<IndianPlayer PlayerId="3">
<Name>Yuvraj</Name>
<Age>22</Age>
</IndianPlayer>
<IndianPlayer PlayerId="4">
<Name>Dravid</Name>
<Age>32</Age>
</IndianPlayer>
<IndianPlayer PlayerId="5">
<Name>Kumble</Name>
<Age>34</Age>
</IndianPlayer>
<IndianPlayer PlayerId="6">
<Name>Sehwag</Name>
<Age>24</Age>
</IndianPlayer>
<IndianPlayer PlayerId="7">
<Name>Laxman</Name>
<Age>32</Age>
</IndianPlayer>
<IndianPlayer PlayerId="8">
<Name>parthiv</Name>
<Age>18</Age>
</IndianPlayer>
<IndianPlayer PlayerId="9">
<Name>Zaheerkhan</Name>
<Age>26</Age>
</IndianPlayer>
</India>
bye
chaitanya

Hi
you can use the following code to delete a particular child based upon the given criteria
Name the xml file as cricPlayer.xml(since i have used that name in the program)
i hope this solves ur problem
// Developed by ottran on 18/06/2004
import java.io.*;
import java.util.*;
import org.w3c.dom.*;
import org.xml.sax.*;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerException;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import javax.xml.transform.*;
import javax.xml.parsers.*;
import javax.xml.*;
import javax.xml.transform.stream.StreamSource;
public class CricDom
public static void saveXML(Document doc, String str)
try{
TransformerFactory transformerFactory = TransformerFactory.newInstance();
Transformer transformer = transformerFactory.newTransformer();
transformer.setOutputProperty(OutputKeys.INDENT,"yes");
transformer.transform(new DOMSource(doc),new StreamResult(str));
catch(TransformerException e)
System.out.println("Transformer Exception: "+e);
public static void main(String args[]){
try
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
Document document = builder.parse("cricPlayer.xml");
document.getDocumentElement().normalize();
Node ParentNode = document.getDocumentElement();
NodeList list = document.getElementsByTagName("IndianPlayer");
for(Node child= ParentNode.getFirstChild(); child != null; child = child.getNextSibling())
try{
if(child.getNodeType()==Node.ELEMENT_NODE)
NamedNodeMap tw = child.getAttributes();
if(child.getAttributes().getNamedItem("PlayerId").getNodeValue().matches("9"))
ParentNode.removeChild(child);
saveXML(document,"cricPlayer.xml");
catch (NullPointerException nex)
System.out.println("Null Exception : "+nex);
catch (Exception ex)
System.out.println("Exception : "+ex);
Bye
ottran

Similar Messages

  • How to delete the last element of a collection without iterating it?

    how to delete the last element of a collection without iterating it?

    To add to jverd's reply, even if you could determine the last element, in some collections it is not guaranteed to always be the same.
    From HashSet:
    It makes no guarantees as to the iteration order of the set; in particular, it does not guarantee that the order will remain constant over time.

  • How to read the child elements in single query

    Hi
    How to read the child elements under 'alternateIdentifiers' and 'matchEntityBasic' in a single query followiing xml content.xml content is of xmltype
    I/p doc
    <UPDATES>
    <matchEntity>
    <sourceUpdateId>SAMSUNG</sourceUpdateId>
    <matchEntityId>861873</matchEntityId>
    <alternateIdentifiers>
    <sourceUpdateId>SAMSUNG</sourceUpdateId>
    <schemeCode>SMG</schemeCode>
    <effectiveDate>2012-01-16</effectiveDate>
    </alternateIdentifiers>
    <alternateIdentifiers>
    <sourceUpdateId>SAMSUNG</sourceUpdateId>
    <schemeCode>TEBBGL</schemeCode>
    <effectiveDate>2012-01-16</effectiveDate>
    </alternateIdentifiers>
    <matchEntityBasic>
    <sourceUpdateId>SAMSUNG</sourceUpdateId>
    <marketExchangeCode>XASE</marketExchangeCode>
    </matchEntityBasic>
    </matchEntity>
    </UPDATES>
    o/p
    sourceUpdateId schemeCode effectiveDate marketExchangeCode
    SAMSUNG SMG 2012-01-16 XASE
    SAMSUNG TEBBGL 2012-01-16
    Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
    i tried the query but not working
    SELECT sourceUpdateId ,schemeCode ,effectiveDate ,marketExchangeCode FROM message pl,XMLTABLE ('/UPDATES/matchEntity/alternateIdentifiers'
                   PASSING pl.messagetext
                   COLUMNS sourceUpdateId VARCHAR2 (20) PATH sourceUpdateId,
                   schemeCode VARCHAR2 (20) PATH 'schemeCode',
              effectiveDate DATE PATH 'effectiveDate',
    marketExchangeCode VARCHAR2 (20) PATH './matchEntityBasic/marketExchangeCode'
    ) x
    iam not retriving marketExchangeCode with the following query
    marketExchangeCode VARCHAR2 (20) PATH './matchEntityBasic/marketExchangeCode'
    thanks

    The problem is that "matchEntityBasic" is not a child of "alternateIdentifiers", so this :
    ./matchEntityBasic/marketExchangeCodepoints to nothing.
    To display both values in the same query, you'll need a two-level approach.
    For example :
    SQL> SELECT x2.sourceUpdateId
      2       , x2.schemeCode
      3       , x2.effectiveDate
      4       , x1.marketExchangeCode
      5  FROM message pl
      6     , XMLTable(
      7         '/UPDATES/matchEntity'
      8         passing pl.messagetext
      9         columns marketExchangeCode   VARCHAR2(20) PATH 'matchEntityBasic/marketExchangeCode'
    10               , alternateIds         XMLType      PATH 'alternateIdentifiers'
    11       ) x1
    12     , XMLTable(
    13         '/alternateIdentifiers'
    14         passing x1.alternateIds
    15         columns sourceUpdateId     VARCHAR2(20) PATH 'sourceUpdateId'
    16               , schemeCode         VARCHAR2(20) PATH 'schemeCode'
    17               , effectiveDate      DATE         PATH 'effectiveDate'
    18       ) x2
    19  ;
    SOURCEUPDATEID       SCHEMECODE           EFFECTIVEDATE MARKETEXCHANGECODE
    SAMSUNG              SMG                  16/01/2012    XASE
    SAMSUNG              TEBBGL               16/01/2012    XASE
    Or the shorter version :
    SQL> SELECT x.sourceUpdateId
      2       , x.schemeCode
      3       , x.effectiveDate
      4       , x.marketExchangeCode
      5  FROM message pl
      6     , XMLTable(
      7         'for $i in /UPDATES/matchEntity
      8          return
      9            for $j in $i/alternateIdentifiers
    10            return element r { $j/child::*, $i/matchEntityBasic/marketExchangeCode }'
    11         passing pl.messagetext
    12         columns sourceUpdateId     VARCHAR2(20) PATH 'sourceUpdateId'
    13               , schemeCode         VARCHAR2(20) PATH 'schemeCode'
    14               , effectiveDate      DATE         PATH 'effectiveDate'
    15               , marketExchangeCode VARCHAR2(20) PATH 'marketExchangeCode'
    16       ) x
    17  ;
    SOURCEUPDATEID       SCHEMECODE           EFFECTIVEDATE MARKETEXCHANGECODE
    SAMSUNG              SMG                  16/01/2012    XASE
    SAMSUNG              TEBBGL               16/01/2012    XASE

  • Help on creating and deleting xml child elements using Toplink please.

    Hi there,
    I am trying to build a toplink xml demo illustrating toplink acting as the layer between my java code and an xml datasource.
    After pulling my custom schema into toplink and following the steps in http://www.oracle.com/technology/products/ias/toplink/preview/10.1.3dp3/howto/jaxb/index.htm related to
    Click on Mapping Workbench Project...Click on From XML Schema (JAXB)...
    I am able to set up java code which can run get and sets against my xml datasource. However, I want to also be able create and delete elements within the xml data for child elements.
    i.e. in a simple scenario I have a xsd for departments which has an unbounded element of type employee. How does toplink allow me to add and or remove employees in a department on the marshalled xml data source? Only gets and sets for the elements seem accessible.
    In my experience with database schema based toplink demos I have seen methods such as:
    public void setEmployeesCollection(Collection EmployeesCollection) {
         this.employeesCollection = employeesCollection;
    Is this functionality available for xml backended toplink projects?
    cheers
    Nick

    Hi Nick,
    Below I'll give an example of using the generated JAXB object model to remove and add a new node. The available APIs are defined in the JAXB spec. TopLink also supports mapping your own objects to XML, your own objects could contain more convenient APIs for adding or removing collection members
    Example Schema
    The following XML Schema will be used to generate a JAXB model.
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
         elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:element name="department">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element ref="employee" maxOccurs="unbounded"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
         <xs:element name="employee">
              <xs:complexType>
                   <xs:sequence>
                        <xs:element name="name" type="xs:string"/>
                   </xs:sequence>
              </xs:complexType>
         </xs:element>
    </xs:schema>---
    Example Input
    The following document will be used as input. For the purpose of this example this XML document is saved in a file called "employee-data.xml".
    <department>
         <employee>
              <name>Anne</name>
         </employee>
         <employee>
              <name>Bob</name>
         </employee>
    </department>---
    Example Code
    The following code demonstrates how to use the JAXB APIs to remove the object representing the first employee node, and to add a new Employee (with name = "Carol").
    JAXBContext jaxbContext = JAXBContext.newInstance("your_context_path");
    Unmarshaller unmarshaller = jaxbContext.createUnmarshaller();
    File file = new File("employee-data.xml");
    Department department = (Department) unmarshaller.unmarshal(file);
    // Remove the first employee in the list
    department.getEmployee().remove(0);
    // Add a new employee
    ObjectFactory objectFactory = new ObjectFactory();
    Employee newEmployee = objectFactory.createEmployee();
    newEmployee.setName("Carol");
    department.getEmployee().add(newEmployee);
    Marshaller marshaller = jaxbContext.createMarshaller();
    marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE);
    marshaller.marshal(department, System.out);---
    Example Output
    The following is the result of running the example code.
    <department>
         <employee>
              <name>Bob</name>
         </employee>
         <employee>
              <name>Carol</name>
         </employee>
    </department>

  • How to delete the child record from the database

    how to delete a parent and child record from the database can we do it in the servlet and my database is oracle

    I'm not sure I understand the question but you could certainly use the JDBC API from within your servlet to access and modify a DB. You could also use an EJB layer to access your DB and accomplish the same tasks.

  • How To Delete Multiple Query Elements in a Transport

    Guys,
    How do you delete Multiple Query Elements in a transport in DEV? Or it's not posible.  I tried to select multiple but only one is being deleted.
    Thanks,
    Recca

    Hi Recca,
    As Nanda said, just go to tcode SE03..Click Unlock Objects (Expert Tool)..Paste your TR number (one at a time) then click Unlock..
    Go back to SE10 and delete your TR numbers..
    Regards,
    Loed

  • How to delete a UI element in a "safe" way?

    When I delete/cut/copy a UI element from a project.
    I cannot rebuild/archive the project due a "classpath" problem.
    The project's structure is damaged and a lot of errors are generated.
    1) How to delete UI elements from the layout without damage the project's structure?
    2) If the project's structure is damaged. Is there an easy way to fix it?
    (I tried the "repair" option from project name's context menu - didn't help).
    Also, I tried to "organize imports" - didn't help either.
    http://img67.imageshack.us/img67/4927/errors0ph.jpg
    Thanks, Omri

    Well, failing everything else, there is a way to do this if you have deleted an element and the project has become damaged.
    In your Windows file explorer, browse to the project directory, search for and delete all the ".class" and ".java" files. Now browse through all the project subdirectories, open every file in Notepad, and search for references to the object which you deleted, and delete those references.
    You need to be really careful when you do this, because you can totally ruin the Web Dynpro project. But if done correctly, it can revive a project which has run into the problem which you describe.
    Walter

  • How to delete parent child relation in Toplink

    Hi All,
    I have 3 tables A,B,C.
    In Table A ,I am saving record.
    Table B & C has parent child relation.
    B-->Parent
    C-->Child
    So I want to save records in Table A.
    And delete from child(C) 1st then from parent(B).
    I m writing my code as,
    em.getTransaction().begin();
    em.persist(Table A);//save in Table A
    em.remove(em.merge(Table B));//Remove from Parent
    But how to delete records from child table then from parent table.
    Thanks
    Sandip

    If you have a @OneToOne relationship between two entities, the join column information is used to order the SQL when you remove two entities. For example, if I have:
    @Entity
    public class Employee implements Serializable {
         @OneToOne
         @JoinColumn(name="ADDR_ID")
         private Address address;
    ...Then the following code runs regardless of the order of the remove calls.
              em.getTransaction().begin();
              Employee parent = new Employee();
              Address child = new Address();
              parent.setAddress(child);
              em.persist(parent);
              em.persist(child);
              em.getTransaction().commit();
              em.getTransaction().begin();
              parent = em.merge(parent);
              child = em.merge(child);
              // order of next two statements unimportant
              em.remove(parent);
              em.remove(child);
              em.getTransaction().commit();If I don't remove the parent and just the child I get the same error you do because of the FK from Employee to Address.
    --Shaun                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • HOW TO DELETE PARTICULAR TRIPLE SET FROM Oracle SEMANTIC TABLES in 11g

    Can somebody help us how to delete a particular set of triples from Oracle(11g) semantic that we have. Because we noticed that few triple belongs to particular data sets were wrongly loaded so we need to remove only those triples.
    Usually we delete all triples including others such and reload them again along with new triples. We would like to avoid this as we go to production.
    Otherwise When we insert a set of triples belongs to a particular data set, is it possible to know what ids Oracle assigned to that set? Can we delete by id? Just a thought.
    Rgds
    Srini

    Hi,
    It is very strange. I got an email in my inbox saying that you want to find out
    IDs of triples that belong to RNAIDB data set like the following.
    "<http://www.lscdd.lilly.com.sg/lscdd/RNAIDB/...../.../:>".
    This forum does not have your message somehow.
    Assume you have asked such an question :), my answers are
    1) from a modeling perspective, it is not a very good idea to encode
    semantics in the URI lexical form itself. A URI should be treated
    as a symbol.
    2) now assume you have a valid reason for doing this, you can try something like the following.
    CREATE INDEX testdel_sub_idx ON tstdel (triple.GET_SUBJECT());
    -- You can then get the rowid out for those offending rows.
    select rowid
    from tstdel t
    where t.triple.GET_SUBJECT() like '<urn:su%'
    -- Or you can remove them directly.
    delete from tstdel t
    where t.triple.GET_SUBJECT() like '<urn:su%'
    ;

  • How to delete/close WBS elements

    Hello Guys,
    We are facing following issues - We have some WBS elements that has not been migrated from company code XX (now incative). Now we canot close those WBS and we are getting errors when posting Settlements (CJ8G/CJ88).
    Error - Asset under construction not completely credited.
    There are some old bookings on the WBS (total sum = 0)  but SAP does not allow us to close it. As this is already closed company code we cannot create assets here anymore.
    Do you know if there is a way to close or delete such WBS elements?
    Thank you..

    Hi Tushar,
    Following the screenshot sent by Tomas, there are many steps which needs to be carried out before setting the deletion flag for the WBS element. One is to ensure that the mandatory fields for the asset are filled as rightly pointed out, second is to ensure deactivating the asset, third is to delete the existing PO's/PR's associated with the project. This will ensure that the WBS element is back in its original state which will then allow us to mark the deletion flag or set the WBS element as deleted. However cant we close the WBS element and then try to set the deletion flag? Is this a wrong practice you feel?
    Kindly advise
    Regards
    Varun

  • How to delete a child row

    hi, i want to delete a table (QUESTIONBNKMASTER )
    i've used delete QUESTIONBNKMASTER ; query for deleting but i got an exception saying that integrity constraint (VTSQBADMIN.FK_CHM_QNO) violated - child record.
    i tried for this command delete VTSQBADMIN.FK_CHM_QNO; but it say's table or view doesn't exits.
    what can i do to delete the table.
    my oracle username is vtsqbadmin.
    please reply soon it's a part of my assignment
    thanx in advance
    cinux

    You can do it many ways
    1. Delete all records from Child table then delete from master table.
    2. Remove the constraints using
    DROP CONSTRAINTS VTSQBADMIN.FK_CHM_QNO;
    and then delete records from master table.
    3. Disable the constraints. and then delete records from master table.
    Regards
    Re

  • How to delete photos in Elements 12 Organizer?

    Been using Elements 6 for years.  Bought E12 to go with a new iMac.  I am totally bewildered by 12.  Simple 1 or 2 click things have become procedures.
    Like deleting pictures from the Organizer... the Delete function is grayed-out in the pull down menu.  Jeez, it seems like a fairly simple thing to do, but I can't find an answer in either of the two books I now own and the darn video tutorials I've sat through! Your help is appreciated!
    1deu
    Just fixed the typos!

    Have you tried clicking once on the photo you want to delete and then press DEL button?  This should do the trick.
    This deletes the image from the catalog but if you want to delete the HD then check the box shown in this picture:

  • How to delete single MRP element line item

    Hi gurus,
    I need to delete a SINGLE line item for an MRP list for materials.  Is there a transaction to do this? 
    I have tried MD08, but that only deletes whole lists.  I am trying to clear out old elements that are years old in my list for a material.
    I will reward useful answers
    Thanks!

    Hi,
    It's very difficult to say what to do since I cannot see what you see, and I do not know anything about your system.
    In MRP there are: stock, requirements (IndReq, DepReq), transactional data (PO, SO, Delivery, PurRqs, etc)
    1. What you should do is to define which materials are related in this issue.
    2. Which kind of MRP elements are related (you have got old requirements, transactional data, etc?).
    If you have old requirements you should find the source of them. DepReq cannot be deleted > they come from higher levels > you should find where they come.
    Do they derive from old transactional data?
    Do they come from higher and higher level, I mean there are IndReqs, SOs for FG?
    (you can use 'pegged' function if you click on the MRP element)
    If you know from which kind of source they come (only they come from old transactional data or from IndReq, SO) > you should eliminate them accordingly.
    A. If they come from SO, IndReq you can use the steps written by me in my previous message. (You can use MD62 to delete old IndReq).
    B.
    If they come from old transactional data, you have to find the way to eliminate them. Maybe you cannot eliminate them by mass processing, I do not know.
    But you canmake groups / categorize the transactional data > after that maybe you can use mass change / handle them accordingly.
    I mean if you have SO and Delivery, you cannot delete the SO when Delivery refering to that SO exist.
    So, in case of requirements please delete the requirements (IndReq, SO) that exist at highest level and running MRP you will get rid of a lot of mess (top > down). In case of transactional data the strategy is the opposite: bottom > up.
    If you get error messages > double click on it and read what SAP says > if it's not clear search for the number of the error message on the forum.
    Sorrowfully, I cannot help in case of HU, I do not know them.
    BR
    Csaba
    Edited by: Csaba Szommer on Jul 23, 2008 10:54 PM
    Edited by: Csaba Szommer on Jul 23, 2008 10:56 PM

  • How to delete particular row in ALV list display

    Hi All,
    My requirement is :
    I am displaying ouput using lav list dispplay befor the first colomn i am displaying check box. i defined my own pf status here . in pf status i have 3 buttons .
    1 select all
    2 deselect all
    3 delete.
    First two options are working fine when i click select all it is selecting all the rown in a program(selectiong all the check boxex) like working fine for deselecting all.
    3 optioin  Delete when i click delete option it has to delete partcular row in a list display and at the same time this entry should delete from the table. this is my requirement. for the third point(delete) option i dont have any logic. anybody can suggest me or send me the sameple code. i am sending my code below.if possible please modify the code and resend it to me.
    type-pools : slis.
    tables : zuser_secobjects.
    data : t_header1 like zuser_secobjects.
    data : begin of it_secobjects occurs 0.
            include structure t_header1.
    *data :  box,
           input(1) type c,
    data :   checkbox type c,
            flag type c,
          end of it_secobjects.
    data : wa_ita like line of it_secobjects.
    *data : it_secobjects like zuser_secobjects occurs 0 with header line.
    data : i_field type slis_t_fieldcat_alv with header line.
    data : w_field like line of i_field.
    data : i_sort type slis_t_sortinfo_alv.
    data : w_sort like line of i_sort.
    data : it_filt1 type slis_t_filter_alv with header line.
    data:
    i_tabname type tabname,
    i_repid like sy-repid,
    is_lout type slis_layout_alv.
    data :   it_filt type slis_t_filter_alv   with header line,
             it_evts type slis_t_event        with header line.
    DATA : is_vari type disvariant.
    constants :   c_default_vari value 'X',
                  c_save_vari    value 'U',
                   c_checkfield type slis_fieldname     value 'ACTION',
                   c_f2code     type sy-ucomm           value '&ETA'.
    data : chk_box type slis_fieldname.
    selection-screen: begin of block b1 with frame title text-t01.
    parameters : p_appln type zuser_secobjects-appln.
    parameters : p_user type usr02-bname, "zuser_secobjects-appln_user,
    p_partnr type zuser_secobjects-appln_partner,
    p_ptype type zuser_secobjects-partner_type default '02',
    p_upostn type zuser_secobjects-user_position,
    p_sdate like likp-erdat default sy-datum,
    p_edate(10) default '12/31/9999',
    p_revnum type zuser_secobjects-revnum,
    p_cted type zuser_secobjects-created_by,
    p_cdate type zuser_secobjects-creation_date,
    p_ctime type zuser_secobjects-creation_time,
    p_chnby type zuser_secobjects-changed_by,
    p_cdate1 type zuser_secobjects-changed_date,
    p_ctime1 type zuser_secobjects-changed_time.
    selection-screen: end of block b1.
    form user_command using p_ucomm like sy-ucomm
    rs_selfield type slis_selfield.
    *DATA :   it_filt type slis_t_filter_alv   with header line.
      case p_ucomm.
        when 'SELECT_ALL'. " SELALL is the FCODE of ur push button
          loop at it_secobjects into wa_ita.
            wa_ita-checkbox = 'X'.
            modify it_secobjects from wa_ita.
          endloop.
      rs_selfield-refresh = 'X'.   "<-  ADD THIS
      when 'DESLCT_ALL'.
        loop at it_secobjects into wa_ita.
            wa_ita-checkbox = ' '.
            modify it_secobjects from wa_ita.
          endloop.
      rs_selfield-refresh = 'X'.   "<-  ADD THIS
        is_lout-f2code               = c_f2code.
        is_lout-box_fieldname        = c_checkfield.
        is_lout-get_selinfos         = 'X'.
        is_lout-detail_popup         = 'X'.
        is_lout-detail_initial_lines = 'X'.
    when 'HIDE_DEL'.
          rs_selfield-exit  = 'X'.
          it_filt-fieldname = 'ACTION'.
          it_filt-tabname   = '1'.
          it_filt-valuf     = 'X'.
          it_filt-intlen    = '1'.
          it_filt-inttype   = 'C'.
          it_filt-datatype  = 'CHAR'.
          it_filt-valuf_int = 'X'.
          it_filt-sign0     = 'E'.
          it_filt-optio     = 'EQ'.
          if it_filt[] is initial.
            append it_filt.
          else.
            modify it_filt index 1.
          endif.
         perform display using i_object.
    PERForm  ALV_LIST_DISPLAY.
    WHEN 'SHOW_DEL'.
          rs_selfield-exit = 'X'.
          free it_filt.
    PERForm  ALV_LIST_DISPLAY.
    when 'SAVE1'.
           select * from zuser_secobjects where
                        appln = zuser_secobjects-appln
                  and   appln_partner = zuser_secobjects-appln_partner
                  and   partner_type = zuser_secobjects-partner_type
                  and   start_date = zuser_secobjects-start_date
                  and   end_date = zuser_secobjects-end_date.
          endselect.
          if sy-subrc eq 0.
            message e000(ZV) with 'Duplicate Entry'.
          endif.
      endcase.
    endform.
    *&      Form  delete
    form delete.
      data : begin of is_secobjects occurs 0.
              include structure zuser_secobjects.
      data : checkbox type c.
      data : end of is_secobjects.
      is_secobjects-checkbox = 'X'.
      modify is_secobjects
        from it_secobjects
        transporting checkbox
      where checkbox = 'X'.
    endform.
    *&      Form  get_data
    form get_data.
      select * from zuser_secobjects
      into table it_secobjects.
    endform.                    " get_data
    *&      Form  prepare_fieldcatalog
          text
    -->  p1        text
    <--  p2        text
    form prepare_fieldcatalog.
      clear: w_field,i_field.
      refresh:i_field.
      i_field-key = 'X'.
      i_field-col_pos = 1.
      i_field-ddictxt = 'S'.
      i_field-seltext_s = '@11@'.
    i_field-checkbox = 'X'.
      i_field-input = 'X'.
      i_field-fieldname = 'HEADER'.
      i_field-outputlen = 0.
      append i_field.
      clear i_field.
      w_field-fieldname = 'APPLN'.
      w_field-tabname = 'IT_SECOBJECTS'.
      w_field-seltext_l = text-m01.
      w_field-outputlen = '10'.
      w_field-col_pos = 1.
      append w_field to i_field.
      clear w_field.
      w_field-fieldname = 'APPLN_USER'.
      w_field-tabname = 'IT_SECOBJECTS'.
      w_field-just = 'C'.
      w_field-seltext_l = text-m02.
      w_field-outputlen = '7'.
      w_field-col_pos = 2.
      append w_field to i_field.
      clear w_field.
    endform.                    " prepare_fieldcatalog
    *&      Form  ALV_LIST_DISPLAY
          text
    -->  p1        text
    <--  p2        text
    form alv_list_display.
      i_repid = sy-repid.
      is_lout-box_fieldname = 'CHECKBOX'.
      it_filt-fieldname = 'ACTION'.
      call function 'REUSE_ALV_LIST_DISPLAY'
           exporting
                i_callback_program       = i_repid
                i_callback_pf_status_set = 'PF_STATUS_SET'
                i_callback_user_command  = 'USER_COMMAND'
                is_layout                = is_lout
                it_fieldcat              = i_field[]
                it_filter                = it_filt[]
                 it_events                = it_evts[]
                i_default                = c_default_vari
                i_save                   = c_save_vari
                is_variant               = is_vari
           tables
                t_outtab                 = it_secobjects.
    endform.                    " ALV_LIST_DISPLAY
    *&      Form  display
          text
         -->P_I_OBJECT  text
    form display using    object.
      case object.
    ENDCASE.
    endform.                    " display
    thanks,
    maheedhar.t

    HI
    In my program checkbox(before the record is displayed)
    I used following lines to display checkbox .
      i_field-key = 'X'.
      i_field-col_pos = 1.
      i_field-ddictxt = 'S'.
      i_field-seltext_s = '@11@'.
      i_field-checkbox = 'X'.  <- Using this command i am getting checkbox
      i_field-input = 'X'.
    when i select this checkbox i press delete option then this entry will remove from internal table and refresh the screen and at the same time i will click on save button this ztable has to update according to that action.
    this is my requirement.
    thanks,
    maheedhar.

  • How to delete a data element? - error message

    Error in the ABAP Application Program
    The current ABAP program "SAPLRSSG" had to be terminated because it has
    come across a statement that unfortunately cannot be executed.
    The following syntax error occurred in program "GP0GVENGV13S7QSCONTM4LCHNZG "
    in include "GP0GVENGV13S7QSCONTM4LCHNZG " in
    line 172:
    "The type <b>"/BIC/OIUSITMDEC"</b> is unknown."
    I already deleted the InfoObject USITMDEC.

    Re-active the Transformation and DTP, then it worked.

Maybe you are looking for

  • . . I finally did it.....X D

    i dropped my ipod touch. i swore i wouldn't but i did. i was cleaning it over a glass end table, and it slipped, hitting the glass table and then the carpet below it. unfortunately, there's a chip in the chrome exterior but no other damages have been

  • RE: CGI Error

    Hi All, Can any one tell me What is these CGI Errors means 1. cgi_init reports: HTTP4047: could not initialize CGI subsystem (Cgistub path ../private/Cgistub), err Cgistub is marked as set user ID on execute and its directory is accessible by other u

  • Error including INCLUDE text

    Hi experts, I'm new at sapscript. I need to print the company logo on a label. I've read many posts everywhere and the task seems pretty simple. Somehow, I'm getting an error that I can't google anywhere while doing the sapscript check: "Error includ

  • Getting error notifications about payment every month

    I get repeatedly notifications about payment information and finally the payment succeeds without changing even the information. Anyway the system doesn't accept correct address information and suggests abbreviated forms of billing address. The probl

  • DON'T copy the selected text automatically!!!

    version: 11.1.1.7 OS: Linux In jdev code editor, when you select "something1", click Ctrl+C, then select "somehting2", click Ctrl + P. You will find nothing happens. This is because when you select "something2", the clipboard is replaced with "someth