cancel
Showing results for 
Search instead for 
Did you mean: 

Sending mail after file has been created

Former Member
0 Kudos

Hi Friends,

I am doing File to File scenario, Here is the decription:

PI 7.0, sender file adapter is picking IDOC-XML(IDOCs of type INVOIC02 ) file and generating text file (using XSL) and sends it to third party.

After generating text file, one html report has to be sent as attachment to mail,indicating these many invoices (BELNR) has been processed.

For generating mail report I am using XSL. XSL also takes same input which PI 7.0 sender adapter picks(i.e. IDOC-XML file) to generate text file.

Mail has to be generated only after text file has been generated.

I need help togenerate mail report, text file is generating properly.

Would be good if I can avoid BPM.

I found one solution:

In sender file adapter while picking file, file will be archived in some location.

In receiver file adapter, after sending text file, one script can be written(OS command after processing), which will move file from archived location to dummy folder.

And one new scenario , File to Mail , can be configured, where sender file adapter will pick file from dummy folder location , which we used earlier in File to File scenario.

But here, how to get exact file name in script(which will be written in receiver file adapter), to move file from archived location to dummy folder.

Because, In sender file adapter I am picking files (.xml).*

And I am agian using DynamicConfiguration in Java mapping to generate dyanmic file name.

I hope, scenario would be clear.

Please revert back ot me for more clarification.

Best Regards,

Divyesh

Accepted Solutions (1)

Accepted Solutions (1)

former_member192295
Active Contributor
0 Kudos

Hi,

We can do your scenario without BPM. Follow below steps

1. Once first scenario is executed Text file will be generate and meanwhile archieving same file to one folder

2. In first interface receiver channel execute OS batch command to copy that file into mail folder folder (for mail)

3. Configure file to mail scenario and pick file from above mentioned mail folder and send data through mail.

4. Once file is picked from mail sender folder delete file immediately ( to avoid duplication) from mail folder

File to mail scenario find below link

/people/prasad.ulagappan2/blog/2005/06/07/mail-adapter-scenarios-150-sap-exchange-infrastructure

I hope now clear

Former Member
0 Kudos

HI, NALLAM GUNA RANJAN.

Thanks for your reply.

I need to send mail report, which is different from text file generated by receiver file adapter.

For generating mail report , XSL is ready and it requires same input IDOC XML file, which is picked up by sender file adapter.

I can not copy that text file in to mail folder, whic hwill be of no use.

Thanks again,

Divyesh

Former Member
0 Kudos

All you need to do is add multiple receivers in Receiver Determination and select the option "Maintain Order at Runtime". First receiver will be your File BS and next your Mail BS.

This always ensures, the mail is sent only when the file is written successfully.

Regards

Jai

Former Member
0 Kudos

Hi,

I understood your valuable inputs.

Nut how about getting filename which PI sender file adapter picks and archives in folder, Because archive folder may contain many files, so how script(written in receiver adapter) can get file name to move file from archive location to folder from which file to mail scenario will start.

sorry for late response.

Best Regards,

Divyesh

Shabarish_Nair
Active Contributor
0 Kudos

>

> Hi,

> I understood your valuable inputs.

> Nut how about getting filename which PI sender file adapter picks and archives in folder, Because archive folder may contain many files, so how script(written in receiver adapter) can get file name to move file from archive location to folder from which file to mail scenario will start.

> sorry for late response.

>

> Best Regards,

> Divyesh

As jai mentioned just use the maintain order at runtime for your requirement of sending the mail after the file.

But i am confused on the above what you have wrote. Why exactly do u need a script and another adapter?

Former Member
0 Kudos

Hi Shabarish,

Thanks for your reply.

I was working on solution proposed by NALLAM GUNA RANJAN.

But as you and Jai mentioned, but I think Maintain Order At Runtime option is available with Interface determination not with Receiver determination.

In my case, From same Input file(from which Text file is generated) mail report has to be generated but after creation of text file only.

Thanks

Best Regards,

Divyesh

Shabarish_Nair
Active Contributor
0 Kudos

>

