cancel
Showing results for 
Search instead for 
Did you mean: 

How do you reverse engineer a JSON or API end-point to get the data TYPE you need in ABAP?

ABAPMarty
Participant
398

I am doing some work to connect to an API using an ABAP HTTP Client. How do I get the data structure to populate and send?

Note: I am working on an ECC system so I might not have access to all solutions proposed.

At this point I have reverse engineered the JSON (building a series of TYPES and putting them together) in a test program until it matches so now I know what the data structure is and how to populate it. 

When I worked with web services in the past we could upload the XSD file for the destination when we want to send data, and that XSD file would generate the ABAP data structures which worked really well.

There must be an easier way to do this. I would appreciated comments from people who have done this and can give advice. I am not a big fan of the "have you tried this?" brigade that are in fact only guessing.

Any experienced advisor would be appreciated.

Ryan-Crosby
Active Contributor
Not aware of any tools that would take a JSON payload and propose an ABAP data structure. A simple construction of types and proper use of serialize/deserialize should be sufficient - I have used it before in a special exeption case where I could not use CPI.
ABAPMarty
Participant
Actually instead of XSD I should probably say WSDL.
View Entire Topic
rajnag
Product and Topic Expert
Product and Topic Expert

Hi, we need to get API documentation from the API provider. I don't see any other way. Tools like swagger can be used to check the documentation if at all API provider enabled them.

rajgaaj_0-1727063478732.png

 

ABAPMarty
Participant
Thanks @rajnag that is what I did. I just assumed there would be an easier way as this is a silly admin load to put onto the developer. Doesn't feel like it respects the developer's time.
ABAPMarty
Participant
@Ryan-Crosby, not sure how I feel about you saying words like "simple" and "sufficient" when it was neither. It's not a great process. In fact I regard it as broken.
Sandra_Rossi
Active Contributor
Swagger -> OpenAPI format. Or WSDL or other formats (IDL for Web Services / See https://en.wikipedia.org/wiki/Interface_description_language)