cancel
Showing results for 
Search instead for 
Did you mean: 

Calling a external SAP program from a view (for example the NotePad)

Former Member
0 Kudos

Hi all.

I trying to call a external SAP program (for example: the windows notepad). I have a view in a BSP with a link, when the link is pressed i trying to call the windows notepad using the function

ws_execute

but it don't work, i obtain an exception (NO_BATXCH) maybe because this function is obsolete. I don't know if exist some class that replace the function. If somebody knows some information about it please give me a reply urgently.

i´m looking for call a external SAP program from a bsp !!!!

Thanks

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

I think that this topic has been answered

Former Member
0 Kudos

Can you not just use the standard html to handle the file display. The file will then simply be displayed in the web browser.

i.e.

<a href="c:\temp\hello.txt">display file</a>

or the following if you want it to open up in a new window

<a href="c:\temp\hello.txt" target="_NEW">display file</a>

Former Member
0 Kudos

Hi Mart

I tried with your example but it appears only to work with a BSP nor with a View. But Thanks a lot. I Think that the IcWebClient Architecture is so hard and i must to investigate about it.

Thanks to all.

gregorw
Active Contributor
0 Kudos

Hello Armando,

why do you want to call an external program from the BSP? What should the application?

Regards

Gregor

Former Member
0 Kudos

Hi Gregor.

Maybe i'm posting the question in the wrong forum. I'm working with CRM (IcWebClient) and i making some modifications to the standard. I need to add a link into a view (like a BSP but not a BSP), when the user press this link one frontend program should be called and executed (i'm testing with the notepad).

I was trying to work at the controller's view, in the event DO_HANDLE_EVENT and using the class

cl_gui_frontend_services->execute

but it isn't working, i obtain an exception and read a previous reply where explain the reason. I finished programing a JavaScript that create one ACTIVEX object ShellExecute and it work but i did it in the view's layout. I think that is possible to make it at the view's controller and that is my question.

Sorry, i think that i don´t specify wath i want to do in the previous post. Thanks all.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You can use cl_gui_frontend_services=>execute or ws_execute (although it is obsolete) if your application is running from the SAPGui. However I think the key in the question is that this is a BSP. Things work completely different in the Web World. First you don't have a presentation layer (SAPGui) to work through. It is just you and the browser. You probably are going to have to find some JavaScript to execute programs on the frontend from a BSP page. However I am sure you will run into security problems there. Imagine if your browser let any web page execute anything on your PC :). There are several posts in the BSP forum that talk about passing content back to the frontend (such as an excel spreadsheet or text document). These might be helpful.

Former Member
0 Kudos

Thanks....

I was thinking like you because i tested with the class cl_gui_frontend_services and i obtained an exception. I finish using a JavaScript to execute the program but i have some problems with the internet browser security. If any person can help me with this....

Former Member
0 Kudos

Hye Armando ,

You can use the class 'cl_gui_frontend_services' and the following method :

for example to display a document in notepad

CALL METHOD cl_gui_frontend_services=>execute

EXPORTING

document = 'C:\WINNT\check.txt' .

or to open a new document text :

CALL METHOD cl_gui_frontend_services=>execute

EXPORTING

  • document = 'C:\WINNT\check.txt'

application = 'C:\WINNT\notepad.exe'.