Skip to Content
0

File/SFTP adapter - Read a file .dat only when .job file exists

Feb 09 at 04:44 AM

109

avatar image
Former Member

Hi Experts,

I need help in designing an interface with File adapter or SFTP adapter only in SAP PO 7.4. Requirement is to read a file called ".dat" in a third party system only when ".job" file exists, the filenames will be the same but the extensions are different. Based on the filename of .job the corresponding .dat file alone should be read and also content conversion needed for the ".dat" file. I am using SAP PO 7.4.

Please suggest me a best approach to do this.

Thanks & Regards,

RV

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Evgeniy Kolmakov Feb 09 at 10:07 AM
1

Hi RV!

Isn't "Additional files" option of sender file channel what you're looking for?

https://help.sap.com/saphelp_nw73/helpdata/en/44/682bcd7f2a6d12e10000000a1553f6/frameset.htm

Regards, Evgeniy.

Show 5 Share
10 |10000 characters needed characters left characters exceeded

RV

Following Evgeniy's idea, you definitely will need to add "PayloadSwapBean" & "MessageTransformBean" in "Module" tab of sender communication channel object to swap your main payload with attachments and to conducting content conversion.

For PayloadSwapBean & MessageTranformBean you can refer following links

https://help.sap.com/viewer/2462a9a468b1491b91fda1923d23f667/7.5.10/en-US/2ebf37423cf7ab04e10000000a1550b0.html

https://help.sap.com/viewer/2462a9a468b1491b91fda1923d23f667/7.5.10/en-US/570b2c4142aef623e10000000a155106.html

0

Hi Chih-Chieh!

I'm not quite sure about MessageTransformBean, but it's no need to swap payloads since the .dat file is taken as main payload and the .job file - as attachment.

I guess that built-in FCC transformer will work as well by default using this configuration (without using MessageTransformBean as separate module)

Regards, Evgeniy.

0

Thanks the feedback, Kolmakov

You are right, I got a mental mistake and thought this was another familiar scenario I encountered.

Cheers, Chih-Chieh

0

The OP has opted for another solution, see comment under Iñaki Vila 's answer. However, I think your's would be the preffered answer since it has all the bells and whistles the OP wanted just out of the box.

To be honest, I first was thinking this ought not work as the additional files (*.dat) will just gete all polled no matter if there's a corresponding *.job file but according to help that shouldn't be the case. Well done SAP :-D

Thanks for having me discover another feature :-D

Cheers

1

Hi Jens!

Thanks for your feedback. Yes, I consider this way to be the most straightforward and easy to use.

Regards, Evgeniy.

0
avatar image
Former Member Feb 09 at 06:42 AM
0

Hi RV,

I guess, you should have to go with OS command to achieve the above requirement.

Regards,

Manoj Kumar

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Manoj,

Yes this is one option I had in my mind. But want to know whether the

1. OS command works in the third party system?

2. I want to read only the .dat file when .job file exist. How you will have this condition with OS command? Because I want to read the .dat and do content conversion and I am doing nothing with .job file.

Thanks & Regards,

RV

0
Iñaki Vila Feb 22 at 09:03 AM
0

Hi RV,

Another option could be to do the poll only to the .job file, then at mapping level do a file lookup to the .dat file (https://blogs.sap.com/2016/04/30/file-lookup-in-sap-pi-using-udf/).

If you don't need to do a map or to use SFTP, that option can be weird. Then, i would do a little trick if you have an SAP ERP involved. You do the pool for the .job file and to call an ERP RFC/proxy and this start a second scenario to poll the .dat file: https://blogs.sap.com/2011/05/24/startstop-a-communication-channel-from-an-abap-program-using-the-external-control-switch/

Regards.

Show 1 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Inaki,

I have created 2 ico - 1 for executing with *.job with OS command to move the *.dat to different folder if *.job exists. 2nd interface will directly pull the *.dat and do the content conversion. I am not sure whether its a best design but it is working now.

Thanks for showing me an another option "File Lookup" I will explore that option too whether its feasible to use in my interface.

0