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

Calling a File in Background.

Former Member
0 Likes
2,272

Hello All,

My requirement is to trigger a file on different server in Background.

WS_EXECUTE function module is working perfectly in Front End but failing in background.

Please can you guide the way out.

Regards,

Shantanu R. Godbole

Hello All,

My requirement is to trigger a file on different server in Background.

WS_EXECUTE function module is working perfectly in Front End but failing in background.

Please can you guide the way out.

Regards,

Shantanu R. Godbole

18 REPLIES 18
Read only

Former Member
0 Likes
2,118

Hi,

WS_EXECUTE is used to execute a front end program like WORD, EXCEL, etc. This will not work in background. Since SAP will not allow any GUI based interactions in the background it will not work.

Regards,

Vikranth

Edited by: Vikranth.Reddy on Sep 14, 2009 12:11 PM

Read only

0 Likes
2,118

Hello Vikranth,

So is there any solution to call a file in Background?

Regards,

Shantanu R. Godbole

Read only

0 Likes
2,118

you have to upload file on application server using tcode CG3Z and then use open data set statement to access the file..

Read only

Former Member
0 Likes
2,118

Hi

Use CL_GUI_FRONTEND_SERVICES->execute

Read only

0 Likes
2,118

Hello Venkatachalam,

CL_GUI_FRONTEND_SERVICES->execute does not work even. What has to be done to call a file in Background Specifically?

Regards,

Shantanu R. Godbole

Read only

Former Member
0 Likes
2,118

Hi

Use open dataset concept for this.

Read only

rainer_hbenthal
Active Contributor
0 Likes
2,118

What kind of program do you want to execute on the application server? In Background there is not GUI and therefore there is no connection to a/the presentation server.

What OS is running on your apllication server? Windows? Unix?

Read only

0 Likes
2,118

Hi All,

I have to trigger a VB Script on a different Server (Windows Non SAP) form a SAP (Linux) server.

It is successful by passing '
(IP addess)\folder\file' in the 'PROGRAM' Parameter of WS_EXECUTE function module and similar function Modules , but in Front end only. So could you please suggest how can we call it in Backgorund.

Regards,

Shantanu R. Godbole

Read only

0 Likes
2,118

Again, you can not use any of the WS_EXECUTE oder GUI Services in Background. You can process files on the application server depending on the OS.

Another way is to trigger another program via HTTP.

Read only

venkat_o
Active Contributor
0 Likes
2,118

Hi Shantanu, <li>It is not possible to deal with front end when program is run in background. <li>Download, upload, ws_download, ws_upload, gui_download, gui_upload,ws_execute, cl_gui_frontend_services=>upload, cl_gui_frontend_services=>download functions,which interact with front-end are not supported in background. <li>If you want to download or upload in background, you need to use OPEN DATASET, TRANSFER or READ DATASET, CLOSE DATASET statements. Thanks Venkat.O

Read only

Former Member
0 Likes
2,118

Indeed you cannot use the GUI functions and you have to use the OPEN DATASET and CLOSE DATASET.

If you placed the file(s) on the SAP server, there is no problem accessing it with these statements.

If you place the file(s) on a network share for example you have give 2 users read/write access to the network share on Windows NT level. Maybe your system administrator has to do this.

The users are <SID>ADM and SapService<SID> where <SID> is the system ID of the system you are working on. These users should be domain users, then it will always work. If they are created locally on the SAP system during installation, you also have to create them in the domain and link them together in one way or another..

Grtz Marcel

Read only

0 Likes
2,118

>

> Indeed you cannot use the GUI functions and you have to use the OPEN DATASET and CLOSE DATASET.

> Grtz Marcel

I can not see how this should trigger a VB Script...

Read only

0 Likes
2,118

My fault, i didn't read the question right. I thought "read" a file instead of "execute" a file.

Sorry.

Read only

0 Likes
2,118

Hi All,

Open Dataset / Close Dataset cant be used as I just have to trigger a File on another Server and not read it.

any connection possible through RFCs , etc

Regards,

Shantanu R. Godbole

Read only

SuhaSaha
Product and Topic Expert
Product and Topic Expert
0 Likes
2,118

>

> Open Dataset / Close Dataset cant be used as I just have to trigger a File on another Server and not read it.

> any connection possible through RFCs , etc

Yes, you can call an RFC which will call the VB application which will reside on the relevant server.

In our systesm , we have an RFC to which we pass some params which calls a VB application which writes a file to the server.

BR,

Suhas

Read only

Former Member
0 Likes
2,118

Setup an external oss command in transaction SM69

And from your programm excecute it by calling the FM SXPG_STEP_COMMAND_START

Read only

Former Member
0 Likes
2,118

Hi Shatanu,

The best way to this woul be using open dataset nad locse datat set.Using this you can trnsafer and pick

the file susung application server.

This will work in the backgroun.

However before uploading the file just check if the contents of the file are manitained properly and the fileds are in the correct sequence..

thanks...

Read only

Former Member
0 Likes
2,118

Hi Suhas,

Can you please provide the VB script that your using, we can use this to get pdf file also?

Please update me.

Thanks,

Hari