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

ABAP program

Former Member
0 Likes
390

Hi,

i want to write the program such that it executes maximum of five times a day next day it should execute maximum of five times more than tht it should not execute can any body help for me

2 REPLIES 2
Read only

Former Member
0 Likes
372

Create a Z-table and in that maintain Last Date of Execution and Number of times of execution, Current Date Executions

In your program starting read that table and the count of Last Date execution + today's execution is less than last days execution5 then run the program and update the table with current date's execution = current date's execution1.

One thing is updating the table with proper data when u r executing the report for last time in a day.

Then u must change last day = today. last day execution = last day execution+5.

try this.. it will work.

Read only

Former Member
0 Likes
372

HI,

u can do that.

try using this code.

DATA:count,date LIKE sy-datum.

GET PARAMETER ID 'MAX' field count.

GET PARAMETER ID 'DAT' FIELD date.

IF date is initial.

date = sy-datum.

ENDIF.

IF date = sy-datum.

count = count + 1.

else.

message e000(zmsgtab)."u con't execute it more than once in a day.

endif.

set PARAMETER ID 'MAX' field count.

IF count > 5.

count = 0.

set PARAMETER ID 'MAX' field count.

date = date + 1.

set PARAMETER ID 'DAT' field date.

message e000(zmsgtab)."u con't execute it more than once in a day.

ENDIF.

write:/ 'this is my program'.

rgds,

bharat.