Skip to Content
avatar image
Former Member

How to read a file using XSJS on HANA?

I have an XSJS app and I would like to be able to read a file(text or CSV) and get the data from it. Then I'm making a data call to the backend to retrieve the data(this part already done) and I want to store that data into another file (text or csv). Unfortunately I haven't found any examples on how to read and write files in xsjs. The file I'm reading will be residing within the same package but I don't know what function to use to read the file. Can anyone point me to where to look?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Jun 16, 2017 at 04:01 PM

    The SAP HANA REST File API can do the job for you.

    But please consider that this is only valid for XS Classic. If you later wanna migrate to XS Advanced, this will not work anymore, because XS Advanced don't use the HANA repo (and you will for sure not use from an XS Advanced application the old XS Classic HANA Repo).

    Maybe you think about your architecture, to not store your business files in the HANA Repot but in a document store or as a BLOB in a table.


    Add comment
    10|10000 characters needed characters exceeded