Skip to Content
author's profile photo Former Member
Former Member

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

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

Add comment
10|10000 characters needed characters exceeded

5 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Mar 09, 2004 at 03:18 PM

    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'.

    Add comment
    10|10000 characters needed characters exceeded

  • Posted on Mar 10, 2004 at 04:24 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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....

  • Posted on Mar 10, 2004 at 10:55 PM

    Hello Armando,

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

    Regards

    Gregor

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Mar 11, 2004 at 11:27 AM

    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>

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member

      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.

  • author's profile photo Former Member
    Former Member
    Posted on Mar 13, 2004 at 09:32 PM

    I think that this topic has been answered

    Add comment
    10|10000 characters needed characters exceeded