<?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 Debugger Scripting in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugger-scripting/m-p/12764240#M2022682</link>
    <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
  &lt;P&gt;Do you know what is the reason why this script is not executable? It is showing syntax error , with class &lt;STRONG&gt;tpda_scr_globals_it&lt;/STRONG&gt; it is executable but not with &lt;STRONG&gt;tpda_scr_locals_it&lt;/STRONG&gt;. Is there a restriction from SAP why it may not be executable.&lt;BR /&gt;Looking forward to your reply. Thank you in advance.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;*&amp;lt;SCRIPT:PERSISTENT&amp;gt;
REPORT  rstpda_script_template.

*&amp;lt;SCRIPT:HEADER&amp;gt;
*&amp;lt;SCRIPTNAME&amp;gt;RSTPDA_SCRIPT_DUMMY&amp;lt;/SCRIPTNAME&amp;gt;
*&amp;lt;FILE_NAME&amp;gt;C:\SCRIPTDEBU\ZSCRIPT_LOCALS.TXT&amp;lt;/FILE_NAME&amp;gt;
*&amp;lt;SCRIPT_CLASS&amp;gt;LCL_DEBUGGER_SCRIPT&amp;lt;/SCRIPT_CLASS&amp;gt;
*&amp;lt;SINGLE_RUN&amp;gt;X&amp;lt;/SINGLE_RUN&amp;gt;

*&amp;lt;/SCRIPT:HEADER&amp;gt;

*&amp;lt;SCRIPT:PRESETTINGS&amp;gt;

*&amp;lt;/SCRIPT:PRESETTINGS&amp;gt;

*&amp;lt;SCRIPT:SCRIPT_CLASS&amp;gt;
*---------------------------------------------------------------------*
*       CLASS lcl_debugger_script DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_debugger_script DEFINITION INHERITING FROM  cl_tpda_script_class_super  .

  PUBLIC SECTION.
    METHODS: prologue  REDEFINITION,
      init    REDEFINITION,
      script  REDEFINITION,
      end     REDEFINITION.

ENDCLASS.                    "lcl_debugger_script DEFINITION
*---------------------------------------------------------------------*
*       CLASS lcl_debugger_script IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_debugger_script IMPLEMENTATION.
  METHOD prologue.
*** generate abap_source (source handler for ABAP)
    super-&amp;gt;prologue( ).
  ENDMETHOD.                    "prolog

  METHOD init.
*** insert your initialization code here
  ENDMETHOD.                    "init
  METHOD script.

    DATA:
    lt_locals TYPE tpda_scr_locals_it.
    ls_locals like line of lt_globals,
    lv_value  type tpda_var_value,
    trace_entry type tpda_trace_custom.

    CALL METHOD trace-&amp;gt;add_src_info.

    CALL METHOD cl_tpda_script_data_descr=&amp;gt;locals(
      RECEIVING
        p_locals_it = lt_locals ).

    LOOP AT lt_locals INTO ls_locals.

      TRY.
          CALL METHOD cl_tpda_script_data_descr=&amp;gt;get_simple_value
            EXPORTING
              p_var_name  = ls_locals-name
            RECEIVING
              p_var_value = lv_value.
        CATCH cx_tpda_varname .
        CATCH cx_tpda_script_no_simple_type .
      ENDTRY.

      trace_entry-value = 'Wert der Variablen' &amp;amp;&amp;amp; space &amp;amp;&amp;amp; ls_locals-name &amp;amp;&amp;amp; '=' &amp;amp;&amp;amp; lv_value.

      CALL METHOD trace-&amp;gt;add_custom_info
        EXPORTING
          p_trace_entry = trace_entry.
    ENDLOOP.
*  me-&amp;gt;break( ).

  ENDMETHOD.                    "script
  METHOD end.
*** insert your code which shall be executed at the end of the scripting (before trace is saved)
*** here

  ENDMETHOD.                    "end
ENDCLASS.                    "lcl_debugger_script IMPLEMENTATION
*&amp;lt;/SCRIPT:SCRIPT_CLASS&amp;gt;

*&amp;lt;/SCRIPT:PERSISTENT&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Br&lt;/P&gt;
  &lt;P&gt;Hakan&lt;/P&gt;</description>
    <pubDate>Sat, 28 Oct 2023 21:07:51 GMT</pubDate>
    <dc:creator>airwave</dc:creator>
    <dc:date>2023-10-28T21:07:51Z</dc:date>
    <item>
      <title>Debugger Scripting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugger-scripting/m-p/12764240#M2022682</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
  &lt;P&gt;Do you know what is the reason why this script is not executable? It is showing syntax error , with class &lt;STRONG&gt;tpda_scr_globals_it&lt;/STRONG&gt; it is executable but not with &lt;STRONG&gt;tpda_scr_locals_it&lt;/STRONG&gt;. Is there a restriction from SAP why it may not be executable.&lt;BR /&gt;Looking forward to your reply. Thank you in advance.&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;*&amp;lt;SCRIPT:PERSISTENT&amp;gt;
