<?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 How to log input parameters for Function Modules? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-log-input-parameters-for-function-modules/m-p/3303384#M791024</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to create a Logging system to trace input parameters for function modules.&lt;/P&gt;&lt;P&gt;The log functionality could be done by developing a class method or a function module (For example 'write_log'), and calling it within each function module that I want to log. The 'write_log' code should be independent from the interface of the Function Module that I want to log.&lt;/P&gt;&lt;P&gt;For example, I'd like to write a function/class method that can log both these functions modules:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Function DummyA&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;   Input parameters: A1 type char10, A2 type char10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Function DummyB&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;   Input parameters: B1 type char20, B2 type char20, B3 type char20, B4 type Z_MYSTRUCTURE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the questions...&lt;/P&gt;&lt;P&gt;- Is there a "standard SAP" function that provide this functionality?&lt;/P&gt;&lt;P&gt;- If not, is there a system variable in which I can access runtime all parameters name, type and value for a particular function module? &lt;/P&gt;&lt;P&gt;- If not, how can I loop at Input parameters in a way that is independent from the function module interface?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for helping!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 Jan 2008 12:06:34 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-21T12:06:34Z</dc:date>
    <item>
      <title>How to log input parameters for Function Modules?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-log-input-parameters-for-function-modules/m-p/3303384#M791024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I need to create a Logging system to trace input parameters for function modules.&lt;/P&gt;&lt;P&gt;The log functionality could be done by developing a class method or a function module (For example 'write_log'), and calling it within each function module that I want to log. The 'write_log' code should be independent from the interface of the Function Module that I want to log.&lt;/P&gt;&lt;P&gt;For example, I'd like to write a function/class method that can log both these functions modules:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Function DummyA&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;   Input parameters: A1 type char10, A2 type char10.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Function DummyB&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;   Input parameters: B1 type char20, B2 type char20, B3 type char20, B4 type Z_MYSTRUCTURE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the questions...&lt;/P&gt;&lt;P&gt;- Is there a "standard SAP" function that provide this functionality?&lt;/P&gt;&lt;P&gt;- If not, is there a system variable in which I can access runtime all parameters name, type and value for a particular function module? &lt;/P&gt;&lt;P&gt;- If not, how can I loop at Input parameters in a way that is independent from the function module interface?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance for helping!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2008 12:06:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-log-input-parameters-for-function-modules/m-p/3303384#M791024</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-21T12:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to log input parameters for Function Modules?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-log-input-parameters-for-function-modules/m-p/3303385#M791025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you want to get this log in SLG1?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;vikas.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2008 12:18:32 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-log-input-parameters-for-function-modules/m-p/3303385#M791025</guid>
      <dc:creator>VikasB</dc:creator>
      <dc:date>2008-01-21T12:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to log input parameters for Function Modules?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-log-input-parameters-for-function-modules/m-p/3303386#M791026</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi tronci,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CONVERSION_EXIT_ALPHA_INPUT&lt;/P&gt;&lt;P&gt; converts any number into a string fill with zeroes, with the number at the extreme right&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;input  = 123 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;output = 0000000000000...000000000000123 &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;CONVERSION_EXIT_ALPHA_OUTPUT&lt;/P&gt;&lt;P&gt; converts any number with zeroes right into a simple integer&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;input   = 00000000000123 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;output  = 123 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try.....if it is helpfull please reward me some points&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2008 12:25:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-log-input-parameters-for-function-modules/m-p/3303386#M791026</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-21T12:25:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to log input parameters for Function Modules?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-log-input-parameters-for-function-modules/m-p/3303387#M791027</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;with the FM call the FM FUNCTION_IMPORT_INTERFACE to get the interface signature details of your function , and then using the parameter names, you can get the value from the rutime and log it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(i am sure there should be a better way - something like system variable giving these info, will look for it and if i find will update)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Raja&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2008 12:39:01 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-log-input-parameters-for-function-modules/m-p/3303387#M791027</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2008-01-21T12:39:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to log input parameters for Function Modules?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-log-input-parameters-for-function-modules/m-p/3303388#M791028</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Vikas,&lt;/P&gt;&lt;P&gt;cheers for replying.&lt;/P&gt;&lt;P&gt;Using the SLG1 function group is not essential.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2008 13:41:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-log-input-parameters-for-function-modules/m-p/3303388#M791028</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-21T13:41:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to log input parameters for Function Modules?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-log-input-parameters-for-function-modules/m-p/3303389#M791029</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Durairaj,&lt;/P&gt;&lt;P&gt;seems that FUNCTION_IMPORT_INTERFACE provides a way to solve the problem!&lt;/P&gt;&lt;P&gt;I'm going to try this function, and see if I can get all the information I need.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you very much&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2008 13:49:09 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-log-input-parameters-for-function-modules/m-p/3303389#M791029</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-21T13:49:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to log input parameters for Function Modules?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-log-input-parameters-for-function-modules/m-p/3303390#M791030</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Using FUNCTION_IMPORT_INTERFACE I'm able to retrieve all the parameters and their type.&lt;/P&gt;&lt;P&gt;Now how can I access the runtime environment to retrieve the value?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 Jan 2008 14:44:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-log-input-parameters-for-function-modules/m-p/3303390#M791030</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-21T14:44:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to log input parameters for Function Modules?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-log-input-parameters-for-function-modules/m-p/3303391#M791031</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;check this sample code. here i am capturing only parameters (import) values. you can extend this to capture tables, changin, etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
