on 11-23-2016 2:59 PM
Hi Experts,
We are working on PI 7.3 dual stack, where the requirement is File to File where the input will be text file containing string '#$' and expected/output file is also text file with same content but the string '#$' in the input file should be replaced by 'nl' or '/n' [next line] in the output file. I mean number of lines formed in output file is dependent on number of '#$' strings present in the input file. I already tried FCC as posted in the link Handling Flat file in SAP PI 7.3 dual stack but I could not achieve this using the same/none helped me. Can you please help me with java mapping code or custom adapter module code to achieve this requirement. I have attached both input[actual-input.txt] & output[expected-output.txt] files here. Kindly help.
Thanks,
Ramu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Evgeniy,
When I click on properties of the file present in input NFS folder present locally in PI the type of file is "File" but not "TXT" as shown in below snippet.
When open with notepad the file would look like as shown below without "#$",
Can you please guide me on how to handle the file with type of file as "File" in PI? Also file opened with notepad do not contain "#$".
Thanks,
Ramu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Evgeniy,
The client changed requirement like sometimes the file comes without special character string "#$" also and remaining times with special characters "#$". Like as shown in below snippets:
CASE1: File with special characters "#$':
CASE2: File without special characters "#$" :
The splitting of file in CASE1 is possible as suggested by you both how to split the file in CASE2. In both cases file content should be separated as lines and the resulting file should look like below i.e., each line will either start with SIV8001 or IL18001.
Kindly help.
Thanks,
Ramu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Evgeniy,
Where should I use MessageTransformBean whether in sender or receiver channel or both as suggested by you? Kindly suggest.
Thanks,
Ramu.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ramu!
You use MessageTransformBean modules in sender adapter before adapter's standard module. Further you can use simple pass-through scenario to transfer your result plain text file to end point.
Regards, Evgeniy.
Hi Evgeniy,
You are champ ! It works like charm. Thanks a ton for your help.
Thank you!
Ramu.
I'm glad that it helped 🙂
Regards, Evgeniy.
Hi,
What was your FCC in sender CC. It should work without any issue.
Put Record.fieldSeparator and Record.endSeparator both '#$' along with Record.FieldNames = Line
Thanks,
Apu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
98 | |
11 | |
11 | |
10 | |
10 | |
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.