on 04-01-2015 1:48 PM
Hi All,
We have a requirement where users need to upload excel data with around 10,000 rows into SAP MII which needs to be passed to a transaction.
Since we are using SAPUI5 controls the only way to send data to a transaction is through a AJAX POST but because of the size of data, the AJAX POST is failing stating too long.
So we are trying to find a way to upload the file directly into workbench so that transaction can read from it and delete the file once completed.
We created a HTML code to upload the file but unable to post using XMLHttpRequest and path:"./" (same folder as the html file):
<!DOCTYPE HTML>
<HTML>
<HEAD>
<TITLE>File Upload</TITLE>
<META http-equiv="X-UA-Compatible" content="IE=edge">
<META http-equiv='cache-control' content='no-cache'>
<META http-equiv='expires' content='0'>
<META http-equiv='pragma' content='no-cache'>
<SCRIPT type="text/javascript" src="/XMII/JavaScript/bootstrap.js"
data-libs="i5Chart,i5Grid,jQuery"></SCRIPT>
<script type="text/javascript">
var client = new XMLHttpRequest();
function upload() {
var file = document.getElementById("uploadfile");
//create new FormData instance to transfer as Form Type
var formData = new FormData();
// add the file intended to be upload to the created FormData instance
formData.append("upload", file.files[0]);
client.open("post", "./", false);
client.setRequestHeader("Content-Type", "multipart/form-data");
client.send(formData); // send formData to the server using XHR
}
// register handler to check XHR instance's status when receiving the response
client.onreadystatechange = function() {
alert(client.response);
}
</script>
</HEAD>
<body>
<input type="file" id="uploadfile" />
<input type="button" value="upload" onclick="upload()" />
</body>
</HTML>
We are getting response:
Request URL:http://<Server>:50000/XMII/CM/Default/
Request Method:POST
Status Code:403 Forbidden
SAP MII version: 14.0 SP5
can anyone help us with this.
Have anyone of you tried uploading files into SAP MII server. Is there a better way?
We are able to do this with applet, we could set hung string as param and applet internally used to handle the posts so never had any issue but we now want to do this with SAPUI5 controls and completely avoid applets(JRE dependency).
You may use a JSP file to upload the excelsheet to MII server. You can use java.io package to read the data from local machine and write to server. I have used this once successfully.
Thanks
Shaji
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravitej,
How about creating an OLEDB connection in dataservers and reading through it instead of doing it using ajax?
Best Regards,
Swaroop
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ravitej,
If this is one time activity or not a regular activity, then convert excel file to xml and place xml file in one shared location. from there MII transaction can pick , process and upload to respective tables.
hope this helps!!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you go to the link below and search for something like "sap xmii file upload" you should find a lot of good information about how to do something like this.
Regards,
Christian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
9 | |
7 | |
3 | |
2 | |
2 | |
2 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.