Hello All.
I try to read a JSON file from an existing inventory application. In this file I found "Bins", "Content" (section of Bin), and "Items".
The json is like that:
I created 3 temp tables, defined the relation. But when I use READ-JSON method, the field Barcode is filled first and second, table but not in the 3rd table. In fact, I think I can only catch the date on 1 level.
How can I fill the Barcode Field in all table ?
Thank you very much !!!
PS : I use OpenEdge 11.7.8, I attach the program and json file.

I try to read a JSON file from an existing inventory application. In this file I found "Bins", "Content" (section of Bin), and "Items".
The json is like that:
Code:
{
"Bins": {
"BinList": [{
"Barcode": "BIN0000930DC10",
"Rows": 2,
"vcolumns": 2,
"Content": [{
"RowDivision": 2,
"ColumnDivision": 2,
"Articles": []
},
{
"RowDivision": 1,
"ColumnDivision": 1,
"Articles": [{
"ArticleId": "FM1317",
"Quantity": 5
}]
}
]
}]
}
}
How can I fill the Barcode Field in all table ?
Thank you very much !!!
PS : I use OpenEdge 11.7.8, I attach the program and json file.
Code:
DEFINE TEMP-TABLE BinList NO-UNDO
FIELD Barcode AS CHARACTER format "x(15)"
FIELD Rows AS CHARACTER
FIELD vcolumns AS CHARACTER
index idx1 is PRIMARY UNIQUE Barcode.
DEFINE TEMP-TABLE Content NO-UNDO
FIELD Barcode AS CHARACTER format "x(15)"
FIELD RowDivision AS CHARACTER format "x" label "Row"
FIELD ColumnDivision AS CHARACTER format "x" label "Col"
index indx2 is PRIMARY UNIQUE Barcode RowDivision ColumnDivision.
DEFINE TEMP-TABLE Articles NO-UNDO
FIELD Barcode AS CHARACTER format "x(15)"
FIELD RowDivision AS CHARACTER format "x" label "Row"
FIELD ColumnDivision AS CHARACTER format "x" label "Col"
FIELD ArticleId AS CHARACTER format "x(20)"
FIELD Quantity AS CHARACTER
index indx3 is PRIMARY UNIQUE Barcode RowDivision ColumnDivision ArticleId.
DEFINE DATASET Bins FOR BinList, Content, Articles
DATA-RELATION FOR BinList, Content
RELATION-FIELDS (BinList.Barcode, Content.Barcode)
DATA-RELATION FOR Content, Articles
RELATION-FIELDS (Content.Barcode, Articles.Barcode,
Content.RowDivision, Articles.RowDivision,
Content.ColumnDivision, Articles.ColumnDivision).
DATASET Bins:READ-JSON ("file", "testjson.txt", "empty").

Attachments
Last edited by a moderator: