How do I get a variable, or object from ABAP STACK.

Hey Gurus,
How do I get a variable, or object from ABAP STACK.
Example: I start my FM. I can see in the ABAP STACK the variable I need. I can see the object; I could use to get my variable. I need to use it in my FM; however I need to reference it in the run time. How do I do that?
Is there a method I can use for reading ABAP STACK?
Do I just use command: get reference of u2026?
Does anyone have an example code?
Basis version 7
Thanks in advance
Martin

Ah, you mean you want to access a variable from another program in the call stack, yes?  You can do this using field symbols, but please don't try to change a value while doing this, it could really screw things up. 
this example, is using two programs, where the second is accessing variables of the first program.  Basically just notice that we are using the program name and the variable name when assigning the field symbol.
report zrich_0006 .
tables: mara.
parameters: p_matnr type mara-matnr..
data: matnr type mara-matnr.
data: imarc type table of marc with header line.
matnr = p_matnr.
select * from marc into table imarc up to 10 rows
               where matnr = p_matnr.
perform in in program zrich_0007.
report zrich_0007 .
*       FORM in                                                       *
form in.
  data: field(50).
  data: xmarc type marc.
  field-symbols: <matnr>.
  field-symbols: <imarc> type marc_upl_tt.
* Assign an individual variable
  field = '(ZRICH_0006)matnr'.
  assign (field) to <matnr>.
* Assign an internal table
  field = '(ZRICH_0006)IMARC[]'.
  assign (field) to <imarc>.
* Write out your data
  write <matnr>.
  loop at <imarc> into xmarc.
    write: / xmarc-werks.
  endloop.
endform.
Regards,
Rich Heilman

