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: 

Problem in Time Comparison

Former Member
0 Kudos

Hi All,

I have a problem where i have to calculate based on the time slots.The time slots are divided in 4 parts i.e from 6 to 12,from 12 to 18,from 18 to 24 and from 0 to 6.

My problem is in table time is stored as 00:00:00.But in my internal table it is coming as 000000.

I have written the code taking colon in consideration.But it is not coming inside the if block.

e.g

IF wa_jcds3-utime between '00:06:00' and '00:12:00'.

l_flag_time2 = 'X'.

qty_time2 = qty_time2 + 1.

ENDIF.

Can someone please resove this.

Thanks in advance,

Saket.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

System always stores the time as '000000'. You have to check with this format.

regards,

Raju.

7 REPLIES 7

kiran_k8
Active Contributor
0 Kudos

Saket,

Check if the following link gives you any lead.

http://www.sapnet.ru/abap_docu/ABENTIME-STAMP-GENERAL.htm

K.Kiran.

Former Member
0 Kudos

Hi,

System always stores the time as '000000'. You have to check with this format.

regards,

Raju.

Former Member
0 Kudos

USE OFFSET TO CAPTURE THE NUMBERS AND THEN COMPARE THE THE TIME BY USING IF STMTS

valter_oliveira
Active Contributor
0 Kudos

Time Formats are always stored as 'HHMMSS' internaly.

So, you have to compare like:


IF wa_jcds3-utime between '000600' and '001200'.
l_flag_time2 = 'X'.
qty_time2 = qty_time2 + 1.
ENDIF.

Regards.

Valter Oliveira.

Former Member
0 Kudos

Define Variables for your times and use that in your IF statement.

data: wf_time1 like sy-uzeit value '000600',

wf_time2 like sy-uzeit value '001200'.

IF wa_jcds3-utime between wf_time1 and wf_time2.

l_flag_time2 = 'X'.

qty_time2 = qty_time2 + 1.

ENDIF.

Edited by: Suresh Kumar on Sep 15, 2008 11:54 AM

Former Member
0 Kudos

Hi.. try this approach.

IF wa_jcds3-utime between '000000' and '060000'.

elseif wa_jcds3-utime between '060001' and '120000'.

.....

ENDIF.

Former Member
0 Kudos

Thanks a lot