2006 Feb 14 6:08 PM
2006 Feb 14 6:44 PM
2006 Feb 14 6:44 PM
This may work for ya.
report zrich_0003.
data: s type string.
data: start type i value -2.
data: end type i value 10.
s = '1 3 5 7 9'.
do 5 times.
if sy-index <= 3.
start = start + 2.
end = ( end - start ) - 1.
else.
start = start - 2.
end = ( end + start ) + 3.
endif.
write:/ s+start(end).
enddo.
Regards,
RIch Heilman
2006 Feb 14 7:01 PM
<b>One funny Answer</b>
*&---------------------------------------------------------------------*
*& Report YCHATEST *
*& *
*&---------------------------------------------------------------------*
*& *
*& *
*&---------------------------------------------------------------------*
REPORT YCHATEST .
data : x type string value '1 3 5 7 9',
y type string,
z type string.
write : / x.
z = x.
shift x up to '3'.
shift x right deleting trailing ' 9'.
shift x left deleting leading space.
y = x.
write : / x.
shift x up to '5'.
shift x right deleting trailing ' 7'.
shift x left deleting leading space.
write : / x.
write : / y.
write : / z.
Message was edited by: chandu
Message was edited by: chandu
2006 Feb 14 7:05 PM
try this...give any 2 odd numbers and execute...!!!
REPORT yytest88.
parameters : ulimit(2) type n default 9.
parameters : llimit(2) type n default 1.
data : val(3) type n.
data : notry type i.
notry = ( ( ulimit - llimit ) / 2 ) + 1.
do notry times.
if ulimit > llimit.
val = llimit.
while val <= ulimit.
write : val no-zero, ' '.
val = val + 2.
endwhile.
else.
val = ulimit.
while val <= llimit.
write : val no-zero, ' '.
val = val + 2.
endwhile.
endif.
new-line.
llimit = llimit + 2.
ulimit = ulimit - 2.
enddo.
2006 Feb 14 7:36 PM
Nice snippet...but what's the porpuose? just for fun?
I have made a Decimal to Binary code...it's cool -:P
Grettings,
Blag.
2006 Feb 14 8:20 PM
2006 Feb 15 1:33 AM
hi prasanth,
try this..
data : low type i , high type i , tlow type i ,thigh type i , count type i value 5, incr1 type i value 2 , incr2 type i.
incr2 = -2.
do count times.
diff = ( high - low ) / 2 + 1.
if low eq high .
incr1 = -2.
incr2 = 2.
endif.
print = low.
do diff times.
write : print.
print = print + 2.
enddo.
skip.
low = low + incr.
high = high + incr.
enddo.
regards
satesh