Application Development and Automation 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: 
Read only

Mail Trigger Issue

Former Member
0 Likes
1,369

Dear All,

I have a requirement to trigger mail as soon as the Material Stock of Project is less than the Prescribed stock which is maintained in the table.

For this a ZTable and a ZProgram is created. How should it shot the mail continuously? Means suppose at 10 the stock of a material has reached below its decided qty then at 10:01 or at 10:02 it should trigger the mail to the mail id maintained for that material. I have no idea of user exit etc.

Please guide me in this matter.

Regards,

Bharti Jain

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,309

I HAVE WRITTEN THE BELOW LOGIC.

I have selected the materaial which is maintained in Z Table. Then based on those MATNR I fetched PRLAB from MSPR table. In my Z table there is a column containing Should be stock. Now I will check that PRLAB LT Should be Stock. In my Zprogram there is no Input Screen. Now how to fetch the stock every time in background. My objective is as stock changes then this Z program should run ,check stock and if true mail trigger .

Regards,

Bharti Jain

8 REPLIES 8
Read only

nabheetscn
SAP Champion
SAP Champion
0 Likes
1,309

If you are creating a custom report to send email and check stock. Please schedule the report at an interval of 2mins or which is convenient to you.

It will check the stock and based on logic will keep sending email in background.

Nabheet

Read only

Former Member
0 Likes
1,309

Thank You For Replying,

The stock is updated with some TCODES which I dont know . Then how my Z Program will know that the stock is less at the particular time . How can I do continuous scheduling for it? Please guide me .

Regards,

Bharti Jain

Edited by: Bharti Jain on Dec 20, 2011 9:49 AM

Read only

0 Likes
1,309

The logi to determine has to be coded and function will provide it and based on thaqt logic you can trigger. Background jobs to be sceduled can be defined in SM36 tcode.

Nabheet

Read only

0 Likes
1,309

Hi,

Do you know the table name where you can check material stock? IF yes then check if there is any filed of data type time which gives times stamp of record creation.

Subsequantly if you schedule your program for every two menutes then check data in table for records created in last 2 or 3 minutes and you can apply logic accrdingly to get the material details and email ID to trigger mails.

Hope it will give you little idea of how to do it.

Read only

Former Member
0 Likes
1,309

Hi Bharti,

the best way is to write your code in User exit which will be called POST SAVE ...

Debug and search the enhancements/exits placed after save.

This will trigger the mail automatically when material stock in project is saved with less than ZTABLE value..

Regards,

Seemanthini

Read only

Former Member
0 Likes
1,310

I HAVE WRITTEN THE BELOW LOGIC.

I have selected the materaial which is maintained in Z Table. Then based on those MATNR I fetched PRLAB from MSPR table. In my Z table there is a column containing Should be stock. Now I will check that PRLAB LT Should be Stock. In my Zprogram there is no Input Screen. Now how to fetch the stock every time in background. My objective is as stock changes then this Z program should run ,check stock and if true mail trigger .

Regards,

Bharti Jain

Read only

0 Likes
1,309

only way is u need to schedule the job every 10mins so that it will automaticallty run the program and check the stock and sends email. Basis person can help u regarding the scheduling if u are not aware of doing scheduling.

Read only

former_member212713
Contributor
0 Likes
1,309

Hi Bharti,

I think your question with about PS Module.

1. Create Z Program

2. Write your selection case in your z program.

3. If there is any material stock level problem you append to your itab.

4. End of selection If There are any records your finally itab you can sending mail process

5. You setup job and schedule periodic time from SM36 (I Think period dont be short, maybe 5-10 min)

If your problem sending mail process from sap pleace again examine.

Best regards.