What is ABAP subroutine

A subroutine is a reusable section of code. It is like a mini-program that can be called from another point in your program. Within it you can define variables, execute statements, compute results, and write output. To define a subroutine, use the form statement to indicate the start of a subroutine, and use endform to indicate the end of the subroutine. The name of a subroutine cannot exceed 30 characters.

To call a subroutine, use the perform statement.

report ztx1706.
write: / 'Before call 1'.
perform sub1.
write: / 'Before call 2'.
perform sub1.
write: / 'After calls'.
form sub1.
write: / 'Inside sub1'.
endform.

Popularity: 6% [?]

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • Slashdot
  • StumbleUpon
  • Reddit

Tags: ,

Leave a Reply

You must be logged in to post a comment.