Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Mail goes without excel attachment when scheduled(using CL_BCS)

former_member196651
Contributor
0 Kudos

Hi Friends,

I am in bizarre situation. Please help me in solving this.

I had created a program to send mail using the class CL_BCS. When a mail is send, an excel attachment had to be added to that mail. This I had accomplished using string_to_solix method of the class CL_BCS_CONVERT(as explained in the example BCS_EXAMPLE_7).

This works fine for me when I am executing the program directly using a T.Code or it is executed from SE38(I am getting mail with attachment in both SAP Inbox as well as in my external mail ID). But my requirement is to schedule this as a periodic background job(say on every Monday at 9:00 am). When I create a job using SM36 for this program, I am getting a mail in both my SAP Inbox as well as in my external mail ID. But the problem is the excel attachment is missing.

I don't know what should I do. Is there anything additional to be done for the background scheduling(for attachment)? Please help me to find a solution for this.

Regards,

Abijith

1 ACCEPTED SOLUTION

former_member196651
Contributor
0 Kudos

Hi All,

Thanks for all your responses. The problem got solved. I haven't done any changes. The mail is not going from DEV only. May be some config issues. But it is working fine from other clients.

Regards,

Abijith

7 REPLIES 7

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

Try submiting BCS_EXAMPLE_7 via background scheduling .

Is it working ? if yes find the difference .

Note that there is no GUI in BCS_EXAMPLE_7 .

Regards.

former_member201275
Active Contributor
0 Kudos

Good suggestion by Eitan, try this with the demo program. I think it is likely not string_to_solix that is causing the excel attachment not working, rather you are using another function before this, for example, SAP_CONVERT_TO_XLS_FORMAT, which is causing the file not to be created background in the first place let alone be emailed.

former_member196651
Contributor
0 Kudos

Hi Eitan,

I had tried this. BCS_EXAMPLE_7 will not send mail to the external ID, if you are scheduled via SM36. This is because, there is no sender. So what I had done was, I copied the same program and added the sender with SY-UNAME. Here also, the mail had gone but without attachment.

Regards,

Abijith

Former Member
0 Kudos

I'm able to get mail with excel attached from background job using demo program BCS_EXAMPLE_7.

Then you need to check mail configuration i think so

former_member196651
Contributor
0 Kudos

Hi All,

Thanks for all your responses. The problem got solved. I haven't done any changes. The mail is not going from DEV only. May be some config issues. But it is working fine from other clients.

Regards,

Abijith

0 Kudos

Hi,

Great news

Also look here

Using cl_bcs naturally.....

Regards.

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

Please close this thread .

Mark your answer as correct since it was internal config problems.

I do not want people think that there is a problem with cl_bcs .

Regards.