1

I'm trying to automatize process using Logic Apps -> On-premises data gateway -> SAP system. I think I have a problem with metadata or cache.

Scenario: I stopped developing solution on Wednesday about 23 (it didn't work), I didn't change anything inside and started to work on Thursday (today) about 12. I had to remind myself what kind of bug it was so i ran this logic app and suddenly it worked fine. I've been using element [RFC] Call function in SAP in Logic Apps with input RFC parameters:

<ZFM_MGR_RFC xmlns="http://Microsoft.LobServices.Sap/2007/03/Rfc/">
      <INVOICE_ID>@{outputs('Invoice')['InvoiceId']}</INVOICE_ID>
</ZFM_MGR_RFC> 

ABAP FM:

  IMPORTING
    VALUE(INVOICE_DATE) TYPE STRING OPTIONAL

  DATA: ls_test TYPE zasd_test.
  ls_test-mandt = sy-mandt.
  ls_test-dates = sy-datum.
  ls_test-time  = sy-timlo.

  INSERT zasd_test FROM ls_test. 

So... I decided to enhance my FM in ABAP with another importing parameters. I added for example CUSTOMER_NAME parameter (string) and input parameter in Logic Apps. Suddenly I have an error - there's my [RFC] Call function in SAP response:

{
    "statusCode": 400,
    "headers": {
        "x-ms-request-id": "7c4b6579-956d-4816-b988-73ad72d2962e",
        "Strict-Transport-Security": "max-age=31536000; includeSubDomains",
        "X-Content-Type-Options": "nosniff",
        "X-Frame-Options": "DENY",
        "Cache-Control": "no-store",
        "Set-Cookie": "ARRAffinity=db497ba0020393419ac466ef860f11922d2080b57a6df974e13c227f651e3274;Path=/;HttpOnly;Secure;Domain=sap-gwc.azconn-gwc.p.azurewebsites.net,ARRAffinitySameSite=db497ba0020393419ac466ef860f11922d2080b57a6df974e13c227f651e3274;Path=/;HttpOnly;SameSite=None;Secure;Domain=sap-gwc.azconn-gwc.p.azurewebsites.net",
        "x-ms-connection-gateway-object-id": "7ebb3fec-1964-41ff-b45b-b97e71c65616",
        "Timing-Allow-Origin": "*",
        "x-ms-apihub-cached-response": "true",
        "Date": "Thu, 15 Jul 2021 21:37:41 GMT",
        "Content-Length": "202",
        "Content-Type": "application/json"
    },
    "body": {
        "error": {
            "code": "GeneralBadRequest",
            "message": "Failed to process request. Error details: 'Parameter: 'CUSTOMER_NAME' not found in the function metadata.'.",
            "target": ""
        }
    }
}

It looks like Logic Apps/On-premise gateway has metadata of function module saved somewhere and refresh it not very often. How can I change it?

Thanks in advance.

Sandra Rossi
  • 11,934
  • 5
  • 22
  • 48
TyRRRax
  • 55
  • 11
  • 1
    I guess Azure Logic Apps connect to SAP systems via standard SAP connector API (for instance SAP .Net Connector) which keep metadata of function interfaces. Maybe Azure Logic Apps has an option to restart it? Maybe restarting the SAP system will make the SAP connector reload the metadata? Otherwise, I know that if you copy your function module to a new one, calling this clone will work. – Sandra Rossi Jul 16 '21 at 06:04
  • 1
    @SandraRossi On-premises data gateway is based on .NET Connector (NCo 3.0). Today I have the same situation. Over night it has started to work fine. – TyRRRax Jul 16 '21 at 07:50
  • Great to know, thanks! Maybe you can post it as an answer? – Sandra Rossi Jul 16 '21 at 07:53
  • 1
    @SandraRossi not yet, I'll try to find out a better solution without copying FM. Later I will post it as an answer – TyRRRax Jul 16 '21 at 08:37

1 Answers1

0

I found a solution. Inside On-premises data gateway in settings overlap there is "Restart right now" button. Everytime you change something inside configuration/source code of program you have to click this button.

Warning: restarting computer doesn't give the same result. You have to restart gateway manually.

PS If you don't use On-Premise SAP Gateway you can temporarily test your solution with copying one FM to another and running the 2nd one.

TyRRRax
  • 55
  • 11