on 08-17-2016 11:16 AM
Hello Everyone,
I have a scenario, where we get 4 different types of files in the same folder. Two files are in XML format and other two are in text format and all these four files have same naming convention and they will be placed in same folder.
Previously we were getting only two XML files and the structure of the files were almost same, hence i had used a common XSD to accommodate both the structures and differentiate them in the Interface determination using XPath expression and have different operation mapping.
Now there are two additional text files which are placed in the same folder with same naming convention as above two XML files. I need to take these two files and drop into one of the folder of ECC system.
Can you please let me know how to accommodate this in my scenario?
Regards,
Nitin Deshpande
Hi Nitin,
When you say file-naming convention is same do u mean even the extension of .txt and .xml file are same ? or their is no extension at all.
If you have extension respectively i.e as .txt/.xml then you can do filtering in RD/ID.
Br
Manoj
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Mark/Manoj,
Thanks a lot for your reply.
Unfortunately, the filename extension are random actually. Files come from SWIFT and it adds up some random reference number at the end hence even the filename extension becomes unique for all the files.
Only way to differentiate them is based on the data present inside them.
Regards,
Nitin
Hi Nitin,
Here's a little POC for you:
I made the sender file channel not to use any extensions:
Receiver determination:
Use xpath to check the existence of a field for the payloads that use XML. In the no receiver found behavior, enter the receiver which accepts text files. In my case it is BC_RD2
Sample test:
Routed to BC_RD2
Test2:
Routed to BC_RD
Regards,
Mark
Hi Mark,
Sorry for the delay in reply. I used the exact same solution for my scenario. Very happy to see, we approached the same method to resolve this.
Actually i had to convert the data into XML. Because i had to differentiate between the four type of files and route them separately -
Below are the steps which i followed -
1. I read the complete data into a single field using FCC.
2. Used XPath expression with consists of function to differentiate between the text file and XML file. In one of the text file we have one fixed ID being generated this was used in the RHS of consists-of function and routed this to one of the receiver which is a ECC system
3. And for the XML files, i checked if the Root tag of XML is present and routed this to another receiver, which is PI system. I placed this in SAP PI system temporarily and ran another ICO to pick this file and map it to proxy. I had to use another scenario for differentiating the two types of XML files using XPath expression.
4. If the above both condition in 1st ICO fails, then the files will be routed to another receiver which places the files directly in one of the folder. This is another text file.
Thanks a lot for your detailed reply and POC.
Regards,
Nitin
You can try this,
Use ASMA "FileType" while picking the file,
Configuring the Sender File Adapter - Advanced Adapter Engine - SAP Library
And use it in your routing condition,
Using the Expression Editor - Integration Directory - SAP Library
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ambuj,
The fileType only has two values: bin and text. However, in the fileSender CC there is no dynamic option for fileType, meaning the value that the dynamic configuration will retrieve is the value set in the channel.
You can do a small test to confirm. Try uploading a text file when the fileType is bin and it will give you bin
Regards,
Mark
Hi Nitin,
In the condition editor for receiver determination, select context objects (xpath is the other option), scroll down and select FileName. Then use the approx sign (wavy equal) and then input .txt.
Regards,
Mark
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
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.