cancel
Showing results for 
Search instead for 
Did you mean: 

SAP PI 7.31 - Dynamic Sender File Pickup based on current date

former_member191528
Participant
0 Kudos

Hello All,

We have a requirement where we want to pick up file from File Location and dynamically post it to SAP based on the current date.

For example we have multiple folders one for each year and each one has one file for each month

2015

Jan.txt

Feb.txt

Mar.txt
Apr.txt

May.txt

Jun.txt

...

...

...

Dec.txt

2016

Jan.txt

Feb.txt

Mar.txt

Apr.txt

May.txt

If the current date is 05/01/2016 then we have to go to 2016 folder and pick up the May.txt file.

Alternatively is there a way to pass the File Name which needs to be picked ?

Thanks,

Kiran

Accepted Solutions (1)

Accepted Solutions (1)

bhavesh_kantilal
Active Contributor
0 Kudos
  • There is no direct way to do this.
  • Couple of options,
    • Use Integration Directory API to update the Source Directory in your Sender File adapter programatically. You can have either a separate interface that does that or a external Java / .Net based Program.
    • Do it manually every month

Regards

Bhavesh

former_member191528
Participant
0 Kudos

Thanks Bhavesh for the info. I never knew we had Integration Directory APIs. That makes PI even  more powerful. What use cases have you used it ?

Also the business kind of agreed to not go with dynamic file location approach for now. But we will surely use it if we have to.


Based on latest update we have to use it. So I will be looking up blogs for it.

Appreciate your inputs.

Thanks,

Kiran

bhavesh_kantilal
Active Contributor
0 Kudos

Here is blog that can act as a starting guide on the integration directory API

former_member191528
Participant
0 Kudos

Thanks Bhavesh !! We are planning to write the code in ABAPA and expose the interface using sproxy. Hopefully that should work too.

Answers (2)

Answers (2)

Former Member
0 Kudos

Have you considered Using an OS command before message processing in the file channel? you can write a BAT file or shell script to move the file from where PI can pick it up. its a fairly simple process instead of using a java mapping or adapter module.

former_member190293
Active Contributor
0 Kudos

Hi, Kiran!

As Bhavesh said, there is no direct way. One thought: what if to execute Operation System command before checking for a file? There you could use some OS script to move needed file to separate predefined folder and pick the file out from there.

Just as idea .

Regards, Evgeniy.

bhavesh_kantilal
Active Contributor
0 Kudos

Good one Evgeniy! I keep forgetting that one can execute scripts on the File adapter!

former_member190293
Active Contributor
0 Kudos

Hi Bhavesh!

"Isnt this why we like the forum?

It reminds us of things we probably don't do everyday so when a real problem comes up we are prepared!" (c) Bhavesh Kantilal

Cheers, Evgeniy.

former_member191528
Participant
0 Kudos


Hi Evgeniy,

That is also another option we were planning to pursue. We will try the Integration Directory API and call it from ECC.

Thanks,

Kiran

bhavesh_kantilal
Active Contributor
0 Kudos

Haha.. What goes around comes around eh?

former_member182412
Active Contributor
0 Kudos

Hi Kiran,

Alternatively you can achieve this using enhanced receiver determination to ignore other files, check below blog for more details.

Regards,

Praveen.

former_member191528
Participant
0 Kudos

Hi Praveen,

That's phenomenal. Truly appreciate you taking time to write the blog to resolve our issue.

Best Regards,

Kiran