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: 

Function module to convert date and time

Former Member
0 Kudos

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

Former Member
0 Kudos

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

Regards,

Rajasekhar Reddy.

Former Member
0 Kudos

hi use the concatenate statement ..

data: filename(60) type c .

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

Former Member
0 Kudos

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

If you want to change the order use offsets.

former_member181962
Active Contributor
0 Kudos
Concatenate '0XX-XXXX-'  sy-datum sy-uzeit+0(2) into filename.

former_member188685
Active Contributor
0 Kudos
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.

Former Member
0 Kudos

Just concatenate the file name ...

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

v_file.

former_member188685
Active Contributor
0 Kudos

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

FILE_GET_NAME_AND_LOGICAL_PATH