<?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 Find variable name in runtime in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-variable-name-in-runtime/m-p/10413946#M1843746</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll explain this question in 2 parts &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/906/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;, the general idea and it's intents&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been trying to do some dynamic coding and I still didn't manage a way to find out a variable name at runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to pass the variable into a method/subroutine and find out what is the variable name along with some other properties:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; o_dynsel-&amp;gt;add_select_option( s_matnr[] &lt;SPAN style="font-size: 10pt;"&gt;).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the idea:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While using the dynamic selection FM's (FREE_SELECTION_INIT), I wanted to map the select-options I have on screen to their corresponding fields inside the function. This can be achieved If:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I know the name of the select option variable and its table-field. -&amp;gt; So I can map it and ensure unicity.&lt;/LI&gt;&lt;LI&gt;I know it's contents -&amp;gt; to map from/to the dynamic selection screen/&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plus, I wanted to do this as generic as possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could do this using a text with the variable name:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; o_dynsel-&amp;gt;add_select_option( i_selop = 'S_MATNR'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i_ref_field = 'MARA-MATNR' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I simply don't like it that way(plus, I can always get spelling errors! )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 30 Jun 2014 18:01:47 GMT</pubDate>
    <dc:creator>adrianos_campanhola</dc:creator>
    <dc:date>2014-06-30T18:01:47Z</dc:date>
    <item>
      <title>Find variable name in runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-variable-name-in-runtime/m-p/10413946#M1843746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'll explain this question in 2 parts &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_macro jive_emote" src="https://community.sap.com/906/images/emoticons/happy.gif"&gt;&lt;/SPAN&gt;, the general idea and it's intents&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been trying to do some dynamic coding and I still didn't manage a way to find out a variable name at runtime.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I wanted to pass the variable into a method/subroutine and find out what is the variable name along with some other properties:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; o_dynsel-&amp;gt;add_select_option( s_matnr[] &lt;SPAN style="font-size: 10pt;"&gt;).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here's the idea:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;While using the dynamic selection FM's (FREE_SELECTION_INIT), I wanted to map the select-options I have on screen to their corresponding fields inside the function. This can be achieved If:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;I know the name of the select option variable and its table-field. -&amp;gt; So I can map it and ensure unicity.&lt;/LI&gt;&lt;LI&gt;I know it's contents -&amp;gt; to map from/to the dynamic selection screen/&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Plus, I wanted to do this as generic as possible.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could do this using a text with the variable name:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; o_dynsel-&amp;gt;add_select_option( i_selop = 'S_MATNR'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i_ref_field = 'MARA-MATNR' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I simply don't like it that way(plus, I can always get spelling errors! )&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Jun 2014 18:01:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-variable-name-in-runtime/m-p/10413946#M1843746</guid>
      <dc:creator>adrianos_campanhola</dc:creator>
      <dc:date>2014-06-30T18:01:47Z</dc:date>
    </item>
    <item>
      <title>Re: Find variable name in runtime</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/find-variable-name-in-runtime/m-p/10413947#M1843747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You will only have access to actual parameter, not that format parameter.&lt;/P&gt;&lt;P&gt;If the variable name is not being passed, you can read the call stack , read the code where it was called, and then do string manipulation to get the variable name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Look at this snippet where method is able to return the names select-options being passed.&lt;/P&gt;&lt;DIV style="background-color: #e7e5dc; width: auto; overflow: auto; margin: 1em 0 !important; padding-top: 1px; font-family: courier new,courier;"&gt;&lt;OL start="1" style="list-style: decimal; background-color: #fff; margin: 0 0 1px 3.5em !important; padding: 0; color: #5c5c5c;"&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&lt;SPAN style="font-style: italic; color: #808080;"&gt;*----------------------------------------------------------------------*&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;CLASS &lt;/SPAN&gt;main &lt;SPAN style="color: #0000ff;"&gt;DEFINITION.&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;PUBLIC &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;SECTION.&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;METHODS:&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; find_name &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;IMPORTING &lt;/SPAN&gt;selopt &lt;SPAN style="color: #0000ff;"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;ANY &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;TABLE&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RETURNING &lt;SPAN style="color: #0000ff;"&gt;value&lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;(&lt;/SPAN&gt;result&lt;SPAN style="color: #800080;"&gt;) &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;TYPE &lt;/SPAN&gt;string. &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;ENDCLASS.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #808080;"&gt;"main DEFINITION&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&lt;SPAN style="font-style: italic; color: #808080;"&gt;*----------------------------------------------------------------------*&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;CLASS &lt;/SPAN&gt;main &lt;SPAN style="color: #0000ff;"&gt;IMPLEMENTATION.&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;METHOD &lt;/SPAN&gt;find_name. &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;TYPES:&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;BEGIN &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;OF &lt;/SPAN&gt;formatted_entry, &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; stack_depth &lt;SPAN style="color: #0000ff;"&gt;TYPE &lt;/SPAN&gt;tpda_stack_level, &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; kind &lt;SPAN style="color: #0000ff;"&gt;TYPE &lt;/SPAN&gt;tpda_event_type, &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; progname &lt;SPAN style="color: #0000ff;"&gt;TYPE &lt;/SPAN&gt;tpda_program, &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; includename &lt;SPAN style="color: #0000ff;"&gt;TYPE &lt;/SPAN&gt;tpda_include, &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;line &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;TYPE &lt;/SPAN&gt;tpda_sc_line, &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;event &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;TYPE &lt;/SPAN&gt;tpda_event, &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;END &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;OF &lt;/SPAN&gt;formatted_entry, &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; formatted_entry_stack &lt;SPAN style="color: #0000ff;"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;STANDARD &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;TABLE &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;OF &lt;/SPAN&gt;formatted_entry &lt;SPAN style="color: #0000ff;"&gt;WITH &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;DEFAULT &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;KEY .&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;DATA &lt;/SPAN&gt;lt_stack &lt;SPAN style="color: #0000ff;"&gt;TYPE &lt;/SPAN&gt;formatted_entry_stack. &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; lt_stack &lt;SPAN style="color: #800080;"&gt;=&amp;nbsp; &lt;/SPAN&gt;cl_abap_get_call_stack&lt;SPAN style="color: #808080;"&gt;=&amp;gt;&lt;/SPAN&gt;format_call_stack_with_struct&lt;SPAN style="color: #800080;"&gt;(&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cl_abap_get_call_stack&lt;SPAN style="color: #808080;"&gt;=&amp;gt;&lt;/SPAN&gt;get_call_stack&lt;SPAN style="color: #800080;"&gt;( &lt;/SPAN&gt;&lt;SPAN style="color: #800080;"&gt;)&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #800080;"&gt;).&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;DATA &lt;/SPAN&gt;ls_stack &lt;SPAN style="color: #0000ff;"&gt;TYPE &lt;/SPAN&gt;formatted_entry. &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;DATA &lt;/SPAN&gt;lt_report &lt;SPAN style="color: #0000ff;"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;TABLE &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;OF &lt;/SPAN&gt;string. &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;DATA &lt;/SPAN&gt;lv_report &lt;SPAN style="color: #0000ff;"&gt;TYPE &lt;/SPAN&gt;string. &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;READ &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;TABLE &lt;/SPAN&gt;lt_stack &lt;SPAN style="color: #0000ff;"&gt;INTO &lt;/SPAN&gt;ls_stack &lt;SPAN style="color: #0000ff;"&gt;INDEX &lt;/SPAN&gt;&lt;SPAN style="color: #3399ff;"&gt;2.&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;IF &lt;/SPAN&gt;sy&lt;SPAN style="color: #808080;"&gt;-&lt;/SPAN&gt;subrc &lt;SPAN style="color: #0000ff;"&gt;EQ &lt;/SPAN&gt;&lt;SPAN style="color: #3399ff;"&gt;0.&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;READ &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;REPORT &lt;/SPAN&gt;ls_stack&lt;SPAN style="color: #808080;"&gt;-&lt;/SPAN&gt;includename &lt;SPAN style="color: #0000ff;"&gt;INTO &lt;/SPAN&gt;lt_report. &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;IF &lt;/SPAN&gt;sy&lt;SPAN style="color: #808080;"&gt;-&lt;/SPAN&gt;subrc &lt;SPAN style="color: #0000ff;"&gt;EQ &lt;/SPAN&gt;&lt;SPAN style="color: #3399ff;"&gt;0.&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;READ &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;TABLE &lt;/SPAN&gt;lt_report &lt;SPAN style="color: #0000ff;"&gt;INTO &lt;/SPAN&gt;lv_report &lt;SPAN style="color: #0000ff;"&gt;INDEX &lt;/SPAN&gt;ls_stack&lt;SPAN style="color: #808080;"&gt;-&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;line.&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;IF &lt;/SPAN&gt;sy&lt;SPAN style="color: #808080;"&gt;-&lt;/SPAN&gt;subrc &lt;SPAN style="color: #0000ff;"&gt;EQ &lt;/SPAN&gt;&lt;SPAN style="color: #3399ff;"&gt;0.&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;TRANSLATE &lt;/SPAN&gt;lv_report &lt;SPAN style="color: #0000ff;"&gt;TO &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;UPPER &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;CASE.&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;FIND &lt;/SPAN&gt;REGEX &lt;SPAN style="color: #4da619;"&gt;'-&amp;gt;FIND_NAME\W*(\w*)\W*' &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;IN &lt;/SPAN&gt;lv_report SUBMATCHES result. &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;ENDIF.&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;ENDIF.&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;ENDIF.&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;ENDMETHOD.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #808080;"&gt;"find_name&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;ENDCLASS.&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-style: italic; color: #808080;"&gt;"main IMPLEMENTATION&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;TABLES &lt;/SPAN&gt;mara. &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;SELECT-OPTIONS:&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp; s_matnr &lt;SPAN style="color: #0000ff;"&gt;FOR &lt;/SPAN&gt;mara&lt;SPAN style="color: #808080;"&gt;-&lt;/SPAN&gt;matnr, &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp; s_mtart &lt;SPAN style="color: #0000ff;"&gt;FOR &lt;/SPAN&gt;mara&lt;SPAN style="color: #808080;"&gt;-&lt;/SPAN&gt;mtart. &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&lt;SPAN style="color: #0000ff;"&gt;START-OF-SELECTION.&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;DATA &lt;/SPAN&gt;lv_name &lt;SPAN style="color: #0000ff;"&gt;TYPE &lt;/SPAN&gt;string. &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;DATA &lt;/SPAN&gt;lr_main &lt;SPAN style="color: #0000ff;"&gt;TYPE &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;REF &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff;"&gt;TO &lt;/SPAN&gt;main. &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;CREATE &lt;/SPAN&gt;OBJECT lr_main. &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp; lv_name &lt;SPAN style="color: #800080;"&gt;= &lt;/SPAN&gt;lr_main&lt;SPAN style="color: #808080;"&gt;-&amp;gt;&lt;/SPAN&gt;find_name&lt;SPAN style="color: #800080;"&gt;( &lt;/SPAN&gt;s_matnr[] &lt;SPAN style="color: #800080;"&gt;).&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;WRITE &lt;/SPAN&gt;/ lv_name. &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp; lv_name &lt;SPAN style="color: #800080;"&gt;= &lt;/SPAN&gt;lr_main&lt;SPAN style="color: #808080;"&gt;-&amp;gt;&lt;/SPAN&gt;find_name&lt;SPAN style="color: #800080;"&gt;( &lt;/SPAN&gt;s_mtart[] &lt;SPAN style="color: #800080;"&gt;).&lt;/SPAN&gt; &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #f8f8f8; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt;&amp;nbsp; &lt;SPAN style="color: #0000ff;"&gt;WRITE &lt;/SPAN&gt;/ lv_name. &lt;/LI&gt;&lt;LI style="list-style: decimal-leading-zero; list-style-position: outside !important; border-left: 3px solid #6CE26C; background-color: #ffffff; color: #5c5c5c; padding: 0 3px 0 10px !important; margin: 0 !important; line-height: 14px;"&gt; &lt;/LI&gt;&lt;/OL&gt;&lt;/DIV&gt;&lt;P&gt;/.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 01 Jul 2014 10:02:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/find-variable-name-in-runtime/m-p/10413947#M1843747</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2014-07-01T10:02:47Z</dc:date>
    </item>
  </channel>
</rss>

