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: 

GET DATA AND TIME CREATION FROM LOCAL FILE

Former Member
0 Kudos
145

Good morning,

I need to get data and time property from a local file on windows.

I tried with CL_GUI_FRONTEND_SERVICES=>FILE_GET_ATTRIBUTES but it doesn't return this information.

I hope there is a method-function that retrive these informations and I don't need to create a .bat file with dir command inside!

Thanks you.

Marco

1 ACCEPTED SOLUTION

SuhaSaha
Advisor
Advisor
0 Kudos
89

AFAIK SAP doesn't provide any standard methods / FMs to address this

7 REPLIES 7

SuhaSaha
Advisor
Advisor
0 Kudos
90

AFAIK SAP doesn't provide any standard methods / FMs to address this

Former Member
0 Kudos
89

Incredible!

0 Kudos
89

at least, if you know that only one OS is used (but you can also determine it dynamically), you can execute directly the OS command (DIR for windows) with CL_ABAP_FRONTEND_SERVICES=>EXECUTE. As DIR is not available as an executable, we can execute it using application "cmd" and parameter "/c dir path/file >resultfile" and minimized=X and synchronous=X, then read the result file. Not clean, but works.

0 Kudos
89

>

> you can execute directly the OS command (DIR for windows).

Hi Sandra,

Your solution rang a bell. Why can't we create an external command & call it using SXPG_COMMAND_EXECUTE or SXPG_CALL_SYSTEM ? Any comments on this ??

Should be a clean solution though

BR,

Suhas

0 Kudos
89

there's a big difference: the question is about the presentation server, while SXPG*/SM69 are for the application server

0 Kudos
89

>

> there's a big difference: the question is about the presentation server, while SXPG*/SM69 are for the application server

Oopsie !!!

Moral of this blunder: Don't post ur (in this case mine) opinions on weekends ...

0 Kudos
89

>

> with CL_ABAP_FRONTEND_SERVICES=>EXECUTE

Little correction: of course, it was CL_GUI_FRONTEND_SERVICES=>EXECUTE