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: 

date and time display

Former Member
0 Kudos

i am printing date from sy-datum and time from sy-uzeit 20070301 at 141726 . Can i change this to print like 03.01.2007 and 14:17:26 . I appreciate your responses.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

concatenate v_date4(2) '.' v_date6(2) '.' v_date0(4) '.' v_time0(2) ":" v_time2(2) ':' v_time4(2) ':' into v_date1.

Regards,

Santosh

13 REPLIES 13

Former Member
0 Kudos

HI Deepthi,

WRITE: sy-datum DD/MM/YYYY,

Regards,

John.

Former Member
0 Kudos

Hello,

DATA: LV_DATUM(10),
          LV_TIME(8).

write: sy-datum to LV_DATUM,
         sy-uzeit to lv_time.

write: LV_DATUM,LV_TIME

If useful reward.

Vasanth

Former Member
0 Kudos

You may use these formatting options with WRITE statement:

... DD/MM/YY

... MM/DD/YY

... DD/MM/YYYY

... MM/DD/YYYY

... DDMMYY

... MMDDYY

... YYMMDD

For TIME:

DATA TIME TYPE T VALUE '154633'.

WRITE (8) TIME USING EDIT MASK '__:__:__'. "Output: 15:46:33

Thanks,

Santosh

Message was edited by:

SKJ

Message was edited by:

SKJ

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

The WRITE statement should automatically do the formatting. The date formatting will come from your specific user settings, and the time is always in the form HH:MM:SS

Regards,

Rich Heilman

Former Member
0 Kudos

Hi,

You can change this to User format, use this code.

data: date type sy-datum,
        time type sy-uzeit.

Data: Date1(10)  type c.
data: time1(8) type c

Date = sy-datum.
time - sy-uzeit.

Write: Date to Date1,
          time to TIME1.

Write:/ Date1, Time1.

Regards

Sudheer

former_member635028
Active Participant
0 Kudos

Hi,

Use this CONVERT_DATE_TO_INTERN_FORMAT

or

CONVERT_DATE_TO_EXTERNAL

CONVERT_DATE_TO_INTERNAL

CONVERT_DATE_INPUT

CONVERT_DATE_WITH_THRESHOLD

CONVERT_DATE_BY_PERIOD_INPUT

CONVERT_DATE_BY_PERIOD_OUTPUT

Use any one of this .

Regards,

Sreevani

Former Member
0 Kudos

concatenate v_date4(2) '.' v_date6(2) '.' v_date0(4) '.' v_time0(2) ":" v_time2(2) ':' v_time4(2) ':' into v_date1.

Regards,

Santosh

amit_khare
Active Contributor
0 Kudos

Concatenate sy-datum4(2) '.' sy-datum6(2) '.' sy-datum+0(4) into v_date.

Do same for time.

Regards,

Amit

Former Member
0 Kudos

call the FM MSS_GET_SY_DATE_TIME

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You can try this.



report zrich_0001 .

data: datum(10) type c.

write sy-datum to datum using edit mask '__.__.____' .

write:/ datum.

Regards,

Rich Heilman

0 Kudos

concatenate sy-uname 'Logged on to' sy-sysid

'on' date 'at' sy-uzeit

into email_data-obj_descr separated by space.

how do i change this statement now .

0 Kudos

ok got it .. let me try

0 Kudos

Copy your sy-datum to a variable of length 10 and same for time aswell and then write that variable. The write statement will print it as per your settings made like '.' or '/' or what ever it is set to.