<?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>Question Re: SAPUI5 Function import usage in Technology Q&amp;A</title>
    <link>https://community.sap.com/t5/technology-q-a/sapui5-function-import-usage/qaa-p/11948580#M4491050</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i used the callFuntion like this :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;var calledFunction = oModel.callFunction("/MyImportFunction",{
  method : 'GET',
  urlParameters : {
    param1: value1,
    param2: value2
  },
  success : function(oData, response){
    ...
  },
  error : function(){
    ...
  }
});&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Note: if the function does not exist, the promise (calledFunction.contextCreated) is rejected so we do not go in the 'success' or 'error' callback from 'callFunction. That is why i add this code after the call:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;calledFunction.contextCreated().catch(function(error){
    ...
});&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;doc: &lt;A href="https://sapui5.hana.ondemand.com/#/topic/6c47b2b39db9404582994070ec3d57a2.html#loio6cb8d585ed594ee4b447b5b560f292a4" target="test_blank"&gt;https://sapui5.hana.ondemand.com/#/topic/6c47b2b39db9404582994070ec3d57a2.html#loio6cb8d585ed594ee4b447b5b560f292a4&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;i hope it will help you&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Fabrice&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jun 2019 12:08:51 GMT</pubDate>
    <dc:creator>Fabrice</dc:creator>
    <dc:date>2019-06-05T12:08:51Z</dc:date>
    <item>
      <title>SAPUI5 Function import usage</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-function-import-usage/qaq-p/11948579</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;My colleague has implemented Function Import which downloads data from a public repository and it works exactly how it should when called in browser&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;SERVER_NAME/GetProductInfoFromWebservice?N='9206'&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;returns correct data in XML, for example, product name, but when I'm trying to utilize it in SAPUI5 application&lt;/P&gt;
  &lt;PRE&gt;&lt;CODE&gt;this._oODataModel.callFunction("/GetProductInfoFromWebservice",&lt;BR /&gt;    "GET",  {&lt;BR /&gt;        "N": "9206" &lt;BR /&gt;    },&lt;BR /&gt;    null,&lt;BR /&gt;    function(oData, oResponse) {&lt;BR /&gt;        console.debug(oData);&lt;BR /&gt;        console.debug(oResponse);&lt;BR /&gt;    },&lt;BR /&gt;    function(oError) {&lt;BR /&gt;        console.debug(oError);&lt;BR /&gt;    }&lt;BR /&gt;);&lt;/CODE&gt;&lt;/PRE&gt;
  &lt;P&gt;it doesn't do a thing. Nothing shows up on the console.&lt;BR /&gt;When I've tried to use read instead of callFunction returned object had only empty fields.&lt;/P&gt;
  &lt;P&gt;How do I correctly utilize Function Import in cases like this?&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2019 12:01:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-function-import-usage/qaq-p/11948579</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-06-05T12:01:44Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Function import usage</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-function-import-usage/qaa-p/11948580#M4491050</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i used the callFuntion like this :&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;var calledFunction = oModel.callFunction("/MyImportFunction",{
  method : 'GET',
  urlParameters : {
    param1: value1,
    param2: value2
  },
  success : function(oData, response){
    ...
  },
  error : function(){
    ...
  }
});&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Note: if the function does not exist, the promise (calledFunction.contextCreated) is rejected so we do not go in the 'success' or 'error' callback from 'callFunction. That is why i add this code after the call:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;calledFunction.contextCreated().catch(function(error){
    ...
});&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;doc: &lt;A href="https://sapui5.hana.ondemand.com/#/topic/6c47b2b39db9404582994070ec3d57a2.html#loio6cb8d585ed594ee4b447b5b560f292a4" target="test_blank"&gt;https://sapui5.hana.ondemand.com/#/topic/6c47b2b39db9404582994070ec3d57a2.html#loio6cb8d585ed594ee4b447b5b560f292a4&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;i hope it will help you&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Fabrice&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2019 12:08:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-function-import-usage/qaa-p/11948580#M4491050</guid>
      <dc:creator>Fabrice</dc:creator>
      <dc:date>2019-06-05T12:08:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAPUI5 Function import usage</title>
      <link>https://community.sap.com/t5/technology-q-a/sapui5-function-import-usage/qaa-p/11948581#M4491051</link>
      <description>&lt;P&gt;The problem lied in not writing method, urlParameters, and parenthesis placement.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2019 13:57:10 GMT</pubDate>
      <guid>https://community.sap.com/t5/technology-q-a/sapui5-function-import-usage/qaa-p/11948581#M4491051</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2019-06-05T13:57:10Z</dc:date>
    </item>
  </channel>
</rss>

