Quantcast
Channel: SCN : Document List - Process Integration (PI) & SOA Middleware
Viewing all articles
Browse latest Browse all 571

Customized File Adapter module on PI 7.31 to send main file as attachment based on the trigger file name

$
0
0

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.

 

pic1.JPG

pic2.JPG

pic3.JPG

pic4.JPG

 

NFS location contains the following files

 

pic5.JPG

 

Sender Channel is started and the following audit logs can be seen in the Audit logs

 

pic6.JPG

pic7.JPG

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

pic8.JPG

In the following screenshot you can see the 102_main .txt file being created as attachment to the main payload

pic9.JPG

Following is the main payload that is being generated by the module

pic10.JPG

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


Viewing all articles
Browse latest Browse all 571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>