-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decoding Issue #1
Comments
Hello Hugo! Best regards, |
Thanks, Koe! |
Hi Koe, |
Sorry for taking so long! I've added support for keywords (true, false and null) and numbers, according to the official JSON syntax (Number format incompatibilities might still happen as parsing will use the standard ABAP Conversion Exits. As you suggested, boolean fields will be translated to the "flag" default: X for true and space for false. |
Thank you, Koe! I'll test it in our system. |
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": "Sean.Le@marcusmillichap.com",
"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.
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
The text was updated successfully, but these errors were encountered: