多个文件下载:用table控件实现
添加一个参数context_element type if_wd_context_element
data lo_nd_t_file type ref to if_wd_context_node.
data lo_el_t_file type ref to if_wd_context_element.
data ls_t_file type wd_this->element_t_file.
* navigate from to via lead selection
lo_nd_t_file = wd_context->get_child_node( name = wd_this->wdctx_t_file ).
call method lo_nd_t_file->set_lead_selection
exporting
element = context_element.
* get all declared attributes
context_element->get_static_attributes(
importing
static_attributes = ls_t_file ).
data: lv_file_name type string ,
lv_mime_type type string .
lv_file_name = ls_t_file-z_file_name.
lv_mime_type = ls_t_file-z_file_type.
*** 下载文件
cl_wd_runtime_services=>attach_file_to_response(
i_filename = lv_file_name
i_content = ls_t_file-z_file_content
i_mime_type = lv_mime_type
i_in_new_window = abap_false
i_inplace = abap_false ).
阅读(2322) | 评论(0) | 转发(0) |