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

Time Related Function Module

Former Member
0 Likes
626

Dear All,

I have to upload the data from excel sheet . in the excel sheet timeis maintained as 5.26 PM , 5.26 AM . How can I conver that into 24 hrs format .

For example .

5.26 PM = 17:26

5.26 AM = 05:26

4 REPLIES 4
Read only

Former Member
0 Likes
556

Hi

Checkout FM <b>HRVE_CONVERT_TIME</b>

<a href="http://help.sap.com/saphelp_nw04/helpdata/en/ec/d940be400d11d3aa27006094b92fad/frameset.htm ">http://help.sap.com/saphelp_nw04/helpdata/en/ec/d940be400d11d3aa27006094b92fad/frameset.htm</a>

Regards

Raj

Message was edited by:

Rajasekhar Dinavahi

Read only

Former Member
0 Likes
556

Hi,

Check this sample code..



DATA: V_INPUT(8) VALUE '5.26 AM'.
DATA: V_TIME TYPE SYUZEIT.
DATA: V_LENGTH TYPE I.

* get the length
V_LENGTH = STRLEN( V_INPUT ).


IF V_INPUT+V_LENGTH(2) = 'PM'.

  V_INPUT+V_LENGTH(2) = ''.

  V_TIME = V_INPUT + 12.  " If it is PM add 12 hours.

ELSE.
  
  V_INPUT+V_LENGTH(2) = ''.

  V_TIME = V_INPUT.

ENDIF.

WRITE: V_TIME.

Thanks

Naren

Read only

Former Member
0 Likes
556

Hi,

SD_CALC_DURATION_FROM_DATETIME

HR_TIME_RESULTS_GET

CALL FUNCTION 'DELTA_TIME_DAY_HOUR'

CCU_TIMESTAMP_DIFFERENCE

<b>Reward points</b>

Regards

Read only

Former Member
0 Likes
556

Hi,

Use the FM HRVE_CONVERT_TIME

split the time at space into time and format and pass the same

this will solve your problem

the parameters passed are shown below :

Import parameters Value

TYPE_TIME B

INPUT_TIME 09:00:00

INPUT_AM_PM PM

Export parameters Value

OUTPUT_TIME 21:00:00

OUTPUT_AM_PM

Regards

Shiva