REPORT  rstpda_script_template.

*&amp;lt;SCRIPT:HEADER&amp;gt;
*&amp;lt;SCRIPTNAME&amp;gt;RSTPDA_SCRIPT_DUMMY&amp;lt;/SCRIPTNAME&amp;gt;
*&amp;lt;FILE_NAME&amp;gt;C:\SCRIPTDEBU\ZSCRIPT_LOCALS.TXT&amp;lt;/FILE_NAME&amp;gt;
*&amp;lt;SCRIPT_CLASS&amp;gt;LCL_DEBUGGER_SCRIPT&amp;lt;/SCRIPT_CLASS&amp;gt;
*&amp;lt;SINGLE_RUN&amp;gt;X&amp;lt;/SINGLE_RUN&amp;gt;

*&amp;lt;/SCRIPT:HEADER&amp;gt;

*&amp;lt;SCRIPT:PRESETTINGS&amp;gt;

*&amp;lt;/SCRIPT:PRESETTINGS&amp;gt;

*&amp;lt;SCRIPT:SCRIPT_CLASS&amp;gt;
*---------------------------------------------------------------------*
*       CLASS lcl_debugger_script DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_debugger_script DEFINITION INHERITING FROM  cl_tpda_script_class_super  .

  PUBLIC SECTION.
    METHODS: prologue  REDEFINITION,
      init    REDEFINITION,
      script  REDEFINITION,
      end     REDEFINITION.

ENDCLASS.                    "lcl_debugger_script DEFINITION
*---------------------------------------------------------------------*
*       CLASS lcl_debugger_script IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_debugger_script IMPLEMENTATION.
  METHOD prologue.
*** generate abap_source (source handler for ABAP)
    super-&amp;gt;prologue( ).
  ENDMETHOD.                    "prolog

  METHOD init.
*** insert your initialization code here
  ENDMETHOD.                    "init
  METHOD script.

    DATA:
    lt_locals TYPE tpda_scr_locals_it.
    ls_locals like line of lt_globals,
    lv_value  type tpda_var_value,
    trace_entry type tpda_trace_custom.

    CALL METHOD trace-&amp;gt;add_src_info.

    CALL METHOD cl_tpda_script_data_descr=&amp;gt;locals(
      RECEIVING
        p_locals_it = lt_locals ).

    LOOP AT lt_locals INTO ls_locals.

      TRY.
          CALL METHOD cl_tpda_script_data_descr=&amp;gt;get_simple_value
            EXPORTING
              p_var_name  = ls_locals-name
            RECEIVING
              p_var_value = lv_value.
        CATCH cx_tpda_varname .
        CATCH cx_tpda_script_no_simple_type .
      ENDTRY.

      trace_entry-value = 'Wert der Variablen' &amp;amp;&amp;amp; space &amp;amp;&amp;amp; ls_locals-name &amp;amp;&amp;amp; '=' &amp;amp;&amp;amp; lv_value.

      CALL METHOD trace-&amp;gt;add_custom_info
        EXPORTING
          p_trace_entry = trace_entry.
    ENDLOOP.
*  me-&amp;gt;break( ).

  ENDMETHOD.                    "script
  METHOD end.
*** insert your code which shall be executed at the end of the scripting (before trace is saved)
*** here

  ENDMETHOD.                    "end
ENDCLASS.                    "lcl_debugger_script IMPLEMENTATION
*&amp;lt;/SCRIPT:SCRIPT_CLASS&amp;gt;

