Skip to Content
Author's profile photo Former Member

Transient Programs in ABAP

It’s good to know that there is a way of writing









    • To Get the dynamically generated Program Name *

With the following additions:










    • Contains Error Message*











    • Name of the include program Concerned  to store this field*











    • Line Number in Transient program*












    • Incorrect word that caused the error*












    • Position of the incorrect word*










    • Trace output*

How Generate Subroutine pool works

When Generate

Subroutine pool

command is
executed it takes the code in the Internal table and checks for errors;
in case of  errors it throws an error giving the line number error text and  so on. If
the code is free from errors it creates a program dynamically and program name
is stored in the field 


. Now you call the routines that are in
dynamically created program.

The syntax for calling the routine in

dynamic program









    • Where Upload is a Subroutine in the dynamically created program*


Transient code

required to dynamically update a database table is written below:

** Begin of Code*


‘Report ztrans.’

to git_abaplist,

‘tables: ‘
to git_abaplist,

to git_abaplist,


to git_abaplist,

Internal table declaration

‘DATA tabname like ‘
to git_abaplist,

to git_abaplist,


‘Occurs 0 with header line.’
to git_abaplist,

Start of Selection

to git_abaplist,

Perform upload

‘form upload.’
to git_abaplist,

GUI Upload

to git_abaplist,


to git_abaplist,

‘Filename = ‘


to git_abaplist.

concatenate ”” p_flname ””
into git_abaplist.


append git_abaplist.

to git_abaplist,



to git_abaplist,

to git_abaplist,

‘data_tab = tabname.’
to git_abaplist,

Updating the database table


to git_abaplist,


to git_abaplist,

‘from table tabname.’
to git_abaplist,

‘endform. ‘
to git_abaplist.

    • End of Code*</font><br>

While Calling

Generate Subroutine pool

, the source code for the subroutine pool to be generated is passed on to the internal table. These Subroutine pools belong to the runtime context of the generating program.


Transient programs are written only for internal use of a program, and all possible exceptions have to be handled while writing a transient program.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member
      It's true that generating transient routines can be very useful but there are certain considerations that should be made before chosing to do so:

      1) there's a considerable performance overhead associated with transient routines,

      2) there's a limit on the number of sub-routines that can be generated within a program. This limit is 36 and anythng over this will create a short-dump (GENERATE_SUBPOOL_DIR_FULL),

      3) SAP say that the GENERATE command is internal only. They write:

      "This statement is for internal use only.

      Incompatible changes or further developments may occur at any time without warning or notice."

      Author's profile photo Former Member
      Former Member
      Blog Post Author
      I have used this in one of my Objects ,Which has already gone live long back and not yet faced any problem as of now,Any way since we are using this Command for Codes written by us as a part of customization, so i think this does not matter.


      Author's profile photo Former Member
      Former Member
      Is there a way to reset the counter before reaching the limit of 36?
      Author's profile photo Former Member
      Former Member
      There is a way to get around the limit of 36 subroutine pool generations.

      Can I ask you to post this question in the ABAP forum, so that the answer is not lost for future reference?