Code Monkey home page Code Monkey logo

Comments (5)

se38 avatar se38 commented on September 15, 2024

Hi Marina,

if you don't need the special handlings of the JSON document class (like special date format etc.) you can try the simple transformation:

"--- JSON -> ABAP ---
zcl_json_document=>transform_simple(
EXPORTING
json_in = json
IMPORTING
data_out = test
).

from zjson.

marinaDurkovic avatar marinaDurkovic commented on September 15, 2024

I was using json_doc->get_next( ) to iterate through objects. When I try transform_simple I'm getting an error at this line of code
2014-12-18 16_34_46-abap debugger 1 exclusive bit-c-solm4_s8s_74

My json is structured like this
2014-12-18 16_46_51-soapui 5 0 0

So maybe that is causing the problem with transform_simple method. In the begining I have [ and later objects that start with { . Do you have a suggestion how can I deal with this type of json structure using that method ?

Regards,
Marina

from zjson.

se38 avatar se38 commented on September 15, 2024

Hi Marina,
unfortunatelly the simple transformation (SAP Standard) needs upper case variable names and has to start with { "RESULT" : ....
See https://github.com/se38/zJSON/wiki/Usage-zJSON#simple-transformation-new-in-release-0217

Performance is indeed an issue with the JSON Document class, especialy with nested loops in it. I'm still searching for a solution.

Uwe

from zjson.

se38 avatar se38 commented on September 15, 2024

Starting to play around with a JavaScript parsing solution. Stay tuned, maybe a fast version 3.0 is near ;)

@marinaDurkovic Is it possible that you send me your testdata (anonymised if personel data included)? uwe.fetzer [at] se38.de

from zjson.

se38 avatar se38 commented on September 15, 2024

Hi Marina,

good and bad news regarding my new JSON parser which uses the SAP Standard class CL_JAVA_SCRIPT now.

Bad news:
I've found an error in the SAP standard class. In case the JSON is too large, the class doesn't work properly.

Good news:
the parser is a loooot faster than before. I've shorten your JSON test file to around 1.600 records and the parsing process lasts 45 seconds.

Your original file:
Length 5.009.241
Lines 107.174
Records ~3.500
Doesn't work

Maximum length which worked:
Length 2.290.743
Lines 49.152
Records 1.606
45 Seconds

I think we can live with this result (and the restriction regarding the size of the file, we "just" have to split the files). Expect a beta version of the new parser end of March or in April.

Regards, Uwe

from zjson.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.