on 03-03-2011 8:03 AM
Hi everyone,
I am trying to save a content of type xstring to a shared location on a server but it does not work.
But I can display the content.
Can anyone help ?
Thanks.
Regards.
Hi David,
Where you are getting problem, kindly paste the code...
Cheers..
Kris.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Kissnas,
I already solved it. Thanks anyway!
The problem is that I set TRUE the i_in_new_window and i_inplace parameters.
They should be set to FALSE.
Not it is working.
Here is the code :
DATA lo_nd_nd_main TYPE REF TO if_wd_context_node.
DATA lo_el_nd_main TYPE REF TO if_wd_context_element.
DATA ls_nd_main TYPE wd_this->element_nd_main.
DATA lv_data LIKE ls_nd_main-data.
navigate from <CONTEXT> to <ND_MAIN> via lead selection
lo_nd_nd_main = wd_context->get_child_node( name = wd_this->wdctx_nd_main ).
get element via lead selection
lo_el_nd_main = lo_nd_nd_main->get_element( ).
get single attribute
lo_el_nd_main->get_attribute(
EXPORTING
name = `DATA`
IMPORTING
value = lv_data ).
DATA: lv_file_name TYPE string VALUE '
server\file.txt'.
cl_wd_runtime_services=>attach_file_to_response(
i_filename = lv_file_name
i_content = lv_data
i_mime_type = 'text/plain'
i_in_new_window = abap_false
i_inplace = abap_false ).
>DATA: lv_file_name TYPE string VALUE '
server\file.txt'.
You can't force a silent download or force the location with cl_wd_runtime_services=>attach_file_to_response due to browser security restrictions. cl_wd_runtime_services=>attach_file_to_response will simply open the dialog within the browser asking the user to save the file. The user will then choose the location.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.