cancel
Showing results for 
Search instead for 
Did you mean: 

Upload 5 files on action of a Button

former_member222068
Active Participant
0 Kudos

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

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

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.

former_member222068
Active Participant
0 Kudos

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

gill367
Active Contributor
0 Kudos

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

former_member184578
Active Contributor
0 Kudos

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

former_member222068
Active Participant
0 Kudos

Thank Q guys, problem has been solved. its working fine

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

Check This thread and last reply by Thomas ..

[]

or

For multiple files uplaod you can use ACFUPDOWNLOAD ui element for details check the details in following link[http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/b9157c878a2d67e10000000a42189c/frameset.htm]

Regards

Kuldeep