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

counter

Former Member
0 Likes
727

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..

4 REPLIES 4
Read only

Former Member
0 Likes
692

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

Read only

sachin_mathapati
Contributor
0 Likes
692

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

Read only

Former Member
0 Likes
692

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

Read only

kiran_k8
Active Contributor
0 Likes
692

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.