Fetching Data from Memory Stack Using New Tool (in Debugger)


Many times we receive a requirement to add validations for standard transactions wherein the field value is not directly accessible in user exit or BADI. So if you are also struggling with such requirement, your wait is over. Prapti is here to your rescue. 😉

In this article, we will be learning a short and simple trick to access screen values in standard transaction code.

Basically, we would exploit the Memory Stack at Run-Time using the New Tool in Debugger. If in any interview, someone asks you, do you know Memory Stack Programming? After going through this article, your answer should be a big confident affirmative. 😛

Following are the steps that need to be followed:

  1. Get the program name and field data from the screen (using F1)
  2. Add a breakpoint in the exit / BADI
  3. Execute the transaction and check the value at runtime using New Tool (Tools -> Special Tool -> Loaded Programs)
  4. Add code in the exit / BADI for fetching data from the screen field

Seeing is Believing. Let me take a very simple real time practical example. While creating a purchase order in SAP, there is a provision to add one-time vendor details. Our requirement is to add a Validation on PINCODE length.

We were using CHECK method of BADI ME_PROCESS_PO_CUST for validation in PO. But found that the address details were not accessible in the BADI.

We followed the 4 steps mentioned above. We found the program name and field data.

Added the debugger and executed the transaction. In the debugger tool, go to New Tool option.

new tool in debugger

Alert: If your debugger takes you to Standard Tab by default, then you would not find the “New Tool“. Do not panic. Just click Desktop 1 or Desktop 2 or Desktop 3 and New Tool would be right there for your service. 🙂

Also ReadA to Z of Integration of SAP Ariba with SAP ECC

Go to Loaded Programs option in Special Tools.

Loaded Program

Select Global Data tab where we will be able to see all the global variables of each program.

New Tool in SAP

Let us now find the program and field for Address data.

Yeah, we got the ADDR1_DATA values. So now we reached the last step – the code :).

Basically, we just dug deep into the memory stack at the run-time and looked for all programs that were loaded in the system for completion of the particular transaction. Using the New Tool, we found the Global Data. Once you have the Global Data, you can just fetch that data in your program using Field Symbol.

Hope you like this trick. This is a simple solution which we need to do in every project. If you are a beginner on SAP ABAP, bookmark this article. You would need this for your first Memory Stack Programming. 😛

You can implement this same trick to fetch any global data like table, structures, variables, objects etc.

Note: There is a limitation. If the variable, work area, table etc are NOT declared as Global on the loaded programs, then we CANNOT retrieve its value using the above method.

Also Check: How to write your first Program in HANA ABAP?

Now I want to hear from you. Do you have any Tip or Trick to share?

Please do not shy away from sharing your knowledge. Together we learn better. Please leave your quick feedback below. Please Like Us on Facebook and Share our Contents.


  1. Hi Prapti, the steps are really innovative in ECC 7.4 version. Could you also share the steps to debug tables & programs which are declared as LOCAL?

    • Hi Vikrum,

      Thanks for reading :).
      To answer your question, as of now I am not able to get any way to access local data of a standard program within exit/BADI. Will surely let you know once I found a way to access local data.

      Prapti Vyas

  2. Hello Prapti, very useful information.
    I have a doubt. If the particular program and structure is not available in loaded program list in a some other scenario then how can we access the ITAB or Structure data in runtime?

  3. Hi,
    Nice post, i am sd consultant i want to learn how to debbug programme or report error
    please post some helpful screens thanks in advance.


  4. Hello Prapti, very useful information to share on New Tool in debugging.
    Want to confirm whether the ASSIGN field symbol logic works if the particular program used in code in not in loaded program list in a some other scenario where the screen is not called at all.

  5. Nice article Prapti. I went through similar article 2 weeks back but you have explained the concept in simple words with good example.

    It will help everybody as we come across this situation many times.


  6. Nice article Prapti. 2 weeks back only I came across this topic while reading in detail on field symbol and how it can be used to access unavailable fields in user exit. You made it very clear with good example.

  7. very nice help, i have found this trick some year age on standard report…..yes some standard report use this trick.
    The same trick can be be use to read but also to write data,but it’s not consigliabile.

Leave a Reply to Prapti Vyas Cancel reply

Please enter your comment!
Please enter your name here