Skip to Content
Former Member
Apr 13, 2009 at 05:42 AM

help in clear ..................


hi Gurus...

i have a small issue in my report where

my select is working good and satisfying the screen condition and according fetches values

but inside the loop , i have used a read stmt to check sy-subrc NE 0 and gets appended to my itable ,

but thing is that , when i have a conditio which doesnt satisfy the sel. screen

the field that is inside the read stmt ...tat column value alone returns in the ALV , i have used the clear but than its showin in the o/p.

wat ever field i use inside the read get shown in the o/p thou the cond is not satisfied, where to clear


i have given my code..........................

  LOOP AT it_pos INTO wa_pos .
    READ TABLE it_kna1 INTO wa_kna1 WITH KEY kunnr = wa_pos-konto .
    IF sy-subrc = 0.

      wa_final-name1 = wa_kna1-name1.
      wa_final-budat = wa_pos-budat.

      READ TABLE it_t005u INTO wa_t005u WITH KEY  bland = wa_kna1-regio.
      IF sy-subrc = 0.
        wa_final-bezei = wa_t005u-bezei.


*read table it_vbrp into wa_vbrp with key vbeln = wa_vbeln.*
*if sy-subrc ne 0.*
*wa_final-xblnr = wa_pos-xblnr.
*append wa_final to it_final.
    LOOP AT it_vbrp INTO wa_vbrp  WHERE  vbeln = wa_vbeln .

      READ TABLE it_vbrk INTO wa_vbrk WITH KEY vbeln = wa_vbrp-vbeln.
      IF sy-subrc = 0.
        wa_final-knumv = wa_vbrk-knumv.

      wa_final-arktx = wa_vbrp-arktx.
      wa_final-fkimg = wa_vbrp-fkimg.
      wa_final-sgtxt = wa_pos-sgtxt.

      LOOP AT it_konv INTO wa_konv WHERE knumv = wa_vbrk-knumv AND  kposn = wa_vbrp-posnr.

        wa_pos-dmshb = ( wa_konv-kwert ) - ( ( wa_konv-kwert * ra_data ) / 100 ).
        wa_final-dmbtr = wa_pos-dmshb.

        APPEND wa_final TO it_final.

    CLEAR:  wa_kna1, wa_t005u,wa_vbrk, wa_vbrp, wa_konv, wa_final, wa_pos.

Edited by: Matt on Apr 13, 2009 8:02 AM Please wrap code in tags. See how much easier it is to read!

Edited by: Matt on Apr 13, 2009 8:03 AM - corrected indenting