on 09-09-2010 8:35 AM
Hi all,
i want to upload documents via WD, i have more than 2 (UPLOAD- BROWSER) Buttoms , and all of this bottoms are binded to one(same) Action, which is mean that in the end , all the uploaded documents will be processed by the same Action, and at once, is that possible, is it possible to loop around a method ( get_attribute)?
is ther any way to do this?
thank you very much
Natel
Edited by: Natel Bargach on Sep 9, 2010 9:35 AM
Hi,
You can create a context of cardinality 0:n and
Create attributes for data , file path , mime etc bind all the FileUpload UI element (assuming that you are using it) to it.
then in the Onaction event of the upload button , you can call method GET_ELEMENTS of IF_WD_NODE for the context created above.
Then LOOP through the elements and call GET_STATIC_ATTRIBUTES() of IF_WD_ELEMENT to get the values of file uploaded (like data , path , mime) etc..
Thanks,
Aditya.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi ,
The following code shows the looping part.Please have a look.
DATA lo_nd_table_node TYPE REF TO if_wd_context_node.
DATA lo_el_table_node TYPE REF TO if_wd_context_element.
DATA ls_table_node TYPE wd_this->element_table_node.
DATA lt_table_node TYPE wd_this->elements_table_node.
DATA lt_table TYPE wdr_context_element_set.
lo_nd_table_node = wd_context->get_child_node( name = wd_this->wdctx_table_node ).//Your node
lt_table = lo_nd_table_node->get_elements( including_lead_selection = abap_true ).//getting all elements
LOOP AT lt_table INTO lo_el_table_node.//looping
lo_el_table_node->get_static_attributes(
IMPORTING
static_attributes = ls_table_node ).
ENDLOOP.
Thanks,
Aditya.
Hi,
The action is fine.What about the context.All are bound to the same context??
And how many elements is get_elements() returning?Or how many times is your loop executing??
This is another way of doing the same process.May be you can also try this.
DATA : lo_nd_upload_file TYPE REF TO if_wd_context_node,
DATA : lt_upload_file TYPE wd_this->Elements_upload_file,
lo_nd_upload_file = wd_context->get_child_node( name = wd_this->wdctx_upload_file ).
lo_nd_upload_file->get_static_attributes_table( importing table = lt_upload_file ).
Aditya.
Binding two UI elements to the same context node isn't going to create two elements in the context. Instead both UI elements will be bound to the same element and overwrite each other. This is why you are recieving only one element back.
You probably should use two different context node in this case.
Hallo Mr Jung,
yes tha is right, so do you mean, i have to create two differents context for two UPLOAD UIelements and binded them to the same ACTION? i dont think that it will work, cause in the end i have to read only from one context, one IF, or it will be better for me if could read separately from each UPLOAD UI-ELEMEENT, this means that the path of the first ULPOAD UI will be read separately from the other one, but only with one ACTION , both will be generated from one ACTION , is this possible ? is there a way to know which UPLOAD UI-Element is filled ? if its the first or the second that is filled or containg a path? means which path belongs to which UPLOAD UI_Element?
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
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.