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 format

Former Member
0 Kudos

Hi All,

I have a small requirment that user wanted both date and time in the format of

DDMMYYHHMMSS, how i can get this.(Please note that user wanted last two digits of the year),Please advice me..

Thanks in advance

Regards,

Sarala.

1 ACCEPTED SOLUTION

former_member181962
Active Contributor
0 Kudos

data: v_datetime(12).

concatenate sy-datum6(2) sy-datum4(2) sy-datum+2(2)

sy-uzeit into v_datetime.

Regards,

Ravi

Message was edited by:

Ravi Kanth Talagana

4 REPLIES 4

former_member181962
Active Contributor
0 Kudos

data: v_datetime(12).

concatenate sy-datum6(2) sy-datum4(2) sy-datum+2(2)

sy-uzeit into v_datetime.

Regards,

Ravi

Message was edited by:

Ravi Kanth Talagana

Former Member
0 Kudos

you need to develop a format using concatenate of

date and time to achieve this .

declare date as variable " get DDMMYY and

time as variable into final variable .

this can be done .

execute the code .

<b>parameters :p_date like sy-datum.

data : val(16) type c,

date(6) type c,

time(6) type c,

mon(2) type c,

yr(2) type c,

day(2) type c.

day = p_date+6(2).

yr = p_date+2(2).

mon = p_date+4(2).

concatenate day mon yr into date.

time = sy-uzeit.

concatenate date time into val.

write:/ val.</b>

regards,

vijay

Former Member
0 Kudos

Hi,

I hope following code will solve your problem.


DATA : v_datum  TYPE sy-datum,
       v_time   TYPE sy-uzeit,
       v_string TYPE string.

v_datum = sy-datum.
v_time  = sy-uzeit.

CONCATENATE v_datum+6(2) v_datum+4(2) v_datum+2(2) v_time INTO v_string.

Reward points if the answer is helpful.

Regards,

Mukul

Former Member
0 Kudos

Hi,

Thank all..