Deleting objects in SAP Enable Now

Deleting content objects is a fairly simple and intuitive process, but there’s still a few things to be aware of – especially when it comes to the Trash, and possibly restoring objects. In this article I look at the various deletion options available, where objects go when you delete them, and how to get them back if you need to.

Firstly, let’s assume we have a couple of content objects we no longer need, and have decided to delete them. In our example, these are Starting with Fiori and Maintaining your SAP User Profile, under the Basic Navigation Group. Here they are in our Producer Workarea:

Figure 1: Workarea structure prior to object deletion

Firstly, note the numbers shown between the object icon and the object name. These are Structure Reference Counters, and are a count of how many times the object appears in the Workarea structure. [For more information on Structure Reference Counters, see the video Objects and Object References.]They are useful to have displayed, especially when you are deleting content, as we shall see in a minute. (If you don’t see these in your Producer, select menu option View > Workarea Details > Show Structure Reference Counter.) In our example, the first object we want to delete, Starting with Fiori, has a Structure Reference Counter of 1, indicating that it exists in only one place – the Basic Navigation Group. The second, Maintaining your SAP User Profile, has a counter of 2, because it exists in two places – once in the Basic Navigation Group, and once in the General Information Group.

Now, let’s delete these objects. First, we’ll delete Starting with Fiori. If we click on this object, and press Delete on the keyboard (or right-click on the object, and select Delete from the shortcut menu), we get the following prompt:

Figure 2: Object deletion confirmation dialog box

At the bottom of the dialog box, there are two options. The first of these is Remove Locally. This will just remove this object from our (local) Producer Workarea and prevent it from being synchronized, but the object will still exist on the Server, and will still exist within our Basic Navigation Group. [For more information on how this works, refer to the video Accessing Producer for the first time, at around the 8 minute mark.] This is not deleting it at all (and shouldn’t really be an option in the ‘Delete’ dialog box). To actually delete the object, you need to select the other option – Delete on Server. If we do this, our Workarea now looks as follows:

Figure 3: Workarea structure after deleting the first object

Here, we can see that the object has indeed been deleted. The other thing to note is that our Basic Navigation group has been checked out for editing. This is an important concept to understand. Groups in SAP Enable Now are not the same a folders in Windows. They are independent objects, and if you change the contents of a Group, you are changing the actual Group itself.

Now, let’s delete the second one of our no-longer-required objects, Maintaining your SAP User Profile. We do this in exactly the same way, see exactly the same dialog box (as the one shown in Figure 2 above), and again select Delete on Server. However, after we do this, our Workarea now looks as follows:

Figure 4: Workarea structure after deleting the second object

Here, you can see that Maintaining your SAP User Profile still exists in our Workarea (and on the Server) – even though we selected Delete on Server. This is because it existed in two places, and all we have done is deleted it from one of those places (the Basic Navigation Group); it still exists in General Information – and you can see that the Structure Reference Counter for the object now shows 1, to reflect this. This is why it is important to check the Structure Reference Counter: if it is 1 then this is the only place the object exists and if you delete it, it will be deleted from the Server; if it is more than 1, then the object exists in multiple places, and only the current reference to it will be deleted. This leads to a common concern with new Authors who just want to remove a content object from a Group (but not delete it from the Workarea) – they see the button name of “Delete from Server” and panic, thinking they will completely delete the object from the Server. That’s not the case; as long as the Structure Reference Counter is more than 1, the object will still exist somewhere on the Server.

CAUTION: The Structure Reference Counter is a count of the number of places in which the object exists within your local synchronized copy of the Server Workarea. If the content object also exists within another Group that you do not have synchronized, the counter will still show as 1, and if you delete the object it will be deleted on the Server. This leads to a ‘zombie’ reference in the other (server) Group. (You will see this if you then synchronize the previously-unsynchronized Group containing the object.) This can only be resolved by restoring the object from the Server Trash (see below).

Now let’s move to looking at where things exist when we delete them – the Trash. There are actually two Trash buckets – one in your local Workarea, and another on the Server. We’ll start with the local Trash. If we look in the Local Trash for our example Workarea, we will see the first of the objects that we deleted, as shown below. We do not see the second object we deleted because, again, we didn’t actually delete it. (If you don’t see your Local Trash, select menu option View > Workarea Details > Show Trash.)

Figure 5: Local Trash in Producer, showing deleted object

Note that this is now a local object – there is no ‘cloud’ symbol on the object icon. This is important. especially when we consider the Server Trash. But first, let’s look at how to restore an object that we have deleted. To do this, select the object in the Local trash, and click on the Restore button at the top of the Property Sheet. When we do this, the object is ‘un-deleted’ and – assuming you have it checked out for editing – will be placed back wherever you deleted it from, as shown below. (Important!: If you do not have the original Group checked out for editing, the restored object will be placed in Unsorted.)

Figure 6: Workarea Structure showing the locally-restored object

Now let’s look at the Server Trash (assuming you have permissions to do this). This contains all objects that existed on the Server but have now been deleted. In our example, we see the following:

