2013 May 23 6:32 AM
Hi,
I have a requirement where I need to move multiple files in a directory to another folder using the SXPG_COMMAND_EXECUTE , I am able to move a single file from one directory to another and renaming by adding date and time stamp but how to move multiple files ?
For eg: Suppose In a directory X there are 10 files starting at " text_<xxxx>" , in the parameter user will give physical path and text* so that the program should copy all the 10 files starting with text and move to destination folder adding the date and time stamp (renaming) ?
The selection screen has two parameters ( source and destination ) !
Thanks,
Sreejith S.
2013 May 23 8:52 AM
2013 May 23 8:22 AM
Sreejith,
Have you tried using wild card characters for writing the command?
Something like MV text_* <destination> I haven't personally worked on that but just a suggestion.
Hope this helps,
~Athreya
Message was edited by: Athreya Hegde
2013 May 23 8:52 AM
2013 May 23 9:52 AM
Hi Raymond,
I know that, but currently they are asking to do with abap, is there any possibility to achieve this functionality through abap.
Regards,
Sreejith S.
2013 May 23 9:06 AM
Hi ,
You need to check with your basis team to write a shell script which takes care of searching files based on a string and moving all the files to a new location.
Once they are done with the script ,they shall create a command in SM49 and provide you which you can use it in the function call SXPG_COMMAND_EXECUTE.
Thanks and Regards,
Sriranjani Chimakurthy.
2013 May 25 11:33 AM
Dear All,
I have got the solution. I have used the EPS_GET_DIRECTORY_LISTING for getting all the files from the source dictionary and then extract only files which I want to move to the destination. Then by looping the SXPG_COMMAND_EXECUTE I can move multiple files to the destination.
Regards,
Sreejith S.
2013 May 25 1:20 PM
Hi,
No it has to be done based on the application server OS and using the SXPG_COMMAND_EXECUTE fm.
Cheers,
Arindam