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

Regarding ABAP program

Former Member
0 Likes
422

Hi,

i want to write a program such tht it executes only a limited times a day

plz help me regarding this

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
395

Hi,

suresh try this code it may solve u r problem..

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

2 REPLIES 2
Read only

Former Member
0 Likes
397

Hi,

suresh try this code it may solve u r problem..

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

Read only

Former Member
0 Likes
395

Hi,

try this code

REPORT YCL118_RESTICT_EXECUTION.

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

<b><removed_by_moderator></b>