<?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: Supplying Export parameters as Import parameters to a Remote Enabled Function Module in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/supplying-export-parameters-as-import-parameters-to-a-remote-enabled/m-p/14086205#M2041711</link>
    <description>&lt;P&gt;Usually, you don't need to deal with low level things like RfcCreateStructure() yourself, this is done automatically for you, when you create the "Function".&lt;/P&gt;&lt;P&gt;But I think, I now understand what's going wrong here: ABAP is &lt;EM&gt;&lt;STRONG&gt;case-insensitive&lt;/STRONG&gt;&lt;/EM&gt;, while programming languages like Python and C are &lt;EM&gt;&lt;STRONG&gt;case-sensitive&lt;/STRONG&gt;&lt;/EM&gt;. Therefore, specifying the RFM parameters in lower-case works in your ABAP report, but when you try the same in your Python client code, it doesn't recognize the function module parameter name ("&lt;SPAN&gt;RFC_INVALID_PARAMETER&lt;/SPAN&gt;").&lt;/P&gt;&lt;P&gt;If this is the problem here, then changing your Python code sample to upper-case should fix it:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;params = {
            'IT_CODE': val1,
            'IV_REPORT_NAME': val2,
            'IV_DEVCLASS': val3
        }&lt;/LI-CODE&gt;&lt;P&gt;(Try it first with plain CHAR-type parameters. -- Structures will then be the next step, once this works...)&lt;/P&gt;</description>
    <pubDate>Fri, 25 Apr 2025 08:53:45 GMT</pubDate>
    <dc:creator>Ulrich_Schmidt1</dc:creator>
    <dc:date>2025-04-25T08:53:45Z</dc:date>
    <item>
      <title>Supplying Export parameters as Import parameters to a Remote Enabled Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/supplying-export-parameters-as-import-parameters-to-a-remote-enabled/m-p/14077986#M2041629</link>
      <description>&lt;P&gt;Dear community,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to figure out a way to call a function module remotely with a client program (either with .NET RFC connector or with PyRFC). For now both do not work for me as I am unable to find the correct solution to my requirement.&lt;BR /&gt;&lt;BR /&gt;Below is my issue : I need to call a remote enabled function module, let's say /MYFM.&amp;nbsp;&lt;BR /&gt;When calling it from ABAP for example the program looks like follow :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;DATA : lt_param1        TYPE xstring,
       lv_param2 TYPE  xstring,
       lv_devclass    TYPE  xstring.


lt_param1 = 'test'.
lv_param2 = 'test'.
lv_param3 = 'test'. 

CALL FUNCTION '/MYFM'
  EXPORTING
    lt_param1        = lt_param1
    lv_param2 = lv_param2
    lv_param2    =  lv_param3 .

  WRITE: / 'Function module called successfully.' .&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;However if I try for example to call it remotely (FM is remotely enabled so that is not the issue) I get the error lt_param1 not found&amp;nbsp;(RFC error: 20 (rc=20): key=RFC_INVALID_PARAMETER).&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The import parameters of my RFM are it_param1, iv_param2 and iv_param3.&lt;BR /&gt;Below is how the FM is called for example using PyRFC&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;val1 = 'test'
val2 = 'test'
val3 = 'test'

params = {
            'it_param1': val1,
            'iv_param2': va2,
            'iv_param3"': val3
        }