Similar Messages

  • How can I get the variable with the value from Thread's run method

    We want to access a variable from the run method of a Thread externally in a class or in a method. Even though I make the variable as public /public static, I could get the value till the end of the run method only. After that scope of the variable gets lost resulting to null value in the called method/class..
    How can I get the variable with the value?
    This is sample code:
    public class SampleSynchronisation
         public static void main(String df[])
    sampleThread sathr= new sampleThread();
    sathr.start();
    System.out.println("This is the value from the run method "+sathr.x);
    /* I should get:
    Inside the run method
    But I get only:
    Inside*/
    class sampleThread extends Thread
         public String x="Inside";
         public void run()
              x+="the run method";
    NB: if i write the variable in to a file I am able to read it from external method. This I dont want to do

    Your main thread continues to run after the sathr thread is completed, consequently the output is done before the sathr thread has modified the string. You need to make the main thread pause, this will allow sathr time to run to the point where it will modify the string and then you can print it out. Another way would be to lock the object using a synchronized block to stop the main thread accessing the string until the sathr has finished with it.

  • How do I get to the request object in a webflow.

    How do I get to the request object in a webflow.
    I created a input process and one function it needs to do is create a cookie.
    Problem is I don't have a response object.
    How do I create/get the response object so I can create a cookie.
    Thanks
    Michael C Ford
    ------------------ Code Line ------------------------------------
    public Object process(HttpServletRequest req, Object requestContext)
    throws ProcessingException
    // get the pipeline and namespace info for the process
    PipelineSession pSession = null;
    String namespace = null;
    String username = req.getRemoteUser();
    pSession = getPipelineSession(req);
    namespace = getCurrentNamespace(pSession);
    /* ***** DO THE INITIAL CREATE OF THE BEAN *** */
         try {
              Properties props = new Properties();
              props.put(
                   Context.INITIAL_CONTEXT_FACTORY,
                   "weblogic.jndi.WLInitialContextFactory");
              Context ctx = new InitialContext(props);
              Object homeObject = ctx.lookup("com.??.??PortalMgr");
              SeechangePortalMgrHome seechangePortalMgrHome =
              (SeechangePortalMgrHome) javax.rmi.PortableRemoteObject.narrow(
                                                      homeObject,
                                                      SeechangePortalMgrHome.class);
              SeechangePortalMgr portalMgr = seechangePortalMgrHome.create();
    /* Set the initail user */
    portalMgr.setUser(username);          
              UserRuntime userRuntime = (UserRuntime)portalMgr.getRuntimeObject();
              System.out.print("Run Time User is " + userRuntime.getUserName());
              System.out.print("Run Time User is " + userRuntime.getOrgSeq());
    // ** cookies for Actuate XXX=(customer sequence ID), YYY=ZZZ is a dummy per
    their requirement
              Cookie cCustSeqNumber = new Cookie("XXX",userRuntime.getOrgSeq());
              Cookie cPassword = new Cookie("YYY","ZZZ");
              cCustSeqNumber.setPath("/");
              cPassword.setPath("/");
              ??response.addCookie(cCustSeqNumber);
              ??response.addCookie(cPassword);          
         } catch (Exception ee) {
              System.out.print("Unable to create Portal Manager" + ee);
    // at this point we add the logic to produce the bean
    return "success";

    Thanks
    Just what I needed, except I needed to caste response.
    Michael C
    "Daniel Selman" <[email protected]> wrote:
    Michael,
    // get the HttpServletResponse from the HttpServletRequest
    HttpServletResponse response =
    equest.getAttribute( WebflowConstants.HTTP_SERVLET_RESPONSE );
    Cookie cPassword = new Cookie("YYY","ZZZ");
    cCustSeqNumber.setPath("/");
    cPassword.setPath("/");
    response.addCookie(cCustSeqNumber);
    response.addCookie(cPassword);
    You HAVE the HttpServletRequest...
    public Object process(HttpServletRequest req, ObjectrequestContext)
    throws ProcessingExceptionMake sense?
    Dan
    "michael C Ford" <[email protected]> wrote in message
    news:[email protected]...
    How can I get to the response this way ?
    this just stored the response as an attribute did it now ?
    If I don't have it, how can I use it in a setAttribute ?
    Sorry just a little slow
    I can't do this can I ?
    request.setAttribute(WebflowConstants.HTTP_SERVLET_RESPONSE,response);
    Cookie cPassword = new Cookie("YYY","ZZZ");
    cCustSeqNumber.setPath("/");
    cPassword.setPath("/");
    response.addCookie(cCustSeqNumber);
    response.addCookie(cPassword);
    "Daniel Selman" <[email protected]> wrote:
    Michael,
    I found this handy snippet in our code:
    // Put the httpServletResponse into the request, this is done
    in
    case IPs want to
    // use the response to deposit cookies. The IPs maynot howeverwrite
    // anything to the response as this will cause an
    IllegalStateException
    request.setAttribute(WebflowConstants.HTTP_SERVLET_RESPONSE,
    response);
    So, the HttpServletResponse is bound into the HttpServletRequest usingthe
    key, WebflowConstants.HTTP_SERVLET_RESPONSE.
    Magic!
    Sincerely,
    Daniel Selman
    "michael C Ford" <[email protected]> wrote in message
    news:[email protected]...
    How do I get to the request object in a webflow.
    I created a input process and one function it needs to do is create
    a
    cookie.
    Problem is I don't have a response object.
    How do I create/get the response object so I can create a cookie.
    Thanks
    Michael C Ford
    ------------------ Code Line ------------------------------------
    public Object process(HttpServletRequest req, Object
    requestContext)
    throws ProcessingException
    // get the pipeline and namespace info for the process
    PipelineSession pSession = null;
    String namespace = null;
    String username = req.getRemoteUser();
    pSession = getPipelineSession(req);
    namespace = getCurrentNamespace(pSession);
    /* ***** DO THE INITIAL CREATE OF THE BEAN *** */
    try {
    Properties props = new Properties();
    props.put(
    Context.INITIAL_CONTEXT_FACTORY,
    "weblogic.jndi.WLInitialContextFactory");
    Context ctx = new InitialContext(props);
    Object homeObject = ctx.lookup("com.??.??PortalMgr");
    SeechangePortalMgrHome seechangePortalMgrHome =
    (SeechangePortalMgrHome) javax.rmi.PortableRemoteObject.narrow(
    homeObject,
    SeechangePortalMgrHome.class);
    SeechangePortalMgr portalMgr = seechangePortalMgrHome.create();
    /* Set the initail user */
    portalMgr.setUser(username);
    UserRuntime userRuntime = (UserRuntime)portalMgr.getRuntimeObject();
    System.out.print("Run Time User is " + userRuntime.getUserName());
    System.out.print("Run Time User is " + userRuntime.getOrgSeq());
    // ** cookies for Actuate XXX=(customer sequence ID), YYY=ZZZ isa
    dummy per
    their requirement
    Cookie cCustSeqNumber = new
    Cookie("XXX",userRuntime.getOrgSeq());
    Cookie cPassword = new Cookie("YYY","ZZZ");
    cCustSeqNumber.setPath("/");
    cPassword.setPath("/");
    ??response.addCookie(cCustSeqNumber);
    ??response.addCookie(cPassword);
    } catch (Exception ee) {
    System.out.print("Unable to create Portal Manager" + ee);
    // at this point we add the logic to produce the bean
    return "success";

  • How can I get the variable with the value from Thread Run method?

    We want to access a variable from the run method of a Thread externally in a class or in a method. Even though I make the variable as public /public static, I could get the value till the end of the run method only. After that scope of the variable gets lost resulting to null value in the called method/class..
    How can I get the variable with the value?
    This is sample code:
    public class SampleSynchronisation
         public static void main(String df[])
    sampleThread sathr= new sampleThread();
    sathr.start();
    System.out.println("This is the value from the run method "+sathr.x);
    // I should get Inside the run method::: But I get only Inside
    class sampleThread extends Thread
         public String x="Inside";
         public void run()
              x+="the run method";
    NB: if i write the variable in to a file I am able to read it from external method. This I dont want to do

    We want to access a variable from the run method of a
    Thread externally in a class or in a method. I presume you mean a member variable of the thread class and not a local variable inside the run() method.
    Even
    though I make the variable as public /public static, I
    could get the value till the end of the run method
    only. After that scope of the variable gets lost
    resulting to null value in the called method/class..
    I find it easier to implement the Runnable interface rather than extending a thread. This allows your class to extend another class (ie if you extend thread you can't extend something else, but if you implement Runnable you have the ability to inherit from something). Here's how I would write it:
    public class SampleSynchronisation
      public static void main(String[] args)
        SampleSynchronisation app = new SampleSynchronisation();
      public SampleSynchronisation()
        MyRunnable runner = new MyRunnable();
        new Thread(runner).start();
        // yield this thread so other thread gets a chance to start
        Thread.yield();
        System.out.println("runner's X = " + runner.getX());
      class MyRunnable implements Runnable
        String X = null;
        // this method called from the controlling thread
        public synchronized String getX()
          return X;
        public void run()
          System.out.println("Inside MyRunnable");
          X = "MyRunnable's data";
      } // end class MyRunnable
    } // end class SampleSynchronisation>
    public class SampleSynchronisation
    public static void main(String df[])
    sampleThread sathr= new sampleThread();
    sathr.start();
    System.out.println("This is the value from the run
    method "+sathr.x);
    // I should get Inside the run method::: But I get
    only Inside
    class sampleThread extends Thread
    public String x="Inside";
    public void run()
    x+="the run method";
    NB: if i write the variable in to a file I am able to
    read it from external method. This I dont want to do

  • How can I get a count of objects in the near cache? (Extend client)

    Hi,
    I'm trying to figure out how to get the count of objects in my near cache (from c++ client). Knowing the size of the near cache is a key factor when optimizing configurations for performance.
    However if I call size() on the cache handle I get the count of objects in the cache (ie the cluster). How can I get a count of objects in the near cache?
    Thanks
    Rich Carless

    H Rich,
    It may not be ideal, but I think you may be able to infer the size by using the HeapAnalyzer (http://download.oracle.com/docs/cd/E15357_01/coh.360/e15728/classcoherence_1_1lang_1_1_heap_analyzer.html) facility, specifically the "class" based HeapAnalyzer. Its Snapshot representation http://download.oracle.com/docs/cd/E15357_01/coh.360/e15728/classcoherence_1_1lang_1_1_class_based_heap_analyzer_1_1_snapshot.html provides a mapping between class name and ClassStats (http://download.oracle.com/docs/cd/E15357_01/coh.360/e15728/classcoherence_1_1lang_1_1_class_based_heap_analyzer_1_1_class_stats.html) which provides information on how many instances of a given class type are in memory. Note the reported counts are process wide but if your key or value type are distinct you may be able to infer your answer. I realize this is rather complex, my only other suggestion would be to just make some guesses on size and see how they effect performance.
    Mark
    Oracle Coherence

  • How can i get this variable value into second page IN BSP

    Hi friends
    I have variable wk_matnr value 'ABC' in first page of BSP.
    How can i get this variable value into second page.
    Moosa

    Hi,
    you can define variable (page attribiue) on the second page with the same name. You can realise the Navigation with Button ther started onInputProcesing routine. In onInputProcesing you have to call navigation->set_parameter with attribut name as parameter and then starting the navigation. If you have checked the auto property on the variable on second page and varable have same name, the value of variable should be transported.
    [See this tutorial|http://help.sap.com/saphelp_erp2005/helpdata/DE/1a/c5133a62983c0ae10000000a114084/frameset.htm]
    Best regards
    Bogdan

  • How do I get "CO" variable 01 to 67 in character format?

    Post Author: Dennis Hernan
    CA Forum: Data Connectivity and SQL
    I have 2 databases. "DBA"."RMS_A0_SEGMENT" & "DBA"."RMS_G0_SEGMENT". The A0 segment has a CNTY variable. We create table B from A only to create SELYEAR & CO. SELYEAR is numeric because it is "2007 as". CO is numeric because it is "CNTY as". The values in CNTY are 1 to 67 numeric. How do I get "CO" variable 01 to 67 in character format?
    Is this standard SQL or would you call it Crysal SQL format? Select "B"."CNTY", "B"."SR", "B"."SEG", "B"."FED_AID",         "B"."TBK_CODE", "B"."PAVE_CYC", "B"."SURFACE",  "B"."LENGTH",         "B".SELYEAR, "C"."KEY_YEAR", "C"."SEG", "C"."SR", "C"."CNTY", "C"."SLDSTATU", "B"."CO" FROM (SELECT "A"."CNTY", "A"."SR", "A"."SEG", "A"."FED_AID",         "A"."TBK_CODE", "A"."PAVE_CYC", "A"."SURFACE",  "A"."LENGTH",         2007 as SELYEAR, CNTY as CO             FROM   "DBA"."RMS_A0_SEGMENT" "A") "B" LEFT JOIN "DBA"."RMS_G0_SEGMENT"  "C"  ON ("B"."SEG" = "C"."SEG") AND ("B"."SR" = "C"."SR") AND ("B"."CNTY" = "C"."CNTY") AND         ("B".SELYEAR = "C"."KEY_YEAR")

    Post Author: Dennis Hernan
    CA Forum: Data Connectivity and SQL
    Here's a simple example: SELECT "A"."A01_CTY_CDE", "A"."DIST_CODE","A"."CTY_NAME", A01_CTY_CDE AS CO NUMERIC(2) FROM SYSADM.CNTY_DIST_XREF "A" I'm trying to create the CO variable numeric(2) from the A01_CTY_CDE which is character(2). The values in A01_CTY_CDE are 1 to 67 character, I need CO to be numeric to merge with another linked table. "I am using the Add Command In Database Expert". I need 4 variables when this is done in the Command Database, A01_CTY_CDE, DIST_CODE,CTY_NAME all charater from the original database "SYSADM.CNTY_DIST_XREF". Also I'm trying & need your help, to create a variable CO with a numberic format, and the values equal to the A01_CTY_CDE variable. Call If you like, Dennis, 717.787.7293.

  • How can i get system variable using java

    Hi,
    I just want to know how can i get system variables using java code.
    for example i want to get the the date for today or i want to get the number of processes that's running.
    Thanks alot

    Hi,
    I just want to know how can i get system variables
    using java code.
    for example i want to get the the date for today or i
    want to get the number of processes that's running.
    Thanks alotSome generic "system variables" are available though Java, usually through the System class.
    Date today = new Date();
    is instantiated with the current date and time.
    Other system values, like environment values, should be passed to java through the command line (-D option) by setting system properties.
    Finally, platform specific values like the number of processes running will have to be written in platform specific code and executed by JNI (java native interface).
    Java is platform or system agnostic. Common system values, like time, are implemented. Hopefully you won't need platform specific values.

  • I have about 800 more songs on my nano than itunes, due to a crash. How can I get the songs onto itunes from the ipod, or at least get the new music ive gotten since the crash onto my ipod without deleting all the other songs when it syncs?

    i have about 800 more songs on my nano than itunes, due to a crash. How can I get the songs onto itunes from the ipod, or at least get the new music ive gotten since the crash onto my ipod without deleting all the other songs when it syncs?

    It has always been very basic to always maintain a backup copy of your computer for just such an occasion.  Use your backup copy to put everything back.
    If you have failed to bakup, then you can transfer itunes purchases from an ipod: File>Transfer Purchases

  • How do i get my podcasts to go from the one i just finished to the next one and how do i sort them from oldest to newest?

    how do i get my podcasts to go from the one i just finished to the next one withouth me having to click on it, and how do i sort them from oldest to newest?

    Not sure if you tried this, but did you hold down both the sleep and home button for 10 seconds? 

  • How do I get iphoto to import videos from my iphone 3s? It only imports photos, not videos. My iPhoto is v. 4.0.3.

    How do I get iphoto to import videos from my iphone 3s? It only imports photos, not videos. My iPhoto is v. 4.0.3.

    My iPhoto is v. 4.0.3.
    Is your QuickTime up to date?
    Video importing requires QuickTime 7.6.2 or later.
    http://support.apple.com/kb/HT4083

  • How do i get air play to work from my macbook to apple tv

    How do i get air play to work from my macbook to apple tv? It does work with some programs like itunes but I can't get it to work with safari.

    apple tv does not work in safari. there is no web browsing capabilities on the apple tv..
    however what you are probably referring to is mirroring? iPad 2 and iPhone 4s have mirroring capabilities, so what you have on the screen is exactly what would appear in the apple tv..
    on ipad for example...ignore the settings page. Instead, go to the iPod controls. Double-press your home button to see the multitasking bar, showing all your recent apps. Swipe your finger from right to left for the mirroring icon; you'll see the AirPlay icon. Tap on that, select your Apple TV and toggle the mirror button to 'on'.

  • When I try using Airplay to stream from Amazon Prime it tries to use Apple TV music.  How can I get it it stream movies from Amazon Prime?

    When I try using Airplay to stream from Amazon Prime it tries to use Apple TV music.  How can I get it it stream movies from Amazon Prime?

    Welcome to the Apple Community.
    Try the following steps, check whether things are working after each step where appropriate, before trying the next.
    Restart the Apple TV (Settings > General > Restart).
    Restart the Apple TV by removing ALL the cables for 30 seconds.
    Restart your router.
    Reset the Apple TV (Settings > General > Reset > Reset all settings)
    Restore the Apple TV (Settings > General > Reset > Restore)

  • I'm new to Mac. I have an iPhone and a Mac Mini.  My original iTunes was on a Windows computer that crashed.  So, all of my iTunes Music and Movies are gone.  How do I get the movies and music from my iPhone to the new Mac Mini?

    I'm new to Mac. I have an iPhone and a Mac Mini.  My original iTunes was on a Windows computer that crashed.  So, all of my iTunes Music and Movies are gone.  How do I get the movies and music from my iPhone to the new Mac Mini?

    If you still have the crashed Win computer, you may be able to recover your music and movies from the hard drive. If you have a friend with a hard drive USB connection kit and a PC, they should be able to help.  Otherwise, check locally for computer services that might do that for you (I think Best Buy Geek Squad may be able to help). If the drive itself is in good shape, it shouldn't be too expensive. 

  • My iPhone is stolen. How can I get my address book back from the iCloud? I should have synchronized my iPad address book. However, I loss some recent contacts from iPhone.

    My iPhone is stolen. How can I get my address book back from the iCloud? I should have synchronized my iPad address book. However, I loss some recent contacts from iPhone.

    I use my iPad to get the address book backed up by iCloud from my iPhone. However, I cannot see the recent new contacts from my iPad. Is there anyway to check the iCloud server to see if my address book backup from my iPhone is still there?

Maybe you are looking for