Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Excel file upload

Former Member
0 Likes
708

Hi ,

I had one requirement to upload excel file.In the excel file that i upload there are some columns that is hided,so is it possible for the function module to retrieve the values from that hided columns.

Thanks,

Arun.

3 REPLIES 3
Read only

Former Member
0 Likes
531

Hi,

try this....


*&---------------------------------------------------------------------*
*&      Form  get_excelint
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
*  -->  p1        text
*  <--  p2        text
*----------------------------------------------------------------------*
FORM get_excelint .

  CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
    EXPORTING
      filename                      = infile
      i_begin_col                   = '1'
      i_begin_row                   = beg_row
      i_end_col                     = '6'
      i_end_row                     = end_row
    TABLES
      intern                        = excel_tab
* EXCEPTIONS
*   INCONSISTENT_PARAMETERS       = 1
*   UPLOAD_OLE                    = 2
*   OTHERS                        = 3
            .
  IF sy-subrc <> 0.
* MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.
ENDFORM.                    " get_excelint

Arunima

Read only

Former Member
0 Likes
531

hi ,

refer this blog

it shows how to read data from multiple sheet into one single sheet

and then into internal table ......

Read only

Former Member
0 Likes
531

Hi,

Check this FM...


TYPE-POOLS truxs.
DATA: it_type TYPE truxs_t_text_data.

*	Uploading the data in the file into internal table
  CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
    EXPORTING
      i_field_seperator    = 'X'
      i_line_header        = 'X'
      i_tab_raw_data       = it_type
      i_filename           = p_file
    TABLES
      i_tab_converted_data = ist_source[]
    EXCEPTIONS
      conversion_failed    = 1
      OTHERS               = 2.

No need to give column no...