|
*&---------------------------------------------------------------------* *& Report ZPRIME * *& * *&---------------------------------------------------------------------* *& * *& * *&---------------------------------------------------------------------* REPORT zprime . DATA : t_no TYPE i, res TYPE p, pr_no TYPE p, tag TYPE i. SELECTION-SCREEN BEGIN OF BLOCK b1. PARAMETERS : pr_num TYPE i. SELECTION-SCREEN END OF BLOCK b1. pr_no = 1. WHILE pr_no LE pr_num. t_no = 2. tag = 0. WHILE t_no < pr_no. res = pr_no MOD t_no. IF res = 0. WRITE : / pr_no. WRITE : 'is not PRIME Number ' COLOR 3 INTENSIFIED OFF. tag = 1. EXIT. ENDIF. t_no = t_no + 1. ENDWHILE. IF tag = 0. WRITE : / pr_no. WRITE : 'is PRIME Number ' COLOR 6 INTENSIFIED OFF. ENDIF. pr_no = pr_no + 1. ENDWHILE.ABAP Tips by : Shanmugam
Fast Links:
Do you have a ABAP Question? ABAP Books
More ABAP Tips
BDC Programming Tips - Sapscripts Tips - Smartforms Tips SAP Basis, ABAP Programming and Other IMG Stuff http://www.erpgreat.com All the site contents are Copyright © www.erpgreat.com
and the content authors. All rights reserved.
|