cancel
Showing results for 
Search instead for 
Did you mean: 

SFTP to File Scenario using multiple files

Former Member
0 Kudos

Hi All,

I have a scenario wherein 2 separate CSV files ex a.csv and b.csv has to be picked up from the SFTP folder and the same has to be mapped and send to one single file ex c.csv.

Say a.csv contains fields Name,Address and b.csv contains Phone,Mobile and I need to map them as per FSD into c.csv which will then have Name,Address,Phone,Mobile

I am bit confused on how to do it.

Shall I use Additional File name option in SFTP sender channel configuration? In that case how will I use the FCC as we have 2 separate csv files and both the files are CSV files and needs to be converted to XML.

Any related threads will help.

Regards,

Shaibayan

Accepted Solutions (1)

Accepted Solutions (1)

iaki_vila
Active Contributor
0 Kudos

Hi Shaibayan,

The most common way is to collect the messages via ccBPM or SAP Netveawer BPM but there is the possibility to pick up the the additional files as attachements and later acces to attachments.

Check similar discussion here

How to read attachments;

Regards.

Former Member
0 Kudos

Hi Inaki,

Thanks for your reply.

BPM is not an option in our case as we are told not to use BPM.

However as per the thread from Michael

"pick both files in one run (one as file, the other one as attachment - so one communication channel )

inside the mapping you can get the values from the attachment and do the mapping"

This part is fine and we can do the mapping by creating N:1 mapping but since our files are .csv files so a content conversion is required for both the a.csv and b.csv. How to go through with this.

The structure will be something like below in the message mapping after we add both the source structures in Signature Tab:

Message

     Message1

          MT_FILE_A

               RecordSet1

                    Name

                    Address

                    Field3

     Message2

          MT_FILE_B

               RecordSet2

                    Phone

                    Mobile

Can I use the below values for Content Conversion?

Document Name:MT_FILE_A,MT_FILE_B

Recordset Structure:RecordSet1,*,RecordSet2,* or we have to use MT_FILE_A.RecordSet1,*,MT_FILE_B.RecordSet2.*

And in the Name Value for Name do we need to use dot for each Document Name i.e.

MY_FILE_A.RecordSet1.fieldSeparator?

Regards,

Shaibayan

Shabarish_Nair
Active Contributor
0 Kudos

any particular reason you cant use a BPM for this? (Please read: )

These are typical use cases for using BPEL/BPMN based interactions. On the other hand, if you want to avoid BPM, it will only create a complex interface. the solutions potentially are;

1. Use additional files option, then read the attachment, convert it to and xml and then merge them together.

2. Split the flow into three. Flow 1 to convert file A as XML, Flow 2 to convert file B as XML and Flow 3 to use additional files, read the attachment and then do the mapping. Advantage - Avoids the headache of converting CSV to XML using code.

3. Append File A into File B and then use another interface to read this single file and do the processing that fits you.

overall, i think you should use BPM as these are the requirements where it fits the need.

Former Member
0 Kudos

Hi Shabarish,

I read you doc and yes its the customer who are not comfortable with the use of BPM.

For the solution 1 I am using Additional File in Sender SFTP Adapter(advantco) and Read Attachment in Operation Mapping. However for the Sender structure and Content Conversion I am confused about the exact structure as mentioned in reply to Inaki.

Can you comment on that?

Thanks,

Shaibayan

iaki_vila
Active Contributor
0 Kudos

Hi Shaibayan,

As far as i know you dont get two messages with the additional file option, You would need as attachment in your SOAP payload then you would need to access to this attachment and to read sequentially without file content conversion possibility and to do the XML treatment manually in a UDF or java mapping.

I dont know a better option but may be someone had an easier option, you can wait.

Hope this helps.

Regards.

Answers (0)