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

Display the time in a different format

0 Likes
3,601

Hey Guys,

I have an ALV where i output some time fields from cr02. Now it looks like this: 19.800 but i need it like this: 00:00:00

How can i do it on a very easy way?

Kind regards

Mario

10 REPLIES 10
Read only

FredericGirod
Active Contributor
3,403

You will need to provide part of your code, especialy the field catalog

Read only

0 Likes
3,403

Hello

This is my type structure.

the data type is tims.

I select this fields from the table into the fields of my table.

Now i want to change this fields, so that they look like format 00:00:00

Read only

Sandra_Rossi
Active Contributor
0 Likes
3,403

In the catalog, uUse the type D for dates (or DATS), not a numeric type like I, P, etc. (or INT4, DEC, etc.) Or indicate a field or a data element which refers to such a type.

Read only

Sandra_Rossi
Active Contributor
0 Likes
3,403

And how does your field catalog look like?

Read only

0 Likes
3,403

Hello Sandra Rossi,

I output the alv like this. alv.png

so i think the output is like the fields from my types

Read only

FredericGirod
Active Contributor
3,403

But it is not a time, it is a number of second.

you have to play with it before display it:

could be something like that (I don't test the code)

data(hour) = time DIV 3600.
data(remaining_time) = time - (hour * 3600 ).
data(minut) = remaining_time div 60.
data(second) = remaining_time - ( minut * 60 ).
result = |{ hour }{ minut }{ second }|.
Read only

0 Likes
3,403

thank you i will try it this way

Read only

Sandra_Rossi
Active Contributor
3,403

You'd better avoid indicating the important part of the question in a separate image. The 3 fields concerned are:

  • KAKO-BEGZT (Start time in seconds (internal))
  • KAKO-ENDZT (Finish time in seconds (internal))
  • KAKO-PAUSE (Cumulative break time in seconds (internal))

19,800 means 19800 seconds = 5 hours and a half

Read only

RaymondGiuseppi
Active Contributor
0 Likes
3,403

Did you try to define some fields with a TIMS / T data type. With implicit conversion adding your integer fields in seconds to an initial time field will provide the expected result (just check for overflow)

Read only

0 Likes
3,403

ty sandra.rossi