on 03-11-2008 4:47 PM
Hello,
I have a File (xml) -> PI -> File (flat) scenario where I need to maintain a part of the sender filename and use it in the receiver filename. This value can be one of three values (if that matters).
I envision having to get the filename value into my payload and then using receiver filename substitution. But how would I get the filename into my payload? Is there another way to "carry" part of the filename over to my output?
example:
sender files: A.123.X, A.456.X, A.789.X
- need to do mapping into new format and create...
receiver files: B.123, B.456, B.789
(the 123, 456 and 789 are not in the original payload data)
Thanks,
Keith
Had to use multiple inbound CCs and duplicated maps with hardcoding since the filename values were not making it through my entire flow.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try following this weblog for dynamic file name.
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
Dynamic filename come under the Dynamic configuration in moni, for your messages.
This is the code used inside.
DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);
DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");
String ourSourceFileName = conf.get(key);
return ourSourceFileName;
Use this code to get the filename from the payload then once you get the filename write the one more UDF to read the only that part of filenmae which you want and at the receiver end use the variable substution to get the fileanme at receiver as sender one
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You guys have me going in the right direction, but now I think my issue is that I don't have a simple File->File mapping in PI. I set the ASMP values (step 1 and step 2 in blog 2664) and see that the DYNAMIC CONFIGURATION value is there in SXMB_MONI.
My first mapping is an XSLT map from the XML input file into a proprietary xml file format. Then I go through the SOAP adapter and do another mapping (multimapping) in order to split out into multiple output files.
I tried adding a message mapping right before my XSLT map with the UDF to get the input filename and map it. At runtime, I am getting this error and don't see that the UDF is working to populate my data with the filename.
TransformerException: com.sap.engine.lib.xml.util.NestedException: Prefix not mapped: ns0 -> java.lang.Exception: XMLParser: Prefix 'ns0' is not mapped to a namespace
I noticed a document on XSLT mapping of ASMA (http://help.sap.com/saphelp_nw04/helpdata/en/43/03fe1bdc7821ade10000000a1553f6/content.htm), but am not sure if this would be a second XSLT map or something I could squeeze into my current XSLT map.
I also tried the UDF at my multimapping, but it seems that the ASMP values are gone by then.
Any suggestions?
More details on my issue...
When I remove my XSLT mapping to see if my first message mapping with UDF to get the filename is working....it is.
<?xml version="1.0" encoding="UTF-8" ?>
<ns0:UPS_EBR_BILL xmlns:ns0="http://www.ups.com/Billing/v1">
<ns0:InvoiceDetails>
<ns0:Invoice>
<ns0:InvoiceNumber>000000082648018</ns0:InvoiceNumber>
<ns0:File>APGI-20080105-xml.zip</ns0:File>
....
Then the aforementioned ns0 error happens when my XSLT map runs. Here is the top of my XSLT. Any suggestions on how to adjust the XSLT to handle the new ns0 or any way to get rid of the ns0 before XSLT mapping?
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns0="http://www.ups.com/XMLSchema/EBR/Billing/v1" xmlns:ns1="http://graybar.com/cold/invoice/">
<xsl:output method="xml"/>
<xsl:template match="/">
<ns1:ColdInvoiceData xmlns:ns1="http://graybar.com/cold/invoice/">
<xsl:for-each select="ns0:UPS_EBR_BILL/ns0:InvoiceDetails/ns0:Invoice">
<Invoice>
Keith,
>This value can be one of three values (if that matters).
Can u explain this? you mean the file can have either one of the file names A.123.X, A.456.X, A.789.X
raj.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
HI,
U can use dynamic configuration along with the adapter specific message attribute to get the file name into your payload.
IN file adapter for ASMA select the file name option and write the UDF in mapping.
Just refer the below link for more information.
/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14
/people/william.li/blog/2006/04/18/dynamic-configuration-of-some-communication-channel-parameters-using-message-mapping
Thnx
Chirag
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.