Application Development and Automation 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: 
Read only

Background Job

lijisusan_mathews
Active Contributor
0 Likes
768

Hello,

My requirement is to copy a file from one folder to another folder and this will be scheduled and run as a background job. So, i am calling a function module 'WS_execute' to run my application as well as copy the file from a source folder to destination folder. When i run this report in front end, it works well. But, when the same report is being scheduled as a background job in sm36, the file doesnot get copied to the destination folder . Can anyone please tell me the solution for this issue?

Thanks in advance,

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
716

Hi Suzie,

WS_EXECUTE is to Execute External Programs on Presentation Server.

It will not work if you schedule this in backgroud.Usually Background job is done for Application Server.

More over WS_EXECUTE is OBSOLETE in ECC6 . Instead you can use GUI_EXEC.

Hope this will help you.

Regards,

Ranjitha.

6 REPLIES 6
Read only

Former Member
0 Likes
716

Hi,

If the folder is on you persentation layer ie on your desktop then you cannot acheive your task by scheduling a background job because background job cannot communicate with the presentation server.

Regards

Kiran.

Read only

Former Member
0 Likes
716

hi,

i think that you have to specify the file name properly.

try calling the function module in a report and specify all the parameters.

then schedule the report in background..

hope this will help you!!!

Thanks & Regards,

Punit Raval.

Read only

Former Member
0 Likes
717

Hi Suzie,

WS_EXECUTE is to Execute External Programs on Presentation Server.

It will not work if you schedule this in backgroud.Usually Background job is done for Application Server.

More over WS_EXECUTE is OBSOLETE in ECC6 . Instead you can use GUI_EXEC.

Hope this will help you.

Regards,

Ranjitha.

Read only

0 Likes
716

Thanx for your replies..

The file is not stord in the presentation server but it is in a network path which will be specified by the users.. and can I use GUI_EXEC if I am connecting using CItrix???

Suzie

Read only

0 Likes
716

Hey Suzie,

I guess what you can do is, try to write one unix command to copy the file from one folder to another folder.

It gets copied. Simple method to achieve it.

Try to search SDN with the keyword CALL'SYSTEM'

You will get lot many posts with examples.

I have written a sample code for you. Try the below example first.

REPORT  ZUNIXCOMMAND.

TYPES: BEGIN OF y_return,
       line(400) TYPE c,
       END OF y_return.

DATA:  t_return TYPE STANDARD TABLE OF y_return.

PARAMETERS: w_cmnd(256) TYPE c LOWER CASE DEFAULT 'cp /tmp/file_a.txt /bin/file_b.txt'.

CALL 'SYSTEM' ID 'COMMAND' FIELD w_cmnd
              ID 'TAB'     FIELD t_return[].

Thanks,

Babu Kilari

Read only

lijisusan_mathews
Active Contributor
0 Likes
716

thanx a lot.. achieved the result using a slightly different manner.. did it using Dos command and executing it using statements.