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

Problem in Time Comparison

Former Member
0 Likes
955

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
Read only

Former Member
0 Likes
920

Hi,

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

regards,

Raju.

7 REPLIES 7
Read only

kiran_k8
Active Contributor
0 Likes
920

Saket,

Check if the following link gives you any lead.

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

K.Kiran.

Read only

Former Member
0 Likes
921

Hi,

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

regards,

Raju.

Read only

Former Member
0 Likes
920

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

Read only

valter_oliveira
Active Contributor
0 Likes
920

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.

Read only

Former Member
0 Likes
920

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

Read only

Former Member
0 Likes
920

Hi.. try this approach.

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

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

.....

ENDIF.

Read only

Former Member
0 Likes
920

Thanks a lot