10-17-2007 3:20 AM
hi all,
my scenario is i have a loop. and first loop pass, i am storing the system date and sytem time in a field TIMESTAMP. then in 2nd loop pass , the time is incremented to 2 mins from the previous TIMESTAMP. So in case, 2minutes is added . when it reaches 60 minutes, automatically it is should become 1 hour and similarly is the casee for 1day.
is there any function m odule .
can you provide me some coding for th is
points will be rewarded
thanks in advance
10-17-2007 3:23 AM
Hi,
If you are using field of type time stamp then you can just add 2 mintues to it.
System will automatically take care of it when it reaches one hour.
Regards,
Atish
10-17-2007 3:25 AM
can you please give me the coding for that like you said of type TIMESTAMP
10-17-2007 3:30 AM
Hi Jayasree
Check this code
PARAMETERS : p_time TYPE sy-uzeit.
PARAMETERS : p_date TYPE sy-datum.
START-OF-SELECTION.
p_time = p_time + 120. " 120 seconds
p_date = p_date + 1. " 1 day
WRITE : p_date.
WRITE 😕 p_time.
Regards
Gopi
10-17-2007 3:38 AM
try to use STD function module.
Please check below links
FUNCTION MODULES
http://www.erpgenie.com/abap/functions.htm
http://www.sapdevelopment.co.uk/fmodules/fmssap.htm
http://www.erpgenie.com/abap/index.htm
http://www.geocities.com/victorav15/sapr3/abapfun.html
Rewards if useful.......
Minal
10-17-2007 3:48 AM
Check this code. It works and satisfies your requirement.
l_Datum = sy-datum.
l_uzeit = sy-uzeit.
l_min = '000200'.
l_uzeit = l_uzeit + l_min.
if l_uzeit > '240000'.
clear l_uzeit.
l_Datum = l_Datum + 1.
endif.
We are adding 2 minutes to L_UZEIT. When L_UZEIT is more than 24 (for 24 hours), it will reset variable and add 1 to date.
Hope this helps.
ashish