Issue while connecting with SAP BAPI/RFC from Azure Logic App

Jeevi Danda 71 Reputation points
2022-12-07T02:24:36.107+00:00

Hi,

I am using logic app to call RFC function in SAP. But the RFC function contains slash(/) in the name as shown in the image below. In the input request parameters body, when I pass the RFC name with slash, it's not accepting and throwing 400 bad request. It is converting all the slashes into an Unicode value 'x002F' like below.

Error Message: 'Element 'x002F*_x002F_BAPI_***_*****' with namespace name '' was not found. Line 1, position 2.'. Ensure that your message xml validates against the operation schema."

Please let me know how I can make this work.

Thanks,
Jeevi

267958-image.png

SAP HANA on Azure Large Instances
SAP HANA on Azure Large Instances
Microsoft branding terminology for an Azure offer to run HANA instances on SAP HANA hardware deployed in Large Instance stamps in different Azure regions.
119 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,840 questions
{count} votes

1 answer

Sort by: Most helpful
  1. David Burg - MSFT 11 Reputation points
    2022-12-13T18:05:54.64+00:00

    The forward-slash character / is reserved in XML for element names. As it is used in SAP for namespace prefixes, it needs to be escaped when used as element name. Your test payload is not a valid XML element name at the moment as it is not escaped.

    Here is a dummy XML payload example for RFC named /BDL/ACTIVATE_SDCCN. The root local node name becomes _x002F_BDL_x002F_ACTIVATE_SDCCN. (This example uses explicit ns2 but you can just define the default namespace for root as well and not deal with the namespace prefix).

    <?xml version="1.0" encoding="UTF-8"?>  
    <ns2:_x002F_BDL_x002F_ACTIVATE_SDCCN xmlns:ns2="http://Microsoft.LobServices.Sap/2007/03/Rfc/" xmlns:ns3="http://Microsoft.LobServices.Sap/2007/03/Types/Rfc/" >  
      <ns2:IF_SOLMAN>X</ns2:IF_SOLMAN>  
      <ns2:IS_MASTER_RFC>  
        <ns3:DESTINATION>ns3:DESTINATION</ns3:DESTINATION>  
        <ns3:INSTALL_NO>00000001</ns3:INSTALL_NO>  
        <ns3:SID>ns3:SID</ns3:SID>  
        <ns3:DESCR>ns3:DESCR</ns3:DESCR>  
        <ns3:MASTER>X</ns3:MASTER>  
        <ns3:TO_SAP>X</ns3:TO_SAP>  
        <ns3:USERNAME>ns3:USERNAME</ns3:USERNAME>  
        <ns3:ACTIVE>X</ns3:ACTIVE>  
        <ns3:TIMESTAMP>ns3:TIMESTAMP</ns3:TIMESTAMP>  
      </ns2:IS_MASTER_RFC>  
      <ns2:ET_MSG>  
        <ns3:BAPIRET2>  
          <ns3:TYPE>S</ns3:TYPE>  
          <ns3:ID>ns3:ID</ns3:ID>  
          <ns3:NUMBER>000</ns3:NUMBER>  
          <ns3:MESSAGE>ns3:MESSAGE</ns3:MESSAGE>  
          <ns3:LOG_NO>ns3:LOG_NO</ns3:LOG_NO>  
          <ns3:LOG_MSG_NO>000001</ns3:LOG_MSG_NO>  
          <ns3:MESSAGE_V1>ns3:MESSAGE_V1</ns3:MESSAGE_V1>  
          <ns3:MESSAGE_V2>ns3:MESSAGE_V2</ns3:MESSAGE_V2>  
          <ns3:MESSAGE_V3>ns3:MESSAGE_V3</ns3:MESSAGE_V3>  
          <ns3:MESSAGE_V4>ns3:MESSAGE_V4</ns3:MESSAGE_V4>  
          <ns3:PARAMETER>ns3:PARAMETER</ns3:PARAMETER>  
          <ns3:ROW>0</ns3:ROW>  
          <ns3:FIELD>ns3:FIELD</ns3:FIELD>  
          <ns3:SYSTEM>ns3:SYSTEM</ns3:SYSTEM>  
        </ns3:BAPIRET2>  
      </ns2:ET_MSG>  
    </ns2:_x002F_BDL_x002F_ACTIVATE_SDCCN>  
    
    2 people found this answer helpful.