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

How can i get path Acrobat reader ?

Former Member
0 Likes
1,685

Hi all,

how can i get the path of Acrobat reader on my frontend ? I know that the program is named AcroRd32.exe.

Thanks so much

Regards,

Hi all,

how can i get the path of Acrobat reader on my frontend ? I know that the program is named AcroRd32.exe.

Thanks so much

Regards,

10 REPLIES 10
Read only

RichHeilman
Developer Advocate
Developer Advocate
0 Likes
1,588

You want to do this programmatically with ABAP?

Regards,

Rich Heilman

Read only

0 Likes
1,588

Yes Sir !

Read only

Former Member
0 Likes
1,588

Hi,

U can get the file path with FM, SO_FILENAME_GET_WITH_PATH

Pass file name as input parameter....

Sreedhar

Read only

0 Likes
1,588

I check out that function module but it did not work for me, it actually picked up the the wrong file in the wrong path. I have written a little sample of what you can do. It worked really good for me. Please remember that, in this program case-sensitivity is important. Enter the name of the program in the selection screen exactly as it appears in the PC. For example, the you must type

<b>A</b>cro<b>R</b>d32.exe

Here is the program.



report zrich_0002 .

data: idir_tab type standard table of file_info.
data: xdir_tab type file_info.

data: imaster type table of string with header line.
data: xmaster type string.

data: count type i.
data: exit_flag type c.

parameters: p_file type localfile lower case.

xmaster = 'C:program files'.
append xmaster to imaster.


loop at imaster.

  clear idir_tab. refresh idir_tab.
  call method cl_gui_frontend_services=>directory_list_files
    exporting
      directory                   = imaster

    changing
      file_table                  = idir_tab
      count                       = count
    exceptions
      cntl_error                  = 1
      directory_list_files_failed = 2
      wrong_parameter             = 3
      error_no_gui                = 4
      others                      = 5.

  clear exit_flag.

  loop at idir_tab into xdir_tab.
    if xdir_tab-isdir = '1'.
      concatenate imaster '' xdir_tab-filename  into xmaster.
      append xmaster to imaster.
    else.
      if xdir_tab-filename = p_file.
        write:/ imaster, xdir_tab-filename.
        exit_flag = 'X'.
        exit.
      endif.
    endif.
  endloop.

  if exit_flag = 'X'.
    exit.
  endif.

endloop.

Regards,

Rich Heilman

Read only

0 Likes
1,588

Strange FM, i pass ACRORD32.EXE as input parameter and it give me C:\Documents and Settings\tafkap\SapWorkDir\

and it's not the true !!

Read only

0 Likes
1,588

ALso, remember that this program will blow thru the entire directory structure of your PC starting from the first entry in the imaster table. I have started this program from the "program files" directory under "C", but you could start form "C". Also remember that if the file is really far down in the structure, it could take a while to find it. For the acrobat executable, only takes a couple seconds.

Regards,

Rich Heilman

Read only

0 Likes
1,588

That's exactlly what it brought back for me!! Try my sample code.

Regards,

RIch Heilman

Read only

0 Likes
1,588

FM SO_PROGNAME_GET_WITH_PATH is better for me.

Thx

Read only

0 Likes
1,588

But Rich, i will test your code

Thanks.

Regards

Read only

0 Likes
1,588

If the FM doesn't work, then you can't use it. My sample program works good for me.

Regards,

Rich Heilman