Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Read a specific JSON object/node from JSON file

rajsg1202
Explorer
0 Kudos

HI,

I have a rawstring stored in my ztable, am able to read the rawstring and convert it to JSON format.

However from this file, I have a specific requirement to read a one specific object/node from Json file.. For example: The JSON file has R1 (root node) C1 (child node) C2 , C3 and C4.

Then based on input I should be able to fetch one node data like C3 ( this may have data in array fashion too). This functionality is similar to XPATH/Jsonpath operations. ( $data[*].nodename) .

Can you please guide on to how to do this in ABAP?

Thanks,

Raj

2 REPLIES 2

gabriel_pill-kahan
Active Participant

You might want to try using Simple Transformation to convert JSON to ABAP and vice versa. Please see https://blogs.sap.com/2013/04/15/abap-2-json-and-json-2-abap-with-st/.

rajsg1202
Explorer
0 Kudos

Hi Gabriel, Thanks.

Though we do transformation JSON to ABAP. How to read a specific a node which may have a nested structures?

Also how to generate transformation id (demo_st_json_table) when I have JSON?

CALL TRANSFORMATION demo_st_json_table SOURCE carriers = carriers
RESULT XML json_writer.