on β2025 Apr 04 5:41 AM
Hi Experts,
SAP Build App β User uploads Excel β Presses Submit.
Integration Suite β Receives Excel data β Maps β Calls S/4HANA API.
Cloud Connector β Connects BTP (cloud) to on-prem S/4HANA system.
S/4HANA β API receives data, creates Sales Order.
As of now i need build apps design and integration flow creation
Request clarification before answering.
Hi Mohith,
A diagram like the below:-
For the controller part:-
onUpload: function (oEvent) {
const that = this;
const file = oEvent.getParameter("files")[0];
if (!file) {
MessageToast.show("Please choose a file.");
return;
}
const reader = new FileReader();
reader.onload = function (e) {
const data = e.target.result;
// Parse the Excel file
const workbook = XLSX.read(data, { type: "binary" });
// Modify contents of the first sheet
const firstSheetName = workbook.SheetNames[0];
const worksheet = workbook.Sheets[firstSheetName];
const json = XLSX.utils.sheet_to_json(worksheet, { defval: "" });
// Example: Add a new column to each row
const modifiedData = json.map((row, index) => {
row["New Column"] = "Row " + (index + 1);
return row;
});
// Convert JSON back to worksheet
const newWorksheet = XLSX.utils.json_to_sheet(modifiedData);
// Replace the original sheet
workbook.Sheets[firstSheetName] = newWorksheet;
// Generate new Excel file
const wbout = XLSX.write(workbook, { bookType: 'xlsx', type: 'binary' });
// Convert to Blob and trigger download
const blob = new Blob([s2ab(wbout)], { type: "application/octet-stream" });
saveAs(blob, "Modified_Excel.xlsx"); // Use FileSaver.js or your own downloader
MessageToast.show("Excel processed and downloaded!");
};
reader.readAsBinaryString(file);
},
// Utility function to convert string to ArrayBuffer
function s2ab(s) {
const buf = new ArrayBuffer(s.length);
const view = new Uint8Array(buf);
for (let i = 0; i < s.length; i++) view[i] = s.charCodeAt(i) & 0xff;
return buf;
}Please ensure 'xlsx.full.min.js' from SheetJS(link)
Thanks,
Jakes
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.