ok, putting the root array into another root object doesnt work. it seemed that there is no easy way via PB integrated functions, so i solved the issue with one loop for the root objects and a function that is called recursively for the child objects:
// loop through all root objects
ll_root = iuo_jsonParser.getRootItem()
for ll_loop = 1 to iuo_jsonParser.getChildCount(ll_root)
ll_row = ids_return.insertRow(0)
if ll_row > 0 then
ll_object = iuo_jsonParser.getChildItem(ll_root, ll_loop)
for li_loop = 1 to iuo_jsonParser.getChildCount(ll_object)
ll_item = iuo_jsonParser.getChildItem(ll_object, li_loop)
ls_key = iuo_jsonParser.getChildKey(ll_object, li_loop)
// checks the data type of each item
choose case iuo_jsonParser.getItemType(ll_item)
case jsonNUMBERitem!
this.of_checkSetItem(ll_row, ls_key, string(iuo_jsonParser.getItemNumber(ll_item)))
case jsonSTRINGitem!
this.of_checkSetItem(ll_row, ls_key, iuo_jsonParser.getItemString(ll_item))
// go deeper for child objects
case jsonOBJECTitem!
this.of_setChildItemREC(ll_row, ll_item, ls_key)
end choose
next
end if
next
with of_setChildItemREC as
int li_loop
long ll_root, ll_loop, ll_object, ll_item
string ls_key
for li_loop = 1 to iuo_jsonParser.getChildCount(al_object)
ll_item = iuo_jsonParser.getChildItem(al_object, li_loop)
ls_key = iuo_jsonParser.getChildKey(al_object, li_loop)
// checks the data type of each item
choose case iuo_jsonParser.getItemType(ll_item)
case jsonNUMBERitem!
return this.of_checkSetItem(al_row, as_key+'_'+ls_key, string(iuo_jsonParser.getItemNumber(ll_item)))
case jsonSTRINGitem!
return this.of_checkSetItem(al_row, as_key+'_'+ls_key, iuo_jsonParser.getItemString(ll_item))
// if it goes deeper: recursive call!
case jsonOBJECTitem!
return this.of_setChildItemREC(al_row, ll_item, ls_key)
end choose
next