Skip to Content
author's profile photo Former Member
Former Member

Reg: what is the subroutine pool

Hi,

I want to know how to create subroutine pool.

Regards,

p.krishna prasad

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

6 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2005 at 10:02 AM

    Hi,

    I suppose that this is a program with subroutines inside ( FORM ... ENDFORM ).

    "Contain parts of programs (FORM routines) that can be called

    using external PERFORM statements."

    PERFORM form IN PROGRAM prog.

    Svetlin

    Message was edited by: Svetlin Rusev

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2005 at 10:06 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2005 at 10:14 AM

    Hi

    Subroutine pool is a type of program where you write the definitions of your subroutines.

    Form …………

    …………….

    …….

    Endform.

    N number of subroutines can be written in subroutine pool and can be used by any program. So, it makes the subroutines global (may be used by any number of programs).

    A subroutine pool can be created from SE38 with Attribute ‘TYPE’: Subroutine pool. You can not execute this type of program. Its subroutines can be used by other program’s Perform statements

    Regards

    Ashish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2005 at 10:23 AM

    In other words: We also call such programs as type 'S'.

    You cannot start a type S program using a transaction code or by entering the program name. Instead, they are containers for subroutines, which you can call externally from other ABAP programs. They cannot contain screens.

    Regards

    Ashish

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2005 at 10:23 AM

    Hi,

    SE38 - > enter name of the subroutine pool - > create - > select type as subroutine pool.

    This one have collection of subroutines.

    Cheers,

    Sasi

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Aug 25, 2005 at 10:40 AM

    The subroutine pool is a routine that is created while a program is working.

    So the code of subroutine isn't directly wrote in the program, but it must be wrote in an internal table.

    For example:

    DATA: TEXT(6) VALUE 'HELLO!', NAME LIKE SY-REPID.

    DATA TCODE(1000) OCCURS 100 WITH HEADER LINE.

    TCODE = 'REPORT MY_REPORT.'.

    APPEND TCODE.

    TCODE = 'FORM MY_FORM.'.

    APPEND TCODE.

    TCODE = 'DATA: TEXT(6) VALUE ''HELLO!''.'.

    APPEND TCODE.

    TCODE = 'WRITE TEXT.'.

    APPEND TCODE.

    TCODE = 'ENDFORM. " MY_FORM'.

    APPEND TCODE.

    GENERATE SUBROUTINE POOL TCODE NAME NAME.

    IF SY-SUBRC = 0.

    PERFORM MY_FORM IN PROGRAM (NAME).

    ENDIF.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.