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

Function module to convert date and time

Former Member
0 Likes
1,469

Hi ,

Requirment is i want to create a file in the application server.So the file name should be in the following format.

0XX-XXXX-YYYYMMDDHH.format.

in this HH-hours.I need to take current date and time.so is there any function module to convert into this format.If it is not there how to create file name in this format.

Thanks,

MR

7 REPLIES 7
Read only

Former Member
0 Likes
1,082

Take current date sy-datum and time sy-uzeit, and concatenate these to other field.

Regards,

Rajasekhar Reddy.

Read only

Former Member
0 Likes
1,082

hi use the concatenate statement ..

data: filename(60) type c .

concatenate 'XXXXXXX' sy-datum sy-uzeit+0(2) into filename .

Read only

Former Member
0 Likes
1,082

why not just concatenate sy-datum and sy-uziet to the file name.

If you want to change the order use offsets.

Read only

Former Member
0 Likes
1,082
Concatenate '0XX-XXXX-'  sy-datum sy-uzeit+0(2) into filename.
Read only

Former Member
0 Likes
1,082
REPORT  ZTEST_CONV.

data:  time_stamp TYPE timestampl.

GET TIME STAMP FIELD time_stamp.

You can try with GET TIME STAMP

But it will be in Different format.

Read only

Former Member
0 Likes
1,082

Just concatenate the file name ...

concatenate v_filename '0XX-XXXX-' sy-datum sy-uzeit+0(2) into

v_file.

Read only

Former Member
0 Likes
1,082

You can Try the Function module to Build the path using the Logical path

FILE_GET_NAME_AND_LOGICAL_PATH