on 07-04-2011 7:52 AM
Dear experts,
I have set up an XSLT mapping that dynamically sets the Directory:
<xsl:param name="inputparam"/>
<xsl:param name="TargetFolder">
<xsl:choose>
<xsl:when test="$storeCode='1234'">
<xsl:value-of select="'BDX'"/>
</xsl:when>
<xsl:when test="$storeCode='4998'">
<xsl:value-of select="'CRB'"/>
</xsl:when>
<xsl:when test="$storeCode='1326'">
<xsl:value-of select="'OLR'"/>
</xsl:when>
<xsl:when test="$storeCode='88746'">
<xsl:value-of select="'ROM'"/>
</xsl:when>
<xsl:when test="$storeCode='16781'">
<xsl:value-of select="'TRY'"/>
</xsl:when>
</xsl:choose>
</xsl:param>
...
<xsl:variable name="__function" select="dyncfg:init($inputparam)" />
<xsl:variable name="__function" select="dyncfg:putValue('http://sap.com/xi/XI/System/File', 'Directory', $TargetFolder)" />
In receiver FTP channel I use:
- AF_Modules/DynamicConfigurationBean
key.0 "write http://sap.com/xi/XI/System/File Directory"
value.0 "message.interface"
- Variable replacement
targetfolder "message:interface_namespace"
- ASMA
Directory
- Target Directory
%targetfolder%
So everything is set up correctly and it also works fine. But sometimes the FTP receiver channel does not get the Directory (I do not know why) and RWB gives the error:
com.sap.aii.af.ra.ms.api.RecoverableException: The Adapter Message Property 'Directory' was configured as mandatory element, but was not supplied in the XI Message header: com.sap.aii.adapter.file.configuration.DynamicConfigurationException: The Adapter Message Property 'Directory' was configured as mandatory element, but was not supplied in the XI Message header
Is there a safer way to accomplish what I am doing? Should I go for a Java mapping?
Thank you for your ideas and best regards,
Peter
Edited by: Peter Wallner on Jul 4, 2011 8:53 AM
Hi Peter
You can do it with XSLT mapping. Check this help page:
http://help.sap.com/saphelp_nw70/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/frameset.htm
The syntax shown there is a bit different from what you wrote in your post.
Regards,
Giuseppe
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Check the source message contents for "storeCode" values. It seems some times when your source file doesn't contain the "storeCode" hardcoded values (as mentioned in your code) then it is going into error becaue there is no default directory name present when your condition fails.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Sarvesh,
Thank you for your hint. In this scenario messages are sent once during the night, 5 messages at once. And always the first message does not get the correct directory. Somehow it does not get the "storeCode". The other 4 messages that come after have no problem. I am on PI 7.0.
Are there any workarounds for that?
Best regards,
Peter
>Somehow it does not get the "storeCode".
If you are sure that storeCode should be there for 1st message but it is not getting somehow then you need to find that reason.
The workaround could be sttting up a default "storeCode" in case when conditions fails.
You can also setup the directory by using a UDF (dynamic configuration method) if you think XSLT is not working fine.
Hello Sarvesh,
Thank you again. I did go for a JAVA mapping now because I can't use graphical mapping in this scenario.
Now I created it and when I look in SXMB_MONI in the "DynamicConfiguration" it tells me "Directory" and "FileName" which is good.
But when I check in RWB the messages get stuck and it says "write property message.interface from key (http://sap.com/xi/XI/System/File)Directory with value null;"
Does the order in the DynamicConfiguration matter? In MONI it looks like this:
- <SAP:DynamicConfiguration xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">
<SAP:Record namespace="http://sap.com/xi/XI/System/Directory" name="Directory">CRB</SAP:Record>
<SAP:Record namespace="http://sap.com/xi/XI/System/File" name="FileName">EXPORT_1401_2011-07-03.xml.zip</SAP:Record>
</SAP:DynamicConfiguration>
But normally the "FileName" is always first, isn't it?
Thanks again and best regards,
Peter
Hello Sarvesh,
In the Sender Channel I have checked "Filename" and in the Receiver Channel I have checked "Directory". And that works too.
And I assume that Java is more reliable than XSLT when having numerous directories to write the files to.
Best regards,
Peter
Edited by: Peter Wallner on Jul 5, 2011 3:26 PM
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.