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: 

Please help " Time Format "

Former Member
0 Kudos

Hi

Please help me out

any body know any function module which can do the task

input = 200000

output = 20:00:00

Regards

Arya

8 REPLIES 8

Former Member
0 Kudos

You don't need an FM.


DATA: timeout(08).

WRITE:/ sy-uzeit USING EDIT MASK '__:__:__'.
WRITE sy-uzeit TO timeout USING EDIT MASK '__:__:__'.
WRITE:/ timeout.

and the output


08:24:49
08:24:49

Former Member
0 Kudos
data:
time type sy-uzeit,
time_char(8) type c.

time = sy-uzeit.

write time to time_char.

Former Member
0 Kudos

No need to use any FM, Plz. refer this code:

REPORT Z_TEST2.

data: E_TIME LIKE SY-UZEIT.

parameter: p_time(6) type n.

e_time = p_time.

write e_time.

Regards,

Joy.

Former Member
0 Kudos

Hi ,

There is FM for converts a time from the externally formatted user input into the SAP system internal format.

That is CONVERT_TIME_INPUT.

Bu for The Output Time Format there is no FM.

You can get The Format by Using EDIT MASK OPTION In WRITE Statement.

Thanks.

Former Member
0 Kudos

Hi,

Use the Write statement as below.

DATA: v_time1 LIKE sy-uzeit VALUE '200000',

v_time2 TYPE char8.

WRITE v_time1 TO v_time2.

WRITE: v_time2.

Former Member
0 Kudos

Hi,

i don't know the function module. but it is simple to use concatenate statement.

first put the input into one string.

ex: data : string(6),result(8) a(2),b(2),c(2).

string = 200000.

start = 0.

len = 2.

a = string + start(len).

start = 2.

b = string + start(len).

start = 4.

c = string + start(len).

concatenate a ':' b ' :' c into result.

write: /result.

reward if helpful

former_member212653
Active Contributor
0 Kudos

data: l_time type tims,
l_char type char8.

l_time = '120000'.
write l_time to l_char.
write l_char.

output = 12:00:00

Former Member
0 Kudos

hi ,

i checked this coding it is working fine..

data : string(6),result(8) ,a(2),b(2),c(2),start type i, len type i.

string = 200000.

start = 0.

len = 2.

a = string+start(len).

start = 2.

b = string+start(len).

start = 3.

c = string+start(len).

concatenate a ':' b ':' c into result.

write:/ result.

use this..