> Hi Shabarish,

> Thanks for your reply.

> I was working on solution proposed by NALLAM GUNA RANJAN.

> But as you and Jai mentioned, but I think Maintain Order At Runtime option is available with Interface determination not with Receiver determination.

> In my case, From same Input file(from which Text file is generated) mail report has to be generated but after creation of text file only.

>

> Thanks

> Best Regards,

> Divyesh

1. In case you intend to use maintain runtime then use a single receiver and add multiple inbound interfaces. This is the easiest solution

2. use a BPM. use send steps in serial. First send step should be File (request for acknowledgment) and then followed by send step for mail.

Do not go for scripts etc unless no other solution persists since maintenance and support in the future will always be an issue.

let me know if u still have issues.

Former Member
0 Kudos

Hi Shabarish,

Shabarish, thanks for your resoponse.

Could you please elaborate more on BPM steps:

Actually, For sending mail, I need to have same input file from which i am creating Text file.

For both mappings i.e. File to Text file and File to Mail, I have written XSL mappings.

Let me give you my steps:

Receive(receive input file) -> Transformation(Generate Text file) -> Send(With Transport acknoledgement) , what should I do further, for sending mail.

And how about ID configuration, Do i need to take different BS for mail?

Best Regards,

Divyesh

Former Member
0 Kudos

receive --> Transformation1(File to text File) -- Send 1-- Transformation2(file to mail)--> send 2

about using BS, that depends on requirement

Shabarish_Nair
Active Contributor
0 Kudos

as mugdha has mentioned

receive --> Transformation1(File to text File) -- Send 1-- Transformation2(file to mail)--> send 2

Note that the incoming abstract file interface is accessible till the end of the BPM so you can use the same for the second transformation also.

But still i suggest avoid BPM. Use a single BS as receiver and add the multiple interface in one interface determination and use the maintain order option

Former Member
0 Kudos

Hi Shabarish,

thanks for your response again.

But Maintain Order at Runtime will work at Message level, not at adapter level.

Requirement is that Mail should go only after text file has been generated, and text file will generate after passing thru Interface determination phase and then Receiver adapter will come in to picture, I want Mail to be sent after this Adapter processing only.

Best Regards,

Divyesh

Shabarish_Nair
Active Contributor
0 Kudos

it will maintain the order. Trust me

Former Member
0 Kudos

Hi Shabarish,

As usual, I trusted on you and it worked

Thanks man, One more query:

In case of error at first message delivery:

If first Message fails then message status goes in to waiting initially and then System Error and

Second message goes in to Holding state.

If everything is fine:

Then I have to simply resend first message and then both message comes in to Successful state.

Now No BPM is involved, I just want to confirm whether this is right approach.

Best Regards,

Divyesh

former_member206760
Active Contributor
0 Kudos

yes you are right.....

if first message in the EOIO goes in error ...you can try resending it once or twice...if it goes succesfully then all the holding messages behind it which are in the same Q will go OK..

but even if after restart it doesnot go.....just cancel that message and after that you will have to restart very first holding message which is immediatley behing that sys error message ....you will get this thru the sequence number ....after doing this all the holding messages will go OK...

Sequence number plays a part here suppose message no 41 is in sys error and because it is not restatable you cancel it....then you have to find the first message which is in holding state in the same Q ...say message with seq number 43 and then restart it ..others in that Q will go automatically...

Edited by: Tarang Shah on Mar 27, 2009 11:46 AM

Answers (1)

Answers (1)

Former Member
0 Kudos

I feel this scenario can be acheived with BPM

Use acknowledgement from send step and after receiving that use receiver determination for sending data through mail

But with out BPM if an error occured in first scenario how about the second scenario and if poll interval b/n two needs to be sync.

All the best for best design

Rajesh

Former Member
0 Kudos

Hi Rajesh,

Hey Rajesh, thanks for quick reply.

About Sync of polling intervals, that can be achieved as I will put file in dummy folder only after Text file has been generated, so mail will not go (as next scenario of FIle to Mail will not be trigerred until text file has been generated.

Best Regards,

Divyesh