Getting the call stack up to a certain location.

Dear friends,
I am searching for a function or method that can give me
the call stack(like in debug mode).
If you know of a function that provides this information
please let me know, its very urgent.
Thanks in advance,
Eitan Illuz.

Hello Eli
You may have a look at thread:
[Get the name of a function module within a function module|Get the name of a function module within a function module;
Sample coding to retrieve the calling function module:
data:
  lt_callstack TYPE abap_callstack.
CALL FUNCTION 'SYSTEM_CALLSTACK'
  IMPORTING
    callstack = lt_callstack.
READ TABLE lt_callstack
  WITH KEY blocktype = 'FUNCTION'
    blockname = 'CRM_ORDER_COPY_SINGLE_OW'
  TRANSPORTING NO FIELDS.
CHECK sy-subrc NE 0.
Reference: [http://martins.de/call_stack_lesen.html]
Regards
  Uwe

Similar Messages

  • How to get the report name from the call stack

    Hi,
    I have a question about how to get the caller information dynamically in a function module.
    For example.
    ZGET_CALLER_INFORAMTION,
    get the caller name -- how ??
    Thanks in advance
    Best Regards,
    Johnney

    Hi,
    You can use SY_CPROG -  caller in external procedures, bye using this u can get the progam name.
    Regards,
    kavitha.k

  • How do I get the calling program?

    Hi,
    I have been using a function module for a long time which is called by quite a number of programs. Now I want it to react differently dependent on the calling program.
    I could use a new optional parameter of course transferring the program id. In that case I have to change quite a number of programs.
    I was just wondering if there is a possibility to get the information of the calling program on the fly. (In the debugger you can find your calling program easily in the 'call stacks'). Does anyone know how to retrieve this information?
    Thanks in advance.
    Regards Johannes

    Hi,
    I am quite overwhelmed by the amount of answers.
    Actually ufortunately neither of the solutions offered solve my problem.
    1.) sy-cprog gives the name of the main program and not the name of the module/include/method that has called my function.
    2.) The function 'RS_EU_CROSSREF' was unknown to me. It is very interesting but it is a cross reference und shows all calling programs and not the one that was actually calling the function.
    Does anyone has got any other ideas?
    Regard Johannes

  • Getting the caller address inside kernel

    How to get the caller address inside a kernel ? I mean address of a kernel
    function x, calling other kernel function y.
    Currently I am doing the following to get the caller address inside a
    kernel function(Sol7, 64-bit sparc). This is not wrong, but may be a
    problem if we turn on compiler optimizations.
    <PRE>
    kernel_func_y(someargs_t *args)
    int x;
    /* get the caller address into args->cl_addr */
    asm("stx %i7, [%i0 + 8]");
    /* use the caller address, here for some reason */
    some_operation(args->calleraddr);
    </PRE>
    Is there any DDI/DDK function/macro available to do this ? If not won't it
    be nice to have such a DDI/DDK macro/function ?
    Thanks

    Hi Sini
    Good question! I dont think there is any library which provides
    this functionality. And yes it might be helpful under some special
    circumstances. Although I think you might be able to get it from
    the stack.
    My 2 cents.
    -Manish

  • Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.

    Hi,
    I am trying to run a long running process, by redirecting to the LongRunningView using the code below. But its throwing exception Can anyone please help
    string strCurrentUrl = SPUtility.OriginalServerRelativeRequestPath;
    strCurrentUrl = strCurrentUrl + "?ListName=" + strListName;
    ////Initiates the Excel Import
    if (ObjdtExcel != null && ObjdtExcel.Rows.Count > 0)
    ExcelImportJob objJob = new ExcelImportJob(strTabName, ObjdtExcel, strFileExt, SPContext.Current.Site.ID, SPContext.Current.Web.ID, strWorkflow, strListName);
    objJob.Title = "Excel Import Job";
    //// Redirect the user to another page when finished.
    objJob.RedirectWhenFinished = false;
    //// Specify if the user can cancel this.
    objJob.UserCanCancel = false;
    //// Specify the refresh rate of the job, here, the page polls every 5 seconds for completion.
    objJob.MillisecondsToWaitForFinish = 15000;
    //// Finally, start the job on a web.
    objJob.Start(SPContext.Current.Web);
    string strUrl = string.Format("{0}?JobId={1}&Source={2}", PROGRESS_PAGE_URL, objJob.JobId, strCurrentUrl);
    SPUtility.Redirect(strUrl, SPRedirectFlags.Default, HttpContext.Current);
    The exception being "Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack."
    Arjun Menon U.K

    Hi Arjun,
    Any update?
    Best regards,
    Patrick
    Patrick Liang
    TechNet Community Support

  • Accessing objects in the Call Stack

    Hi all,
    is there any way to access in your ABAP program, objects in the previous levels of the call stack (the way we can display them in the debugger using the (program)object syntax).
    Thanks,
    Z

    I got the solution.
    I tried out the (program)object syntax with different kinds of statements.
    The one with field-symbols works:
      ASSIGN ('(ZTESTPROGRAM)LS_OBJ') TO <fs>.
    Where ZTESTPROGRAM contains the object LS_OBJ

  • Get the calling system in the remote FM

    Hello,
    how can i get the calling System in a FM, which was called over remote RFC from another System?
    Best regards,
    TomSd

    Hi thomas,
    1. we can refer to the calling system
      using 'BACK'
    2. ie. if we call using
      call function 'abc' destination 'BACK',
      then it will call rfc in the calling system.
    regards,
    amit m.

  • How to print the call stack of a thread?

    I would like to print out the call stack of a thread, something that looks like the output of pstack.
    From within the thread itself, I suppose I can fork1() to duplicate the thread and fork another process to run pstack on the duplicated thread.
    I would much rather use some api to print out the stack directly. Any pointer would be appreciated.

    Hi,
    The code below will do what you want.
    All that needs to be done is to call csprintstack() from within
    your application. Remember to link in the dynamic linking library,
    libdl.so, as dynamic library functions are used.
    Cheers.
    Jon Haslam<br>
    Developer Technical Support<br>
    Sun Microsystems<br>
    <pre>
    #include <ucontext.h>
    #include <sys/frame.h>
    #include <dlfcn.h>
    #include <setjmp.h>
    #include <sys/procfs_isa.h>
    #include <stdio.h>
    #if defined(sparc) || defined(__sparc)
    #define FRAME_PTR_REGISTER REG_SP
    #endif
    #if defined(i386) || defined(__i386)
    #define FRAME_PTR_REGISTER EBP
    #endif
    struct frame *
    csgetframeptr()
    ucontext_t u;
    (void) getcontext(&u);
    return (((struct frame *)
    u.uc_mcontext.gregs[FRAME_PTR_REGISTER])->fr_savfp);
    void
    cswalkstack(struct frame * fp, int (*operate_func)(void *, void *),
    void * usrarg)
    void * savpc;
    struct frame * savfp;
    while (fp &&
    (savpc = (void*)fp->fr_savpc) &&
    (*operate_func)(savpc, usrarg) == 0) {
    fp = fp->fr_savfp;
    static int
    csprintaddress(void pc, void usrarg)
    Dl_info info;
    char * func;
    char * lib;
    if(dladdr(pc, & info) == 0) {
    func = "??";
    lib = "??";
    else {
    lib = (char *) info.dli_fname;
    func = (char *) info.dli_sname;
    fprintf((FILE *) usrarg,
    "%s:%s+0x%x\n",
    lib,
    func,
    (unsigned int)pc - (unsigned int)info.dli_saddr);
    return(0);
    void
    csprintstack(FILE * f)
    cswalkstack(csgetframeptr(), csprintaddress, (void *) f);
    </pre>

  • Get the Caller Name using JTAPI

    For the incoming call, I am able to read the Caller ID using connection[0].getAddress(), but it gives me the phone number of the incoming call. Is there a way to get the Caller Name of the incoming call as well?

    You get the caller name as shown on the phone's display by calling CiscoCall.getCurrentCallingPartyDisplayName

  • How to get the complete Stack-Trace ?

    Hi,
    I'm getting the following error on the screen.
    oracle.jbo.DMLException: JBO-26041: Failed to post data to database during "Insert": SQL Statement " INSERT INTO OTA.OTA_QUESTIONS(QUESTION_ID,TEXT,ALLOW_HTML_FLAG,OBJECT_VERSION_NUMBER,BUSINESS_GROUP_ID,START_DATE_ACTIVE) VALUES (:1,:2,:3,:4,:5,:6)".
    I want to get the complete stack-trace. I turned on the screen log, but still not getting the error-stack. Can anyone lemme know, how to get the complete error-stack ? This error is raised from a seeded page.
    Thanks,
    Guna.

    This is a developer raised exception and not a standard expection(depends on a profile), that is why you cannot see the error stack.You have to put system.out.println, to debug.You get such errors when there is some fundamental mistake and not framework exception.
    As the error says look into the query and see all bind variables are setting properly.
    --Mukul                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • HT1338 I am trying to use FaceTime with my partner in Mexico but is not connecting. We do get the call, but it just does not connect. What should I do?

    I am trying to use FaceTime with my partner in Mexico but is not connecting. We do get the call, but it just does not connect. What should I do?

    Try turning off the Firewall in System Preferences > Security & Privacy
    Apple - Support - FaceTime

  • How do I get the directory name that a class is located in?

    How do I get the directory name that a class is located in? I have a class located under /com/dhcmc and I want to be able to retrieve the "/com/dhcmc" that the class is residing under so that I can then use this directoy name to build a relative path name for the other directories supporting the application such as the images directory etc i.e.
    |---com
    |   \---dhcmc       (my class resides here)
    |       +---images  (supporting app dirs under the class dir)
    |       +---config  (supporting app dirs under the class dir)

    You can try the methods.
    Class.getClassLoader()
    Class.getResourceAsStream()
    Class.getResource()
    You probably wont get the complete directory path, but you might
    be able to load the files relative to your classes directory.

  • I lost my iPhone, but it's been more than 24 hours so iCloud won't let me see the last known location of the device, and i need the map of it's last know location to find the phone, how do i get the map of it's last known location?

    I lost my iPhone, but it's been more than 24 hours so iCloud won't let me see the last known location of the device, and i need the map of it's last know location to find the phone, how do i get the map of it's last known location?

    It's not likely to re-connect to a network lying on the ground somewhere and getting rained on, it would be really great if I could see that map again so I could use it's last known location to find it.  Kind of pointless to have a 24 hr killswitch deadline.  If I had known I would have taken a screen-shot while I still had access to the information.  Since I lost the phone at Canada's Wonderland (which is now closed for the season) I don't have access to the location where I lost the phone (under a roller-coaster probably), and so I wanted to send the Lost And Found people a screen-shot of it's last known location, but I guess I can't do that now.  (Apple are big jerks)

  • Getting the calling object reference / class?

    Dear forum members,
    Is it possible for A in the below example to get that B was the "caller"?
    class A {
      A() {
      public void someMethod(String text) {
        System.out.println("I was called with: " + text);
        System.out.println("I was called by: " + thatMagicWayToGetCallerClassOrReference());
    class B {
      public static void main(String[] args) {
        A a = new A();
        a.someMethod("HOLA HOLA");
    }

    Another way of getting the class of your caller is to use a SecurityManager object. getClassContext() is protected but you can get at it by subclassing SecurityManager (it works if you just instanciate the manager without installing it). This gives you a reference to the Class object itself where the stack trace returns only the class name. Bear in mind that the class in question will be several items up the array, the first entry is the SecurityManager itself, the second the called class.
    However, I agree with others it doesn't sound like the best design. If you're having trouble with not being able to change the interface specifications to pass the extra information then consider using a static reference, if necessary a ThreadLocal. What happens if you want to call the offending method indirectly through some central method at some future time? You've lost the call origin data.
    Why can't you simply add a parameter to the offending call?

  • Moving a method down the call stack

    This is partially a blazeds question as well, which I have already inquired about there.
    My situation is that I have a consumer.subscribe followed by the rpc, followed by the consumer expected to handle the results of the rpc.  What seems to be happening is a race condition between the subscribe and the rpc call - with the results being returned back before some of teh consumers have finished subscribing.  This is all being handled in one method.  For the most part, it needs to be encapsulated like this because we're using the parsley IoC container.  By creating a new context on a button click, it automatically instantiates and initalizes the consumers.  A retrievedataevent is then fired straight away.
    Is there anyway around this?  I noticed that if i create a Timer and set it to 1 millisecond, it somehow fixes itself.  Does timer somehow drop the current method down the callstack?  Or deprioritize it?
    Thanks in advance.  I'm banging my head against the wall here

    This is the way that Aperture works by design - you just need to get comfortable with album picks, every album can have a different album pick from the same stack, it will be the image that shows up at when the stack is closed.
    These may help
    [Aperture Organization|http://photo.rwboyer.com/2008/07/apple-aperture-21-organization>
    [Aperture Stacks and Albums|http://photo.rwboyer.com/2008/09/aperture-2-organization-tip-more-on-sta cks-and-albums>
    [Aperture Album picks and image versions|http://photo.rwboyer.com/2008/12/aperture-2-quick-tip-album-picks-and- image-versions>
    Maybe even this that explains how Aperture stacks work vs. Lightroom stacks
    [Aperture vs Lightroom stacks|http://photo.rwboyer.com/2008/10/aperture2-vs-lightroom2-stacks>
    RB

Maybe you are looking for