Baan wherebind(变量,变量)

 domain tdpcg.prbk  old.prbk
 domain tcccur   old.ccur

 old.ccur = “”
 old.prbk = “”

 select tdpcg031.*, tdpcg011.*, tcibd001.*
 from tdpcg031, tdpcg011 , tcibd001     
 where tdpcg031._index2 = {:tdipu001.item, tdpcg.pbor.stnd}
 and  tdpcg011._index1 = { tdpcg031.pbor, tdpcg031.prbk }
 and  tdpcg011.modu = tdpcg.mous.po
 and  tdpcg031.efdt <= :1
 and  (tdpcg031.exdt > :1 or tdpcg031.exdt = 0 )
 and  tdpcg031.bapr <> 0.00
 and  tcibd001._index1 = {:tdipu001.item}
 order by tdpcg031._index2 desc
 wherebind (1, prc.ref.date)
 selectdo
  if old.prbk = tdpcg031.prbk and
     old.ccur = tdpcg031.curn then
   continue
  endif

  if correct.price.book.and.matrix.definition() then
   |* generate for every found curr. a record *
   create_mdss_prc_line()
   
  endif

  old.prbk = tdpcg031.prbk
  old.ccur = tdpcg031.curn
 endselect