Example with Excel
Smw0 the thing code into the transfer template to the server:
The from code used to download the template is as follows:
FORMsub_chek_directory. DATA: L_formkey1 likeWwwdatatab. DATA: l_filename1 likerlgrap-filename. DATA: L_fileTYPE string. DATA: L_RC likesy-SUBRC. DATA: L_temp ( -). DATA: L_resultTYPEc. l_filename1='C:\Users\00186159\Desktop\333.XLS'."This path is downloaded to the local address of the template, you can change the SELECT Single* into corresponding Fields ofL_formkey1 fromWwwdataWHEREObjID ='Zexcel' . CLEARL_file.CLEARL_result. L_file =l_filename1. Pager METHODCl_gui_frontend_services=>file_existExportingfile=L_file Receiving result=L_resultEXCEPTIONSCntl_error=1Error_no_gui=2Wrong_parameter=3OTHERS=5. IFL_result =space. Pager FUNCTION 'Download_web_object' ExportingKey=l_formkey1 Destination=l_filename1ImportingRC=L_RCchangingTemp=l_temp. IFL_tempNEl_filename1. MESSAGEe398 (xx) withtext-001. ENDIF. ENDIF.EndForm.
Note: HTML templates and binary object names can be used with the same name and are relid differentiated in the Wwwdata table.
ABAP file upload download with SMW0