*&amp;lt;/SCRIPT:PERSISTENT&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;Br&lt;/P&gt;
  &lt;P&gt;Hakan&lt;/P&gt;</description>
      <pubDate>Sat, 28 Oct 2023 21:07:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/debugger-scripting/m-p/12764240#M2022682</guid>
      <dc:creator>airwave</dc:creator>
      <dc:date>2023-10-28T21:07:51Z</dc:date>
    </item>
    <item>
      <title>Re: Debugger Scripting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugger-scripting/m-p/12764241#M2022683</link>
      <description>&lt;P&gt;Difficult to help if you don't post the message of the syntax error.&lt;/P&gt;&lt;P&gt;I tried your code. The syntax error is very clear:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;Comma without preceding colon (after LS_LOCALS ?).&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;What don't you understand?&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2225740-image.png" /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2023 08:05:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/debugger-scripting/m-p/12764241#M2022683</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-10-29T08:05:50Z</dc:date>
    </item>
    <item>
      <title>Re: Debugger Scripting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugger-scripting/m-p/12764242#M2022684</link>
      <description>&lt;P&gt;Please disregard typo eror  with "comma without preceding colon".&lt;/P&gt;&lt;P&gt;In the end even after correcting the code doesn't do what it should do. &lt;/P&gt;&lt;P&gt;All what I see is the message although I am not using the program RSTPDA_SCRIPT_DUMMY&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;The program "RSTPDA_SCRIPT_DUMMY" is not Unicode-compatible, according to its program attributes.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Pls. help why it is not working as expected. &lt;/P&gt;&lt;P&gt;Br&lt;/P&gt;&lt;P&gt;Hakan&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2023 17:40:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/debugger-scripting/m-p/12764242#M2022684</guid>
      <dc:creator>airwave</dc:creator>
      <dc:date>2023-10-29T17:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Debugger Scripting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugger-scripting/m-p/12764243#M2022685</link>
      <description>&lt;P&gt;I can "disregard" your original question if you update it. Don't post an answer just to change your original question.&lt;/P&gt;&lt;P&gt;I see nowhere in your code the presence of "RSTPDA_SCRIPT_DUMMY". Again, difficult to help if the question is unclear...&lt;/P&gt;</description>
      <pubDate>Sun, 29 Oct 2023 19:35:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/debugger-scripting/m-p/12764243#M2022685</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-10-29T19:35:12Z</dc:date>
    </item>
    <item>
      <title>Re: Debugger Scripting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugger-scripting/m-p/12764244#M2022686</link>
      <description>&lt;P&gt;I don't understand what you mean with?&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;Don't post an answer just to change your original question&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I have never have tried to change the original question. The syntax error doesn't change &lt;/P&gt;&lt;P&gt;the fact that it is not possible to trace the internal variables same as the globals. You can simply &lt;/P&gt;&lt;P&gt;test by your own to see that Write a sniplet and test above script. &lt;/P&gt;&lt;P&gt;When you perform the script by using the type &lt;STRONG&gt;tpda_scr_globals_it&lt;/STRONG&gt; intead using &lt;STRONG&gt;tpda_scr_locals_it&lt;/STRONG&gt; &lt;/P&gt;&lt;P&gt;you will notice it is working. &lt;STRONG&gt;But not by using tpda_scr_locals_it&lt;/STRONG&gt;. This is still the original question. &lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 07:56:07 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/debugger-scripting/m-p/12764244#M2022686</guid>
      <dc:creator>airwave</dc:creator>
      <dc:date>2023-10-30T07:56:07Z</dc:date>
    </item>
    <item>
      <title>Re: Debugger Scripting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugger-scripting/m-p/12764245#M2022687</link>
      <description>&lt;P&gt;Please use the COMMENT button for comments, asking for complements, adding details, replying to a comment or a proposed solution or to the OP question, etc., ANSWER is only to propose a solution, dixit SAP text at the right of the answer area. &lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 08:25:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/debugger-scripting/m-p/12764245#M2022687</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-10-30T08:25:16Z</dc:date>
    </item>
    <item>
      <title>Re: Debugger Scripting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugger-scripting/m-p/12764246#M2022688</link>
      <description>&lt;P&gt;First please explain what exactly means "it is not working"?&lt;/P&gt;&lt;P&gt;(I ran the script, I don't know what your question is)&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2023 08:42:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/debugger-scripting/m-p/12764246#M2022688</guid>
      <dc:creator>Sandra_Rossi</dc:creator>
      <dc:date>2023-10-30T08:42:18Z</dc:date>
    </item>
    <item>
      <title>Re: Debugger Scripting</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/debugger-scripting/m-p/12764247#M2022689</link>
      <description>&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2225762-sd1.jpg" /&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="migrated-image" src="https://community.sap.com/legacyfs/online/storage/attachments/storage/7/attachments/2225763-sd2.jpg" /&gt;&lt;/P&gt;&lt;P&gt;Hi Sandra,&lt;/P&gt;&lt;P&gt;you can trace global/local variables from any program by this way while Debugging with this script.&lt;/P&gt;&lt;P&gt;You can test this with below script. &lt;/P&gt;&lt;P&gt;You need simply to load this script as local file and execute directly. This generates an entry where you can later see in transaction SAS.&lt;/P&gt;&lt;P&gt;The issue is when you are using above script where I am tracing the local variables of a program&lt;/P&gt;&lt;P&gt;by using of class tpda_scr_&lt;STRONG&gt;locals&lt;/STRONG&gt;_it then it fails&lt;/P&gt;&lt;P&gt;and end up with the message &lt;STRONG&gt;"syntax error"&lt;/STRONG&gt; and no more detailed error message.&lt;/P&gt;&lt;P&gt;But in below script I am refering to class tpda_scr_&lt;STRONG&gt;globals&lt;/STRONG&gt;_it&lt;STRONG&gt;.&lt;/STRONG&gt; This works fine.&lt;/P&gt;&lt;P&gt;tpda_scr_&lt;STRONG&gt;globals&lt;/STRONG&gt;_it   =&amp;gt; works fine&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;tpda_scr_&lt;B&gt;locals&lt;/B&gt;_it   =&amp;gt; fails&lt;BR /&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;*&amp;lt;SCRIPT:PERSISTENT&amp;gt;
REPORT  rstpda_script_template.

*&amp;lt;SCRIPT:HEADER&amp;gt;
*&amp;lt;SCRIPTNAME&amp;gt;RSTPDA_SCRIPT_DUMMY&amp;lt;/SCRIPTNAME&amp;gt;
*&amp;lt;FILE_NAME&amp;gt;test.TXT&amp;lt;/FILE_NAME&amp;gt;
*&amp;lt;SCRIPT_CLASS&amp;gt;LCL_DEBUGGER_SCRIPT&amp;lt;/SCRIPT_CLASS&amp;gt;
*&amp;lt;SINGLE_RUN&amp;gt;X&amp;lt;/SINGLE_RUN&amp;gt;

*&amp;lt;/SCRIPT:HEADER&amp;gt;

*&amp;lt;SCRIPT:PRESETTINGS&amp;gt;

*&amp;lt;/SCRIPT:PRESETTINGS&amp;gt;

*&amp;lt;SCRIPT:SCRIPT_CLASS&amp;gt;
*---------------------------------------------------------------------*
*       CLASS lcl_debugger_script DEFINITION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_debugger_script DEFINITION INHERITING FROM  cl_tpda_script_class_super  .

  PUBLIC SECTION.
    METHODS: prologue  REDEFINITION,
      init    REDEFINITION,
      script  REDEFINITION,
      end     REDEFINITION.

ENDCLASS.                    "lcl_debugger_script DEFINITION
*---------------------------------------------------------------------*
*       CLASS lcl_debugger_script IMPLEMENTATION
*---------------------------------------------------------------------*
*
*---------------------------------------------------------------------*
CLASS lcl_debugger_script IMPLEMENTATION.
  METHOD prologue.
*** generate abap_source (source handler for ABAP)
    super-&amp;gt;prologue( ).
  ENDMETHOD.                    "prolog

  METHOD init.
*** insert your initialization code here
  ENDMETHOD.                    "init
  METHOD script.

    DATA:
    lt_globals TYPE tpda_scr_globals_it,&lt;BR /&gt;    ls_globals like line of lt_globals,&lt;BR /&gt;    lv_value  type tpda_var_value,
    trace_entry type tpda_trace_custom.

    CALL METHOD trace-&amp;gt;add_src_info.

    CALL METHOD cl_tpda_script_data_descr=&amp;gt;globals(
      RECEIVING
        p_globals_it = lt_globals ).&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;
    LOOP AT lt_globals INTO ls_globals.&lt;BR /&gt;
      TRY.
          CALL METHOD cl_tpda_script_data_descr=&amp;gt;get_simple_value
            EXPORTING
              p_var_name  = ls_globals-name&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;            RECEIVING
              p_var_value = lv_value.
        CATCH cx_tpda_varname .
        CATCH cx_tpda_script_no_simple_type .
      ENDTRY.

      trace_entry-value = 'Wert der Variablen' &amp;amp;&amp;amp; space &amp;amp;&amp;amp; ls_globals-name &amp;amp;&amp;amp; '=' &amp;amp;&amp;amp; lv_value.&lt;/CODE&gt;&lt;/PRE&gt;&lt;PRE&gt;&lt;CODE&gt;
      CALL METHOD trace-&amp;gt;add_custom_info
        EXPORTING
          p_trace_entry = trace_entry.
    ENDLOOP.
  ENDMETHOD.                    "script
  METHOD end.

  ENDMETHOD.                    "end
ENDCLASS.                    "lcl_debugger_script IMPLEMENTATION
*&amp;lt;/SCRIPT:SCRIPT_CLASS&amp;gt;

*&amp;lt;/SCRIPT:PERSISTENT&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Oct 2023 10:00:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/debugger-scripting/m-p/12764247#M2022689</guid>
      <dc:creator>airwave</dc:creator>
      <dc:date>2023-10-30T10:00:39Z</dc:date>
    </item>
  </channel>
</rss>

