Selección de archivo único.
PARAMETERS: pa_file type LOCALFILE.
Proceso:
at selection-screen on value-request for pa_file. *---------------------------------------------------------------------- perform get_file_name using 'Filename to download to'(011) changing pa_file.
Rutina:
*---------------------------------------------------------------------- * Form get_file_name *---------------------------------------------------------------------- * F4 help for file name *---------------------------------------------------------------------- form get_file_name using lo_text changing lo_file. data: lt_files type standard table of sdokpath,
lw_file type sdokpath. call function 'TMP_GUI_FILE_OPEN_DIALOG' EXPORTING window_title = lo_text TABLES file_table = lt_files EXCEPTIONS others = 4. if sy-subrc = 4. message 'GUI error: please contact the helpdesk' type 'E'. endif. read table lt_files index 1 into lw_file. lo_file = lw_file-pathname.
endform. " get_file_name
Alternativa
Class CL_RSAN_UT_FILES
method F4
:
AT SELECTION-SCREEN ON VALUE-REQUEST FOR pa_mfile. CL_RSAN_UT_FILES=>F4( exporting i_applserv = space i_gui_extension = space i_gui_ext_filter = space i_title = 'Choose file to UPLOAD from' changing c_file_name = pa_mfile ).
Para buscar directorio --> TMP_GUI_BROWSE_FOR_FOLDER.
Fuente:
http://abapcadabra.com/index.php/reporting/the-selection-screen/147-selscreen-f4-filename
Comentarios
Publicar un comentario