cancel
Showing results for 
Search instead for 
Did you mean: 

File Movement- Automation

tamil_arasan
Active Contributor
0 Kudos

Dear Experts,

We have SAP ERP 6.0 EHP4 in Linux Red Hat 5.1, we are running SAP payroll and few files are generating in the servers. we have to move those files to third party servers. Right now, we are manually moving the files through SFTP. Is it possible to automate this process? can we use incron or any other utilities?

Kindly suggest.

Thanks a lot!,

Pradeep.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

If the directory where the files are generated is always the same and the filename has a defined pattern you could always do a check for files in that directory and only execute the movement of files if there are files present in the directory.

Something like this

if [ -f /path/to/file/filename_pattern]

then

     move /path/to/file/filename_pattern with whatever program you want to use

else

     exit 0

fi

Put a check like above into the script and schedule the script with "crontab -e" (see "man 5 crontab" for syntax).

Best regards,

Peter

tamil_arasan
Active Contributor
0 Kudos

Hi Deepak,

Thanks a lot!!

but when i tried to create external command in SM69 and tried to execute it manually. I am gettin the below error

 

standard in must be a tty

External program terminated with exit code 1

any suggestion please?

Regards,

Pradeep

former_member188883
Active Contributor
0 Kudos

Hi Pradeep,

Can you check whether path mention is correct and sidadm user has full permission to execute the shell script.

You may manually login with sidadm and execute the script and check the results.

once successfull replicate the same in SM69

Hope this helps.

Regards,

Deepak Kori

former_member188883
Active Contributor
0 Kudos

Hi Pradeep,

You may write a shell script to move the file as per requirement. Schedule this shell script using cron as per desired timing.

Check out examples here

Help for shell scripts for moving all files from one directory to another | Unix Linux Forums | She...

http://www.unix.com/os-x-apple-/186333-moving-files-automatically.html

Hope this helps,

Regards,

Deepak Kori

tamil_arasan
Active Contributor
0 Kudos

Hi Deepak,

Thanks!

we have a script to move the files however we can't say when the programs will run to generate the files. for Example, some times the file will create in the third week of the month or seond week of the month.

so we need to schedule the script based on the file creation. we can do it through incron but Red hat OS is not supporting it. any suggestions please.

Thanks and regards,

Pradeep

former_member188883
Active Contributor
0 Kudos

Hi Pradeep,

How are the file created ?

Do we have any ABAP program or Job for this ?

Regards,

Deepak Kori

tamil_arasan
Active Contributor
0 Kudos

Hi Deepak,

we are using ABAP programs in background mode to generate the files. HCM releated files will be created in the application server.

Thanks,

Pradeep

former_member188883
Active Contributor
0 Kudos

Hi Pradeep,

Add a function module to execute a shell script to move the files within the existing ABAP program.

This will ensure that when the file is created that time only shell script is executed.

Some sample programs

Hope this helps.

Regards,

Deepak Kori