Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

One mapping program for three diferent enviroments

Hello there,

I have developed a scenario in which an rfc requests a web service trough XI. In the process a BPM is involved together with some XSLT mappings.

R3->XI->WebService

The Web service request message looks like follows:

-

-


<?xml version="1.0" encoding="UTF-8"?>

<cem:Z_ORDER_SEARCH xmlns:cem="http://XXXXXXXX/yyyyyyyyyyyy">

<messageStructure/>

</cem:Z_ORDER_SEARCH>

-

-


Where "http://XXXXXXXX/yyyyyyyyyyyy" Is the web service destination.

Everything works fine, but as I have to manage three different environments for Development, Quality and Production I need three different versions of the XSL mapping since destinations are not the same for Dev, Qlty and Production environments.

I found out that I can get information of the sender using runtime parameters as follows:

-

-


<xsl:param name="SenderSystem">

-

-


I would like to evaluate this information to determine the target URL destination.

If the sender is the development sender then the URL target is the development destination and so on.

I tried the following code:

-

-


<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"

xmlns:cemDev="http://developmentDestination"

xmlns:cemQlty="http://qualityDestination"

xmlns:cemPrd="http://productionDestination"

xmlns:cem=""

<xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemDev"/>

<xsl:template match="/">

<cem:mappingProgram/>

</xsl:template>

</xsl:stylesheet>

-

-


This works all right, but I cannot insert code to evaluate the destination.

On the other hand, this code is not valid:

-

-


<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"

xmlns:cemDev="http://developmentDestination"

xmlns:cemQlty="http://qualityDestination"

xmlns:cemPrd="http://productionDestination"

xmlns:cem="">

<xsl:param name="SenderSystem"/>

<xsl:choose>

<xsl:when test="string($SenderSystem) = 'PRODUCTION'">

<xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemPrd"/>

</xsl:when>

<xsl:when test="string($SenderSystem) = 'QUALITY'">

<xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemQlty"/>

</xsl:when>

<xsl:otherwise>

<xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemDev"/>

</xsl:otherwise>

</xsl:choose>

<xsl:template match="/">

<cem:mappingProgram/>

</xsl:template>

</xsl:stylesheet>

-

-


Neither this one:

-

-


<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format"

xmlns:cemDev="http://developmentDestination"

xmlns:cemQlty="http://qualityDestination"

xmlns:cemPrd="http://productionDestination"

xmlns:cem="">

<xsl:param name="SenderSystem"/>

<xsl:template match="/">

<xsl:choose>

<xsl:when test="string($SenderSystem) = 'PRODUCTION'">

<xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemPrd"/>

</xsl:when>

<xsl:when test="string($SenderSystem) = 'QUALITY'">

<xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemQlty"/>

</xsl:when>

<xsl:otherwise>

<xsl:namespace-alias stylesheet-prefix="cem" result-prefix="cemDev"/>

</xsl:otherwise>

</xsl:choose>

<cem:mappingProgram/>

</xsl:template>

</xsl:stylesheet>

-

-


I tried this other code, which is obviously not valid:

-

-


<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">

<xsl:param name="SenderSystem"/>

<xsl:choose>

<xsl:when test="string($SenderSystem) = 'PRODUCTION'">

<cem:Z_ORDER_SEARCH xmlns:cem="http://productionDestination">

</xsl:when>

<xsl:when test="string($SenderSystem) = 'QUALITY'">

<cem:Z_ORDER_SEARCH xmlns:cem="http://qualityDestination">

</xsl:when>

<xsl:otherwise>

<cem:Z_ORDER_SEARCH xmlns:cem="http://developmentDestination">

</xsl:otherwise>

</xsl:choose>

<cem:mappingProgram/>

</cem:Z_ORDER_SEARCH>

</xsl:template>

</xsl:stylesheet>

-

-


So the only way I found to make it works is like this:

-

-


<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

<xsl:template match="/">

<xsl:param name="SenderSystem"/>

<xsl:choose>

<xsl:when test="string($SenderSystem) = 'PRODUCTION'">

<cem:Z_ORDER_SEARCH xmlns:cem="http://productionDestination">

<cem:mappingProgram/>

</cem:Z_ORDER_SEARCH>

</xsl:when>

<xsl:when test="string($SenderSystem) = 'QUALITY'">

<cem:Z_ORDER_SEARCH xmlns:cem="http://qualityDestination">

<cem:mappingProgram/>

</cem:Z_ORDER_SEARCH>

</xsl:when>

<xsl:otherwise>

<cem:Z_ORDER_SEARCH xmlns:cem="http://developmentDestination">

<cem:mappingProgram/>

</cem:Z_ORDER_SEARCH>

</xsl:otherwise>

</xsl:choose>

</xsl:template>

</xsl:stylesheet>

-

-


Unfortunately this doesn’t solve my problem, because I need to reproduce the mapping program three times in the document.

Any ideas, or suggestions how to manage one mapping program for the three different environments?

Thanks a lot in advance, Ra├║

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question