Application Development 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: 

Open PDF file from SAP ?

Former Member
0 Kudos

Hi gurus,

Is there any FM or command that We can open a pdf file from our computer , This means that Open pdf with Acrobat reader but will be triggered in ABAP .

Thanks

1 ACCEPTED SOLUTION

Former Member
0 Kudos

You Can use CL_GUI_FRONTEND_SERVICES=>EXECUTE to open files/documents on the presentation server. Do not provide the APPLICATION parameter, as such the PDF doucument will open with open with the default application as configured on your system.

Hope it helps.

~Berry

4 REPLIES 4

Former Member
0 Kudos

Hi,

Try the FM GUI_RUN .With this function module you can open the websites also.You have to provide the name of executable file for the application and the path.Path can be URL or your PDF file path.

Former Member
0 Kudos

You Can use CL_GUI_FRONTEND_SERVICES=>EXECUTE to open files/documents on the presentation server. Do not provide the APPLICATION parameter, as such the PDF doucument will open with open with the default application as configured on your system.

Hope it helps.

~Berry

Former Member
0 Kudos

Hi,

You can even use WS_EXECUTE function module.

Give the following 2 parameters to it:

CALL FUNCTION 'WS_EXECUTE'

EXPORTING

DOCUMENT = 'X'

PROGRAM = C:\TEMP.PDF

Regards,

Ravi Kalapur

Former Member
0 Kudos

Hi,

First you need to download the pdf file onto the frontend computer then the MF WS_EXECUTE will do the job:

CALL FUNCTION 'WS_EXECUTE'
      EXPORTING
        document           = 'X'
        program            = path_document
      EXCEPTIONS
        frontend_error     = 1
        no_batch           = 2
        prog_not_found     = 3
        illegal_option     = 4
        gui_refuse_execute = 5
        OTHERS             = 6.

A good directory to download you file would be the SapWorkDir, I have seen in the standard that sap get this directory using WS_QUERY:

CALL FUNCTION 'WS_QUERY'
      EXPORTING
        query          = 'CD'
      IMPORTING
        return         = path_for_copy
      EXCEPTIONS
        inv_query      = 1
        no_batch       = 2
        frontend_error = 3
        OTHERS         = 4.

Hope it helps

Regards,

Renaud Wanschoor