Professional Documents
Culture Documents
Sometimes, especially inside user-exits that are called in several different places, we need to know where it was
called to decide what to do.
Some fields in the "sy" structure can be useful for this: sy-tcode (transaction), sy-repid (current main program), sy-
cprog, sy-xprog, sy-xform, etc.
This info might not be enough, however: we might need to know if we are inside a given form, for example, even if
we might be several levels below (the form called another form, which in turn called another form, that then called a
function, that called our exit..).
To know this, we need to get the current call stack. In debug mode, we can see it by clicking the button "Calls".
Getting that info in our programs is just as easy: just use function SYSTEM_CALLSTACK, and you'll get an
internal table with that same information.
Ej