Hi, Matthew. How could I access data in the main program from the function? I have a standard SAP program, and...
I am in the user exit (through a call function). Inside the user exit I want to access data from the main program that is not among the interface parameters. Set a breakpoint in the user exit. Then in the debugger, look at Goto --> System --> System Areas and choose MEMORIES.
Here you will find all the IDs of the data that has been EXPORTED TO MEMORY. Double click on each of these, and you may get some idea of the contents. Otherwise, search for these memory IDs in the calling code, and you should be able to determine the structure of the fields/tables to IMPORT the data into.
Of course, if SAP hasn't done an EXPORT, this method won't work.
I hope that helps. Otherwise, I do have a vague recollection of a method that opens ALL the variables of the calling program to you. But I've had a dig around my archive, and can't find it. If I do, I'll be sure to publish it.
Dig Deeper on SAP ABAP
Related Q&A from Matthew Billingham
An SAP user is trying to run a report in an SAP ALV Grid online and wants to know how to get the data in the report to appear along with the header. Continue Reading
An SAP user needs to transfer customer purchase order spreadsheet data to SAP VA01 to create a new sales order. Continue Reading
An SAP user needs information on how to change the password on several SAP user accounts from a central location. Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.