cancel
Showing results for 
Search instead for 
Did you mean: 

Call B1 function Parameter error

Former Member
0 Kudos

Hi all,

I am working on exchange rate import from SAP Business One Integration blog by Pierre Canali  exchange rate is collected from a

url  :  http://www.ecb.europa.eu/stats/eurofxref/eurofxref-daily.xml .   I face a problem starts at for -each loop. I get a error " parameters doesn't match existing methods "

The processing flow

Now i added the atom 7 which consists of following  xsl for-each loop that calls SBObob function to insert/update exchange rates

  1. <xsl:template xmlns:gesmes="http://www.gesmes.org/xml/2002-08-01" xmlns="http://www.ecb.int/vocabulary/2002-08-01/eurofxref" name="transform"> 
  2.    <xsl:for-each select="/vpf:Msg/vpf:Body/vpf:Payload[./@id=&apos;atom2&apos;]//*[./@rate]"> 
  3.       <xsl:variable name="currency"><xsl:value-of select="./@currency" /></xsl:variable> 
  4.       <xsl:if test="/vpf:Msg/vpf:Body/vpf:Payload[./@id=&apos;atom8_2&apos;]/jdbc:ResultSet/jdbc:Row[jdbc:CurrCode = $currency]"> 
  5.          <ExchangeRate xmlns=""> 
  6.             <xsl:attribute name="date"> 
  7.                <xsl:call-template name="b1ilib.strgReplace"> 
  8.                   <xsl:with-param name="subs" select="&apos;.&apos;"></xsl:with-param> 
  9.                   <xsl:with-param name="var" select="&apos;-&apos;"></xsl:with-param> 
  10.                   <xsl:with-param name="wstrg" select="../@time"></xsl:with-param> 
  11.                </xsl:call-template> 
  12.             </xsl:attribute> 
  13.             <xsl:attribute name="currency"> 
  14.                <xsl:value-of select="./@currency"></xsl:value-of> 
  15.             </xsl:attribute> 
  16.             <xsl:attribute name="rate"> 
  17.                <xsl:choose> 
  18.                   <xsl:when test="/vpf:Msg/vpf:Body/vpf:Payload[./@id=&apos;atom8_1&apos;]/jdbc:ResultSet/jdbc:DirectRate = &apos;Y&apos;"> 
  19.                      <xsl:value-of select="./@rate"></xsl:value-of> 
  20.                   </xsl:when> 
  21.                   <xsl:otherwise> 
  22.                      <xsl:value-of select="1 div ./@rate"></xsl:value-of> 
  23.                   </xsl:otherwise> 
  24.                </xsl:choose> 
  25.             </xsl:attribute> 
  26.          </ExchangeRate> 
  27.       </xsl:if> 
  28.    </xsl:for-each> 
  29. </xsl:template> 

Regards:

Navin

Accepted Solutions (1)

Accepted Solutions (1)

pierrecanali
Active Participant
0 Kudos

Hi Navin,

if you are using newer version of b1if you cannot use entities inside function call.

Try with this:

concat(/ExchangeRate/@currency,',', /ExchangeRate/@date,',', /ExchangeRate/@rate, ',','true')


Let me know if it worked.


Regards


Pierre

Former Member
0 Kudos

Hi Pierre,

I have changed the parameter as you had mentioned but still i get a error message while debug

The method's parameters trying to call mismatch the existing method's.

At B1 call function atom it displays


<Message_Is_Not_Wellformed/>


I need a clarification in the Atom 7 you had defined xsl template with a URL, while i am running that url in browser it show error page.


http://www.gesmes.org/xml/2002-08-01

http://www.ecb.int/vocabulary/2002-08-01/eurofxref





Regards:

Navin


pierrecanali
Active Participant
0 Kudos

Hello Navin,

I had a try with the scenario and it is actually working in my environment.

Please pay attention at:

  1. atom identifiers, you may have different atoms id than mine, depending on how/when you add atoms during design. As a suggestion open the incoming xml by clicking the Red Arrow during Debug and pay attention at your atoms id.
  2. http://www.gesmes.org/xml/2002-08-01 and http://www.ecb.int/vocabulary/2002-08-01/eurofxref are namespaces !!!
  3. I had to add :

<xsl:include href="../../com.sap.b1i.system.lib/xsl/string.xsl" />

          in my for-each predecessor transform (actually atom6) because it's calling the template b1ilib.strgReplace

Regards

Pierre

Former Member
0 Kudos

Hi Pierrie,

Surely i will workout and inform you.

Regards;

Navin

Former Member
0 Kudos

Hi ,

Sorry for late reply. I have tried with changing parameter but the error is about parameter

I tired both paramter as per your instruction but failed.

concat(/ExchangeRate/@currency,',', /ExchangeRate/@date,',', /ExchangeRate/@rate, ',','true')



concat(/ExchangeRate/@currency, &quot;,&quot;, /ExchangeRate/@date, &quot;,&quot;, /ExchangeRate/@rate, &quot;,true&quot;)



Regards:

Navin


pierrecanali
Active Participant
0 Kudos

Hi Navin,

I've poor information to help you.

  1. Disable the atom that calls B1Function, and run a test.
  2. Post here the message you got at atom0 (red arrow in debug).

So we can see what happen...

Regards

Pierre

Former Member
0 Kudos

Hi Pierre,

Thanks for response

I removed the B1 Function i get the below message at atom 0

After Xsl transform for Exchange Root Node i get below output message:

Regards:

Navin

Former Member
0 Kudos

Hi Pierrie,

I had tried running the XSL transform , i tired without using the call template output message available for next atom ,but when i include this call template .

<xsl:attribute name="date">

              

<xsl:call-template name="b1ilib.strgReplace">

        

<xsl:with-param name="subs" select="&apos;.&apos;"></xsl:with-param>

  <xsl:with-param name="var" select="&apos;-&apos;"></xsl:with-param>

  <xsl:with-param name="wstrg" select="../@time"></xsl:with-param>

</xsl:call-template>

            

</xsl:attribute>

following error message accurs

com.sap.b1i.utilities.UtilException: UTE001 Nested exception: com.sap.engine.lib.xml.util.NestedException: Transformer: Could not find specified template in xsl:call-template 'b1ilib.strgReplace'.

Still i hadnt included the B1 function in the process.

Regards:

Navin

jan_polak
Participant
0 Kudos

Hi Pierre,

nice example, thanks.

In my environment I must modify example this way:

Atom11:

For-each atom:

B1Function atom must be just before for-each atom, atoms 10 and 9 I must deactivate:

Jan

Former Member
0 Kudos

Hi Pierre,

Thanks for the guidance, error resolved.

Regards:

Navin

Former Member
0 Kudos

Hello Pierre,

in your post from

pierrecanali
Active Participant
0 Kudos

Hi Thomas,

you are right atom was atom7.

Anyway nothing to be confused! You must use the xsl:include in the same atom you call the tempate b1ilib.strgReplace.

See your local documentation for useful examples.

Regards,

Pierre

Former Member
0 Kudos

Got it. Thanks!

It simply needed to be a child of the stylesheet.

Now the scenario works.

Thanks for help & the usefull blog.

Regards,

Thomas

Answers (0)