Summary
This document will help us in understanding and achieving the following scenario by using customized file adapter module.
Scenario:
· There are multiple files (set of Trigger and Main files) present in NFS location as shown below
Trigger File Name: XYZ_trigger.txt
Main File Name: XYZ_main.txt
· First , trigger file needs to be read and based on the first 3 digits (XYZ) present in trigger file name , corresponding main file needs to be read and sent as an attachment
· Both the files need to be deleted from NFS location.
· The same logic should apply for rest of the files (set of Trigger and Main files) present in NFS location.
Note: The above scenario can be extended to read multiple data files as well and send them as attachments. Also, corresponding files can be converted in to XML payloads inside the module itself and send it to PI Adapter Engine for further transformation
Prerequisites
· Java and PI Knowledge.
· SAP PI 7.31(Single Stack),SAP NetWeaver Developer Studio 7.31 SP07,Java Version 1.6.
Details
Sender FILE Channel Configuration
Once the Adapter module has been deployed on PI server, the module needs to be maintained in sender FILE adapter. Please find the below sender channel configurations for the same.
NFS location contains the following files
Sender Channel is started and the following audit logs can be seen in the Audit logs
As shown in the screenshot above, the Trigger file name is being read. First 3 characters of the trigger file name is being retrieved and based on the 3 characters , corresponding Main file is being read , deleted and the main file is being created as an attachment.
In the following screenshot you can see the 101_main .txt file being created as attachment to the main payload
In the following screenshot you can see the 102_main .txt file being created as attachment to the main payload
Following is the main payload that is being generated by the module
Related Content
Please refer to my blog:http://scn.sap.com/docs/DOC-44536on SCN in order to setup NWDS for creating customized adapter module.
PFA Adapter module code for reference .
Regards
Vinay