Monday 28 December 2020

ABAP Tricks for Functionals | Trick #1 – Edit Table Values in S/4 HANA using SE16 Debug Edit

Introduction –

We come across situations where we need to edit values in standard/custom tables. There could be many reasons why you want to edit values in standard/custom tables, some reasons are listed below.

1. You are performing testing, and want to simulate a test scenario without changing a lot of test data

2. You do not have a table maintenance transaction available to edit table value

3. You have found a data inconsistency and want to change table value to fix it

This blog post explains how to step by step edit a non primary field value in SAP standard or custom table.

Note this process should be used with extreme caution in your productive and non-productive environments. Changing table values directly can cause unwanted consequences. You should only use this approach, when you are fully aware of what you change, will not cause any harm to the standard SAP system.

Prerequisites-

◉ For debug edit to work you need to have access to transaction SE16

◉ You need to have access to debug edit – Authorization Object – S_DEVELOP with object type DEBUG and activity 02

Solution –

Step 1- Identify the table and field you want to edit (For this example, I will edit the material text in table MAKT) and open the table using transaction SE16

SAP ABAP Exam Prep, SAP ABAP Tutorial and Material, SAP ABAP Prep, SAP ABAP Career, SAP ABAP Certifications

SAP ABAP Exam Prep, SAP ABAP Tutorial and Material, SAP ABAP Prep, SAP ABAP Career, SAP ABAP Certifications

SAP ABAP Exam Prep, SAP ABAP Tutorial and Material, SAP ABAP Prep, SAP ABAP Career, SAP ABAP Certifications

Step 2 – Select the row you want to edit, and double click on it

SAP ABAP Exam Prep, SAP ABAP Tutorial and Material, SAP ABAP Prep, SAP ABAP Career, SAP ABAP Certifications

Step 3 – Enter /h in the SAP command field, and turn on the debugger, if everything is fine, you will see a message saying “Debugging switched on”

SAP ABAP Exam Prep, SAP ABAP Tutorial and Material, SAP ABAP Prep, SAP ABAP Career, SAP ABAP Certifications

SAP ABAP Exam Prep, SAP ABAP Tutorial and Material, SAP ABAP Prep, SAP ABAP Career, SAP ABAP Certifications

Step 4 – Press F7 till you reach program include LSETBF01 and routine – set_status_val, click on line 34 variable code, and change it from SHOW to EDIT

SAP ABAP Exam Prep, SAP ABAP Tutorial and Material, SAP ABAP Prep, SAP ABAP Career, SAP ABAP Certifications

SAP ABAP Exam Prep, SAP ABAP Tutorial and Material, SAP ABAP Prep, SAP ABAP Career, SAP ABAP Certifications

SAP ABAP Exam Prep, SAP ABAP Tutorial and Material, SAP ABAP Prep, SAP ABAP Career, SAP ABAP Certifications

Step 5 – Edit the data and save it (Note you can only edit non primary fields using this approach)

SAP ABAP Exam Prep, SAP ABAP Tutorial and Material, SAP ABAP Prep, SAP ABAP Career, SAP ABAP Certifications

SAP ABAP Exam Prep, SAP ABAP Tutorial and Material, SAP ABAP Prep, SAP ABAP Career, SAP ABAP Certifications

Step 6 – The data edit is complete, now you can view the edited data, to confirm it actually was saved in the system

SAP ABAP Exam Prep, SAP ABAP Tutorial and Material, SAP ABAP Prep, SAP ABAP Career, SAP ABAP Certifications

SAP ABAP Exam Prep, SAP ABAP Tutorial and Material, SAP ABAP Prep, SAP ABAP Career, SAP ABAP Certifications

No comments:

Post a Comment