Monday, December 20, 2010
REPORT ztest_notepad.
PARAMETERS: p_file TYPE rlgrap-filename.

AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
DATA:w_file_tab TYPE filetable,
w1 LIKE LINE OF w_file_tab,
w_rc TYPE i.

CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
default_extension       = 'XLS'
CHANGING
file_table              = w_file_tab
rc                      = w_rc
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 ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
READ TABLE w_file_tab INTO w1 INDEX 1.
IF sy-subrc = 0.
p_file = w1-filename.
ENDIF.

0 comments:

Post a Comment

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.