cancel
Showing results for 
Search instead for 
Did you mean: 

Sending an email from BRF plus

priyank_dev2
Participant
0 Kudos

Hello everyone,

I need to send an email from BRF plus.I have developed an application with email and an element(say Z)data object with dummy constant value as 1.

Next,function call in event mode.In the signature tab, i have included email application name in the context and result parameter as a time stamp(since I do not need to woory about result parameter).The ruleset condition is- if Z = 1 then process the email.

But when i run the simulation,it is not triggering any email.The email id is hardcoded for testing purpose.

Pls let me know if iam missing anything in the above mentioned steps?.

Accepted Solutions (1)

Accepted Solutions (1)

carsten_ziegler
Active Contributor
0 Kudos

Probably you are still on a release where in the simulation you cannot define if actions shall be executed or not. In the screenshot below you can see this in the "Action Settings".

Before, the simulation did not execute actions that require a commit/update task. You can only see in the execution protocol if the action was executed. This improvement was introduced in NW 702, NW 730 and NW703/731 some months ago in a note.

What you may do is calling the function from an ABAP report. This should make sure there is a commit. Also, of course you need to make sure your email server connection is configured.

former_member198721
Participant
0 Kudos

Hi Carsten,

I am not able to see the screen as given by you.Can you suggest how to see this screen,as i am facing the same issue.

I have created a function

Input :

A boolena variable

MAil id

output : ACTIONS

in the Ruleset i have created a Action --> Send EMail , with Mail id and a body,

After simulation BRFplus screen showing ACtion triggered , but i am not getting email in my mail box.

Also can you suggest how to add update and commit task and how to check if my email server connection is configured or not. Also how can i Upgrade my BRFplus?

Regards,

Khushbu

former_member198721
Participant
0 Kudos

Hi Carsten,


I have added 'COMMIT WORK' statement in ABAP , and its working , i am getting emails ,

Thanks for your help.


Can we send attachments also in the SEND email ACTION?


Regards,

Khushbu

elma_zhong
Associate
Associate
0 Kudos

Hi khushbu,

How did you do to get the email? Could you please share with me ?

I created a function with sending email to **@sap.com, but it occured error, while i was simulating?

ERROR: Open SQL array insert produces duplicate records in the database. (termination: RABAX_STATE)

I would be really appreciated if you can help me and give me some ideas.

Thanks a lot.

former_member198721
Participant
0 Kudos

Hi Elma,

Create a action send email ,

than just activate and simulate, I was not getting mails by simulation as I was not having the settings as mentioned by the Cartsen , but when I used it with commit work in ABAP than it was working.

Regards ,

Khushbu

elma_zhong
Associate
Associate
0 Kudos

Hi Khushbu,

I created the function exactly the same with yours. But when I simulated it , the errors occured.

Do i need to set up SMTP or some other configurations before using email function?

Thanks a lot.

Best Regards,

Elma

former_member198721
Participant
0 Kudos

Please paste your St22 dump analysis.

elma_zhong
Associate
Associate
0 Kudos

Hi Khushbu,

The error as below:

anindyaSAP
Product and Topic Expert
Product and Topic Expert
0 Kudos

This is a SQL error which occurs when you try to add a duplicate entry in a table. This is unlikely to be caused by send email action.

Along with Send email action, are you performing anything related to DB? Are you calling any procedure via procedure call expression that may cause this?

Are you getting same error if you don't use send email action? If you can provide more information on your design it may help.

Also check the documentation in :
http://help.sap.com/saphelp_dsm10/helpdata/en/81/16504679d0406a9aa4cfaa052541c4/content.htm

Thanks,

Anindya

anindyaSAP
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Elma,

Sorry, I overlooked the 2nd screenshot of the dump. Although I am not 100% sure, Note 140212, 170907, 175154, 371797 may help here. The error is from Address Management (BC-SRV-ADR).

Thanks,

Anindya

elma_zhong
Associate
Associate
0 Kudos

Hi Anindya,

I simulated this function which is only sending email. But this function is used by another expression(let's say B)which as you said, calling an expression(let's say A) that is related to DB.

But i don't get the error while simulating expression B or expression A.

Thanks a lot.

anindyaSAP
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Elma,

I am not sure how only send mail action is causing this dump. I created a send email action and that did not hit the FM.

But as I told, you may check note 140212, 170907, 175154 and 371797 for some clue.

