2014 Sep 02 5:17 AM
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.
2014 Sep 02 5:27 AM
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
2014 Sep 02 7:03 AM
Hi ,
Thank you for your response , my query is how I can define the mentioned slots time ranges in ABAP.
2014 Sep 02 7:17 AM
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
2014 Sep 02 5:57 AM
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.
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |