sapdev logo background
sapdev logo sapdev logo
Comments

SELECT from COOI table



*Code to demonstrate COVP Select

*  The FOR ALL ENTRIES comand only retrieves data which matches
*  entries within a particular internal table.
** posid = wbs element name (i.e. DV.INSS.380950)
** pspnr = wbs element code (deduced using conversion routine)
  SELECT ekko~ebeln
     ekpo~ebelp
     ekko~lifnr
     ekko~bedat
     lfa1~name1
     ekpo~bednr
*         covp~objnr
*         covp~wtgbtr
     cooi~objnr
     cooi~wkgbtr
     ekpo~menge
     ekpo~netpr
     ekpo~mwskz
     ekpo~elikz
     ekkn~sakto
     ekkn~ps_psp_pnr
     prps~psphi
     prps~posid
     cooi~matnr
     ekpo~matkl
     cooi~beknz
     prps~pspnr
APPENDING CORRESPONDING FIELDS OF TABLE it_reptab2
FROM cooi AS cooi INNER JOIN prps AS prps
  ON prps~objnr EQ cooi~objnr
     INNER JOIN ekko AS ekko
  ON ekko~ebeln = cooi~refbn
     INNER JOIN lfa1 AS lfa1
  ON lfa1~lifnr = ekko~lifnr
     INNER JOIN ekpo AS ekpo
  ON ekpo~ebeln = cooi~refbn AND
     ekpo~ebelp = cooi~rfpos
     INNER JOIN ekkn AS ekkn
  ON ekkn~ebeln = cooi~refbn AND
     ekkn~ebelp = cooi~rfpos
WHERE prps~posid IN p_wbs  AND
     cooi~kokrs       EQ '****' AND
     cooi~lednr       EQ '00'   AND
*     ekkn~ps_psp_pnr  EQ prps~pspnr AND
     prps~pspnr      EQ prps~pspnr AND
     ekkn~sakto      IN p_sakto AND
     ekpo~matkl      IN p_matkl AND
     ekko~lifnr      IN p_lifnr AND
     ekko~bedat      IN p_bedat.



comments powered by Disqus


Can't find something on ERPWorkbench? A quick search should fix that: