on 02-24-2015 10:51 AM
Hello!
Our partner puts 2 files on a ftp server:
123.txt
123.pdf
Our goal is only to transmit the files if both files (same filename with extensions .txt and .pdf) are available. Sometimes the printed version (.pdf) is available later and then the .txt file should not be pulled as long as the .pdf is not available.
Does anyone know how to solve this problem?
Thanks in advance for your help!
Best regards
Christian
Hi Christian
The general idea provided by the rest above to use "Additional files" feature is the right direction.
However, if you need the .txt files to be picked up ONLY when the .pdf is present, I would suggest the configuration below:-
i) Set *.pdf as the filename mask for files to pick up
ii) Set .txt as the additional file to pick up optional = NO
This is because the PDF comes later, so it should be the "trigger" file that initiates the pick up of both files.
Additionally, for this approach, if you want to just transmit the .txt file to the end location (you did not mentioned where it's going - file, proxy, idoc, etc), you will need to use PayloadSwapBean to swap the .txt file into the main payload.
There are some screenshots for such configuration in my article below. The article is for a different requirement, but the screenshots relevant to your case is in Scenario 2 section.
Rgds
Eng Swee
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Christian
Another alternative approach for you to consider since you won't be able to use SFTP.
Have a two step scenario:
Scenario 1 - pick up ALL files from FTP and deposit them into a temporary NFS location
Scenario 2 - use sender File adapter with NFS protocol to pick up the pdf and addition txt file.
This way you can use the additional files functionality in the sender NFS channel.
You still have not mentioned what is the intended target. Note that File (FTP/NFS) receiver adapters do not support attachments in case you need to deliver both files to the final destination.
Rgds
Eng Swee
Hi Eng Swee,
that's exactly the scenario I created yesterday!
Now I have to find a way that the 2 files are processed properly. One is a PDF which should only be forwarded to another server without any conversion, the second file (.txt) is a EDIFACT message which has to be converted to an IDoc. In worst case I will add a scenario 3 with 2 sender channels, one for each file.
I am also searching for a way to get rid of the error messages if the second file is missing. This situation can last for days and it would be very annoying to receive error messages all 15 minutes.
Best regards
Christian
Hi Christian
For the forwarding part to different destinations, you can try the following approach:
i) Sender NFS channel picks up PDF file and have additional files setting for TXT file. PayloadSwapBean is set in sender module chain to swap TXT file to the main payload
ii) Have 2 unconditional receivers in receiver determination - one for PDF target server, another for IDoc backend receiver. It will cause a message split with both messages having 1 main payload and 1 attachment.
iii) For PDF receiver, no mapping necessary and just send to the receiver file/FTP channel. At the receiver channel, use PayloadSwapBean to swap back the PDF file to the main payload.
iv) For the EDIFACT/TXT file, map as normal to IDoc target.
The second part of your query regarding the error messages will depend on the sequence of the files. Will the files always come in a particular sequence (irrespective of the delay between their arrival), i.e. TXT file first, followed by PDF file? If yes, then setting the file mask to pick the one that arrives later will work, i.e. the TXT file will just sit there without causing any errors until the PDF finally arrives.
If there is no guaranteed sequence, then it is more challenging - might need to think a bit more on that.
Rgds
Eng Swee
Hi Christian
For the first scenario (pick up all files and store in NFS), set ASMA for FileName at both sender FTP and receiver NFS channel.
For the second scenario, set ASMA for FileName as sender NFS channel.
1) Since the PDF is the main file being picked, the FileName will contain the PDF filename, in your EDIFACT mapping, just change the extension from .pdf to .txt
2) No changes here, just set ASMA for FileName at receiver channel.
Let me know if you need further information.
Rgds
Eng Swee
Hi Eng Swee,
thanks a lot for your help!
I have a problem with the PayloadSwapBean. If I configure the CC like you mentioned the payload isn't swapped and the system tries to convert the PDF file with the EDIFACT-/IDoc conversion:
"Additonal file" is the EDIFACT file. So I set it swap.keyValue:
If I check it in SXMB_MONI I can see that the MainDocument is the PDF file and the Additonal File is the E2X converted EDIFACT file:
Do I use a wrong setting in the PayloadSwapBean?
Thank you!
Best regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Hailong
Unfortunately, just with that information, I don't have any suggestion as the above approach would not work.
If you have more information on the actual scenario, I suggest that you open a new thread and provide as much information as possible. Then maybe the forum members will be able to come up with some suggestion specific to your scenario.
Rgds
Eng Swee
Hi Hailong,
the scenario would also work. The only problem is that you will receive an error message every time the system tries to poll the message. E.g. if in my scenario the PDF file would be available before the .txt file the system generates an error message because the mandatory "first" file is missing.
If you find a way to get rid of the error message my/Eng Swees solution should meet your expectations too.
Regards
Christian
Hi Christian,
Assuming you're sending the .pdf files just as attachment, you can use 'Additional File' feature available for Sender File Adapter. Here's the help document for the same.
You can set <Additional FileN>.optional as 'NO' to trigger errors, if files are not present.
Hope this helps.
PS. Don't forget to give points.
Regards
Bibek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bibek,
thanks for your reply!
What do you mean with ".pdf files just as attachment"? We have 2 files on the server with the same filename (the filename is unknown) and a different extension (.txt and .pdf).
Could you please verfiy the link you sent in your posting? The target isn't accessible.
Thank you!
Regards
Christian
Hi Christian,
Check Q4 in below WIKI.
Sender File Adapter Frequently Asked Questions - Process Integration - SCN Wiki
Regards,
Praveen.
Hi Christian,
I mean you're only processing(i.e. xml conversion and mapping) the .txt file and the .pdf file is to be sent as it is without any conversion or so.
The link is working fine for me. Anyways you can check here : https://help.sap.com/saphelp_nw73/helpdata/en/44/692ab8a4b633eae10000000a1553f6/content.htm
Regards
Bibek
Hi Giridhar,
thanks for your reply!
In our case the sender file adapter should check all 15 minutes if there are files available. If both files are available they should be transferred. If only one one the files is available nothing should be transfered.
As we do not know when the second file is available (could also be days later) we can't set a value for the waiting time.
Regards
Christian
Hi Christian,
You can configure the channel like below then if both files available then PI will pick up otherwise PI wont pick up it will raise an error saying that the second file is not available.
The first file will be main payload and second will be the attachment to the main payload, what is the receiver adapter in your case?
Sender Channel :
Receiver Channel:
By using store attachments i have written main payload and attachment in the target directory. I used SFTP adapter.
Regards,
Praveen.
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.