cancel
Showing results for 
Search instead for 
Did you mean: 

Trigger from XI to ECC

Former Member
0 Kudos

Dear All,

I would like to trigger a ECC job as soon as the Sender File channel sends a file to the destination in PI.

I do not want to use Proxy as I would have to do complex File content conversion.

The idea is that when PI archives the file in the sender channel it triggers a ECC job which in turn will execute a ABAP program and read the file from the PI archive directory and email the user with details in the file.

Please advise if there is any solution to trigger a job in ECC  based on sender file channel in PI .

Thanks,

Teresa

Accepted Solutions (1)

Accepted Solutions (1)

ambrish_mishra
Active Contributor
0 Kudos

Hi Teresa,

Simple solution would be to modify the same ABAP program to check for the presence of file in the archive directory path and then do further processing as you stated in your post. The job to execute this program can be scheduled to run as per agreed frequency.

Hope it helps!

Ambrish

Former Member
0 Kudos

Hi Ambrish,

We want to send an email as soon as PI sends out that file. The user may download multiple files back to back . So we do not want to wait for all files to go to Archive directory.

Thanks,

Teresa

ambrish_mishra
Active Contributor
0 Kudos

Hi Teresa,

In that case, schedule the batch job to run every 2 mins. Check for more than one file and move the file to another directory or delete it once it is read and send mail within a loop based on number of files present in the directory.

Alternative solution would be to create another interface which is triggered when a file is read and archived, send a proxy message to ECC with just the file name (if it is not dynamic) and this proxy code should have the code which again reads the file at specific location and send mail.

cheers,

Ambrish

Former Member
0 Kudos

Thank you . I like the second option where we can send a proxy messages to ECC with just file name.

So to trigger this interface do we need to use bpm? 

Can we use the same interface and trigger the proxy once the sender channel reads the file ? Then in the Proxy we can go to archive directory and pick up the file and email the user.

ambrish_mishra
Active Contributor
0 Kudos

I assume you are sending the file to another system as pass through. If not please explain your design.

If my assumption is right, you would need an additional inbound interface with receiver as ECC with message type having just one field and in mapping, you can write the dynamic configuration code to get the file name and populate in this field. Then your proxy code will take care of the rest.

Ambrish

ambrish_mishra
Active Contributor
0 Kudos

Hi Teresa,

Forgot to answer your question. You don't need BPM to achieve the above design. Just an additional inbound interface to be executed in sequence one without mapping (which does the pass through) and one new with mapping for getting the file name and populating it in payload for proxy.

Event based message processing is executed from PI. this does not suit your requirement. Here you need the trigger in ECC to read the file and send an email so this design can do the job.

If you want to try PI design, this is what I would suggest:

If in the email just needs total number of records and amount and this information is available, say.. in the last line of the file, then you can read the records as string with simple FCC, read the last line in mapping through a simple Java code and ignore the rest and populate it in the content of the email through graphical mapping with mail package API.

Choice is yours! decide PI and non-PI.

Hope it helps!

Ambrish

Answers (1)

Answers (1)

nabendu_sen
Active Contributor
0 Kudos

Hi Teresa,

The answer of your question is  NO. I don't think, you can trigger an ECC Job or call an ABAP program from your sender File channel. I also have another question, what is the end to end scenario of this PI interface? I can see Sender is picking up the file and Archiving it, but what next?

I really don't think you need PI in this requirement. ABAP Interface program can easily achieve this which could be written at SAP ECC side. Do you have any specific reason for using PI?

Regards,

Nabendu.

Former Member
0 Kudos

We want to use PI for Archiving. The end to end scenario is file to file. Moving file from on location to another. We want all our interfaces to go via PI for monitoring and Archiving purposes.

In this case the thought was that end user will keep downloading files to a folder location and PI will poll that folder location and as soon it finds one will send it to the target folder location .

The twist is that the user needs an email with the details in the file before file is sent out to the external partner.

Former Member
0 Kudos

I was reading the event based message triggering with dependencies posted by Krishnakumar.

http://scn.sap.com/community/pi-and-soa-middleware/blog/2007/04/12/xi--event-based-message-triggerin...

This blog was helpful but not sure how to set up my scenario. Do you think this should help my scenario?

Former Member
0 Kudos

Hi,

If i understood your scenario is once file is picked and archived then an email needs to be sent to the user filename along with content .

if yes then you can achieve this easily in PI itself..

All you need is to create two receivers one for file archiving and other for email trigger..

using this approach you can achieve this easily instead of proxy developments and all..

HTH

Rajesh

Former Member
0 Kudos

Hello,

I too think that creating 2 receivers will suit your scenario- as suggested by Rajesh

              / ----File (External System)

File ----

             \-----Mail (send mail to user - using DC read the file name and send the same in mail content)

Thanks

Amit Srivastava

Former Member
0 Kudos

Thanks Rajesh. There dont need the entire content of the file but just a few important information. If they needed the content i could have used mail adapter in PI itself.

Former Member
0 Kudos

Thanks Amit. The file is a .txt file and the end user wants an email with File name and only few values from the file for eg - Total number of records , Amount . They do not want the whole file content to be sent via email as file has confidential information.

Any other options ? Have you worked on Event based message triggering ? Will it work for my scenario?

Former Member
0 Kudos

Hello Teresa,

No, i don't have any prior exp. with this kind of event based message triggering, but u can give a try...I think, it may work but i am not not sure how u will define the sender id for interface B becoz it will be a pass through scenario to ur external system (using dummy interface objects) and if i am not wrong for defining id under SXMB_ADM u need references of actual SI from ESR?

Having said that, personally, i would have opted for  java program to read the file content and extract relevant info and then send the mail.

Thanks

Amit Srivastava

Former Member
0 Kudos

Hi Amit,

Can we do content conversion of the file an extract the relevant data ? It is just a text file with couple of lines of data and I know from which which line I need to pick up the required Total and Amount.

I can then mail this using PI ?

Is content conversion easy? Can you please share some blogs or examples of a simple content conversion?

Thanks,

Teresa