Deleting an object in a graph

Hi everyone.
I wanted to ask a question about how exactly one deletes an object on a graph.If we say that the graph is like a tree i.e with root , leaves and other nodes that are in between how one deletes a specified object?

A very simple way of describing such a tree/graph structure relatively efficiently is "keep a pointer to your parent/ancestor/predecessor and each parent/ancestor/predecessor has some kind of Collection of all its children/successors. If you want to delete an item (including all its successors) just go to the parent's Collection and remove it.
//this is not very elegant code for maximum simplicity
public class Node {
  public Collection children = new HashSet();
  public Node parent = null;
  public void addChild(Node node){
    node.parent = this;
    this.children.add(node);
  public void remove(){
    this.parent = null;
    parent.children.remove(this);
  public static void main(String[] args){
    Node root = new Node();
    root.addChild(new Node());
    root.addChild(new Node());
    Node n1,n2;
    root.addChild(n1 = new Node());
    n1.addChild(n2 = new Node());
    n2.remove();
    n1.remove();

Similar Messages

  • Log for Addition/Deletion of object in a Transport Request

    Dear Friends,
    Recently I had a issue where I tried deleting an object from a transport request and I got the message that object is deleted successfully.
    But when the transport was imported then it failed with Sy-subrc 8 because of the same object in transport.  The reason for the same could be :
    1.) Either the object was not deleted from the transport request.
    2.) Or Some one else added the same object again in the request.
    I want to read the log of this transport in such a way that I see when a object has been added/deleted from a transport request along with SAP User ID of the person doing it.
    Is this possible ? If so kindly share the steps with me.
    Thanks a Lot for your kind help!!! This is very important for me....
    Regards,
    Lalit

    Hello Lalit
    I hope nothing of that sort is available as the transport requests will again have tasks under them.
    The changes done to  the task will have to be tracked in that case but SAP doesn't have that task change logging as far as I know.
    All E0* tables relates to transports and objects under these transports none of them have logs on this nor even any transactions which allow user to edit the transport object.
    You get an action log which provides who created it and who releaed them.
    But if you configure CharM on Solution manager I hope you can track each changes.
    Regards
    Vivek

  • Error in FM DDIF_NAMETAB_GET when deleting BI objects via transport request

    Dear all,
    when importing a transport request in which several types of BI objects are deleted (Infocubes, DSO's, transformations, routines, DTP's, query elements, infosets, process chains). The import terminates only when transporting from acceptance to production with return code 12 due to an uncaught exception:
    Transporting from development to acceptance did not raise this exception.
    The ST22 dump (see below) refers in the "contents of system fields" section to a DSO, and to post-import activities. The DSO and the associated tables could not be found (rsa1 & se16), since they are deleted as desired.
    Some of the relevant notes that I have found do refer to DSO related problems, but they all indicate to install SP19 which we already have installed (BW 7.0 Patch Level 23)
    Could you please assist in pointing out potential solutions based on the information from the ST22 Runtime Error below?
    Kind regards,
    PJ
    Runtime Errors         UNCAUGHT_EXCEPTION
    Except.                CX_RS_PROGRAM_ERROR
    Date and Time          08.02.2011 10:48:14
    Short text
        An exception occurred that was not caught.
    What happened?
        The exception 'CX_RS_PROGRAM_ERROR' was raised, but it was not caught anywhere
        along the call hierarchy.
        Since exceptions represent error situations and this error was not
        adequately responded to, the running ABAP program
        'CL_RSDD_DS====================CP' has to be
        terminated.
    Error analysis
        An exception occurred which is explained in detail below.
        The exception, which is assigned to class 'CX_RS_PROGRAM_ERROR', was not caught
        and therefore caused a runtime error.
        The reason for the exception is:
        Error in BW: Error in DDIF_NAMETAB_GET
    How to correct the error
        If the error occurs in a non-modified SAP program, you may be able to
        find an interim solution in an SAP Note.
        If you have access to SAP Notes, carry out a search with the following
        keywords:
        "UNCAUGHT_EXCEPTION" "CX_RS_PROGRAM_ERROR"
        "CL_RSDD_DS====================CP" or "CL_RSDD_DS====================CM001"
        "APPEND_DS_TEC_FIELDS"
    System environment
        SAP-Release 700
        Application server... "dp1ci"
        Network address...... "<removed>"
        Operating system..... "HP-UX"
        Release.............. "B.11.23";
        Hardware type........ "ia64"
        Character length.... 16 Bits
        Pointer length....... 64 Bits
        Work process number.. 45
        Shortdump setting.... "full"
        Database server... "spisap02"
        Database type..... "ORACLE"
        Database name..... "DP1"
        Database user ID.. "SAPBIW"
        Terminal................. " "
        Char.set.... "C"
        SAP kernel....... 700
        created (date)... "Dec 14 2009 20:47:35"
        create on........ "HP-UX B.11.23 U ia64"
        Database version. "OCI_102 (10.2.0.1.0) "
        Patch level. 236
        Patch text.. " "
        Database............. "ORACLE 10.1.0.*.*, ORACLE 10.2.0.*.*, ORACLE 11.2.*.*.*"
        SAP database version. 700
        Operating system..... "HP-UX B.11";
        Memory consumption
        Roll.... 5979936
        EM...... 0
        Heap.... 1459888
        Page.... 40960
        MM Used. 6988880
        MM Free. 415648
    User and Transaction
        Client.............. 000
        User................ "DDIC"
        Language key........ "E"
        Transaction......... " "
        Transactions ID..... "4D5111661004210BE10000000AFA2502"
        Program............. "CL_RSDD_DS====================CP"
        Screen.............. "SAPMSSY0 1000"
        Screen line......... 6
    Information on where terminated
        Termination occurred in the ABAP program "CL_RSDD_DS====================CP" -
         in "APPEND_DS_TEC_FIELDS".
        The main program was "RDDEXECU ".
        In the source code you have the termination point in line 61
        of the (Include) program "CL_RSDD_DS====================CM001".
        The program "CL_RSDD_DS====================CP" was started as a background job.
        Job Name....... "RDDEXECL"
        Job Initiator.. "DDIC"
        Job Number..... 10475900
    Source Code Extract
    Line  SourceCde
       31         RAISE EXCEPTION TYPE cx_rs_program_error
       32           EXPORTING
       33             text = 'Invalid DSO subtype'.                   "#EC NOTEXT
       34     ENDCASE.
       35
       36 *   get table name from DDIC
       37     CALL METHOD cl_rsd_odso=>get_tablnm
       38       EXPORTING
       39         i_odsobject = n_infoprov
       40         i_tabt      = l_tab
       41       IMPORTING
       42         e_tablnm    = l_tablnm
       43       EXCEPTIONS
       44         OTHERS      = 1.
       45
       46     IF sy-subrc <> 0.
       47       RAISE EXCEPTION TYPE cx_rs_program_error
       48         EXPORTING
       49           text = 'Error in CL_RSD_ODSO=>get_Tablnm'.        "#EC NOTEXT
       50     ENDIF.
       51
       52     CALL FUNCTION 'DDIF_NAMETAB_GET'
       53       EXPORTING
       54         tabname   = l_tablnm
       55       TABLES
       56         dfies_tab = l_t_comp
       57       EXCEPTIONS
       58         not_found = 1
       59         OTHERS    = 2.
       60     IF sy-subrc <> 0.
    >>>>>       RAISE EXCEPTION TYPE cx_rs_program_error
       62         EXPORTING
       63           text = 'Error in DDIF_NAMETAB_GET'.        "#EC NOTEXT
       64     ENDIF.
       65
       66
       67   ELSE.
       68 *   model table only needed for standard datastore objects, for
       69 *   write optimized DSOs target table is a changelog that is fully described by
       70 *   dta_pro (infoobjects)
       71     CHECK n_s_dta-odsotype = rsdod_c_type-standard.
       72
       73 *   get model table fields to add
       74     CALL METHOD cl_rsd_odso=>get_mod_tab
       75       IMPORTING
       76         e_mod_fld_ur = l_t_comp.
       77   ENDIF.
       78
       79 * according to T.B. ( 13.04.2007) the correct position is
       80 * not needed in the D version
    Contents of system fields
    Name     Val.
    SY-SUBRC 0
    SY-INDEX 0
    SY-TABIX 1
    SY-DBCNT 1
    SY-FDPOS 0
    SY-LSIND 0
    SY-PAGNO 0
    SY-LINNO 1
    SY-COLNO 1
    SY-PFKEY
    SY-UCOMM
    SY-TITLE Execute Post-Import Methods and XPRAs for Transport Request
    SY-MSGTY E
    SY-MSGID DA
    SY-MSGNO 300
    SY-MSGV1 /BIC/AV_AMOFCB40
    SY-MSGV2
    SY-MSGV3
    SY-MSGV4
    SY-MODNO 0
    SY-DATUM 20110208
    SY-UZEIT 104759
    SY-XPROG SAPLSYST
    SY-XFORM SYSTEM_HOOK_OPEN_DATASET

    Hi All
    We are also experiencing this same error when transporting deletions of multiple objects.
    Although the transport was cancelled in the destination system (production) it appears to have largely deleted all objects successfully except for DSOs.
    The DSOs still appear in the table RSDODSO (via SE11) but are not visible anywhere else.  When you try to view the DSO via RSDODS a warning appears saying "DataStore object to be deleted by transport -> delete only allowed".  If you try to delete them in this transaction the same ABAP runtime error as the transport appears.
    Any assistance would be greatly appreciated!
    Regards
    David

  • How to delete all objects in a package?

    Hello,
    I've seen a similar question here. But is there a tool or a smart way to delete all objects in a dev class or a transport request?
    Best Regards
    Volker

    These are really 3 questions??
    1. To delete objects in a request there are a number of ways, here is one:
    Position cursor on modifiable request.
    Double click on request and choose 'Objects' tab
    Choose object line you want to delete and click 'Delete'
    Save your changes.
    2. To delete objects in a Dev Class:
    Go to work bench --> edit object, Class and give your class name, you will see delete option at the bottom of the screen.
    3. How to delete all objects in a package:
    here is a link with the steps you need for this: http://benxbrain.com/en/index.do?onInputProcessing(brai_object_thread)&001_threadid=0000161442&sysid=WP5&pgmid=R3TR&object=DOMA&obj_name=DEVCLASS&child_param=

  • Deletion of Object Dependency in BOM

    Hi All,
    I am trying to delete the Object dependency from a BOM using the Function Module "CUKD_API_ALLOCATIONS_MAINTAIN". After executing it, the Object is getting deleted but the Bulb like symbol for Obj(Object Dependency) in Transaction CEWB is not disabling. Please help me in this.
    Thanks
    Vinay

    Solved

  • Deletion of Objects in ABAP Workbench

    Hi,
    I want do delete an self defined interface in the ABAP Workbench. But for some reason it is not possible to delete this interface, although its not used anywhere. I got the message
    Object cannot be edited with Class Builder
    Message no. OO612
    But where else should I delete the interface if not in the class builder or in the workbench?
    Any ideas how to solve this problem?

    Good day,
    I also ran into this issue when trying to deploy some wd objects with SAPlink.
    I managed to delete the objects by using the "OO_INTERFACE_DELETE" function module. There is also a function module called "OO_CLASS_DELETE" to delete classes.
    In either case you just populate the parameters in the following way:
    INTERFACE (or CLASS) = <your class\interface name>
    COMMIT = 'X'
    FORCE = 'X'
    Hope this helps.
    Regards,
    Shaun

  • How to create a deletion transport request without deleting the object.

    Hi Experts,
    I got a very strange requirement in which i want to delete a object from QA envirement. One way to delete it is delete the object in developement and save it in a transport request. And transport that request to QA.
    But can't delete the object from Dev environment. So is there any other way by which i can do this.
    Thanks
    Yogesh Gupta

    Hi,
    You need not worry about deleting the objects in QA now.
    Have the set of objects which you will not be tranporting to PROD.
    After your project is live and during support before handholding to the customer, clean your system DEV,QUA.
    Reward Points if Useful.
    Thanks,
    Anita

  • How to delete an object from a change master?

    I have a situation where a PDM has copied a route (task list) that was tied to a change master and brought it over by mistake, the route was also copied to the wrong group number and counter. What I want to do is have the route deleted and recreated with it's own group number and counter 1, however because it is linked to a change master it keeps pulling in that same group number. Any idea how to correct this or remove the material from the change master, we've tried to delete the object but get the message that not all objects were deleted and it is still there.
    Thanks in advance.

    HI sathish,
    1. If the old request is release,
       then we cannot do anything.
      (There is no point in changing that old request)
      (bcos its already released)
    2. what can be done is that
       u save once again the objects,
       and it will once again ask for new request.
    3. this time save it in new request
    regards,
    amit m.

  • How to delete an object from a request?

    friends,
          There is an exit developed to include a subscreen in a standard screen. The layout, flow logic and some include files are saved in different requests..i saved everything in one request and tried to release it...but it's not getting released.."Repair so, how to delete the object(s) from all the old requests where it is saved? when i attempt to delete the request, it is not allowing saying that changes can't be made to a released request. any other options available? how to go about with this? thanks all.

    HI sathish,
    1. If the old request is release,
       then we cannot do anything.
      (There is no point in changing that old request)
      (bcos its already released)
    2. what can be done is that
       u save once again the objects,
       and it will once again ask for new request.
    3. this time save it in new request
    regards,
    amit m.

  • Deletion of object list if header notification is of type M2

    Hi,
    I have a requirement where I need to delete the object list in a WO in IW32 only if the type of the header notification is M2. I have used BAPI_ALM_ORDER_MAINTAIN to do it, but this is not working. Is there any way I can remove the object list from the work order?

    Hi,
    I have a requirement where I need to delete the object list in a WO in IW32 only if the type of the header notification is M2. I have used BAPI_ALM_ORDER_MAINTAIN to do it, but this is not working. Is there any way I can remove the object list from the work order?

  • Project Online - Can't Delete Resource and User from Delete Enterprise Objects

    I would like to link a resource account to a user account but I ran into an error: "The resource account
    is already in use.".  This is a known issue which I attempted to resolve by following the instructions in KB2881398.
    However when deleting the selected resource from Delete Enterprise Objects I get a message indicating success ("The
    selected Resources and Users have been deleted.") but the duplicate user is still in the listing in Delete Enterprise Objects and when attempting to link the remaining resource to a user logon account I still get the error
    "The resource account is already in use."
    Why is the user not deleted even though Delete Enterprise Objects reports success and how can I delete these duplicates to be able to successfully link the account?

    Hi,
    This might be due to your Exchange Sync issue, where your project workspace is unable to delete that user from local DB. Try following steps to diagnose the problem:
    1) Go to your Resource Pool, DELETE a resource.
    2) While resource is being Deleted, open another window 
    Server Settings -> Manage Queue Jobs
    3) Here you can view the progress of your current Resource Deletion update, check if all goes smooth and your Resource is deleted successfully by showing process completion 100% :
     ( to view any error look at the
    last column of table on Manage Queue Job page)
    4) Cross check your Resource by running Resource Availability Report.
    Basically this will give you a fair idea of your resource deletion problems and how system is responding to it.
    Regards

  • Report to delete OM objects

    hello seniors
    can anyone help me with report to delete OM objects?

    *& Report  Z_HRP1000_DELETE
    REPORT  Z_HRP1000_DELETE.
    type-pools truxs.
    DATA : it_raw   TYPE truxs_t_text_data, "VARIABLES DECLARATION
           c_space(1)   TYPE  c VALUE ' '.
    data : begin of it_1000 occurs 0,
           objid like hrp1000-objid,
           end of it_1000,
           wa_1000 like line of it_1000.
    data : it_fail like it_1000 occurs 0 with header line.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    PARAMETERS: p_file LIKE rlgrap-filename OBLIGATORY.
    parameters : p_otype like hrp1000-otype.
    SELECTION-SCREEN END OF BLOCK b1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      PERFORM get_file USING p_file.  "CALLING F4 HELP FOR D=FILES
      START-OF-SELECTION.
       PERFORM get_data.       "UPLAODING DATA FROM EXCEL
    if it_1000[] is not initial.
      loop at it_1000 into wa_1000.
        delete from hrp1000 where otype = p_otype
                              and objid = wa_1000-objid.
        if sy-subrc <> 0.
          it_fail-objid = wa_1000-objid.
          append it_fail.
          clear it_fail.
        endif.
        clear wa_1000.
      endloop.
    endif.
    if it_fail[] is not initial.
      loop at it_fail.
       write : it_fail-objid.
       clear it_fail.
      endloop.
    endif.
    *&      Form  GET_FILE
          text
         -->P_P_FILE  text
    form GET_FILE  using    p_p_file.
    CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        CHANGING
            file_name = p_p_file
        EXCEPTIONS
            mask_too_long = 1
        OTHERS = 2.
    IF sy-subrc NE 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    endform.                    " GET_FILE
    *&      Form  GET_DATA
          text
    -->  p1        text
    <--  p2        text
    form GET_DATA .
    *If no file upload  path is mentioned
      IF p_file = c_space.
       MESSAGE
        LEAVE LIST-PROCESSING.
      ENDIF.
    *Function module for uploading the file
        CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
        EXPORTING
        I_FIELD_SEPERATOR          =
          i_line_header              =  'X'
          i_tab_raw_data             =  it_raw
          i_filename                 =  p_file
        TABLES
          i_tab_converted_data       = it_1000
       EXCEPTIONS
         conversion_failed          = 1
         OTHERS                     = 2
      IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
             WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
        LEAVE LIST-PROCESSING.
      ENDIF.
    endform.                    " GET_DATA

  • How to see who deleted the Object

    Hi Gurus
    Would you please advise if some data target or transformation is deleted from the BW system how to know who deleted the objects?
    Thanks

    How to see who deleted the Object

  • How to delete proxy Objects/structure in R/3

    Hi Experts,
    In my scenario i generated ABAP proxy. I want to delete that proxy now. I am selected the particular proxy and i deleted. but here only service interface only deleting. not deleting all objects like message type and data type and proxy generated objects are not deleting.
    While i am deleting it was allowing me to delete only root object. under root table structure and datatype/message type objects are not deleting. here even i deleted lock entrys also.
    Here my question is how to delete all proxy objects. please give me your valuable suggestions.
    thanks
    Srini

    refer this Problem in deleting Proxy Objects that talks about the same issue .

  • Delete Business Object Type (SWO1)

    Hi gurus,
    How can we delete/modify objects in SWO1 that were created in a previous version. Are these actions allowed, is there a workaround if its not allowed?
    Thanks for your help!
    Jason

    Hi Raymond,
    Thank you for your help.
    I have come accross that thread in SDN while doing some research already. But It does not completely answer my question.
    Correct me if I'm wrong, this means there is absolutely no workaround to modify a business object type that has been created in a different version?  If thats the case why does SAP enforce this rule?
    Thank you

Maybe you are looking for

  • Everytime I try to download itunes it says, Itunes Installer Interrupted?!

    I was originally having problems downloading itunes because I couldn't get Quicktime and Itunes off my computer, but I download a program called Byetunes that completely deleted itunes from my computer. Unfortunately now every time it gets finish dow

  • Mapping Problem: only constants are mapped the rest is missing

    Hi Community, I have a really strange problem. I mapped a message type and an external definition (a modified IDoc) in the repository. If I use the test function of the message mapping everything is fine. All values and constants are mapped correctly

  • Number range of product group

    Dear all where we define the number range of product group? Rgds Avinash

  • Video auf den PC speichern

    Hallo, ich hatte nie Probleme mit Premiere E 11, aber dieses Mal will er mir auf Teufel komm raus das Video nicht auf den PC laden. Immer wieder erscheint ein Fenster mit folgender Meldung: CA Headless has encountered an error Das Programm selbst sch

  • Upgrade to 11 Network ACLs

    Hi, I'm upgrading from 10g to 11g. According to documentation ( Upgrade Guide B28300-03 )the following script should be executed befor upgrade : DECLARE acl_path VARCHAR2(4000); BEGIN SELECT acl INTO acl_path FROM dba_network_acls WHERE host = 'host_