Front end services
This morning, one of my colleagues had a requirement, in which he wanted to process a file from presentation server and once done, the file system should move the file to a different directory, in the presentation server. We have done the same in application server using SYSTEM command, but to do the same, the following approach can be used.
Assuming presentation server is a Windows system.
Assuming presentation server is a Windows system.
- Create a .BAT file with following script. Assuming that we are moving a file called 'File1.txt' from C: to C:\Folder
c:
cd \
move file1.txt folder\file1.txt - Name the file as move_file.bat and store it in C:\ root
- Have the following piece of code for executing from ABAP code
CALL METHOD cl_gui_frontend_services=>execute
EXPORTING
APPLICATION = 'C:\move_file.bat' .
The above code will execute the BAT file from ABAP code. We can also launch any application from ABAP with above manner.
Learnt something !