Wednesday, 22 October 2025

Abap Code Fibonachi Number

 Code :

Report zfibo.

PARAMETERSp_from TYPE i,
             p_to   TYPE i.

 DATAv_from      TYPE i,
       v_to        TYPE i.

 DATATYPE i,
       b TYPE i,
       TYPE i,
      cnt type i.

 START-OF-SELECTION.

   v_from p_from.
   v_to   p_to.

   MOVE v_from TO b.

   cnt 0.
   DO  v_to times.


     IF v_to < cnt.
       EXIT.
     ENDIF.

     a + b.
     a b.
     b c.

     writec.

     cnt b + 1.
   enddo.

Result :














No comments:

Post a Comment

Visitor

Code Syntax Try...Endtry

  Code : Report Try. Parameters  NUMBER  type  I . data  RESULT  type  P  decimals  2 . data  OREF  type  ref  to  CX_ROOT . data  TEXT  typ...