<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How do I get a variable, or object from ABAP STACK. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/4255826#M1015899</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you checked fm SYSTEM_CALLSTACK ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can find few threads in the forum related to this. please make a search in SYSTEM_CALLSTACK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 04 Aug 2008 18:09:31 GMT</pubDate>
    <dc:creator>former_member194669</dc:creator>
    <dc:date>2008-08-04T18:09:31Z</dc:date>
    <item>
      <title>How do I get a variable, or object from ABAP STACK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/4255825#M1015898</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I get a variable, or object from ABAP STACK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a method I can use for reading ABAP STACK? &lt;/P&gt;&lt;P&gt;Do I just use command: get reference of u2026?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have an example code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basis version 7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2008 17:54:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/4255825#M1015898</guid>
      <dc:creator>Martin_Kuma</dc:creator>
      <dc:date>2008-08-04T17:54:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a variable, or object from ABAP STACK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/4255826#M1015899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you checked fm SYSTEM_CALLSTACK ? &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can find few threads in the forum related to this. please make a search in SYSTEM_CALLSTACK&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2008 18:09:31 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/4255826#M1015899</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2008-08-04T18:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a variable, or object from ABAP STACK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/4255827#M1015900</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;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.  &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;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.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
report zrich_0007 .

*---------------------------------------------------------------------*
*       FORM in                                                       *
*---------------------------------------------------------------------*
*       ........                                                      *
*---------------------------------------------------------------------*
form in.

  data: field(50).
  data: xmarc type marc.

  field-symbols: &amp;lt;matnr&amp;gt;.
  field-symbols: &amp;lt;imarc&amp;gt; type marc_upl_tt.

* Assign an individual variable
  field = '(ZRICH_0006)matnr'.
  assign (field) to &amp;lt;matnr&amp;gt;.

* Assign an internal table
  field = '(ZRICH_0006)IMARC[]'.
  assign (field) to &amp;lt;imarc&amp;gt;.

* Write out your data
  write &amp;lt;matnr&amp;gt;.

  loop at &amp;lt;imarc&amp;gt; into xmarc.
    write: / xmarc-werks.
  endloop.

endform.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2008 18:15:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/4255827#M1015900</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2008-08-04T18:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a variable, or object from ABAP STACK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/4255828#M1015901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have question for you please.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if IN form is in a function group, then whether if we called &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
perform in in program zrich. " Function group main program
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Whether it will work?&lt;/P&gt;&lt;P&gt;a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2008 18:28:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/4255828#M1015901</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2008-08-04T18:28:56Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a variable, or object from ABAP STACK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/4255829#M1015902</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think it would since I have done something simular in the past.  For example, there was a user exit, and of course the implementation was in an INCLUDE which was inside of a function module, I needed access to some variable at a higher level function call, so I used this same thing and pointed to the variable of the main program of the function group.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2008 18:37:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/4255829#M1015902</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2008-08-04T18:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a variable, or object from ABAP STACK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/4255830#M1015903</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Gurus&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for the quick response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see I did not write everything. Sorry. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To explain my problem: &lt;/P&gt;&lt;P&gt;This is a BW object call InfoSpoke. The InfoSpoke collects data from BW and places them in a csv on the file system. There is no way to create the file name dynamically in the InfoSpoke self. You can assign a logical file, but for each InfoSpoke one u2013 and imagine I have 200+ of them. So I am trying to create the file name dynamically by a FM. The FM u2018justu2019 needs to find which InfoSpoke called the FM and return the name of it. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This FM, which I use is a customer exit for logical file /TX: FILE/. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;During debug I found that right after the PAI module an object is created, which is used during the entire process of data retrieval and save. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now I either reference the object self and then use one of the methods available, or I directly reference one of the variables. &lt;/P&gt;&lt;P&gt;But I do not know how to assign/reference the object/variable. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rich, the assignment you are using. Well, you know that the ZRICH_0006 calls the ZRICH_0007 and thus can assign ZRICH_0006 variables in the ZRICH_0007. However I do not, as the program is generated at run time. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to define a variable/object, which will be known at run time. Then I need to assign the values in call stack to this variable/object. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;aRs, the SYSTEM_CALLSTACK returns the list of methods, but I need the variable/object which is used in side these methods. The list of the used methods, does not help much.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2008 19:25:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/4255830#M1015903</guid>
      <dc:creator>Martin_Kuma</dc:creator>
      <dc:date>2008-08-04T19:25:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a variable, or object from ABAP STACK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/4255831#M1015904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Martin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I think you have 2 options &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Try to use EXPORT/IMPORT&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb3bde358411d1829f0000e829fbfe/content.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/Helpdata/EN/fc/eb3bde358411d1829f0000e829fbfe/content.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. Write the dynamic file name in a custom table with unique in the userexit and read it whenever you need using infospoke id.&lt;/P&gt;&lt;P&gt;( I will not suggest for second option)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; a®&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Aug 2008 20:05:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/4255831#M1015904</guid>
      <dc:creator>former_member194669</dc:creator>
      <dc:date>2008-08-04T20:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a variable, or object from ABAP STACK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/4255832#M1015905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;a®s,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How do I IMPORT from ABAP STACK, please?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;I have the method: CL_RSB_... The method has a variable: lv_var. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I cannot add an EXPORT to ID 'XXX' to the method.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Martin&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 05 Aug 2008 12:03:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/4255832#M1015905</guid>
      <dc:creator>Martin_Kuma</dc:creator>
      <dc:date>2008-08-05T12:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a variable, or object from ABAP STACK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/4255833#M1015906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;added implicit enhancement to a method&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 07 Aug 2008 11:21:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/4255833#M1015906</guid>
      <dc:creator>Martin_Kuma</dc:creator>
      <dc:date>2008-08-07T11:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do I get a variable, or object from ABAP STACK.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/13956425#M2038047</link>
      <description>&lt;P&gt;&lt;SPAN class=""&gt;Thank you for the constructive and valuable instructions. Works well!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Dec 2024 14:02:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-do-i-get-a-variable-or-object-from-abap-stack/m-p/13956425#M2038047</guid>
      <dc:creator>w_tschernjak</dc:creator>
      <dc:date>2024-12-05T14:02:23Z</dc:date>
    </item>
  </channel>
</rss>

