Skip to Content
0
Former Member
Jun 10, 2009 at 05:52 AM

entries not appending

32 Views

Hi experts

-


below is my coding.....

I have 16 entries to my input when i set a break-point but when it goes inside the loop ,

it appends only ones and iam getting only one line item ....rest of my 15 items is not coming

i think i have done a small mistake in my loop which i am not able to find it out ,,,,pls

help me out,,,,,

thanks in advance

Rachel

SUBMIT ZRFITEMAP WITH KD_LIFNR-low IN So_LIFNR
                 WITH KD_BUKRS-LOW = pr_BUKRS
                 WITH X_OPSEL = 'X'
*                 WITH PA_STIDA-LOW = so_budat-low
                 with so_budat-low in so_budat
                 WITH X_NORM = 'X'
                 WITH X_SHBV = 'X'
                 WITH FREE SELECTIONS TEXPR
                 AND RETURN .

*    endif.

    clear: it_pos .
    import it_pos from memory id 'zit_pos'.
    free memory id 'zit_pos'.

 if it_pos is not initial.

***********************selecting

Select bukrs belnr gjahr blart budat xblnr usnam xreversal
                 from bkpf into corresponding fields of table it_bkpf
                 for all entries in it_pos
                 where bukrs = pr_bukrs and
                 gjahr = it_pos-gjahr and
                 belnr = it_pos-belnr and
                 blart = 'KR' and
                 budat = it_pos-budat
                 and xblnr = it_pos-xblnr.


if it_bkpf[] is not initial.

 select bukrs gjahr belnr lifnr hkont shkzg dmbtr
           from bseg into corresponding fields of table it_bseg
           for all entries in it_bkpf
           where bukrs = it_bkpf-bukrs     and
                 gjahr = it_bkpf-gjahr and
                 belnr = it_bkpf-belnr .
                 .
  Endif.
  endif.

   if it_lfb1 is not initial.
****** Select Vendor name.
    select lifnr name1
           from lfa1 into corresponding fields of table it_lfa1
           for all entries in it_lfb1
           where lifnr = it_lfb1-lifnr.

  endif.




  sort it_bseg by lifnr.


loop at it_pos into wa_pos .
   wa_final-belnr = wa_pos-belnr.
   wa_final-budat = wa_pos-budat.
   WA_FINAL-XBLNR = WA_POS-XBLNR.
   wa_final-dmbtr = wa_pos-dmshb.
Endloop.
          append wa_final to it_final.
        Clear:  wa_final, Wa_bseg, wa_pos..