cancel
Showing results for 
Search instead for 
Did you mean: 

Query output as mail

Former Member
0 Kudos

Dear Friends,

We are using ECC6.00 and for one of our user requirement for inspection lot ageing and notificatin ageing, we require to send mail based on the ageing days if more than 7 days to the users from SAP.

Is it possible to do the same using the query output.

Regards,

M.M

Accepted Solutions (1)

Accepted Solutions (1)

Former Member

Dear Roderick,

Thank you for your immediate reply. I am not able to understand clearly your explanation. I have provided the details from what i understood from your suggestion below. Kindly tell me whether this is right.

1) Bring the local field in the selection screen.

2) select values > 7 for the local field and save as variant.

3) Call this variant in SM36 job

4) schedule job with the distribution list.

Am i right. If this is the condition, how will system able to stop mail if the list output has no records. i.e., since the local field has value >7 in the selection screen, when the report is executed, if there are no records with ageing 7 then mail should not be triggered. will this happen.

Kindly explain.

Regards,

M.M

Former Member
0 Kudos

Hi,

You are correct with the steps to follow.

As far as I am aware the spool list will not be created or sent if there are no results returned from the query. Just test this scenario out in your testing environment to make 100% sure.

Regards,

Roderick

Answers (2)

Answers (2)

Former Member
0 Kudos

Dear Roderick,

Thank you very much for your useful information. Everything is okay with your suggestion but only one thing and that is the mail should be triggered only if the number of days (ageing) is more than 7. In the query i have created a local field to calculate the ageing with the difference between the creation date and completion date, which yields result, but to send mail based on this condition is where i struck up.

Can this be achieve by coding in the Query? if yes kindly help me with the steps and the syntax of the coding.

Regards,

M.M

Former Member
0 Kudos

Hi,

You can link this local field that you created to the selection screen of the query, this should solve your issue of only finding the data you want to send based on the local field definition. You can then save a variant for the query that will modify the selection dates ie for the current week or month etc. Link this variant to your batch job you have defined and it should hopefully solve your problem.

Regards,

Roderick

Former Member
0 Kudos

Hi,

You could possibly create a standard ABAP query in transaction SQ01 to extract these results.

To send the query results to the user via mail do the following:

In transaction SQ01 on the main menu go to Query -> More Functions -> Display Report Name.

Now take this report name and setup a batch job for it in transaction SM36 and link this batch job to a distribution list which you can create in transaction SO23.

Regards,

Roderick