Skip to Content
0

How to send mail notification based on file content

Aug 22, 2017 at 07:11 AM

66

avatar image


Hi Experts,

I am having one passthrough scenario file to email (no ESR objects ), I need to pick the file and send email notifications, which I did and working fine .

but channeling part here is ,I need read EDI file content

First of all we have to identify the data set that must be separated. Our identifier is the bank account (0001234567)which can be found in every line item starting with :80:



Example: 80:10010010/0001234567


If the bank statement for this particular bank account must be separated the whole data set starting with :82: and ending with - must copied in a text file





The name of the text file is the same name as of the original file + the bank account no. So in this case it would be:So, in this case, it would be:So, in this case, it would be:So, in this case, it would be:


example : Bank_20170822_0001234567.txt

Subsequently, this new file should be sent via email.

Could you please check if this is possible.

Best , Shiva

mail1.png (962 B)
mail1.png (962 B)
mail2.png (10.4 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Manoj K Aug 22, 2017 at 10:03 AM
0

Hi Shiva,

Use java mapping to read only the part of text file using substring function and also embeed the dynamic filename in this java mapping only.

Br,

Manoj

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

Hi Manoj ,

Thanks for your involvement again in this topic, It would be great if you provide Java mapping code reference for this, I will change accordingly.

In this source file, we have multiple bank identifiers/accounts, for each bank file we need to create new txt file as well and need to send as email notification,

Best , Shiva

0
G SHIVA Feb 28 at 07:34 AM
0

Hi Experts,

Any solutions for this requirement.

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

Dear Shiva

You can user Java mapping to implement this scenario

If only once the output text file has to be generated from the input file, then find the 82: pattern in the input data and extract all the following data characters till "-".

Return this output data in a text file by using the Dynamic FileName Configurations to the receiver channel

Thanks and Regards

Sikander

0

Hi Sikander ,

Thanks ,Can you give sample Java code? which can be done for above requirement?

Best , Venkatesh

0

Dear Shiva

Below link can help you out to set file name dynamically

https://wiki.scn.sap.com/wiki/display/XI/Dynamic+file+name+and+directory+in+Receiver+File+Adapter+-+summary+of+possibilities

Below link can help you out with some java code to extract the data based on some pattern

https://stackoverflow.com/questions/4662215/how-to-extract-a-substring-using-regex

Thanks and Regards

Sikander

1