Skip to Content
0
Former Member
Jan 16, 2018 at 01:04 PM

JSON to ABAP Create Data Dynamically?

6233 Views

Hi,

How can i create data from complex json. This data nested structure. Also can be contain array in array line. It is so complex :)

Example JSON;

[
  {
    "MATKL": "Mal Grubu 1",
    "ATTRB": {
      "TYPE": "A",
      "BRANCH": "B"
    },
    "MATNR": [
      {
        "NAME": "Malzeme 1",
        "WEIGHT": "12,2",
        "LENGTH": "",
        "UoM": "KG"
      }
    ]
  },
  {
    "MATKL": "Mal Grubu 1",
    "ATTRB": {
      "TYPE": "A",
      "BRANCH": "B"
    },
    "MATNR": [
      {
        "NAME": "Malzeme 1",
        "WEIGHT": "12,2",
        "LENGTH": "",
        "UoM": "KG"
      }
    ]
  }
]


Its output like that;

I need to seperate all json data into my dynamic structure type then i will use it update my z tables.

Call transformation statement's result parameter must be same type json data. If not contain same fields. I cant transfer it to internal table completly.

Note : Standard class or function module can be use in old SAP version(Kernel Id).

How can i solve it? Please help.

Thanks for your valuable answers.

Attachments

json.png (10.9 kB)