Beruflich Dokumente
Kultur Dokumente
Purpose
DISCLAIMER: The JavaScript library is an open source library that is not an IP of SAP. Refer
to the license file and use it accordingly.
Overview
In order to upload the spreadsheet, a Screen Personas HTML viewer is used to add a HTML
Input control with type = “file”. This input control will accept the excel file path from the user.
Once the file contents are read, we make use of the XLSX.utils.sheet_to_csv method to convert
the data into CSV format. This data is then sent to another Personas script for forming the
parameter of an RFC to transfer data to backend.
In the second script, we receive the comma separated data, create a well formed string of
contents and send it to backend as an RFC parameter.
if (a[0]){
valueExists = true;
parameters += '{"F1":"' + a[0] + '","F2":"' + a[1] + '","F3":"' +
a[2] + '","F4":"' + a[3] + '","F5":"' + a[4]+ '"},';
}
}
FUNCTION ztest_csv_to_list.
*"----------------------------------------------------------------------
*"*"Local Interface:
*" TABLES
*" DATA_TABLE STRUCTURE ZTEST_XL_SO OPTIONAL
*"----------------------------------------------------------------------
EXPORT data_table TO MEMORY ID 'MEMORY'.
SUBMIT ztest_xl_to_list.
ENDFUNCTION.
Then a report program ‘ztest_xl_to_list’ is invoked to loop through the data_table contents and
write them as an ABAP List.
REPORT ztest_xl_to_list.
DATA: data_table TYPE TABLE OF ztest_xl_so,
ls_table TYPE ztest_xl_so.
START-OF-SELECTION.
IMPORT data_table FROM MEMORY ID 'MEMORY'.
LOOP AT data_table INTO ls_table.
WRITE:/10 ls_table-f1 ,
40 ls_table-f2,
80 ls_table-f3,
110 ls_table-f4,
150 ls_table-f5.
ENDLOOP.
SAP Screen Personas, Microsoft Excel to ABAP List, Excel upload in SAP Screen Personas for
SAP GUI for HTML