on 03-17-2011 7:05 AM
HI Friends,
Requirement: I need to upload master for 5 tables using 5 upload UI elements, on action of a button i should upload legacy data to tables. I am capable of uploading one file but not 5.
Can someone help me. it is high priority.
Thanks in Advance,
Sankar
Hi sankar,
Use 5 upload ui elements.. and code in button.
I done with 3 uploads at a time.
check for sample..
http://wiki.sdn.sap.com/wiki/display/WDABAP/UploadandDownloadfilesinWebdynproABAP
Thanks,
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 am able to upload one file on action of a button. kindly can you edit my logic, i.e how to upload file 1 in table 1 and file2 to table 2.
TYPES :
BEGIN OF str_itab,
name(10) TYPE c,
age(10) TYPE c,
gender(10) TYPE c,
END OF str_itab.
DATA : t_table1 TYPE STANDARD TABLE OF str_itab,
i_data TYPE STANDARD TABLE OF string,
lo_nd_sflight TYPE REF TO if_wd_context_node,
lo_el_sflight TYPE REF TO if_wd_context_element,
l_string TYPE string,
fs_table TYPE str_itab,
upload TYPE STANDARD TABLE OF ysg_upload,
l_xstring TYPE xstring,
fields TYPE string_table,
lv_field TYPE string.
* DATA : t_table TYPE if_upload=>elements_data_tab,
* data_table TYPE if_upload=>elements_data_tab.
* get single attribute
wd_context->get_attribute( EXPORTING name = `UPLOAD`
IMPORTING value = l_xstring ).
CALL FUNCTION 'HR_KR_XSTRING_TO_STRING'
EXPORTING
in_xstring = l_xstring
IMPORTING
out_string = l_string.
SPLIT l_string AT cl_abap_char_utilities=>newline INTO TABLE i_data.
* bind with table element.
LOOP AT i_data INTO l_string.
SPLIT l_string AT cl_abap_char_utilities=>horizontal_tab INTO TABLE fields.
READ TABLE fields INTO lv_field INDEX 1.
fs_table-name = lv_field.
READ TABLE fields INTO lv_field INDEX 2.
fs_table-age = lv_field.
READ TABLE fields INTO lv_field INDEX 3.
fs_table-gender = lv_field.
APPEND fs_table TO t_table1.
* APPEND fs_table TO upload.
APPEND fs_table TO upload.
ENDLOOP.
lo_nd_sflight = wd_context->get_child_node( 'DATA_TAB' ).
lo_nd_sflight->bind_table( t_table1 ).
Thanks in Advance
Sankar
For multiple upload you can use ACFUPLOAD.
how ever if you want to do it with five fileupload UIs.
your code is fine.
here you are doing it for one fileUpload which is having its property data bound to UPLOAD attribute.
for all the five attributes bind it to five different attributes
i.e for first use attribute UPLOAD1 of type XSTRING.
similarly for second use UPLOAD2 of type xstring.
same way create five attributes
then repeat the same process of filling the node.
thanks
sarbjeet singh
Hi shankar,
I think u r binding all 5 File Upload UI to a single attribute..!! Take 5 FileUpload UI elements and bind each UI element data to different context attributes.. for example first UI element data too UPLOAD1 2nd to UPLOAD2 3rd to UPLOAD3 .... then in the button Onaction evevt read these 5 context attribute values.. as
wd_context->get_attribute( EXPORTING name = `UPLOAD1`
IMPORTING value = l_xstring1 ).
wd_context->get_attribute( EXPORTING name = `UPLOAD2`
IMPORTING value = l_xstring2 ).
then append to internal table.. and bind it to node
Reply if u need some more clarifications.,
Thanks & Regards,
Kiran
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.