Subroutine

                  Subroutines are procedures that we define in an ABAP program and can be called from any program. Subroutines are normally called internally, i.e. called from the same program in which it is defined. But it is also possible to call a subroutine from an external program. Subroutines cannot be nested and are usually defined at the end of the program.In Subroutine We Dont Need To Write Code Seperately For each one . We can Create One Code Which IS usable to all.
A subroutine is a block of code introduced by FORM and concluded by ENDFORM.
FORM <subroutine name> 
[USING ... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]... ] [CHANGING... [VALUE(]<pi>[)] [TYPE <t>|LIKE <f>]... ]. 
<Subroutine code>
ENDFORM.
A subroutine is called by a PERFORM statement 


Create Subroutine For Airthmatic Operation.

Step 1. Create Program using  SE38. Write Down Parameters  an      
           Variables.



Step 2. Create Perform and Form...ENDFORM  Operation.



Step 3. Provide  Input Values.



Step 4. Output.






0 comments:

Post a Comment