cancel
Showing results for 
Search instead for 
Did you mean: 

How to use external JS API like PAPA PARSE in SAP UI5

Former Member
0 Kudos

Hi All,

I am working with CSV files where i need to import them and show them in SAP UI5 table before exporting it to HANA.

The issue is i need to convert the CSV file(in string format) to Array Format first. For this a simple split at ',' is not sufficient as a string might also contain a comma.

For this i am planning to use papa parse (Papa Parse - Powerful CSV Parser for JavaScript), where i need to use its api method "parse".

This API JS file is available in .js format file, which i am unable to attach as its not supported, so i am pasting the GIT link here: PapaParse/papaparse.min.js at master · mholt/PapaParse · GitHub

The issue i am facing now is how to use this js file, i've copied it to my folder, but how to load it(instantiate) and how to call its methods.

Can someone please help??

Accepted Solutions (1)

Accepted Solutions (1)

karthikarjun
Active Contributor
0 Kudos

Hi Mahesh,

Goto Index.html----> create one script tag---> like <script href="give your JSFilepath">   </script>

Else:

use jQuery.sap.require() - Give your reference folder path name

Thanks,

KA

Answers (1)

Answers (1)

0 Kudos

Hi

var script = "http://url library" or "local path to library"

$("head").append('<script type="text/javascript" src="' + script + '"></script>');