Wednesday, December 29, 2010
REPORT ztest_notepad.
DATA:it_nfal       TYPE STANDARD TABLE OF nfal WITH HEADER LINE.
DATA:total_records TYPE i.
DATA: c1           TYPE cursor,
c2           TYPE cursor,
c3           TYPE cursor.
DATA:cgh_flag      TYPE c,
kkh_flag      TYPE c,
sgh_flag      TYPE c.

START-OF-SELECTION.
SELECT COUNT( * ) FROM nfal INTO total_records.
OPEN CURSOR:c1 FOR SELECT * FROM nfal WHERE einri = 'CGH',
c2 FOR SELECT * FROM nfal WHERE einri = 'KKH',
c3 FOR SELECT * FROM nfal WHERE einri = 'SGH'.
DO.
IF cgh_flag NE 'X'.
FETCH NEXT CURSOR c1 APPENDING TABLE it_nfal.
IF sy-subrc <> 0.
CLOSE CURSOR c1.
cgh_flag = 'X'.
ENDIF.
ENDIF.
IF kkh_flag NE 'X'.
FETCH NEXT CURSOR c2 APPENDING TABLE it_nfal.
IF sy-subrc <> 0.
CLOSE CURSOR c2.
kkh_flag = 'X'.
ENDIF.
ENDIF.
IF sgh_flag NE 'X'.
FETCH NEXT CURSOR c3 APPENDING TABLE it_nfal.
IF sy-subrc <> 0.
CLOSE CURSOR c3.
sgh_flag = 'X'.
ENDIF.
ENDIF.
IF cgh_flag = 'X' AND
kkh_flag = 'X' AND
sgh_flag = 'X'.
EXIT.
ENDIF.
ENDDO. 

0 comments:

Post a Comment

Your useful comments, suggestions are appreciated.Your comments are moderated.

Followers

Contact Form

Name

Email *

Message *

Web Dynpro ABAP Book

An SAP Consultant

Follow US


Want to Contribute ?

If you are interested in writing about the new stuff you learn everyday while working, please write to the.sap.consultants@gmail.com.

Click on Contribution for more details.