Below is the code that is compiled and giving no error but on running below code nesting error is soming. Where am I wrong in the code below.
Code:
Clear
Close All
Local lcJSON, oJSON
TEXT TO jSON
[{"data":{"b2cs":[{"csamt":0,"rt":12,"flag":"N","pos":"24","txval":7500,"typ":"OE","iamt":900,"sply_ty":"INTER"},{"csamt":0,"samt":443.5,"rt":5,"flag":"N","pos":"02","txval":17740,"typ":"OE","camt":443.5,"sply_ty":"INTRA"}]},"status_cd":"1","status_desc":"GSTR request succeeds","header":{"ret_period":"052022"}}]
ENDTEXT
lcJSON = Json
Set Procedure To '.\Utilities\Gst\nfJson-master\nfJson\nfjsonread.prg'
oJSON = nfjsonread(lcJSON)
Close All
Create Cursor CURb2CS (sply_ty c(5),typ c(2),etin c(15),pos c(2),diff_prcnt N(2),rt N(5,2),;
txval N(12,2),iamt N(10,2),camt N(10,2),samt N(10,2),csamt N(10,2))
tnLevel = 0
btypev='B2CS'
For Each Gstr1Crit In oJSON.Array
tnLevel = Evl(tnLevel, 0)
Local lnI, lvMember, laMembers[1]
For lnI=1 To Amembers(laMembers,Gstr1Crit )
lvMember = Getpem(Gstr1Crit,laMembers[lnI])
If Vartype(lvMember)="O" And Upper(laMembers[lnI]) = 'DATA'
Do B2CS_jSON With lvMember,btypev
Endif
Endfor
Endfor
Endproc
Procedure B2CS_jSON(OB2bjson,btypev)
For Each Rowv In OB2bjson.&btypev
Select CURb2CS
Append Blank
Gather Name Rowv
Endfor
Endproc