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

Order time ranges

former_member188791
Participant
0 Likes
922

Hi Group,

Its regarding Order delivery day and time , I have requirement to check time of order to decide on the route.

I am getting order day time YYYYMMDDHHMMSS and processing time, and I have to check whether this falling in the below order processing time slot or not:

Slot1 : Midnight to 18:00

slot2 : End of Slot1 to 19:30

slot3 : End of slot2 to 23:59

 

when order date = today and processing time is slot1

    then code = 1

when order date = today and processing time is slot2 and order time(hhmm) is after 18:00

      then code =2

when order date =  today and processing time is slot3 and order time(hhmm) is before 18:00

       then code = 3

when Order date = yesterday and processing time is slot 1

   

    then code = 99.

can any body sugget how I can write above code effectively in ABAP.

Hi Group,

Its regarding Order delivery day and time , I have requirement to check time of order to decide on the route.

I am getting order day time YYYYMMDDHHMMSS and processing time, and I have to check whether this falling in the below order processing time slot or not:

Slot1 : Midnight to 18:00

slot2 : End of Slot1 to 19:30

slot3 : End of slot2 to 23:59

 

when order date = today and processing time is slot1

    then code = 1

when order date = today and processing time is slot2 and order time(hhmm) is after 18:00

      then code =2

when order date =  today and processing time is slot3 and order time(hhmm) is before 18:00

       then code = 3

when Order date = yesterday and processing time is slot 1

   

    then code = 99.

can any body sugget how I can write above code effectively in ABAP.

4 REPLIES 4
Read only

former_member212124
Active Participant
0 Likes
855

Hi Rajiv,

Convert the time stamp to date and time separately( Using FM).

And then use Case/IF statement  to code according to condition.

thanks,

vidyasagar

Read only

0 Likes
855

Hi ,

Thank you for your response , my query is how I can define the mentioned slots time ranges in ABAP.

Read only

0 Likes
855

Updated

If you are using CACS_TIMESTAMP_GET_DATE (FM).

then use this code.

if e_time between '000000' and '180000'.

elseif e_time between '180100' and '193000'.

elseif e_time between '193100' and '235900'.

endif.

I am assuming that new slot will be considered 1min after previous slot.

thanks,

vidyasagar

Read only

mayur_priyan
Active Participant
0 Likes
855

Hi,

Check the following to convert timestamp to date and time.

http://help.sap.com/abapdocu_70/en/ABAPCONVERT_TIME-STAMP.htm#&ABAP_ONE_ADD@1@

Once it is converted you can use this and compare with the date and time slot and provide the necessary output.