You may also try to debug the generated code for the function while you simulate and check if FM ADDR_SAVE_INTERN is called. If it is called, the stack trace may give a hint on exactly who is calling it and why.

Thanks,

Anindya

elma_zhong
Associate
Associate
0 Kudos

Hi Chaudhuri,

This error is resolved by applying one of the notes. Thanks a lot.

Best Regards,

Elma

elma_zhong
Associate
Associate
0 Kudos

Hi Khushbu,

Could you please share with me the ABAP code with commit work for using the BRF+ function with action? Since the error is resolved now. Thank you very much.

Best Regards,

Elma

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi all,

Does anyone know if it is posibble to send this email using another account instead of current user (For example WF-BATCH.)?

I cannot find such a customizing option.

Thanks!

Fernando

priyank_dev2
Participant
0 Kudos

Hi,

I tried the same by hardcoding the user ID.But the mail is not getting triggered from BRF Plus.

Regards,

PD

Jocelyn_Dart
Product and Topic Expert
Product and Topic Expert

Hi Fernando/Priyank

Please do not resurrect old threads. This is against SCN rules of engagement.

Instead start a new discussion. It will make it easier next time you want to find an answer .

Closing this thread now.

Rgds,

Jocelyn

with my moderator hat on

anbusivam_s
Participant
0 Kudos

BRF+ doesn't support attachments in email actions as there is no file storage mechanism available in BRF+. Still you may do this indirectly by adding the link to the attachment in the mail where the link points to some storage where the attachment can be fetched by the end user.

former_member198721
Participant
0 Kudos

Hi Anbusivam,

Thanks for your input.But providing link cannot solve my requirement.

let me explain it clearly.

For example , after processing few expressions i got  few plants in a table Z_TEST in BRF function.

WERKS

1706

1705

1704

1708

Now,

I want to send email with below body.

Hi,

plants

1706

1705

1704

1708

triggering error.

-----------------------------------

I dont want separate mail for every plant , i want a combined mail.

So is there any way to do that.

Regards,

Khushbu

carsten_ziegler
Active Contributor
0 Kudos

You can concatenate the values in a formula. There is a formula function CONCATENATE_TABLE that allows you to convert a table into a string with a delimiter such as

"1706, 1705, 1704, 1708". In older releases you may have to create a loop expression and concatenate one by one.

This expression is then used directly in the email as a parameter (&1, &2, etc). Many users think you can only use data objects for the parameters but instead you can also directly use any expression.

former_member198721
Participant
0 Kudos

Hi Carsten ,

Thanks for your reply.

But here comes one more question ,the maximum size of an element allowed in BRFplus is 255 .

So in case i am having a big list of plants so one string cannot hold it.

I tried something , as shown below

Hi,

ERROR report

&1

&2

---------

for place holder &1 I can connect a loop expression on table z_material_table having below values

Z_material

1706

u001

1505

6008

9000

5623

1540

Now value of place holder &2 will get assigned dynamically by looping on this table.

so that in my mail i can see.

--------------

Hi,

ERROR report

1706

u001

1505

6008

9000

5623

1540

---------

And i have assigned value from table z_material_table-Z_material to Z_mater1 (place holder &2) .

But in mail value is coming empty.

Please find attached screenshot.

Kindly suggest.

carsten_ziegler
Active Contributor
0 Kudos

What is the name of your loop expression?

I can see that Z_MATER1 is the result of your loop. But in the email you probably directly use the data object but not the loop expression.

Second, within the rule in the loop you keep on overwriting Z_MATER1 instead of appending to it (using a formula). Unfortunately, you are still on an NW 702 release where you miss several of the newer features.

Anyway, what I forgot to mention: You may also assign a table directly to your email variable. Depending on the release the table is automatically converted into a string.

former_member198721
Participant
0 Kudos

Hi Cartsen,

Good day!

Can you share the details of the version which can solve these issues?

Thanks,

Khushbu

carsten_ziegler
Active Contributor
0 Kudos

I have checked the source code. It had been added beginning of 2010. It is very difficult to say which support package for NW 7.02 it really is. However, I think you should have the code.

former_member204244
Active Participant
0 Kudos

Hi Carsten,

Can we bold few letters in BRF send mail action in the body of the mail.

I have this requirement But I am not sure whether its feasible or not.

Could You Please help me.

Thanks,

Ishani

anindyaSAP
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Ishani,

This is possible if you send emails in HTML format. With a latest enhancement HTML formatted email is supported in BRF+. Please check Note 2158477.

Thanks,

Anindya