﻿// read open orders

// search condition
Set V[condition]  "KUNNR = '&V[zcso_kunnr]' and VKORG = '&V[zcso_vkorg]'"
Set V[condition] "&V[condition] and VTWEG = '&V[zcso_vtweg]' and SPART = '&V[zcso_spart]' and TRVOG = '0'"
Set V[condition] "&V[condition] and AUDAT GE '&V[today-365_ymd]'"

// clear result tables
Set text[r1] ""
Set text[r2] ""
Set text[r3] ""
Set text[r4] ""
Set text[r5] ""


// read orders
Call /guixt/select in.Table="VBAK" in.Condition="&V[condition]" in.Fields="VBELN,AUDAT,AUART,NETWR,BSTNK" table.V1table="r1" table.V2table="r2" table.V3table="r3" table.V4table="r4" table.V5table="r5"  

// pass to VB
CallVB charts.zcso.neworders 

// clear result tables
Set text[r1] ""
Set text[r2] ""
Set text[r3] ""
Set text[r4] ""
Set text[r5] ""
