sbcgua / ajson

Yet another json parser serializer for ABAP
MIT License
53 stars 16 forks source link

Converting hashed tables from JSON to ABAP fails #84

Closed albertmink closed 2 years ago

albertmink commented 3 years ago

Example code that fails to convert into ABAP type.

TYPES:
  BEGIN OF ty_parameter,
    technical_id TYPE c LENGTH 4,
    name         TYPE string,
  END OF ty_parameter,
  ty_parameters TYPE HASHED TABLE OF ty_parameter WITH UNIQUE KEY technical_id
    WITH UNIQUE HASHED KEY xml_name COMPONENTS name.
DATA ls_result TYPE ty_parameters.
DATA json TYPE string.
json = '[{"technicalId": "1"}]'.
DATA(lo_ajson) = zcl_abapgit_ajson=>parse( iv_json =   json
                                     ii_custom_mapping = zcl_abapgit_ajson_mapping=>create_camel_case( ) ).
lo_ajson->to_abap( IMPORTING ev_container = ls_result ).
albertmink commented 2 years ago

implemented in #89