cancel
Showing results for 
Search instead for 
Did you mean: 

Display of POs

Former Member
0 Kudos

Hi all,

How to place a link of some file which is stored in the PC when i click on the details of some POs..

.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi

Try this sample code.

Incase you click on the details, you can use

AT LINE-SELECTION Event (or similar event is generated by Double-clicking or Pressing F2 key), here is some sample code.

See this sample code.

<u>For executing a File on your PC</u>

Here you need to call your .doc (MS word) or .pdf (Acrobar Reader) / .exe (Executable file) or any other file on your PC



Report  ztest_file_execute.

Start-of-selection.
perform execute.

Form execute.
 
call function 'WS_EXECUTE'
     exporting
*         DOCUMENT           = ' '
*         CD                 = ' '
*         COMMANDLINE        = ' '
*         INFORM             = ' '
          program            = 'C:winntexplorer.exe'
*         STAT               = ' '
*         WINID              = ' '
*         OSMAC_SCRIPT       = ' '
*         OSMAC_CREATOR      = ' '
*         WIN16_EXT          = ' '
*         EXEC_RC            = ' '
*    IMPORTING
*         RBUFF              =
     exceptions
          frontend_error     = 1
          no_batch           = 2
          prog_not_found     = 3
          illegal_option     = 4
          gui_refuse_execute = 5
          others             = 6.
 
if sy-subrc ne 0.
  message i010(bctrain).
endif.

endform.

----


<b>For File_open_dialog</b>



AT LINE-SELECTION.
perform get_filename p_flag p_filename.
perform execute.

form get_filename  using value(p_flag) type rprxxxxx-kr_feld4
                   changing p_filename type rlgrap-filename.
 
 
  class cl_gui_frontend_services definition load.
 
  data: l_filefilter   type string,
        l_filename     type string,
        l_filetable    type filetable,
        l_rc           type i,
        l_user_action  type i,
        l_window_title type string.
 
* only when local
  check p_flag is initial.
 
* Set data type drop-down and popup title
  concatenate cl_gui_frontend_services=>filetype_text
              cl_gui_frontend_services=>filetype_all
          into l_filefilter.
  l_window_title = text-f02.
 
* Dialogue
  call method cl_gui_frontend_services=>file_open_dialog
    exporting
      window_title            = l_window_title
      default_extension       = con_ext
*     DEFAULT_FILENAME        =
      file_filter             = l_filefilter
      initial_directory       = con_init_dir
*     MULTISELECTION          =
    changing
      file_table              = l_filetable
      rc                      = l_rc
      user_action             = l_user_action
    exceptions
      file_open_dialog_failed = 1
      cntl_error              = 2
      error_no_gui            = 3
      not_supported_by_gui    = 4
      others                  = 5
          .
  if sy-subrc <> 0.
    message e899(5a) with 'Error'.
  endif.
 
* dialogue not canceled
  check l_user_action <> cl_gui_frontend_services=>action_cancel.
 
  read table l_filetable into l_filename index 1.
  check sy-subrc = 0.
  p_filename = l_filename.
 
endform.                    " get_filename

----


Let me know incase you need any other details.

Regards

- Atul

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Ravi,

Will u make me more clear abt your problem so that I can go through it.

Navneet.

Former Member
0 Kudos

Hi

Please send me the details. Have you done any coding yet.. ?

I will help you out.

Regards

- Atul

Former Member
0 Kudos

No..Still i didnt get any idea how to start and where to start...

Pls help