09-12-2008 6:13 AM
Hi Frnds,
In my selection-screen i have few fields and a email button.
when i click on the email button it asks for email id.
then i execute the report.the output is send to the person.
now i have created a ztable which store some data along with
no of times the email has been sent.
how to work out for this..hope the counter loop can be used.
if counter how to work!!
tnx..
09-12-2008 6:27 AM
HI,
Fetch the Data from the Z table and Also the Number of times Value in Variable VAR
Apply the Value in
DO VAR Times.
Code to Send MAil.
Enddo.
Regards
Sumit Agarwal
09-12-2008 6:29 AM
Hi ,
Try this...
select * from ztable into table tb_email where mail = e-mail-id.
If sy-sybrc ne 0.
Update the required data in your Ztable with counter = 1.
Else.
sort tb_email ascending by counter .
read table tb_email into wa_email index 1.
wa_email-counter = wa_email-counter + 1.
modify tb_email from wa_email index 1 tranporting counter.
Endif.
Now modify the Ztable from tb_email.
Regards,
Sachin M M
09-12-2008 6:32 AM
Hi,
here is the algorithm for ur requirement
when user clicks send email button,
1) Fetch the no_of_times field from ZTABLE into lv_counter
2) Send the email now.
3) if its successfully sent,
ADD 1 to lv_counter.
4) UPDATE ZTABLE SET no_of_times = lv_counter WHERE <condition>
Hope this helps.
Cheers,
Kothand
09-12-2008 6:40 AM
Rudra,
Generate a number everytime you send a mail and store the number and the mail id along with the other data in the ztable.To generate a number you can use the function module
GET_NEXT_NUMBERS.
K.Kiran.