cancel
Showing results for 
Search instead for 
Did you mean: 

B1i 2.0 parameter in URL

Hi all,

Currently I'm trying to set up B1i 2.0 to accept an incomming url with a parameter and use this parameter to make an JDBC call.
I Already have several working scenarios based on XML, but one can't be XML.

As a test I created sap.GetCardCode. In this I have a xsl with the below code.
This test xsl is working and returning the cardname the way I need it.
The problem I have is I want the url to have something like ?cardcode=D19999 and to NOT send an XML or something similar to the URL

I can't find any working examples with B1i 2.0
The example I found Here doesn't work for me. If I try this I keep getting error

while trying to invoke the method com.sap.b1i.bizprocessor.BizProcMessage.setProperty(java.lang.String, java.lang.String) of a null object loaded from local variable 'inMsg'

To sum things up, how can i get an url parameter to end up in:

<xsl:variable name="CardCode" select=URL PARAMETER />

Test XSL:

            <xsl:template match="/">
                <vpf:Msg>
                    <xsl:copy-of select="/vpf:Msg/@*" />
                    <xsl:copy-of select="/vpf:Msg/vpf:Header" />
                    <vpf:Body>
                        <xsl:copy-of select="/vpf:Msg/vpf:Body/*" />
                        <vpf:Payload Role="X" id="{$atom}">
                            <xsl:call-template name="transform" />
                        </vpf:Payload>
                    </vpf:Body>
                </vpf:Msg>
            </xsl:template>
            <xsl:template name="transform">
                <xsl:variable name="CardCode" select="'D19999'" />
                <jdbc:SqlStatement>
                    select CardName from OCRD WITH(NOLOCK) where CardCode='
                    <xsl:value-of select="$CardCode" />'
                </jdbc:SqlStatement>
            </xsl:template>
former_member186605
Active Contributor

Accepted Solutions (0)

Answers (1)

Answers (1)

kvbalakumar
Active Contributor

Hi,

Try the below to fetch the value of URL Parameter(s):

 <xsl:variable name="CardCode" select="bfa:io/bfa:key[@name='CardCode']/@value"/>

Regards,

Bala