08-25-2005 10:56 AM
Hi,
I want to know how to create subroutine pool.
Regards,
p.krishna prasad
08-25-2005 11: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
08-25-2005 11:06 AM
Hi,
Check this link.
http://help.sap.com/saphelp_erp2004/helpdata/en/9f/db999535c111d1829f0000e829fbfe/frameset.htm
Hope this helps you.
Thanks,
Ruthra.R
08-25-2005 11: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 programs Perform statements
Regards
Ashish
08-25-2005 11: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
08-25-2005 11:23 AM
Hi,
SE38 - > enter name of the subroutine pool - > create - > select type as subroutine pool.
This one have collection of subroutines.
Cheers,
Sasi
08-25-2005 11: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.