Unix Script and SM69
I have a following requirement below:
"For each record in table get the directory and run the Unix Script that will transfer the output file with format DEV<taskid>.out from SFTP server directory to SAP directory /dev/sump/.supp/out/" and decrypt the file"
the designer wants to make use of the Unix Command that will be maintained in SM69.. How to maintain this?
Also I have found out the function module SXPG_COMMAND_EXECUTE and Im not sure that this will trigger the Unix command maintained in SM69. What is the use of this Function Module?
Another requirement is to read all files transferred to directory /dev/sump/.supp/out/. How am I going to retrieves all those files (filenames)? There is a function module EPS_GET_DIRECTORY_LISTING. What is the use of it?
How will be the Unix Scripting will be placed in SM69? Should this be part in ABAP? Thanks for your prompt reply.
Srinivas Adavi replied
Let us say your unix script name is "transfer". Go to SM69, in the menu click "create". Enter a name say 'ZTRANSFER' in "Command Name" field. Under "Operating System Command", enter "transfer" and save.
Now call the function module SXPG_COMMAND_EXECUTE and give COMMANDNAME = 'ZTRANSFER'. Pass any parameters needed to the ADDITIONAL_PARAMETERS parameter (only if you checked the corresponding box in SM69).
EPS_GET_DIRECTORY_LISTING basically gives you a list of files in a root directory specified under DIR_NAME. But since this is a basis function module, you need S_TRANSPRT authority.