ABAP CODE FOR PALINDROME
REPORT ZPALINDROME.
DATA:
num TYPE i value 121,
rev TYPE i value 0,
numcopy TYPE i value 0,
digit TYPE i.
numcopy = num.
WHILE numcopy > 0.
digit = numcopy mod 10.
numcopy = numcopy / 10.
rev = rev * 10 + digit.
ENDWHILE.
if num = rev.
WRITE 'num is palindrome'.
else.
WRITE ' num is not a palindrome'.
ENDIF.
DATA:
num TYPE i value 121,
rev TYPE i value 0,
numcopy TYPE i value 0,
digit TYPE i.
numcopy = num.
WHILE numcopy > 0.
digit = numcopy mod 10.
numcopy = numcopy / 10.
rev = rev * 10 + digit.
ENDWHILE.
if num = rev.
WRITE 'num is palindrome'.
else.
WRITE ' num is not a palindrome'.
ENDIF.