Application Development 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: 

ALSM_EXCEL_TO_INTERNAL_TABLE is not working from Fiori app

dubbaka
Participant
0 Kudos
1,934

We are using ALSM_EXCEL_TO_INTERNAL_TABLE to download .XLSX file in to internal table, it is working fine with SAP GUI, But we have assigned this T-code to FIORI using Symentic Object and Catalog ID.

But this ALSM_EXCEL_TO_INTERNAL_TABLE Is not working from FIORI app, Can anyone please suggest is there any alternative solution for this issue.

CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = p_file
i_begin_col = 1
i_begin_row = 1
i_end_col = 250
i_end_row = 60000
TABLES
it_data = gt_exl_data
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.

5 REPLIES 5

dubbaka
Participant
0 Kudos
1,579

I also tried below FM

DATA: it_raw TYPE truxs_t_text_data,
gt_source_all TYPE TABLE OF ty_source.
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
* I_FIELD_SEPERATOR =
i_line_header = 'X'
i_tab_raw_data = it_raw " WORK TABLE
i_filename = p_file
TABLES
i_tab_converted_data = gt_source_all "ACTUAL DATA
EXCEPTIONS
conversion_failed = 1

OTHERS = 2.

This FM also works fine in SAP GUI, but in Fiori app i am getting error.

VXLozano
Active Contributor
1,579

I think that when you access the system through Fiori, you are working in a web based environment. The FM you are asking for work are GUI based ones. So you'll never be able to make them work. You'll need to upload the file (not sure how... FTP?) and then work from there.

dubbaka
Participant
0 Kudos
1,579

Hello vicen.lozano,

The below FM is working for .CSV from Fiori app also, I am searching for similler FM to read XLSX file.

CALL FUNCTION 'KCD_CSV_FILE_TO_INTERN_CONVERT'
EXPORTING
i_filename = lv_filename
i_separator = ','
TABLES
e_intern = gt_intern
EXCEPTIONS
upload_csv = 1
upload_filetype = 2
OTHERS = 3.

dubbaka
Participant
0 Kudos
1,579
I can upload .CSV file from Fiori app using below code, but not .XLSX file.

I think we can not upload .XLSX file from Fiori app.

CONSTANTS c_separator TYPE c VALUE ',' .

DATA: lv_filename TYPE rlgrap-filename.

lv_filename = p_file.
*Read the CSV file data to an internal table
CALL FUNCTION 'KCD_CSV_FILE_TO_INTERN_CONVERT'
EXPORTING
i_filename = lv_filename
i_separator = c_separator
TABLES
e_intern = gt_intern
EXCEPTIONS
upload_csv = 1
upload_filetype = 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.

Sandra_Rossi
Active Contributor
1,579

ALSM_EXCEL_TO_INTERNAL_TABLE is based on OLE, it can work via SAP GUI, but not via the Web.

You are asking to upload an XLSX file via the Fiori app, you can at least do it with abap2xlsx.