Deleting multiple entries from a table via SE16 ??

Deleting multiple entries from a table via SE16 ??

As the title says, the content of this article covers how to delete multiple entries from a table using SE16.

Disclaimer (very important):

  1. I am writing this article for learning purposes, therefore please understand the risk associated with deleting entries from a standard table, especially in production environment.
  2. If you ever need to do so, make sure to try it yourself in a lower environment as well, because once an entry is deleted, it's gone forever - literally poof.

I hope you understand the risk.

For this demo, I'll use a custom table I created which currently have five entries as shown below.

Custom table ZREFONE opened in SE16 having a total of 5 entries


Now, let's jump into the actual process of deleting entries in bulk from SE16.

  • Access the table you want to work with in transaction SE16

Accessing the table in SE16


  • Populate the search criteria with the fields you want to delete: This step will ensure that only those entries will be deleted which are being accessed using SE16. Here, you can see I'm searching for 3 entries to delete.

Populating the field PRIMARY KEY with the values I want to delete


  • Select all the displayed entries (very important to make it work)

Displayed entries have been selected


  • In the transaction bar, enter the transaction /h and press ENTER and then press F7: This step will trigger the debugger. Pressing F7 will trigger display of the selected entries in form view. Make sure to press F7 after pressing ENTER.

Triggering debugger


  • Set a breakpoint using breakpoint button or by pressing F9

Setting breakpoint using breakpoint button

Create the breakpoint for Source Code in program SAPLSLVC_FULLSCREEN for include LSLVC_FULLSCREENF01 at line 1076 and press Continue (or green check).

Make sure to put the screen no. to empty

Creating the breakpoint

Once the breakpoint is created, a message will be received in the bottom of the screen saying Breakpoint Set

Breakpoint created successfully


  • Trigger the created breakpoint by pressing F8

Triggering breakpoint using continue button or pressing F8


  • Update the value of variable OK_CODE to DEL5 and initiate the action delete all.

To do so, in line 1076, double click on variable OK_CODE. Click on the pencil icon to edit the value of variable OK_CODE and change the value to DEL5 Press Continue or F8

These steps will initiate the delete all action.

Updating the value of variable OK_CODE to initiate the action DELETE ALL

This will generate a pop-up window confirming to delete all values from the database.


  • Click YES to delete all values.

DELETE ALL confirmation pop-up window


  • Once done, the displayed entries will disappear as they are deleted

Selected entries are deleted.


Now after this rechecking the table for no of remaining entries. One could see only 2 entries are remaining and the previously deleted entries does not exist anymore.

Accessing table without any selection criteria
Only 2 entries are remaining. The deleted 3 entries don't exist anymore.


And this is how multiple entries are deleted from SE16.

Unfortunately, in my research, I couldn't find a way to create and update multiple entries at once using SE16. If you happened to know a way, please share the same.

Once again, the idea behind sharing this article was purely for learning purposes. If you ever need to use this technique, please try it in a lower environment first and please understand the risk associated with this.


I hope you enjoyed the article.

That would be all for today.

Have a great day, keep learning and keep sharing ??.


Vishal Wilfred Abreo

SAP MM ECC & S/4 HANA | 9+ experience in Public Procurement & Material Management | GeM | Warehouse Management | Inventory Management & Control | ISO IMS & AQMS | AIR 3 in Samanvay Portal of GOI

6 个月

Only Technical Consultants can actually try this in production environment as most Functional Consultants or Core Users are barred from using SE16/SE16N/SE16H in Production Server! However user who are not confident it’s always better to try & analyse the data in Development, Quality, Sand Box or Pre-Preduction Server before actually making such risky excersize in Production.

回复

要查看或添加评论,请登录

Vaibhav Goyal的更多文章

社区洞察

其他会员也浏览了