FUNCTION y_test_fm.
*"----------------------------------------------------------------------
*"*"Local Interface:
*"  IMPORTING
*"     REFERENCE(PARAM1) TYPE  CHAR10
*"     REFERENCE(PARAM2) TYPE  CHAR10
*"     REFERENCE(PARAM3) TYPE  CHAR10
*"----------------------------------------------------------------------
  DATA: ep TYPE STANDARD TABLE OF rsexp ,
        ip TYPE STANDARD TABLE OF rsimp ,
        tp TYPE STANDARD TABLE OF rstbl ,
        el TYPE STANDARD TABLE OF rsexc ,
        vals TYPE tihttpnvp ,
        wa_vals TYPE ihttpnvp ,
        wa_ip TYPE rsimp .
  FIELD-SYMBOLS: &amp;lt;temp&amp;gt; TYPE ANY .

  CALL FUNCTION 'FUNCTION_IMPORT_INTERFACE'
    EXPORTING
      funcname                 = 'Y_TEST_FM'
*   INACTIVE_VERSION         = ' '
*   WITH_ENHANCEMENTS        = 'X'
*   IGNORE_SWITCHES          = ' '
* IMPORTING
*   GLOBAL_FLAG              =
*   REMOTE_CALL              =
*   UPDATE_TASK              =
*   EXCEPTION_CLASSES        =
    TABLES
      exception_list           = el
      export_parameter         = ep
      import_parameter         = ip
*   CHANGING_PARAMETER       =
      tables_parameter         = tp
*   P_DOCU                   =
*   ENHA_EXP_PARAMETER       =
*   ENHA_IMP_PARAMETER       =
*   ENHA_CHA_PARAMETER       =
*   ENHA_TBL_PARAMETER       =
*   ENHA_DOCU                =
   EXCEPTIONS
     error_message            = 1
     function_not_found       = 2
     invalid_name             = 3
     OTHERS                   = 4
            .
  IF sy-subrc = 0.
    LOOP AT ip INTO wa_ip .
      MOVE: wa_ip-parameter TO wa_vals-name .
      ASSIGN (wa_vals-name) TO &amp;lt;temp&amp;gt; .
      IF &amp;lt;temp&amp;gt; IS ASSIGNED .
        wa_vals-value = &amp;lt;temp&amp;gt; .
      ENDIF .
      APPEND wa_vals TO vals .
    ENDLOOP .
  ENDIF.

ENDFUNCTION.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 07:14:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-log-input-parameters-for-function-modules/m-p/3303391#M791031</guid>
      <dc:creator>athavanraja</dc:creator>
      <dc:date>2008-01-22T07:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to log input parameters for Function Modules?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-log-input-parameters-for-function-modules/m-p/3303392#M791032</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Durairaj,&lt;/P&gt;&lt;P&gt;this is exactly what I was looking for, thank you for the help!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 Jan 2008 09:40:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-log-input-parameters-for-function-modules/m-p/3303392#M791032</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-22T09:40:25Z</dc:date>
    </item>
  </channel>
</rss>

