function module

 

Create function module.

      *  First create function group in se80. Give name and create and activate the function group.

        *  Goto se37

        *  Give name starts with z/y.

        *  ZAJAY_OPERATIONS.

        * Import means input parameters

                    



                * Export means output parameters.

                                


                *  Then source code means performs operations.

                                    


Calling function module through program.

    REPORT ZAJAY_OPEATION.

    PARAMETERSP_a type i,
            p_b type i.
    datav_sum type i,
          v_sub type i.
    CALL FUNCTION 'ZAJAY_OPERATIONS'
      EXPORTING
       V_A           p_a
        v_b           p_b
     IMPORTING
       V_C           v_sum
       V_D           v_sub.

   write'addition of',P_a ,'and',p_b ,'is :' ,v_sum.
   write'subtraction of',P_a,'and',p_b,'is :' ,v_sub.


Input


Output


                            







Calling function module through program


    REPORT ZAJAY_FM.

    PARAMETERSP_a type i,
            p_b type i.
    datav_sum type i,
          v_sub type i,
          v_mul type i,
           v_div type i.

    CALL FUNCTION 'ZAJAY_OPERATIONS1'
      EXPORTING
        v_a           P_a
        v_b           P_b
     IMPORTING
       V_SUM         V_sum
       V_SUB         V_sub
       V_MUL         V_mul
       V_DIV         V_div.

   write'addition of',P_a ,'and',p_b ,'is :' ,v_sum .
   write'subtraction of',P_a,'and',p_b,'is :' ,v_sub .
   write:  'mutiply of' P_a 'and'p_b ,'is :' ,v_mul .
   write:  'divison of' P_a 'and'p_b ,'is :' ,v_div .

Comments

Popular posts from this blog

New syntax for append- VALUE (new syntax 7.4+) in ABAP

Read statement new syntax in ABAP. (7.4+).

Concatenation new syntax( 7.4+ ).