Menu

Editing SAP Tables with SE16 and SE16N

2013-04-17       

When working as developers with SAP ERP®, we sometimes need to change a value in a table – maybe just for testing purposes, maybe permanently. But in most cases, it’s not possible or not worth the effort to create a maintenance dialog or write a small program that does the job. But it is possible to do it with built-in tools such as SE16 and SE16N.

Unsere Literaturempfehlung

ABAP Workbench - 100 Tipps & Tricks

Es gibt 100 gute Gründe, warum Sie dieses Buch kaufen sollten. Doch die verraten wir Ihnen hier nicht. Nur so viel: Wenn Sie die ABAP Workbench als Ihr zweites Wohnzimmer begreifen, ist dieses Buch genau das richtige für Sie! Die Mini-Tutorials in diesem Buch unterstützen Sie dabei, Software in ABAP effizienter zu entwickeln. Tipps und Tricks, wie Sie sich bei der Bearbeitung von Quelltext das Leben leichter machen, wie Sie häufig wiederkehrende Programmieraufgaben automatisieren oder umständliches Vorgehen früherer Tage endlich über Bord werfen. Sie werden die ABAP Workbench in einem ganz neuen Licht erleben. Eine klare Sprache, Klick-für-Klick-Anleitungen, Zusammenfassungen und Hervorhebungen sorgen dabei für einen schnellen und unkomplizierten Lernerfolg.

Bei amazon.de ansehen →

Using SE16 to change table data

It’s possible to trick transaction SE16 to think you’re in editing mode. To do this, however, you have to have authorizations for debugging and for changing data during debugging (authorization object S_DEVELOP, fields ACTVT = 1 and OBJTYPE = DEBUG).

Enter /h in the command field to enable debugging.

If you have this, enter transaction SE16 and select the data you want to change. Once you’re in the list display, make sure you are using the SE16 standard list. If you’re in ALV grid or list display, this will not work. You can change this by opening your user settings via Settings -> User Parameters or pressing F8 directly in the list display.

Once you have the correct list, insert /h in the command field to enter debugging mode manually. The system will tell you with a prompt whether you did it right.

After this is done, double-click the entry you want to change. The debugger will open. Now look for this piece of code:

if code = 'SHOW'.

Hint: It’s in the include LSETBF01 in the form set_status_val. If you have authorization for SE80 or something similar, you can also set a breakpoint there beforehand. Now change the value of the variable code to whatever you want to do: INSR to insert new entries, EDIT to edit the data, DELE to delete the row. Afterwards, press F8 to give control back to the program.

You will now be able to make changes to the data. Don’t forget to save afterwards!

Using SE16N to change table data

It’s even easier if you have access to transaction SE16N. After having entered the table you’d like to edit, enter the command &SAP_EDIT in the command line. The system will, again, prompt you if you did it right. You will now be able to make changes to the data. Be careful, though: if you’re on release 5.0 or higher, changes you do here are logged and can be viewed with program RKSE16N_CD.

If you’re really sure what you’re doing, you can even switch of the foreign key check in SE16N by entering the command &SAP_NO_CHECK in the command line. Be careful! You can really screw up your data if you do this incorrectly.

Happy editing!