How to trigger a 'delete' across different related tables in ABAP?

Hello All,
I am creating database tables for storing different values of features coming under different countries. I have eight tables in my design and there are fields repeating in different tables, which i am connecting through foreign key relationship.
After entering values to all my tables, if i need to delete a particular field value which is repeating in more than two tables, is it possible to trigger a delete event by which if am deleting the field value in a particular table, all the related field values also get deleted from the respective tables?
For example, if i have a PRODUCT field in three tables, and if one of the PRODUCT is deleted from a particular table, can i trigger a delete event by which i can delete all the values related to that particular PRODUCT from all the related tables? The PRODUCT is a primary keyfield, and i have maintained proper foreign key relations also.
I have tried deleting entries using the views and using the database table itself, but only that particular table value is being deleted.
Is there any function module for triggering a delete?
Can anyone help me with some solution?Sample code will be helpful.
Thanks in Advance,
Shino

Hi,
My friend it is not advisable to delete any field from a database  table bcoz it's creats incosistance data for all the other related tables, but there r few Function Modules that provide u this functionality.
Such As:
G_REPORT_DELETE_ADDFLD_ENTRY
G_CATT_DELETE_TABLE_ENTRY
RKE_DELETE_FIELDS_FROM_TABLE
Regards

Similar Messages

  • How to retrive the deleted data in Z table

    Hi Gyes,
    How to retrive the deleted data in Z table.
    Thanks & Regards,
    Suresh

    Hello Suresh
    If you have not activated the technical setting "Log data changes" in the definition of your z-table (which is unlikely) then there will be no change documents available.
    If you have downloaded your z-table entries sometimes you could use these data for recovery.
    Otherwise your last change is to ask your <b>basis team</b> when the last backup has been made.
    Regards
      Uwe

  • How to upload records  in two different interface tables through WebADI.

    We have created custom integrator with two different interfaces to insert records in AP_INVOICES_INTERFACES and AP_INVOICE_LINES_INTERFACE. Also defined the custom layout in which we mention the header and lines column info to be displayed in the spreadsheet. When I tried to create document to upload the records into the interface tables, could find two different interface for header and lines , when we select the header and upload records into the AP_INVOICES_INTERFACES table it was successfull. But couldn't upload records inserted in Lines interfaces tables. How do we upload records in both the table do we have constraint with Web ADI can insert records to only one interface tables. Any recommendation highly appreciated.

    Raghu,
    Thanks for the reply,
    I have a concern, But if you are connecting a another database you have to create one more subreport and each time am creating connections across databases we have to create subreport and go for the design to show the record. Is it any way to have a common field or union records approach in crystal report 2008.
    For Example :
    Approach 1 :
    Emp name           Emp salary      (Common Header)
    Variable Field1    Variable field2   ( Iterations to be done here for records)
    Variable field 1 contains ---> emptbl(employee name), b.emptbl(employee name) (A database, b database, c database or any .db)
    Variable field2  contains --->  emptbl (salary info between databases)
    Approach 2:
    getting all the records and union all the records 
    Thanks
    Murali Sri

  • How to load data into 3 different target tables usin BODS ?

    Hello Friends,
    I have 5 different source tables with same field definitions, Now I want to load all the records into three/four different target tables (Flat file, SQL Server, XML, and Oracle ) Could anyone please tell me how to do this task ?
    Thanks in Advance,
    Bheem.

    Hello Bheem,
    You can create separated dataflow for each target as suggested by Bala, this is a good choice when evaluating you scenario.
    If you put all targets in the same dataflow you may experience problems if one of them is down (as you have different servers as targets).
    BODS will send the data simultaneously to all targets and when one fails, the load will be break and you may have the tables not sinc anyways (if you plan to use a single dataflow to avoid this situation, it won't do it).
    So the best option is to create separated dataflow and put inside another one so you can run a singe dataflow that will call each one of the target and if onw fails the other will complete accordingly.
    Then if you put them inside a error trapping, you may even make your dataflow to retry the load prior abend the job.
    Think about cascading your dataflows and let the leaf level simple as it can be so it will be easier to schedule and debug your process.
    Pay attention to datatypes and other conversions you might need when working with more than one source/target.
    Regards,

  • How to choose in Delete Duplicates from internal table?

    Now I need to delete Duplicates from internal table,
    So at first I sort
    than I delete duplicate
    Sort itab1 BY Company_Code  Asset_No Capital_Date.
          DELETE ADJACENT DUPLICATES FROM itab1 COMPARING Company_Code  Asset_No  Capital_Date
    Company_Code
    Asset_No
    Capital_Date
    Remark
    BC35
    1515593
    20021225
    Helen
    BC35
    1515593
    20021225
    Common Asset
    BC35
    1515594
    20030109
    Judy
    BC35
    1515594
    20030109
    Common Asset
    But here comes my problem~If I want to delete the Common Asset in Remark Column,how I let it choose the right one to do it?

    Hi Jack
    Try the below coding..
    Report zsamp.
    types: begin of t_tab,
            comp_code(4) type c,
            ***_no(7) type n,
            cap_date type d,
            remark type string,
            end of t_tab.
    data: i_tab type TABLE OF t_tab,
           w_tab type t_tab.
    w_tab-comp_code = 'BC35'.
    w_tab-***_no = '1515593'.
    w_tab-cap_date = '20021225'.
    w_tab-remark = 'Helen'.
    append w_tab to i_tab.
    w_tab-comp_code = 'BC35'.
    w_tab-***_no = '1515593'.
    w_tab-cap_date = '20021225'.
    w_tab-remark = 'Common Asset'.
    append w_tab to i_tab.
    w_tab-comp_code = 'BC35'.
    w_tab-***_no = '1515594'.
    w_tab-cap_date = '20030109'.
    w_tab-remark = 'Judy'.
    append w_tab to i_tab.
    w_tab-comp_code = 'BC35'.
    w_tab-***_no = '1515594'.
    w_tab-cap_date = '20030109'.
    w_tab-remark = 'Common Asset'.
    append w_tab to i_tab.
    sort i_tab by remark.
    delete ADJACENT DUPLICATES FROM i_tab COMPARING remark.

  • How to implement a page showing different database tables

    I am wondering what is the best way to implement the following task:
    On the left side of a page, there are two Listboxes. On the right side of the page, I want to display different database tables depending on the selected value from those two Listboxes.

    I am wondering what is the best way to implement the
    following task:
    On the left side of a page, there are two Listboxes.
    On the right side of the page, I want to display
    different database tables depending on the selected
    value from those two Listboxes.A Data Table component isn't really designed to dynamically swap which database table you're binding too (and therefore which set of columns you will display) under the covers. Here are a couple of general strategies to consider for accomplishing your functional requirements:
    * Create a separate Data Table component for each possible database table, all on the same page, and dynamically set the "rendered" property of the selected Data Table to true, while setting it to false for all other Data Tables. That way, only the corect one will be shown.
    * Create a separate page for each Data Table, using a similar look and feel so that it appears to the user like it's all the same page. To save cutting and pasting the list components, put them in a JSP Page Fragment so they can be reused on each page. ((SIDE NOTE: This is a very common technique for simulating what looks like tabbed panes, but where the implementation actually uses separate pages.))
    * Use frames so that the left frame (containing the list boxes) stays the same, and the right frame switches to a different page for each of the tables. This is essentially another way to share the list components across the pages.
    * Abandon all the ease-of-use stuff Creator provides for binding to data tables, and write code that programmatically erases all the old child components and creates new ones. This is the sort of thing you'd need to do for a "SQL BROWSER" sort of application, where the set of columns is not known ahead of time.
    Craig McClanahan

  • How can I modify data from a Transparent Table without ABAP code.

    Hi,All
    How can I modify data from a Transparent Table (like TCURR),  and important thing is I want do all that with no ABAP code here. It is like that we always do that in a Oracle database use TOAD or PLSQL third party tools, with no script code here.
    I had fond that there is a way can do that:
    1, type 'se11',and Display Database table 'TCURR', click Contents, then click Execute to display all data
    2, type '/h' and let debugging on
    3, select one of this data then click 'Display',enter in debugging system.
    4, then make a breakpoint in the code. But... display a dialog let I type a 'ABAP Cmnds', I want to know what can be type in for that?
    and, My system is ECC6.
    thank you all
    Edited by: xuehui li on Aug 20, 2008 6:30 PM

    Hello,
    Your approach (with Vijay's suggestion) MAY work.  However, depending on how tight security is at the company that you are working at you may or may not be able to acutaly change the value of the SHOW field to EDIT.  This will be especially true if you are working in a Production environment.  Vijay's other comment is true as well.  This is not a recommended approach to change data (especially data with a financial impact like TCURR) in a production environment.  The auditors will not be impressed.
    Explore the option of a maintenace view or look at tcode TBDM to upload a file which includes daily rates from providers like Reuters or try tcode s_bce_68000174 which is a maintenance view on TCURR.
    Regards
    Greg Kern

  • How to track multiple documents across different sites

    What I am trying to do seems relatively simple yet I can't seem to find a way to do it.
    I have found methods to track documents relative to me and recently modified documents within a specific site.
    Basically I want to take document A from the Developer site, document B from the HR site and Document C from the Architecture site and display them in a webpart on a different site that will let me see when they have been modified and by who. It seems that
    you can display whole libraries in a webpart from another sites but not select documents from multiple libraries.
    I have tried making copies to display in a webpart but it doesn't show you when the original has been modified. I need the originals to remain yet display there status in a webpart on a different site.
    Any advise or direction would be greatly appreciated.
    Thanks!

    Hi,
    According to your post, my understanding is that you wanted to display libraries in different sites.
    You can save the library web part to file, then upload the file to a different site.
    When you modify the library files, in the different site the web part would also update.
    http://www.microsofttechnology.net/2013/04/sharepoint-2010-display-list-or-library.html
    More references:
    https://listrollup.codeplex.com/
    https://store.bamboosolutions.com/sharepoint-Cross-Site-Display-Web-Part.aspx
    Thanks & Regards,
    Jason
    Jason Guo
    TechNet Community Support

  • How to trigger an ActionListener in different class on click of a tree node

    Hi guyz,
    There are three panels inside my main Frame
    -->TopPanel,MiddlePanel and BottomPanel. I have a tree structure inside a panel. This panel along with couple more panels is in MiddlePanel. My main class is "mainClass.java". Inside that i have an actionListener for a specific button. I need to trigger that actionListener when i click one of the tree nodes in the panel i specified before. The problem is that my MiddlePanel is itself a different ".java" file which is being called in my "mainClass" when a specific button is clicked. There are different buttons in my "mainClass" file and for each one i am creating different MiddlePanels depending on the buttons clicked.
    So, if i click the tree node, i need to remove the MiddlePanel and recreate the MiddlePanel(One that will be created when a different button in the mainClass file is clicked). i.e., i need to trigger the actionListener for that corresponding button. Is there a way to do it?

    use this code to call different panel by selecting tree node.....ok
    import javax.swing.*;
    import javax.swing.tree.*;
    import java.awt.*;
    import java.sql.SQLException;
    import javax.swing.event.*;
    class MainTree extends JFrame
    private static final long serialVersionUID = 1L;
         CardLayout cl = new CardLayout();
         JPanel panel = new JPanel(cl);
    public MainTree() throws Exception
    JPanel blankPanel = new JPanel();
    blankPanel.setBorder(BorderFactory.createTitledBorder("Blank Panel"));
    panel.add(blankPanel,"0");
    panel.add(blankPanel,BorderLayout.CENTER);
         panel.setPreferredSize(new Dimension(800, 100));
         setSize(1000, 700);
    setLocationRelativeTo(null);
    setDefaultCloseOperation(EXIT_ON_CLOSE);
    // getContentPane().setLayout(new GridLayout(1,2));
    getContentPane().setLayout(new BorderLayout());
    ConfigTree test = new ConfigTree();
    DefaultMutableTreeNode mainTree = (DefaultMutableTreeNode)test.buildTree();
    JTree tree = new JTree(mainTree);
    tree.setCellRenderer(new DefaultTreeCellRenderer(){
    private static final long serialVersionUID = 1L;
         public Component getTreeCellRendererComponent(JTree tree,Object value,
    boolean sel,boolean expanded,boolean leaf,int row,boolean hasFocus){
    JLabel lbl = (JLabel)super.getTreeCellRendererComponent(tree,value,sel,expanded,leaf,row,hasFocus);
    NodeWithID node = (NodeWithID)((DefaultMutableTreeNode)value).getUserObject();
    if(node.icon != null)lbl.setIcon(node.icon);
    return lbl;
    getContentPane().add(new JScrollPane(tree));
    loadCardPanels((DefaultMutableTreeNode)((DefaultTreeModel)tree.getModel()).getRoot());
    getContentPane().add(panel,BorderLayout.EAST);
         getContentPane().add(blankPanel,BorderLayout.WEST);
    // getContentPane().add(panel);
    tree.addTreeSelectionListener(new TreeSelectionListener(){
    public void valueChanged(TreeSelectionEvent tse){
    NodeWithID node =(NodeWithID)((DefaultMutableTreeNode)((TreePath)tse.getPath())
    .getLastPathComponent()).getUserObject();
    if(node.nodePanel != null)
    String cardLayoutID = node.ID;
    cl.show(panel,cardLayoutID);
    cl.show(panel,"0");
    public void loadCardPanels(DefaultMutableTreeNode dmtn)
    for(int x = 0; x < dmtn.getChildCount(); x++)
    if(((DefaultMutableTreeNode)dmtn.getChildAt(x)).isLeaf() == false)
    loadCardPanels((DefaultMutableTreeNode)dmtn.getChildAt(x));
    NodeWithID node = (NodeWithID)((DefaultMutableTreeNode)dmtn.getChildAt(x)).getUserObject();
    if(node.nodePanel != null)
    String cardLayoutID = node.ID;
    panel.add(cardLayoutID,node.nodePanel);
    public static void main(String[] args) throws Exception{new MainTree().setVisible(true);}
    class ConfigTree
    public Object buildTree() throws Exception
    NodeWithID n0 = new NodeWithID("HelpDesk","");
    NodeWithID n1 = new NodeWithID("Administrator",n0.nodeName);
    NodeWithID n2 = new NodeWithID("Report Form",n1.nodeName,new Tree().getContentPane());
    NodeWithID n3 = new NodeWithID("Create User",n2.nodeName,new JPanel());
    NodeWithID n4 = new NodeWithID("Unlock User",n2.nodeName,new unlockui().getContentPane());
    NodeWithID n5 = new NodeWithID("List User",n2.nodeName,new JPanel());
    NodeWithID n6 = new NodeWithID("Assign Role",n2.nodeName,new AssignRole());
    NodeWithID n9 = new NodeWithID("Operator",n1.nodeName,new JPanel());
    NodeWithID n10 = new NodeWithID("Create Ticket",n9.nodeName,new JPanel());
    NodeWithID n11 = new NodeWithID("My Ticket",n9.nodeName,new JPanel());
    NodeWithID n12 = new NodeWithID("All Ticket",n9.nodeName,new JPanel());
    NodeWithID n13 = new NodeWithID("Event Viewer",n1.nodeName,new JPanel());
    DefaultMutableTreeNode top = new DefaultMutableTreeNode(n0);
    DefaultMutableTreeNode branch1 = new DefaultMutableTreeNode(n1);
    top.add(branch1);
    DefaultMutableTreeNode node1_b1 = new DefaultMutableTreeNode(n2);
    DefaultMutableTreeNode n1_node1_b1 = new DefaultMutableTreeNode(n3);
    DefaultMutableTreeNode n2_node1_b1 = new DefaultMutableTreeNode(n4);
    DefaultMutableTreeNode n3_node1_b1 = new DefaultMutableTreeNode(n5);
    DefaultMutableTreeNode n4_node1_b1 = new DefaultMutableTreeNode(n6);
    branch1.add(node1_b1);
    branch1.add(n1_node1_b1);
    branch1.add(n2_node1_b1);
    branch1.add(n3_node1_b1);
    branch1.add(n4_node1_b1);
    DefaultMutableTreeNode node4_b1 = new DefaultMutableTreeNode(n9);
    DefaultMutableTreeNode n1_node4_b1 = new DefaultMutableTreeNode(n10);
    DefaultMutableTreeNode n2_node4_b1 = new DefaultMutableTreeNode(n11);
    DefaultMutableTreeNode n3_node4_b1 = new DefaultMutableTreeNode(n12);
    node4_b1.add(n1_node4_b1);
    node4_b1.add(n2_node4_b1);
    node4_b1.add(n3_node4_b1);
    DefaultMutableTreeNode node5_b1 = new DefaultMutableTreeNode(n13);
    branch1.add(node1_b1);
    branch1.add(node4_b1);
    branch1.add(node5_b1);
    return top;
    class NodeWithID
    String nodeName;
    String ID;
    JPanel nodePanel;
    ImageIcon icon;
    public NodeWithID(String nn,String parentName)
    nodeName = nn;
    ID = parentName+" - "+nodeName;
    public NodeWithID(String nn,String parentName,Container container)
    this(nn,parentName);
    nodePanel = (JPanel) container;
    nodePanel.setBorder(BorderFactory.createTitledBorder(ID + " Panel"));
    public NodeWithID(String nn,String parentName,JPanel p, ImageIcon i)
    this(nn,parentName,p);
    icon = i;
    public String toString(){return nodeName;}
    }

  • How to regenerate classes after adding new related tables ?

    HI,
    I am using JDeveloper 10.1.3.0.4 to generate java classes from tables.
    It is a great product, I like it a lot. I am planning to generate java classes in several iterations. I have one primary table, with FK from two different tables.
    If I include all the 3 tables to generate java classes, it generates methods with which I can access the collections referred via FK. It is working great!
    I like it a lot. Zero coding effort !!!
    Now if I want to add another table, which is also a FK to the primary table, I was able to do the mapping manually using the mapper to create the relation. But how do I regenerate the primary class again to have a method to access the new collection?
    Is it possible to do handcoding to introduce this new relation ?
    If so , can you show some pointers ?
    Thanking in advance
    Sambath
    Oracle Consulting

    Hi,
    Additional information for the above question.
    I am just reading the data, since all the tables are existing tables and I don't have any need to update the data.
    Sambath

  • Help needed writing trigger for deleting records from multipul tables

    i am trying to write a trigger which would help me delete the record from 3 different tables
    lets say i have table a , b and c
    i an trying to write a trigger which would help me delete the same record from table a and c.
    drop trigger az_zzz_trigger;
    create trigger az_zzz_trigger
    before INSERT or UPDATE or DELETE ON az_employ
    FOR EACH ROW
    BEGIN
    IF DELETING then
    delete from za_payroll
    delete from az_salary_audit
    end if;
    end;
    while executing this trigger all data of table za_payroll is delete.
    what should i do so that only the record which i delete from az_employ gets deleted from az_payroll and az_salary_audit

    872959 wrote:
    i am trying to write a trigger which would help me delete the record from 3 different tables
    lets say i have table a , b and c
    i an trying to write a trigger which would help me delete the same record from table a and c.
    drop trigger az_zzz_trigger;
    create trigger az_zzz_trigger
    before INSERT or UPDATE or DELETE ON az_employ
    FOR EACH ROW
    BEGIN
    IF DELETING then
    delete from za_payroll
    delete from az_salary_audit
    end if;
    end;
    while executing this trigger all data of table za_payroll is delete.
    what should i do so that only the record which i delete from az_employ gets deleted from az_payroll and az_salary_auditutilize appropriate WHERE clause

  • How to insert an ID into the related tables???

    Hi,
    I have 3 tables in my database who are related.
    Table employees, functions and specializations
    The employees table has an empID, functions has an funID and the related empID and specializations has an speID and to the related empID.
    When I insert a new employee, i want that the empID from employees is automatically inserted into the tables functions and specializations.
    How can I do that with SQL???????

    Why PL/SQL code of course. :)
    SQL> create table employees
      2    (emp_id number,
      3     emp_name varchar2 (20)
      4    ) ;
    Table cr&eacute;&eacute;e.
    SQL> create table functions
      2    (emp_id number,
      3     fun_id number,
      4     fun_name varchar2 (20)
      5    ) ;
    Table cr&eacute;&eacute;e.
    SQL> create trigger employees_afi
      2     after insert on employees
      3     for each row
      4  begin
      5     insert into functions (emp_id) values (:new.emp_id) ;
      6  end ;
      7  /
    D&eacute;clencheur cr&eacute;&eacute;.
    SQL> insert into employees (emp_id, emp_name) values (1, 'SMITH') ;
    1 ligne cr&eacute;&eacute;e.
    SQL> select * from functions ;
       EMP_ID    FUN_ID FUN_NAME
            1
    SQL>

  • Hierarchy across different dimension tables?

    Hello
    I have a situation here..
    I have Dim1 and Dim2. They are both M to M relationship to each other. Therefore, I introduced a mapping table called Mapping_F in the middle. So the relationship looks like this:
    Dim1 ---> Mapping_F------> Dim2.. Dim1 and Dim2 don't have any common keys to join directly...
    Now in reality, 1 dim1 can have many dim2, 1 dim2 can also have many dim1 attribute...
    We have a requirement, which is to create a hierarchy drill-down on report featuring Dim1 and other measures.. User can click on Dim1 and it will display the measures for all of the dim2 stuffs under this dim1 attribute value..
    This would require creating a hierarchy that goes from Dim1 to dim2, however, based on the existing model, how can this be implemented?
    Any suggestion will be greatly appreciated..
    Thanks

    You can try creating 2 different reports and navigate from one to another using navigate or Go URL

  • How to bring data from 3 different internal table to one

    hii all,
              i have 3 internal table ls_mat,which has around 20 fields,it_stpo,which has 3 fields,and it_mast,i need to bring all these 3 table data in one tabel...how do i do...plzz help...

    Hi ,
    Does this internal table have any fields in common in all the three.
    If yes , then loop ls_mat
    Declare a type will all the fields and create a structure and internal table with that type (for ex lx_final and lt_final respectively)
    Loop at ls_mat into lx_mat.
    1.copy all the fields of lx_mat to respective lx_final.
    2.read table it_stpo into lx_stpo with key field = lx_mat-field.
    3.Copy all fields of lx_stpo to respective lx_final.
    4. read table it_mast into lx_mast with key field = lx_mat-field.
    5. copy all fields of lx_mast to respective lx_final.
    6. now append lx_final to lt_final.
    Endloop.
    now you can get all values inside lt_final.
    Regards,
    sivaganesh

  • How to trigger an event every time BSID table is updated?

    Dear all,
    I have a request at my company to develop/implement/configure a trigger to BSID standard table, to catch all records inserted and perform some calculations with the field WRBTR. I must do this whenever a record is inserted.
    Thank you in advance, i hope you will understand my poor english.
    Kind Regards,
    /S. Nuvunga

    You need to do customization for the archivelink. In this you can also set the workflow which should be started. This isn't done using a change document or an event.
    Check the customizing, there are several nodes there you need to customize. Read the help in customizing for those steps. Check in customizing under:
    Application server --> Basic services --> Archivelink
    There are several nodes which need to be configured.
    Regards,
    Martin

Maybe you are looking for