cancel
Showing results for 
Search instead for 
Did you mean: 

Excel data upload in WEBUI

former_member198132
Active Participant
0 Kudos

Hi all,

I am uploading the excel sheet in WEBUI.

For that I am using Java script to pick the file as well as upload the excel data. Here Upload_file is also executing , It is taking the Alert message also what file we are trying to load .

After that Excel object was not getting generating . I did BOLD that code where  I am getting the problem. The Control is not triggering the  Second Alert  " This file is mine" means above code is not working .  Already I have checked all the active controls. Do  I need to active still anything .

When I click on Upload  button , After Alert message .. Excel was not generating .. Please help me in this What i need to do.

Please find the code.  This code I have copied from blog excel upload in WEBUI.

regards,

Ajay

<script language="javascript"  type="text/javascript">

function upload_file( ){

var iRow="1",

      jCol="1",

      ActiveRows="0",

      fileName="",

      sValue=" ";

fileName=document.getElementById("<%= controller->component_id %>_fileUpDown").value;

if ( fileName == "" ) {

alert("Upload." + "\n" + " " + "\n" + "Please choose an Excel file as source.");

return;

}

if ( fileName != "") {

alert("Upload." + "\n" + " " + "\n" + "This file is to be uploaded:" + "\n" + fileName);

Excel = new ActiveXObject("Excel.Application");

Book = Excel.Workbooks.Open( fileName );

alert("Upload." + "\n" + " " + "\n" + "This file  is mine:" + "\n" + fileName);

ActiveRows = Book.Worksheets("Sheet1").Range("A1.IV64000").CurrentRegion.Rows.Count;

for (iRow=1; iRow<=ActiveRows; iRow++) {

for (jCol=1; jCol<4; jCol++) {

cData = Book.Worksheets("Sheet1").Cells(iRow,jCol).value;

sValue = sValue.concat(cData,"\n");

}

}

document.getElementById("<%= controller->component_id %>_Excel_Data").value = sValue;

Excel.Workbooks.Close;

  return nameUpload();

}

}

</script>

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Ajay,

   I pasting you a link ,just refer it , may be it will solve your issue.

   http://wiki.sdn.sap.com/wiki/display/CRM/CRM+Web+UI+-+Uploading+data+from+Excel+files

   Thank You & Regards

    Rohan

former_member198132
Active Participant
0 Kudos

Hi Rohan,

I did  copied the same from that blog

I came to know that code Java script is not working  InternetExplorer 8.

The Excel application is not creating . I put one Alert after excel creation , but that is not triggering.

Do i need to add anything for browser based.

regards,

Ajay

Former Member
0 Kudos

Hi Ajay,

   i use Explorer 8, and it seems fine here.  Not so sure but just check this out..

http://johanvanzijl.com/articles/tag/sap-crm/

Thank You & Regards

Rohan