Xsi:nil="true" in XSLT Map breaks "choose"-"when" loops - annoying
Hello,
Handling "nil" element in choose loops breaks my XSLT tranformation.
As soon as the element is set to nil, either the "otherwise" branch is executed (wrongly) or the XSLT processing stops.
I test with "count" for the existence of the element. Depending on if it is nil,
other elements have to be processed in sub-loops.
I have an XSLT Mapping in JDeveloper.
It processes a SOAP request in the form:
<result>
<customerNew>CUSTOMER_NEW_NAME</customerNew>
<customerCurrent>CUSTOMER_NAME</customerCurrent>
</result>
which can also be:
<result>
<customerNew xsi:nil="true">
</customerNew>
<customerCurrent>CUSTOMER_NAME</customerCurrent>
</result>
To check for Nil I use:
<xsl:when test='not(boolean(count(/ns0:changeCustomer/result/customerNew))) and contains(/ns0:changeCustomer/result/customer,"USER_NAME_SOME_BODY")'>
(the xslt maps between two xsd files and we have quite strict schema definitions)
As soon as I use the test statement in a loop, it breaks, even if I test for "true" and do not simply check for count<1 etc.
How can I work with the <customerCurrent> Element, even if the previous element is nilled?
I talked to several experienced developers and nobody could help. They can do checks in plain xsl with xalan, but not in JDeveloper.
This took me five days already...who can advice?
Your help is appreciated very much.
hi user570144
You write "They can do checks in plain xsl with xalan, but not in JDeveloper.". Could you describe in detail what it is you (would like to) do "in JDeveloper" and how that is different from "plain xsl with xalan"?
The "contains" function in your xsl:when test example has the expression "/ns0:changeCustomer/result/customer", but in the xml examples you gave there is no "customer" element inside the "result" element, only "customerNew" and "customerCurrent" elements.
(tip : You can use "Your Control Panel" to make your name visible in forum posts.)
regards
Jan Vervecken
Similar Messages
-
Xslt mapping in Imported archieves
Hi all,
The requirement is that I need to use XSLT mapping for this I created message mapping copied as a .xslt file and imported in the imported archeives and then I removed the message mapping .
The problem is that when I try to use this XSLT mapping under the interface mapping as XSLT option I am getting a warning "message mapping name has no program"
Please let me know why this is happening.
Thanks,
SriHi,
as you said:
choose XSLT mapping
then choose your XSLT mapping name
save and activate
Regards,
michal -
Graphical Mapping Vs XSLT mapping Vs Java Mapping Vs ABAP Mapping
Hi Experts,
I have a question regarding different message mapping options available in XI namely
Graphical Mapping
XSLT mapping
Java Mapping
ABAP Mapping
Q1: Which amoung the above mappings is the best and why?
Q2: On what cases Graphical, XSLT, Java and ABAP Mapping should be used?
Q3: Is it true that graphical and XSLT mappings are converted into Java class internally?
Kindly help!
Thanks
Gopal
Message was edited by:
gopalkrishna baligaHi,
There is no hard and fast rule for using the mapping techniques.
Graphical Mapping is used for simple mapping cases. When, the logic for your mapping is simple and straight forward and it does not involve mult hiearchical mapping requirement. and context handling.
Java and XSLT mapping are used when graphical mapping cannot help you.
When the choice is between Java And XSLT, XSLT is simpler than java mapping and easier. But, it has its drawbacks. XSLT can lead to a bad perfrormance if the Source XML is huge.
Java Mapping uses 2 types of parsers. DOM and SAX. DOM is easier to use with lots of classes to help you create nodes and elements, but , DOM is very processor intensive.
SAX parser is something that parses your XML one after the other, and so is not processor intensive. But, it is not exaclty easy to develop either.
For further info on each of the mapping, refer to these links,
Graphical Mapping,
http://help.sap.com/saphelp_nw04/helpdata/en/6d/aadd3e6ecb1f39e10000000a114084/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
XSLT Mapping
http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm
http://www.w3.org/TR/xslt20/
Java Mapping
http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
DOM parser API
http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/package-frame.html
Also, check this thread for more info,
Different types of Mapping in XI
Am not sure about XSLT , but , yes graphical mapping is converted into java classes internally and these classes use SAX parsing as well.
Regards,
Bhavesh -
XSLT mapping not working b'coz " " & " " replaced with and
Hello Experts,
I have a RFC to JMS scenario. One of the parameter of RFC is a string field. This field will contain the XML data in it.
I need to create a complete XML payload using this data in a string field. For this I am using XSLT map :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.1" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml" omit-xml-declaration="no"/>
<xsl:template match="/">
<xsl:for-each select="//Nem">
<xsl:copy-of select="."/>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
This XSLT mapping works fine when tested independently.
But in actual scenario at runtime the "<" & ">" used to indicate a node are getting replaced with < and >. Then the XSLT mapping fails and produces no output.
The output of XSL will be passed in to a java mapping which signs the payload digitally.
What is the issue with these signs? How can I overcome this problem?
Any inputs will be of great help.
Kind Regards,
Abhijeet.
Edited by: Abhijeet Ambekar on May 4, 2010 2:01 PMHi Stefan,
Yes - I want to get rid of & # 60. But these (& # 60 and & # 62) are not added by XSLT mapping. Rather they are in the input available to XSLT map.
In sxmb_moni, i can see the inbound payload correctly :
<?xml version="1.0" encoding="UTF-8" ?>
- <rfc:HDK083_REFUS_SENDDOCU xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
<P_SIGN_DOCUMENT />
<P_XML_DOCUMENT><NemRefusionIndberetningSamling><NemRefusionIndberetningStruktur MessageID="1"><HeaderStruktur><SignOffIndikator>true</SignOffIndikator><TransaktionKode>Opret</TransaktionKode><IndberetningstypeKode>Anmeldelse</IndberetningstypeKode><FravaerTypeKode>Sygdom</FravaerTypeKode><FravaerendeStruktur><FravaerendeTypeKode>Loenmodtager</FravaerendeTypeKode><LoenUnderFravaerIndikator>false</LoenUnderFravaerIndikator></FravaerendeStruktur><IndberetningUUIDIdentifikator>bf9cc44e-af15-4e19-8457-5845d75385d2</IndberetningUUIDIdentifikator><ReferenceAttributTekst>ref. Nielsen-1503831372 (23. oktober 2009)</ReferenceAttributTekst>
but when I try to download the payload or right click on payload to view source I get something like below:
<?xml version="1.0" encoding="UTF-8"?><rfc:HDK083_REFUS_SENDDOCU xmlns:rfc="urn:sap-com:document:sap:rfc:functions"><P_SIGN_DOCUMENT></P_SIGN_DOCUMENT><P_XML_DOCUMENT>& # 6 0;NemRefusionIndberetningSamling& # 62; & # 60;NemRefusionIndberetningStruktur MessageID="1"& #62;& #60;HeaderStruktur& #62;& #60;SignOffIndikator& #62;true& #60;/SignOffIndikator& #62;& #60;TransaktionKode& #62;Opret& #60;/TransaktionKode& #62;& #60;IndberetningstypeKode& #62;Anmeldelse& #60;/IndberetningstypeKode& #62;& #60;FravaerTypeKode& #62;Sygdom& #60;/FravaerTypeKode& #62;& #60;FravaerendeStruktur& #62;& #60;FravaerendeTypeKode& #62;Loenmodtager</FravaerendeTypeKode><LoenUnderFravaerIndikator& #62;false</LoenUnderFravaerIndikator></FravaerendeStruktur& #62;<IndberetningUUIDIdentifikator& #62;bf9cc44e-af15-4e19-8457-5845d75385d2& #60;/IndberetningUUIDIdentifikator& #62;& #60;ReferenceAttributTekst& #62;ref. Nielsen-1503831372 (23. oktober 2009)& #60;/ReferenceAttributTekst& #62;
(extra spaces added to "& # 60" as browser was converting it to < ,>)
If i take the source code for payload and test XSLT mapping, it fails. But if I manually replace all "& # 60" with < and "& # 6 2" with >, then the mapping works fine.
So I think for XSLT map to work correctly, we need to replace all "& # 60 " . Please suggest.
Kind Regards,
Abhijeet. -
Set xsi:nill="true" attribute in XML
Hi,
I'm trying to set the xsi:nill attribute in an XML element by scripting. (Javascript)
The setAttribute method doesn't work. And manually adding a new and empty element doesn't work either.
When I leave a field which has binding empty, the nill attribute is automatically set to true.
Why can't I reproduce this by scripting? Does someone have a clue?
Thanks in advance!
Regards,
KristofHi Kristof,
I think you can only do this with a loadXML method, makes it very clumsy by the following code;
var dataItems = xfa.datasets.createNode("dataGroup","items");
xfa.datasets.data.nodes.append(dataItems);
dataItems.loadXML('<item xsi:nil="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>',false,true);
Will produce the following xml
<items>
<item xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"/>
</items>
Good Luck
Bruce -
Java ,abap and XSLT mapping
Hi all,
can any one provide some material on java ,ABA and XSLT mapping(as i got requirement on my current project)..
thanks in advance.
regards
krish..Hi
All mapping related links
There is no hard and fast rule for using the mapping techniques.
Graphical Mapping is used for simple mapping cases. When, the logic for your mapping is simple and straight forward and it does not involve any complex logic.
Java and XSLT mapping are used when graphical mapping cannot help you and you have multilevel hierarchy structure data.
When the choice is between Java and XSLT, XSLT is simpler than java mapping and easier. But, it has its drawbacks. One among them being that you cannot use Java APIs and Classes in it. There might be cases in your mapping when you will have to perform something like a properties file look up or a DB lookup, such scenarios are not possible in XSLT and so, when you want to use some specific Java API's you will have to go for Java Mapping.
Java Mapping uses 2 types of parsers. DOM and SAX. DOM is easier to use with lots of classes to help you create nodes and elements, but, DOM is very processor intensive.
SAX parser is something that parses your XML one after the other, and so is not processor intensive. But, it is not exactly easy to develop either.
To know more about each of them please go thru the following links. And if you ask me your which is better, it depends basically on the scenario you implementing and the complexity involved. Anyways please go thru the following links:
Graphical mapping
http://help.sap.com/saphelp_nw04/helpdata/en/6d/aadd3e6ecb1f39e10000000a114084/content.htm
http://help.sap.com/saphelp_nw04/helpdata/en/43/c4cdfc334824478090739c04c4a249/content.htm
/people/bhanu.thirumala/blog/2006/02/02/graphical-message-mapping-150-text-preview
http://www.sapgenie.com/netweaver/xi/mapping1.htm
/people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping
XSLT mapping
http://help.sap.com/saphelp_nw04/helpdata/en/73/f61eea1741453eb8f794e150067930/content.htm
http://www.w3.org/TR/xslt20/
JAVA mapping
http://help.sap.com/saphelp_nw04/helpdata/en/e2/e13fcd80fe47768df001a558ed10b6/content.htm
DOM parser API
http://java.sun.com/j2se/1.4.2/docs/api/org/w3c/dom/package-frame.html
ABAP mapping
/people/r.eijpe/blog
To know more about the value mapping tools for the SAP Exchange Infrastructure (XI), please go thru the following link:
http://www.applicon.dk/fileadmin/filer/XI_Tools/ValueMappingTool.pdf
To get an idea as to what value mapping is, please go thru the following links:
http://help.sap.com/saphelp_nw04/helpdata/en/13/ba20dd7beb14438bc7b04b5b6ca300/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/f2/dfae3d47afd652e10000000a114084/frameset.htm
http://help.sap.com/saphelp_nw04/helpdata/en/2a/9d2891cc976549a9ad9f81e9b8db25/content.htm
most of the links that I have provided also helps you get the step by step procedure of doing the same. And also involves the procedure to implement certain advanced features.
And please go through this link which clearly explains the 3 types of mappings.
/people/ravikumar.allampallam/blog/2005/02/10/different-types-of-mapping-in-xi
regards
Prasad -
MIAL RECIEVER CC -- ISSUE USED XSLT MAPPING
Hi All,
I have a Scenario in which IDOC is a sender and Mail Adaptert is reciever .The Xi is supposed to sent the Email notification to the client . Mail adapter is SMTP configured correctly ,Reciever Mail CC is up and running but Error is :Delivery of the message to the application using connection Mail_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: java.lang.StringIndexOutOfBoundsException: String index out of range: 0
The Mapping here is used is XSLT mapping and in SXMB_MONITOR , Error shown is :
SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="">
<SAP:Category>Application</SAP:Category>
<SAP:Code area="MAPPING">TRANSFORMER_CONF_EX</SAP:Code>
Could you plesae help me this Issue asap .
Thanks,
VaraHi Abhi ,
I checked in ATOVA SPY XML Check , it seems to be the issue in XSLT mapping .
Part of XSLT mapping Error line:
when test="//IDOC/EDI_DC40/RCVLAD = '3157411730014'"> --There was a single qoute missing
Tested in Atova with payload , it worked
Thanks for your supprt as well.
Best Regards,
Vara -
How to insert new line break in XSLT mapping
Hi experts,
I am doing file to mail scenario, i am sending the text file as an attachment using reciever mail adapter.
I did everything, i can able to send the mail with text file attachment, but with in the file i got multiple rows, i need to put line break in XSLT mapping.
I did use following statement but it is inserting small rectangle between the records, the records are not separating with new lines, all are in one line.
<xsl:text>*#xA;</xsl:text>
note: in real coding replace * with &
Can anyone suggest me how to insert new line in XSLT mapping.
My XSLT mapping as look like:
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns0="http://www.Coj.co.za/SapIsuToABSA/DirectDebitFile">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:variable name="break"><br/></xsl:variable>
<xsl:variable name="space"> </xsl:variable>
<xsl:variable name="newline"><xsl:text></xsl:text></xsl:variable>
<xsl:template match="/">
<ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
<Subject>Please Check Attached Direct Debit File</Subject>
<From>S@za</From>
<To>P@za</To>
<Content_Type>text/plain</Content_Type>
<Content>
<xsl:for-each select="MT_SapIsuToABSA_DirectDebitFile/DirectDebitRec/Body">
<xsl:value-of select="Space1"/>
<xsl:value-of select="Cust_AccNo"/>
<xsl:value-of select="Reserve_1"/>
<xsl:value-of select="Cust_Name"/>
<xsl:value-of select="Cust_Name1"/>
<xsl:value-of select="Cust_Bank_AccNo"/>
<xsl:value-of select="Space2"/>
<xsl:value-of select="Cust_Bank_BranchNo"/>
<xsl:value-of select="Reserve_2"/>
<xsl:value-of select="Space3"/>
<xsl:value-of select="Cust_AccNo_1"/>
<xsl:value-of select="Space4"/>
<xsl:value-of select="Reserve_3"/>
<xsl:value-of select="Deduction_Amnt"/>
<xsl:value-of select="Space5"/>
<xsl:value-of select="Reserve_4"/>
<xsl:value-of select="Space6"/>
<xsl:value-of select="Action_Date"/>
<xsl:value-of select="Space7"/>
<xsl:value-of select="Reserve_5"/>
<xsl:text>*#xA;</xsl:text>
note: in real coding replace * with &
</xsl:for-each>
</Content>
</ns1:Mail>
</xsl:template>
</xsl:stylesheet>
Kind regards,
PraveenHi,
I think <xsl:text>#xa;</xsl:text> should do the trick, but depending on which OS (ux or win), the "new line" chars sequence is different (win would require a CRLF like <xsl:text>#xd;*#xa;</xsl:text>)
Chris
-> &
Edited by: Christophe PFERTZEL on Apr 14, 2010 2:16 PM -
Hi,
I have 2 mapping program one is main .xsl program and other one is value mapping program .xsl .
I have zipped both the program and imported into Imported archive in IR but while testing in interface mapping i am getting error.
error:could not compile xslt stylsheet.
Some of the interface having one .xsl program and value mapping is also defined in the main program itself,these interface i am able to execute successfully but unable to execute wherever there are 2 program (main prog + value mapping).
It seems that value mapping is not loading / executing.
Can anyone please guide me how to call value mapping using xslt mapping?
Thanks,
SubbuHi Prateek,
Thanks for the response.
Yes i have 2 program and both needs to execute in one interface mapping.
First program (main) is MappingMOAPS_SAVEMULTIPLE2013.xsl and second program i.e (value mapping) MO_vmf.xsl.
From main program itself value mapping program is called.
Please look below code for main & value mapping prog.
In main prog this is the parameter (<xsl:import href="MO_vmf.xslt"/>) where value mapping prog name is mentioned.
I have already zipped and imported but while testing in interface mapping it is giving error that "could not compile xslt stylsheet".
Could you plaese tell how to check or make XSL to accommodate multiple mappings?
Main mapping : MappingMOAPS_SAVEMULTIPLE2013.xsl --
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file was generated by Altova MapForce 2008sp1
YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE
OVERWRITTEN WHEN YOU RE-RUN CODE GENERATION.
Refer to the Altova MapForce Documentation for further details.
http://www.altova.com/mapforce
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vmf="http://www.altova.com/MapForce/UDF/vmf" exclude-result-prefixes="vmf xs xsi xsl">
<xsl:import href="MO_vmf.xslt"/>
<xsl:output method="xml" encoding="UTF-8" indent="yes"/>
<xsl:template match="/PPR">
<MOAPS_SAVEMULTIPLE201>
<IDOC>
<EDI_DC40>
<xsl:for-each select="SI_ID_IDOCS">
<xsl:for-each select="ID_TABNAM">
<TABNAM>
<xsl:value-of select="."/>
</TABNAM>
</xsl:for-each>
</xsl:for-each>
<xsl:for-each select="SI_SP_SAP_PARTNER_INFO">
<xsl:for-each select="SP_MANDT">
<MANDT>
<xsl:value-of select="."/>
</MANDT>
</xsl:for-each>
</xsl:for-each>
<xsl:for-each select="SI_ID_IDOCS">
<xsl:for-each select="ID_DIRECT">
Value mapping : MO_vmf.xsl:
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file was generated by Altova MapForce 2008sp1
YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE
OVERWRITTEN WHEN YOU RE-RUN CODE GENERATION.
Refer to the Altova MapForce Documentation for further details.
http://www.altova.com/mapforce
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:vmf="http://www.altova.com/MapForce/UDF/vmf" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs xsi xsl">
<xsl:template name="vmf:inputtoresult">
<xsl:param name="input"/>
<xsl:choose>
<xsl:when test="$input='01'">
<xsl:value-of select="'PM1C'"/>
</xsl:when>
<xsl:when test="$input='02'">
<xsl:value-of select="'PM2C'"/>
</xsl:when>
<xsl:when test="$input='03'">
<xsl:value-of select="'EXT3'"/>
</xsl:when>
Regards,
Subbu -
I want to genarate fixed legth file using XSLT mapping
Hi Experts,
I am doing File to Mail scenario, text file as an attachmetachment in reciver side, i have successfully send the text file as an attachment in the mail. but i need fixed length fields in the file.
I know we can do it in XSLT mapping using <xsl:if> or <xsl:choose> but i dont know how to use it.
Can anybody please tell how can i use those statements in XSLT.
Kind Regards,
Praveen.Hi Stefan,
This is my XSLT mapping, I am not expert in XSLT please can you help me, i want to do fixed length for "cust_name" field below.
<?xml version='1.0'?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ns0="http://www.Coj.co.za/SapIsuToABSA/DirectDebitFile">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:variable name="break"><br/></xsl:variable>
<xsl:variable name="space"> </xsl:variable>
<xsl:variable name="newline"><xsl:text></xsl:text></xsl:variable>
<xsl:template match="/">
<ns1:Mail xmlns:ns1="http://sap.com/xi/XI/Mail/30">
<Subject>Please Check Attached Direct Debit File</Subject>
<From>joburg</From>
<To>PraveenG</To>
<Content_Type>text/plain</Content_Type>
<Content>
<xsl:for-each select="MT_SapIsuToABSA_DirectDebitFile/DirectDebitRec/Body">
<xsl:value-of select="Space1"/>
<xsl:value-of select="Cust_AccNo"/>
<xsl:value-of select="Reserve_1"/>
<xsl:value-of select = "Cust_name" />
<xsl:value-of select="Cust_Name1"/>
<xsl:value-of select="Cust_Bank_AccNo"/>
<xsl:text> </xsl:text>
<xsl:value-of select="Space2"/>
<xsl:value-of select="Cust_Bank_BranchNo"/>
<xsl:value-of select="Reserve_2"/>
<xsl:text> </xsl:text>
<xsl:value-of select="Space3"/>
<xsl:value-of select="Cust_AccNo_1"/>
<xsl:text> </xsl:text>
<xsl:value-of select="Space4"/>
<xsl:value-of select="Reserve_3"/>
<xsl:value-of select="Deduction_Amnt"/>
<xsl:text> </xsl:text>
<xsl:value-of select="Space5"/>
<xsl:value-of select="Reserve_4"/>
<xsl:value-of select="Space6"/>
<xsl:text> </xsl:text>
<xsl:value-of select="Action_Date"/>
<xsl:value-of select="Space7"/>
<xsl:text> </xsl:text>
<xsl:value-of select="Reserve_5"/>
<xsl:text>
</xsl:text>
</xsl:for-each>
</Content>
</ns1:Mail>
</xsl:template>
</xsl:stylesheet> -
Hello Friends,
I have got one scenario in which XSLT mapping is used.The third party file is mapped to IDoc INVOIC01.After the development of the mapping code,I got the result as below in the XML Spy
<E1EDP01 SEGMENT="1">* first segment
<POSEX>0</POSEX>
<E1EDP02 SEGMENT="1"> Subsegment1
<QUALF>001</QUALF>
</E1EDP02>
<E1EDP04 SEGMENT="1"> Subsegment2
<MWSKZ></MWSKZ>
<MSATZ>22.00</MSATZ>
<MWSBT>6.660</MWSBT>
</E1EDP04>
<E1EDP04 SEGMENT="1">Subsegment2
<MWSKZ></MWSKZ>
<MSATZ>22.00</MSATZ>
<MWSBT>13.330</MWSBT>
</E1EDP04>
</E1EDP01>
<E1EDP01 SEGMENT="1">
<POSEX>0</POSEX>
<E1EDP02 SEGMENT="1">
<QUALF>001</QUALF>
</E1EDP02>
<E1EDP04 SEGMENT="1">
<MWSKZ></MWSKZ>
<MSATZ>22.00</MSATZ>
<MWSBT>6.660</MWSBT>
</E1EDP04>
<E1EDP04 SEGMENT="1">
<MWSKZ></MWSKZ>
<MSATZ>22.00</MSATZ>
<MWSBT>13.330</MWSBT>
</E1EDP04>
</E1EDP01>
But the expected result is as below:
<E1EDP01 SEGMENT="1">
<POSEX>0</POSEX>
<E1EDP02 SEGMENT="1">
<QUALF>001</QUALF>
</E1EDP02>
<E1EDP04 SEGMENT="1">
<MWSKZ></MWSKZ>
<MSATZ>22.00</MSATZ>
<MWSBT>6.660</MWSBT>
</E1EDP04>
</E1EDP01>
<E1EDP01 SEGMENT="1">
<POSEX>0</POSEX>
<E1EDP02 SEGMENT="1">
<QUALF>001</QUALF>
</E1EDP02>
<E1EDP04 SEGMENT="1">
<MWSKZ></MWSKZ>
<MSATZ>22.00</MSATZ>
<MWSBT>13.330</MWSBT>
</E1EDP04>
</E1EDP01>
ie For each E1EDP01 segment,there should be only one E1EDP04 segment.
Please help me in this regard how to code the xslt map for this...
Thank you
Sam
Edited by: Guest on Apr 4, 2008 1:00 PMHello Ashish,
Thanks for your reply.
The third party system is th sender and sends XSD file which contains header detail (with multiple tax details in it) and multiple line Item details (which contains one tax details per lineitem).
ie if there are two line items then each line item should have one tax details (1st tax detail in header should match with 1st tax details of linitem, and 2nd should match with second line item tax details..etc)
<?xml version="1.0" encoding="UTF-8"?>
<INVOIC01 xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<IDOC BEGIN="1">
<E1EDK04 SEGMENT="1">
<MWSKZ>VAT</MWSKZ>
<MSATZ>22.00</MSATZ>
<MWSBT>6.660</MWSBT>
</E1EDK04>
<E1EDK04 SEGMENT="1">
<MWSKZ>VAT</MWSKZ>
<MSATZ>22.00</MSATZ>
<MWSBT>13.330</MWSBT>
</E1EDK04>
<E1EDP01 SEGMENT="1">
<POSEX>0</POSEX>
<E1EDP04 SEGMENT="1">
<MWSKZ>VAT</MWSKZ>
<MSATZ>22.00</MSATZ>
<MWSBT>6.660</MWSBT>
</E1EDP04>
</E1EDP01>
<E1EDP01 SEGMENT="1">
<POSEX>0</POSEX>
<E1EDP04 SEGMENT="1">
<MWSKZ>VAT</MWSKZ>
<MSATZ>22.00</MSATZ>
<MWSBT>13.330</MWSBT>
</E1EDP04>
</E1EDP01>
</IDOC>
</INVOIC01>
I thinks this is like a copying th header segment details in the item details.
Please help me in ths regard
Thank you
Sam -
XSLT mapping - Which transformation engine is used in PI 7.0
Hi,
In my favorite xslt tool I can choose which transformation engine I want to use while executing the xsl.
Which Transformation engine is used in PI 7.0 ?
(Nice to test with the same as PI have....)
Br, MartinHi ,
as per my knowledge PI 7.0 uses XALAN parcer to execute XSLT Mapping programs,its available in in PI server it slelf.
Regards,
Raj -
Hi All,
I am trying to implement an XSLT mapping on the ABAP Engine. I went to the Transformation Workbench(SE80).I have created 4 levels of packages (Structure->Main->then 2 more levels) and included Package Interface SAI_TOOLS in 'Use Accesses' tab.
I have also set com.sap.aii.repository.mapping.additionaltypes=R3_ABAP|Abap-class;R3_XSLT|XSL (ABAP Engine)
in the Exchange Profile.
Now I want to create the tranformation (ST or XSLT) so that I can see it in the Repository.
At which package level(1st to 4th), should I right-click and go to 'Create->More->Transformations' so that I can see this XSLT Mapping program in the repository?
I have followed all the links from help.sap.com but I am unable to get the desired result, i.e. see my Mapping in the Repository when I choose Mapping Program of type 'XSL->ABAP Engine', from the drop-down box in Interface Mapping.
Kindly help.
Regards,
Puloma.Hi Naveen,
I did as you told, i.e. keyed in the name of the ABAP Transformation program (mapping) name.I have not written any namespace for the Mapping program in the Interface Mapping Design, just the Program name.
When I execute my mapping from se80, it works perfectly.
I created this Transformation program at the topmost level (i.e. Structure package level).
But when I execute my scenario, I get the following runtime error in sxmb_moni:
Error in mapping program zpc_transfom2 (type R3_XSLT, kernel error ID UNCAUGHT_EXCEPTION).
What is wrong? Did I create the transformation program at the wrong level?
Regards,
Puloma. -
XSLT mapping with Java helper classes
Hi,
I'm trying to implement a XSLT mapping to convert my request to a specific soap request message format for this I'm calling some methods from a java helper class. I have imported the jar file into the archives. When I tried to test the interface it keeps complaing there is some exception but doesn't give me the exact error. Has any one called any java helper classes with in XSLT mapping, if so I would appreciate if you could help me with this. Here is the code from xsl.
<wsse:Security soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:wsse="http://schemas.xmlsoap.org/ws/2002/07/secext" xmlns:UserToken="java:com.company.test.mapping.UserTokenMap">
<wsse:UsernameToken>
<wsse:Username xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<xsl:value-of select="UserToken:getUsername()"/>
</wsse:Username>
<wsse:Password wsse:Type="wsse:PasswordDigest" xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<xsl:value-of select="UserToken:getPasswordDigest()"/>
</wsse:Password>
<wsse:Nonce xsi:type="soapenc:string" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<xsl:value-of select="UserToken:getNonce()"/>
</wsse:Nonce>
<wsu:Created xsi:type="soapenc:string" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<xsl:value-of select="UserToken:getCreateDate()"/>
</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
Thanks,
JoeHi,
I'm getting following exception when I refer to the java class with in my XSLT mapping. Any one encountered the same problem.
com.sap.engine.services.ejb.exceptions.BaseRemoteException:
Exception in method transform.
at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.transform(MapServiceRemoteObjectImpl0.java:218)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0p4_Skel.dispatch(MapServiceRemoteObjectImpl0p4_Skel.java:104)
at com.sap.engine.services.rmi_p4.DispatchImpl._runInternal(DispatchImpl.java:320)
at com.sap.engine.services.rmi_p4.DispatchImpl._run(DispatchImpl.java:198)
at com.sap.engine.services.rmi_p4.server.P4SessionProcessor.request(P4SessionProcessor.java:129)
at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
at java.security.AccessController.doPrivileged(Native
Method)
at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
Caused by: java.lang.UnsupportedClassVersionError:
com/earthlink/xi/mapping/UserTokenMap (Unsupported
major.minor version 49.0)
at java.lang.ClassLoader.defineClass0(Native
Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:539)
at java.lang.ClassLoader.defineClass(ClassLoader.java:448)
at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingLoader.findClass(RepMappingLoader.java:175)
at java.lang.ClassLoader.loadClass(ClassLoader.java:289)
at java.lang.ClassLoader.loadClass(ClassLoader.java:235)
at com.sap.engine.lib.xsl.xpath.JLBLibrary.<init>(JLBLibrary.java:33)
at com.sap.engine.lib.xsl.xpath.LibraryManager.getFunction(LibraryManager.java:69)
at com.sap.engine.lib.xsl.xpath.ETFunction.evaluate(ETFunction.java:98)
at com.sap.engine.lib.xsl.xpath.XPathProcessor.innerProcess(XPathProcessor.java:56)
at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:43)
at com.sap.engine.lib.xsl.xpath.XPathProcessor.process(XPathProcessor.java:51)
at com.sap.engine.lib.xsl.xslt.XSLValueOf.process(XSLValueOf.java:76)
at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
at com.sap.engine.lib.xsl.xslt.XSLElement.process(XSLElement.java:248)
at com.sap.engine.lib.xsl.xslt.XSLNode.processFromFirst(XSLNode.java:296)
at com.sap.engine.lib.xsl.xslt.XSLTemplate.process(XSLTemplate.java:272)
at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:463)
at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:431)
at com.sap.engine.lib.xsl.xslt.XSLStylesheet.process(XSLStylesheet.java:394)
at com.sap.engine.lib.jaxp.TransformerImpl.transformWithStylesheet(TransformerImpl.java:398)
at com.sap.engine.lib.jaxp.TransformerImpl.transform(TransformerImpl.java:240)
at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingTransformer.transform(RepMappingTransformer.java:150)
at com.sap.aii.ibrep.server.mapping.ibrun.RepXSLTMapping.execute(RepXSLTMapping.java:81)
at com.sap.aii.ibrep.server.mapping.ibrun.RepSequenceMapping.execute(RepSequenceMapping.java:54)
at com.sap.aii.ibrep.server.mapping.ibrun.RepMappingHandler.run(RepMappingHandler.java:80)
at com.sap.aii.ibrep.server.mapping.rt.MappingHandlerAdapter.run(MappingHandlerAdapter.java:107)
at com.sap.aii.ibrep.server.mapping.ServerMapService.transformInterfaceMapping(ServerMapService.java:127)
at com.sap.aii.ibrep.server.mapping.ServerMapService.transform(ServerMapService.java:104)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceBean.transform(MapServiceBean.java:40)
at com.sap.aii.ibrep.sbeans.mapping.MapServiceRemoteObjectImpl0.transform(MapServiceRemoteObjectImpl0.java:167)
... 10 more
; nested exception is:
java.lang.UnsupportedClassVersionError:
com/earthlink/xi/mapping/UserTokenMap (Unsupported
major.minor version 49.0) -
Multi Mapping using condition & Dynamic Receiver determination – Used XSLT Mapping
Dear Experts,
I am struggling to identify an error on the Technical Routing. Firstly according to my scenario, I receive an XML file with multiple PO's and I have to split the file to 2 different target messages. and also according to the source payload I have to send the file to 2 different receivers. first receiver is ABAP Proxy to the back end system and the 2nd one is to a file location. I have used XSLT to split the message into 2 target message type and I have used a XSLT mapping for receiver determination. Does any one have any idea of what I am doing wrong.
Note: some time I will only be able to fill in on target message.
I have attached my XSLT message split mapping with this post, please let me know if you have further question.
Your help is more appreciated.
Advance Thanks,
Pradeep
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" version="1.0">
<xsl:variable name="vFlag"/>
<xsl:variable name="vPONUM" select="POTRACKING/Lines[1]/PONumber"/>
<xsl:template match="/">
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<ns1:MT_Tracking xmlns:ns1="http://www.findel-education.co.uk/axapta">
<xsl:for-each select="POTRACKING/Lines">
<sap:call-external class="ZCL_VNAP_OBJECTS" method="CHECK_PO_EXIST">
<sap:callvalue param="IP_EBELN" select="string(PONumber)"/>
<sap:callvariable name="vFlag" param="EP_BOLEAN" type="string"/>
</sap:call-external>
<xsl:if test="$vFlag = 0">
<Lines>
<DDate>
<xsl:value-of select="DespatchDate"/>
</DDate>
<PONumber>
<xsl:value-of select="PONumber"/>
</PONumber>
<POLine>
<xsl:value-of select="POLine"/>
</POLine>
<QTY>
<xsl:value-of select="Quantity"/>
</QTY>
<VendorMaterial>
<xsl:value-of select="VendorMaterialNumber"/>
</VendorMaterial>
<AccountRef>
<xsl:value-of select="AccountReference"/>
</AccountRef>
<ConsignNumber>
<xsl:value-of select="ConsignmentNumber"/>
</ConsignNumber>
<CarrierURL>
<xsl:value-of select="CarrierURL"/>
</CarrierURL>
<ConsignURL>
<xsl:value-of select="ConsignmentURL"/>
</ConsignURL>
</Lines>
</xsl:if>
</xsl:for-each>
</ns1:MT_Tracking>
</ns0:Message1>
<ns0:Message2>
<ns2:MT_Tracking xmlns:ns2="http://www.findel-education.co.uk/ecc/ax/po/ftp">
<xsl:for-each select="POTRACKING/Lines">
<sap:call-external class="ZCL_VNAP_OBJECTS" method="CHECK_PO_EXIST">
<sap:callvalue param="IP_EBELN" select="string(PONumber)"/>
<sap:callvariable name="vFlag" param="EP_BOLEAN" type="string"/>
</sap:call-external>
<xsl:if test="$vFlag = 1">
<Lines>
<DDate>
<xsl:value-of select="DespatchDate"/>
</DDate>
<PONumber>
<xsl:value-of select="PONumber"/>
</PONumber>
<POLine>
<xsl:value-of select="POLine"/>
</POLine>
<QTY>
<xsl:value-of select="Quantity"/>
</QTY>
<VendorMaterial>
<xsl:value-of select="VendorMaterialNumber"/>
</VendorMaterial>
<AccountRef>
<xsl:value-of select="AccountReference"/>
</AccountRef>
<ConsignNumber>
<xsl:value-of select="ConsignmentNumber"/>
</ConsignNumber>
<CarrierURL>
<xsl:value-of select="CarrierURL"/>
</CarrierURL>
<ConsignURL>
<xsl:value-of select="ConsignmentURL"/>
</ConsignURL>
</Lines>
</xsl:if>
</xsl:for-each>
</ns2:MT_Tracking>
</ns0:Message2>
</ns0:Messages>
</xsl:template>
</xsl:stylesheet>Hi Hareesh,
Please find my determination in the XSLT below, I am using enhanced receiver determination.
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:sap="http://www.sap.com/sapxsl" xmlns:p1="http://sap.com/xi/XI/System" xmlns:ns="urn:sap-com:document:sap:idoc:messages" version="1.0">
<xsl:variable name="vFlag"/>
<xsl:variable name="vAX" select="0"/>
<xsl:variable name="vSAP" select="0"/>
<xsl:variable name="vBoth" select="0"/>
<!-- <xsl:variable name="vPONUM" select="POTRACKING/Lines[1]/PONumber"/>-->
<xsl:template match="/">
<xsl:for-each select="POTRACKING/Lines">
<sap:call-external class="ZCL_VNAP_OBJECTS" method="CHECK_PO_EXIST">
<sap:callvalue param="IP_EBELN" select="string(PONumber)"/>
<sap:callvariable name="vFlag" param="EP_BOLEAN" type="string"/>
</sap:call-external>
<xsl:choose>
<xsl:when test="$vFlag = 0">
<!-- <p1:Receivers>
<Receiver>
<Service>
<xsl:text>BS_AXAPTA_TST</xsl:text>
</Service>
</Receiver>
</p1:Receivers>-->
<xsl:variable name="vAX" select="$vAX + 1"/>
</xsl:when>
<xsl:when test="$vFlag = 1">
<!-- <p1:Receivers>
<Receiver>
<Service>
<xsl:text>BS_ECQCLNT300</xsl:text>
</Service>
</Receiver>
</p1:Receivers>-->
<xsl:variable name="vSAP" select="$vSAP + 1"/>
</xsl:when>
</xsl:choose>
</xsl:for-each>
<xsl:if test="$vSAP > 0">
<xsl:if test="$vAX > 0">
<xsl:variable name="vBoth" select="$vBoth + 1"/>
<xsl:variable name="vSAP" select="0"/>
<xsl:variable name="vAX" select="0"/>
</xsl:if>
</xsl:if>
<xsl:if test="$vBoth > 0">
<p1:Receivers>
<Receiver>
<Service>
<xsl:text>BS_AXAPTA_TST</xsl:text>
</Service>
</Receiver>
<Receiver>
<Service>
<xsl:text>BS_ECQCLNT300</xsl:text>
</Service>
</Receiver>
</p1:Receivers>
</xsl:if>
<xsl:if test="$vAX > 0">
<p1:Receivers>
<Receiver>
<Service>
<xsl:text>BS_AXAPTA_TST</xsl:text>
</Service>
</Receiver>
</p1:Receivers>
</xsl:if>
<xsl:if test="$vSAP > 0">
<p1:Receivers>
<Receiver>
<Service>
<xsl:text>BS_ECQCLNT300</xsl:text>
</Service>
</Receiver>
</p1:Receivers>
</xsl:if>
</xsl:template>
</xsl:transform>
Maybe you are looking for
-
SSRS Expression Currency Format
Hi, I have "$ 1234000.00" as Dollar amount but want to display "$ 1,234,000". Have tried the following which is not working. This is in the format field for the text box, when i take properties. '$'#,0,;('$'#,0,) after setting the choices below. The
-
After downloading 2 days ago $35.00 of TV episodes on the iPhone 4s because it had the memory, my computer does not. I was also taking advantage of a friend's high speed internnet f that I don't have at home, I ended 2 weeks of agony by returning the
-
How do I save the file after I have converted it from pdf to word
HOW DO I SAVE A FILE AFTER I HAVE CONVERTED IT FROM PDF TO WORD
-
Converting footage from 23.97 to 29.97
I have a HD1080 footage uncompressed at the frame rate of 23.97 I would like convert it into a 29.97 frame rate. What is the best way in Final Cut to maintain the same kind of quality from the original footage? Right now I put the clip in the Timelin
-
Trouble Sync for Treo650 with Windows XP Home Edition
Please let me know if you can help me with the trouble shoot, I cannot SYNC CONTACTS, CALENDAR, ETC.... Post relates to: Treo 650 (Cingular)