Skip to Content
0
Former Member
Jun 30, 2006 at 05:08 AM

Flow Logic

23 Views

Hello All,

I am encountering an issue :

Loop at i_bseg.
read table i_final with key bukrs = i_bseg-bukrs
                            belnr = i_bseg-belnr
                       gjahr = i_bseg-gjahr binary search.
IF ( i_final-blart eq 'ZM' or i_final-blart eq 'ZG' ).
ELSE.
* Process only records which are Account Type 'D'.
  if i_bseg-koart = 'D'.
  Write:/write statements
  ENDIF.
ENDIF.
at end of belnr.
  write:/ Write Statements
endat.
endloop.

In the ELSE part (So, the Document is not of type ZM and ZG) i have 2 test cases

Case1-

Document No.       KOART
1000000000         S
1000000000         S

Case2-

Document No.       KOART
1000000000         D
1000000000         K

So, in Case1 it should not have processed the Document as it is of Type 'S' but, the AT END OF BELNR gets written on to the screen.

In case2, if i use CONTINUE the first record gets processed as it is of type 'D' and when it sees 'K' it CONTINUES and comes out of the Loop completly and does not write the AT END OF BELNR for the One record that it processed.

Could you please provide some pointers .

Thank you.

- PSK