sbcgua/ajson

Converting hashed tables from JSON to ABAP fails

albertmink opened this issue · 1 comments

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 ).

implemented in #89