Skip to Content
0
Former Member
Jul 02, 2007 at 04:52 AM

program to produce multiplication table

2666 Views

Hi all,

somebody tell me how to produce a multiplication table in abap. I tried doing this, the values are coming to the internal table but ia am unable to get the output.

Please help me out cos i have to use a similar looping condition in my bdc work.

DATA : BEGIN OF ITAB OCCURS 0,

NUM1 TYPE I ,

NUM2 TYPE I ,

NUM3 TYPE I ,

END OF ITAB .

DO 10 TIMES .

ITAB-NUM1 = ITAB-NUM1 + 1 .

DO 10 TIMES .

ITAB-NUM2 = ITAB-NUM2 + 1 .

ITAB-NUM3 = ITAB-NUM1 * ITAB-NUM2 .

ENDDO .

IF ITAB-NUM2 IS NOT INITIAL .

ITAB-NUM2 = 0 .

ENDIF .

ENDDO .

ENDDO .

LOOP AT ITAB .

WRITE : / ITAB-NUM1, '*' , ITAB-NUM2 , '=' , ITAB-NUM3 .

ENDLOOP .

Regards

Tharanatha H.