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 display

Former Member
0 Likes
884

Hi

i want to display the File name as follows.

Parameters:.p_file : MMDDYYYYHHMMSS.txt

MM : Month

DD : Day

YYYY: Year

HH : Hours

MM : Minutes

SS : Seconds

How do i do this ?

Krupali

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
857

Hello


concatenate sy-datum+4(2) sy-datum+6(2) sy-datum(4) sy-uzeit '.txt' into p_file.

7 REPLIES 7
Read only

Former Member
0 Likes
857

from where are you getting the file

Please elaborate

Regards,

Kushagra

Read only

Former Member
0 Likes
857

use Concatenate with date and time.

if system date than use sy-datum and for time use SY-UZEIT

concatenate both in one variable

Read only

anversha_s
Active Contributor
0 Likes
857

'try this

data : file(14) type c,
         lv_date(8) type c,
         lv_time(6) type c.

move SY-DATUM to lv_date.
move SY-UZEIT to lv_time.

concatenate lv_date lv_time to file.

Read only

former_member585060
Active Contributor
0 Likes
857

Try like this

PARAMETERS : p_file(18) TYPE c.

INITIALIZATION.

p_file = sy-datum.

p_file+8(6) = sy-uzeit.

p_file+14(4) = '.TXT'.

BREAK-POINT.

Regards

Bala Krishna

Read only

Former Member
0 Likes
858

Hello


concatenate sy-datum+4(2) sy-datum+6(2) sy-datum(4) sy-uzeit '.txt' into p_file.

Read only

Former Member
0 Likes
857

hii

take date & time in c type of variable or move them in to variable of type c and use like following code.

DATA:
date(8) type c value '02022008',
time(6) type c value '332233',
wa_ext(4) type c value '.txt',
v_result(18) type c.
concatenate date time wa_ext into v_result.
write: v_result.

regards

twinkal

Read only

Former Member
0 Likes
857

Hi KR,

Ur req is not clear to me... Pls elaborate more so that u can get accurate answer...

See The Code Below...

if u want the file name in parameter to be like that then use below code..

PARAMETERS : p_date TYPE sy-datum,
             p_time TYPE sy-uzeit.

PARAMETERS : p_file(18) TYPE c DEFAULT '08272008170604.txt'.

INITIALIZATION.

p_date = sy-datum.
p_time = sy-uzeit.

CONCATENATE
p_date+4(2)" MM
p_date+6(2)" DD
p_date+0(4) " YYYY
p_time+0(2)
p_time+2(2)
p_time+4(2)
'.txt' INTO p_file.

if u want to display in report output then use below code..

PARAMETERS : p_file(18) TYPE c DEFAULT '08272008170604.txt'. " Format MMDDYYYYHHMMSS.txt

WRITE : /'Month', p_file+0(2),
        /'Date', p_file+2(2),
        /'Year', p_file+4(4),
        /'Hour', p_file+8(2),
        /'Minute', p_file+10(2),
        /'Second', p_file+12(2).

Hope it will solve your problem..

Thanks & Regards

ilesh 24x7