Figure 7: Server Trash showing the (still) deleted object

Again, there is a Restore option (on the right of the toolbar above the Property Sheet). If we click on this, the restored object will always be placed in Unsorted – even if we have the Group checked out for editing within Manager. We can drag-and-drop it back into the Basic Navigation Group within Manager, but in our example we already have the Group checked out (to us) in Producer. So instead, we’ll switch back to Producer, and check out the restored Server object from there.

Back in producer, we select menu option Server Workarea > Check Out Objects, and can find our newly-restored listed, but here it is shown back where it used to belong, and not under Unsorted). Why? Because the object we are checking out from the server is exactly the same object as the one we restored from our Local Trash, so it is not an ‘orphan’ (SAP Enable Now knows where it belongs.). (Note that if we hadn’t restored it in Producer, it would show up under Unsorted in the Checkout dialog box.)

Figure 8: Producer Workarea showing the locally-restored object along with the Checkout dialog box showing the Server-restored object

This gives us a problem, as you can see from the above image. We already have a ‘local’ restored copy of the object Starting with Fiori in our Workarea (shown on the right), but we are now attempting to download a new copy from the Server (where it was restored from the Server Trash). Again, this is exactly the same object – it has the same UID. Luckily, SAP Enable Now identifies this, and asks us what we want to do:

Figure 9: Confirmation of overwrite when re-synchronizing the Server-restored version of the object

Although the message refers to ‘resources’, it doesn’t mean ‘Resource’ objects – it just means “objects”. Here, SAP Enable Now is letting us know that we have a ‘local’ copy of the same object we are (re)downloading from the Server. Here, we need to click Overwrite, and our local copy will be overwritten by the newly-downloaded version. (If you click Keep, the check-out operation will simply be cancelled for this object.)

Figure 10: Producer Workarea showing the object restored from the Server

Here, you can see that we are now back to having the Server version in the Basic Navigation group – you can see the ‘cloud’ symbol on the object icon again (compare Figure 10 with Figure 6).

To complete the story, if we had not restored the object in Producer and had only restored it in Manager, as soon as we try to refresh the Group the object was originally in (Basic Navigation in this example) – either by refreshing the Workarea, or refreshing the Group object from the server – we would see a message of:

Figure 11: Re-synchronizing a Server Group following object restore on the Server only

When we click on Update and Check Out, we will see the same message of “Checkout will overwrite local resources” (see Figure 9), and the restored object will be downloaded from the Server again and will appear in our structure as before (see Figure 10). The version in our Local Trash will also be deleted – this is the ‘overwrite’ that we were warned would happen.

Finally, a word of caution. There are times when SAP Enable Now will still ‘recognize’ objects that are in your Producer Local Trash (specifically, it will continue to count them in the Server Reference Counter). You should therefore periodically empty your Local Trash, by selecting the Local Trash Group and then clicking the Empty Trash button. Don’t worry, this will only delete the ‘local’ trash version – there will still be the version in the Server Trash (assuming they have been saved to the Server at least once), if you realize you need to keep it. Although, of course, the Administrator should also be performing housekeeping and emptying the Server Trash periodically, for much the same reasons.

2 thoughts on “Deleting objects in SAP Enable Now”

  1. Leopold:
    Thanks for your comments!
    (1) I agree with having the ‘delete locally’ functionality. I use it a lot, and always teach developers to use it. I just don’t think having it as an option in the DELETE dialog box helps – it confuses people. This option is already there on the shortcut menu under ‘Server Actions’, so it doesn’t need to be here as well.
    (2) UPDATE: Yes, I see the problem with the zombie reference that you mention. This is likely an error in the logic. It looks as though because it has a Structure Reference Counter of 1 it deletes the object (not the reference) – even though it is linked elsewhere on the server. The only way to get it back is to restore it from the Server Trash, and then Update from Server in Producer. I’ll add a note to the blog post, and see if I can get SAP to fix the issue.
    Thanks, Dirk

  2. Hi Dirk,
    that is some great info material to this topic!

    I for myself feel, that it is a good thing to have the “Remove Locally” in the deletion Dialog. If users only have a part of the structure checked out in their workarea, and want to remove some unnecessary part of it (to speed up synchronizing), they are often unsure of what to do. This button prevents some accidential changes to the server structure.

    In the past, there was also the following situation which was dangerous:
    For your example:
    If you only have checked out the first group (General Information) with its two children object, but not the second group (Basic Navigation) and you want to delete the file (Maintaining your SAP User Profile), the structure reference counter shows only “1”, because you only have the one object in your work area and the second reference is only saved on the server.

    Now you hit “Delete on Server” on the object, so I would expect, that it removes the reference, because a second element exists in a different location on the server. After deletion (and empty trash), try to check out the object from the server from the second location:
    You will only get a zombie/empty reference downloaded.

    Did you also encounter this problem in the past?

    Best regards
    Leopold

What's on your mind?

This site uses Akismet to reduce spam. Learn how your comment data is processed.