Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 9129

Re: Transform JSON array with subobjects to internal table

$
0
0

hi Custodio,

I make a call to get the JSON response, so

CALL METHOD send_get_request
     EXPORTING
       iv_url           = rest_url
       it_header_params = lt_params
     RECEIVING
       rv_response      = l_json.


l_json looks like this:

{

"userAgreementList":

[{"displayDate":"2014-11-17T09:58:13-08:00",

"displayUserInfo":{"fullNameOrEmail":"xxx@xxxl.com"},

"esign":true,"agreementId":"xxxx","latestVersionId":"xxx","name":"test","status":

"OUT_FOR_SIGNATURE"},

{"displayDate":"2014-11-17T08

:27:04-08:00",

"displayUserInfo":{"company":"xx","fullNameOrEmail":"x"},"esign":true,"agreementId":"xxx","latestVersionId":"xx","name":"test":"SIGNED"}]}

 

 

then I call ID transformation to process.

CALL TRANSFORMATION id SOURCE XML l_json RESULT useragreementlist = rt_agreements


I continue to get the CX_ST_MATCH exception.

 

If I do:

REPLACE FIRST OCCURRENCE OF 'userAgreementList' IN l_json WITH 'USERAGREEMENTLIST'.
REPLACE ALL OCCURRENCES OF 'displayDate' IN l_json WITH 'DISPLAY_DATE'.
REPLACE ALL OCCURRENCES OF 'fullNameOrEmail' IN l_json WITH 'FULL_NAME_OR_EMAIL'.
REPLACE ALL OCCURRENCES OF 'esign' IN l_json WITH 'ESIGN'.
REPLACE ALL OCCURRENCES OF 'agreementId' IN l_json WITH 'AGREEMENT_ID'.
REPLACE ALL OCCURRENCES OF 'name' IN l_json WITH 'NAME'.
REPLACE ALL OCCURRENCES OF 'status' IN l_json WITH 'STATUS'.


CALL TRANSFORMATION id SOURCE XML l_json RESULT useragreementlist = rt_agreements.


I get display_date, esign, agreement_id, name, status.


I am missing company, fullnameoremail and latestversionid,


hope that helps.  I appreciate anything you can do!


Thx

Chris


Viewing all articles
Browse latest Browse all 9129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>