on 04-28-2016 5:05 AM
Hello Experts
I have a scenario wherein a CSV file has to picked up from a SFTP and it has to be pushed into R/3 through proxy.
The first field of the last row of the CSV file has to have a value "EOF".If the first field of the last row doesnt have this value then the file should not be picked ,It should be placed in an error folder.
I will attach the screen shot for your reference.
Please let me know if any more clarification is required.
Thanks in advance
Advit ramesh
Hello Advit,
Ideally I would still go ahead with considering this a CSV file , reading CSV to XML and then using Enhanced Receiver Determination.
Regards
Bhavesh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ramesh,
There are 3 ways as per my understanding -
1. In PI source structure define only one parameter to take each line of CSV under this parameter using FCC like -
Structure -
Record 0...unbound
Text 0...unbound
FCC -
Record.fieldName - Text
Record.fieldSeparator - 'nl'
Record.endSeparator - 'nl'
So in PI you will get value like -
<Record>
<Text>UserID,UserName,Closing Balance,.......</Text>
</Record>
<Record>
<Text>DLTR0000333153,test.................... </Text>
</Record>
.
.
.
.
<Record>
<Text>EOF,,,,................................. </Text>
</Record>
Now take the whole thing in a UDF after removing context. Here, you can take the count of records and read the last one first. Split that depending on comma and store it in a array. Check first value of array - arr[0] . If its not EOF then through an exception else map it to the target structure taking multiple result List.
But here PI will pick each file to validate the condition.
2. Go for OS Script. As your source is SFTP so you need to take it first to an NFS location and then need to go for the command prompt solution . But here one pipeline will increase.
3. Some short on Custom Module can be written for that.
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 |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
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.