Application Development 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: 

Regarding ABAP program

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Former Member
0 Kudos

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>