on 08-01-2016 6:57 PM
Dear Team,
I am very new to SAP PI. I have a scenario where PI will pick the .csv file from AL11 of SAP and convert to .txt file and place in to FTP location of of third party system.
I have gone through the SDN but didn't get clear solution.
Info: We are not using ESR part
.csv file contain pipe delimited between fields.
.csv structure is as attached
Could any one please provide step by step procedure.
Thanks,
Sree
Hi Sai,
If its pass through , then simply put the file name with extension .txt in the receiver file CC.
This will work without any issue.
Thanks,
Apu
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sai,
If you are new on SAP PI, then use FCC both side, at Sender as well at Receiver CC.
First, at Sender CC, use fieldSeparator as | and endSeparator as 'nl'.
And after that at Receiver CC, use fieldSeparator as ' ' and endSeparator as 'nl'.
Also with that, at Sender CC set document offset = 1, it will ignore header line.
And at Receiver CC set addHeaderLine as '1', that will again add a header line while writing it on FTP.
Save this file as .txt that's easily done at Receiver CC.
Hope it will help you.
If you are good in UDF, then try with that, because that will be much more easy for you.
Regards,
Anoop Kumar Rai
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Anoop,
Thanks for the information.
sender is .csv and receiver is txt with file name should be abc_xyz_today's date.txt.
From AL11 PI will pick the file and send it to FTP server of third party system.
CSV file is Tab delimited.
Is it possible without FCC both the ends?
Can you please share me step by step screen shot.
Thanks
Hi Sai,
For file name conversion you have to write a UDF using dynamic conversion and mapped it with any upper field. You will get this UDF from different places n internet, just Google it with Dynamic Configuration for file name, and change value of filename as your wish and DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","filename");.
It's my recommendation to use FCC in this scenario, because its difficult to hold full TSV file in a string field. Its good to separate line using FCC then spliting it into nodes in Message Mapping.
You can follow this solution to:-
1. At Sender CC, specify only endSeparater as 'nl'.
2. In data type for both Sender and receiver specify only one field like 'Text'.
3. In message mapping, just write a UDF to replace Tab with Space in string and map one to one mapping between Text-to-UDF-to-Text.
4. At Receiver CC, also same thing have to do, specify only endSeparater as 'nl'.
If you don't want to use FCC at all, (i.e, not recommended), then just take whole file content in one string node, and write a UDF to change String Array into ArrayList and then loop on ArrayList to replace Tab with Space for each row.
First specify which way you want to do then only i will able to provide screenshots.
Hope this will be help full.
Regards,
Anoop Kumar Rai
Hi Sai,
This is absolutely possible without FCC if your scenario is pass through only and you need to mapping to convert data and put into target structure.
For file name conversion in the target end just put your required file name in the receiver file CC. In the processing tab select add time stamp as file construction mode that will add the date when the file will be processed.
Thanks,
Apu
Dear Experts,
Thanks for your valuable inputs.
Since we are changing the file extension from .csv to .txt we can bypass the scenario.
From the sender side i have used NFS. But i am getting empty message and in sxmb_moni i am getting no interface action for sender and receiver found message.
Please guide me on the above issues.
Thanks,
Sree
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
do you only want to change the extension of file or you also want to change the file format?
For changing the extension you can mention the required file name in receiver adapter.
to change the format please provide the target format to provide inputs.
regards,
Harish
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear Harish,
Thanks for your inputs.
Find the .CSV file in this directory(AL11) and rename it as [today’s date (yyyymmdd)]_sample_abc.txt.
Move the file to FTP directory of third party.
From sender side file adapter we need to do any FCC?
For sender side shall we take NFS in the message protocol? At the receiver side FTP since this is from third party.
Flat File structure:
Item Field Description InfoObject template Type Length
1 Name Name 0Name Char 35
2 Type Char 1
3 Date Date 0Date DATS 8
4 Payment payment Char 1
Based on the above txt file structure please suggest and share step by step guide.
Thanks,
Sree
Hi Sree,
If you do not need to change the content or format of the file you can use the NFS at the sender side and File adapter at the receiver side without any FCC.
Please refer the below blog
http://scn.sap.com/docs/DOC-3716
regards,
Harish
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
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.