‎2010 Jun 16 9:56 AM
Hi i am trying to pass some values from one internal table to another..the problem is my 1st internal table ( GT_BKPF2) is smaller than my 2nd internal table (GT_PAYR).
EX: GT_BKPF2 has one document no with two line items
GT_PAYR has one document number corresponding to GT_BKPF2 but it consist of 5 void check which i would like to display.But my report will only show the 1st void check and print beside the two line items and not the remanining...
should i be doing a loop statement?
‎2010 Jun 16 10:08 AM
Yes you can very well Use loop if you don't have any perfromance issue ( Use Parallel Cursor...) , but more preferred you can use READ statement with KEY addition to it. (check subrc fro successful read )..
‎2010 Jun 16 10:12 AM
Hi i have use read statement but it doesn't seems to work..here is part of my code
SELECT VOIDR
CHECV
CHECT
ZBUKR
GJAHR
VBLNR
FROM PAYR
INTO CORRESPONDING FIELDS OF TABLE GT_PAYR
FOR ALL ENTRIES IN GT_BKPF2
WHERE ZBUKR = GT_BKPF2-BUKRS
AND GJAHR = GT_BKPF2-GJAHR
AND VBLNR = GT_BKPF2-BELNR.
*IF NOT GT_PAYR[] IS INITIAL.
*
* SORT GT_PAYR BY ZBUKR GJAHR VBLNR.
*
*ENDIF.
* Get all documents except parked document.
LOOP AT gt_bseg INTO wa_bseg.
AT NEW gjahr.
CLEAR: wa_bkpf, wa_ce40001_awkey, gt_PAYR.
READ TABLE gt_bkpf INTO wa_bkpf WITH KEY bukrs = wa_bseg-bukrs
belnr = wa_bseg-belnr
gjahr = wa_bseg-gjahr.
READ TABLE gt_PAYR WITH KEY ZBUKR = wa_bseg-bukrs
VBLNR = wa_bseg-belnr
gjahr = wa_bseg-gjahr.
ENDAT.