Giter VIP home page Giter VIP logo

abap-json's People

Contributors

koemaeda avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

abap-json's Issues

Decoding Issue

Hello Koemaeda!

I ran into an issue with decoding a JSON object using your great ZCL_JSON class. (Thank you so much for making that one available!!!)

My JSON object is like this:

{
"totalRecordCount": 1,
"aches": [{
"accountHolderTerminated": false,
"accountVerified": true,
"depositAmount1": null,
"depositAmount2": null,
"userCode": 0,
"accountingId": "les04",
"accountHolderEmailAddress": "[email protected]",
"accountHolderFirstName": "Sean",
"accountHolderMiddleName": "M.",
"accountHolderLastName": "Le",
"accountHolderName": "Sean Le",
"accountNumber": "9xxxxx54321",
"accountType": "Checking",
"paymentType": "Commissions",
"bankName": "",
"confirmAccountNumber": "",
"routingNumber": "123xxx6789",
"userId": "sle4",
"accountTypeIndicator": "C",
"dateAdded": "2018-04-16T09:44:44.627",
"dateAccountVerified": "2018-04-16T00:00:00",
"finalTerminationDate": null
}]
}

"decode" parses the aches array in the JSON object correctly.
But for some reason unknown to me it doesn't parse the value for totalRecordCount. The value comes out as 0.

This is how I did define the corresponding type for the JSON object in SAP:

TYPES: BEGIN OF agent,
accountholderterminated TYPE string,
accountverified TYPE string,
depositamount1 TYPE string,
depositamount2 TYPE string,
usercode TYPE string,
accountingid TYPE string,
accountholderemailaddress TYPE string,
accountholderfirstname TYPE string,
accountholdermiddlename TYPE string,
accountholderlastname TYPE string,
accountholdername TYPE string,
accountnumber TYPE string,
accounttype TYPE string,
paymenttype TYPE string,
bankname TYPE string,
confirmaccountnumber TYPE string,
routingnumber TYPE string,
userid TYPE string,
accounttypeindicator TYPE string,
dateadded TYPE string,
dateaccountverified TYPE string,
END OF agent.

TYPES: BEGIN OF web_service,
         totalrecordcount TYPE i,
         aches TYPE TABLE OF agent WITH DEFAULT KEY,
       END OF web_service.
DATA: v_agent TYPE web_service.

Koemaeda, do you have any idea why? Again, the aches array does parse correctly; the only issues is with the totalRecordCound field.

Thank you very much for your time!

Best regards,

---Hugo

Contribute

Hello @koemaeda, how are you?

I'm Brazilian and I want to contribute to the project. Do you accept?

Thanks for your project.

==================================================
Que legal cara, vi que você é brasileiro! Gostaria de contribuir com o projeto, posso?

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.