on 03-18-2014 7:29 PM
Hi,
We have requirement where we are doing file pass through. But client wants PI to raise alert when it receives 0 byte file.
How can we achieve this using File/FTP/SFTP adapter when we are not reading the actual payload and doing only pass thru?
Thanks,
Vertika
Thanks for suggestion's. Just wanted to get some more clarification on alert part.
When you say throw exception if size is not equals to 0, then how exactly we can raise the alerts. One way could be not defining any receiver for that condition, but in this case the exception would always say "InterfaceDetermination did not yield any actual interface".
Can you please elaborate on exception and alert part?
Thanks,
Vertika
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you handle this condition check in receiver determination and select the radio button for throw exception then you'll get an error message as " no receiver found" and hence your alert email will contain the same.
I don't think you'll get the error text as(alert) as zero kb file.
If you would like to get that then you can define another inbound interface(file- mail) and execute it when the file size is 0. You can handle the mail content in the mapping and of-course this is independent of your alerting part.
Hello,
>>One way could be not defining any receiver for that condition, but in this case the exception would always say "InterfaceDetermination did not yield any actual interface".
In my previous reply i have just given u a pointer about how to check file size using standard way and route/fail interface.
And yes, indeed if u want to throw custom alert (stating that file size if zero or something else) then u have to add another receiver and send mail using mail adapter - that's the easy solution i can think of.
Thanks
Amit Srivastava
Hi ,
You can easily handle the scenario using Custom module .
Here is the logic:
1)Create the sender data type with additional field status 0..1
2)In sender channel check process empty files option .
3In custom module read the payload and check whether it is empty .
If it is empty then populate xml o/p payload as your mt mt,namespace<status>NV</status><mt>
If it is not empty then add this <status>V</status> after main namespace tags and then actual xml payload ,populate as custom module xml o/p
Now in receiver determination check the status field value and based on that draft either mail or actual mapping .
Here you have 2 mappings
1 Mail
1 Normal mapping .
I just given a rough idea.Think on it you can find better sol.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Vertika - You can follow Amit's suggestion. The context object is "SourceFileSize".
However in case of SFTP sender,you might have to change the namespace under " adapter specific attributes" to "http://sap.com/xi/XI/System/File" as i don't see any context object for SFTP adapter.
For some reason if you can't change the namespace may be you can make use of below..
Hi ,
I thought of suggesting the above as well ,but strike to my mind lately .Any how above is the better solution than above suggested by me .
In RD-->XPATH editor select context Object-->SourceFileSize Notequals 0 targetsystem
If no receiver found ,Process as Follows :
select the following receiver (MAILCOMPONENT)
Regards
Venkat
Hi Vertika,
AFAIK - there is no standard way for pass through interface to raise alert (for empty file). so you need to develop adapter module to raise the alert for empty file.
Please refer the help page
Configuring the Sender File Adapter - Advanced Adapter Engine - SAP Library
Under Handling of Empty Files, specify how empty files (length 0 bytes) are to be handled:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
11 | |
10 | |
9 | |
8 | |
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.