result = connection.call('/MYRFM', **params)&lt;/LI-CODE&gt;&lt;P&gt;Can you please advise ?&amp;nbsp;&lt;BR /&gt;Many thanks in advance.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Apr 2025 16:39:27 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/supplying-export-parameters-as-import-parameters-to-a-remote-enabled/m-p/14077986#M2041629</guid>
      <dc:creator>Waelf</dc:creator>
      <dc:date>2025-04-16T16:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: Supplying Export parameters as Import parameters to a Remote Enabled Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/supplying-export-parameters-as-import-parameters-to-a-remote-enabled/m-p/14079833#M2041648</link>
      <description>&lt;P&gt;I can see two problems here:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Your ABAP test code does not make an RFC call, but a "local" call. If you want a real test, add DESTINATION 'NONE' and the usual SYSTEM_FAILURE &amp;amp; COMMUNICATION_FAILURE exceptions to your CALL FUNCTION statement, then you are performing a real RFC call including the serialization &amp;amp; deserialization of the FM parameters (where the error seems to happen).&lt;/LI&gt;&lt;LI&gt;In your ABAP test code, you call the importing parameter &lt;STRONG&gt;lt&lt;/STRONG&gt;_param1, but in Python you call it &lt;STRONG&gt;it&lt;/STRONG&gt;_param1?! One of them must be wrong...&lt;/LI&gt;&lt;/OL&gt;</description>
      <pubDate>Fri, 18 Apr 2025 10:07:04 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/supplying-export-parameters-as-import-parameters-to-a-remote-enabled/m-p/14079833#M2041648</guid>
      <dc:creator>Ulrich_Schmidt1</dc:creator>
      <dc:date>2025-04-18T10:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Supplying Export parameters as Import parameters to a Remote Enabled Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/supplying-export-parameters-as-import-parameters-to-a-remote-enabled/m-p/14079895#M2041649</link>
      <description>&lt;P&gt;Hello Ulrich,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for getting back. Yes my bad it is indeed a typo from my part. The correct import parameter defined in the RFM is &lt;STRONG&gt;it&lt;/STRONG&gt;_param1.&amp;nbsp;&lt;BR /&gt;So I implemented your changes to make a real RFC call and it still works correctly.&amp;nbsp;&lt;BR /&gt;Below is the code I tested for the ABAP report. For the python call I tried both a synchronous and transactional RFC and still getting the same error (I don't know if that makes any difference but I was out of solutions so I tried it anyway).&amp;nbsp;&lt;BR /&gt;Below is the exact RFM I am trying to call (populated data is irrelevant in this case only serving to chedk if the parameters are recognized or not).&lt;BR /&gt;&lt;BR /&gt;For my client script as it is based on the RFCSDK are there specific modifications I should make in my code to correctly perform the call ? I can switch to a C based client script to use directly the RFCSDK and its proposed features.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="abap"&gt;REPORT ZTEST.
DATA : lt_code        TYPE /sloap/t_char72, "#EC NEEDED
       lv_report_name TYPE  progname,
       lv_devclass    TYPE  devclass,
       lv_line        TYPE  CHAR72,
       lv_line1       TYPE  CHAR72.


lv_report_name = 'zwa'.
lv_devclass = 'zwa'.

lv_line = 'FUNCTION test test'.
APPEND lv_line TO lt_code.

*lv_line = 'REPORT'.
*APPEND lv_line TO lt_code.
*
*lv_line = 'test test'.
*APPEND lv_line TO lt_code.


CALL FUNCTION '/SLOAP/GEN_MODULE_REPORT' DESTINATION 'NONE'
  EXPORTING
    it_code        = lt_code
    iv_report_name = lv_report_name
    iv_devclass    =  lv_devclass
  EXCEPTIONS
      SYSTEM_FAILURE = 1
      COMMUNICATION_FAILURE = 2
      OTHERS = 3.

  WRITE: / 'Function module called successfully.' .&lt;/LI-CODE&gt;&lt;P&gt;From what I read in your article&amp;nbsp;&lt;A href="https://assets.cdn.sap.com/sapcom/docs/2016/09/faa21fe1-8a7c-0010-82c7-eda71af511fa.pdf" target="_self"&gt;RFC Client Programming&lt;/A&gt;&amp;nbsp;I understand that when using the function &lt;STRONG&gt;RfcCreateFunction()&lt;/STRONG&gt; the RFC data container I am sending to the remote backend is filled based on the function metadata returned with &lt;STRONG&gt;RfcGetFunctionDesc()&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Therefore I understand that if I invoke the function&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;RfcCreateStructure()&lt;/STRONG&gt;&lt;/EM&gt;&amp;nbsp; I can then supply the metadata definition for my RFC function, which may explain why I have the issue as the metadata returned from the &lt;STRONG&gt;RfcGetFunctionDesc()&lt;/STRONG&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;is empty ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks in advance !&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 18 Apr 2025 11:45:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/supplying-export-parameters-as-import-parameters-to-a-remote-enabled/m-p/14079895#M2041649</guid>
      <dc:creator>Waelf</dc:creator>
      <dc:date>2025-04-18T11:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Supplying Export parameters as Import parameters to a Remote Enabled Function Module</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/supplying-export-parameters-as-import-parameters-to-a-remote-enabled/m-p/14086205#M2041711</link>
      <description>&lt;P&gt;Usually, you don't need to deal with low level things like RfcCreateStructure() yourself, this is done automatically for you, when you create the "Function".&lt;/P&gt;&lt;P&gt;But I think, I now understand what's going wrong here: ABAP is &lt;EM&gt;&lt;STRONG&gt;case-insensitive&lt;/STRONG&gt;&lt;/EM&gt;, while programming languages like Python and C are &lt;EM&gt;&lt;STRONG&gt;case-sensitive&lt;/STRONG&gt;&lt;/EM&gt;. Therefore, specifying the RFM parameters in lower-case works in your ABAP report, but when you try the same in your Python client code, it doesn't recognize the function module parameter name ("&lt;SPAN&gt;RFC_INVALID_PARAMETER&lt;/SPAN&gt;").&lt;/P&gt;&lt;P&gt;If this is the problem here, then changing your Python code sample to upper-case should fix it:&lt;/P&gt;&lt;LI-CODE lang="python"&gt;params = {
            'IT_CODE': val1,
            'IV_REPORT_NAME': val2,
            'IV_DEVCLASS': val3
        }&lt;/LI-CODE&gt;&lt;P&gt;(Try it first with plain CHAR-type parameters. -- Structures will then be the next step, once this works...)&lt;/P&gt;</description>
      <pubDate>Fri, 25 Apr 2025 08:53:45 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/supplying-export-parameters-as-import-parameters-to-a-remote-enabled/m-p/14086205#M2041711</guid>
      <dc:creator>Ulrich_Schmidt1</dc:creator>
      <dc:date>2025-04-25T08:53:45Z</dc:date>
    </item>
  </channel>
</rss>

