Skip to Content
avatar image
Former Member

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

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??

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Nov 03, 2015 at 10:03 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Nov 03, 2015 at 12:55 PM

    Hi

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

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

    Add comment
    10|10000 characters needed characters exceeded