Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Transient programs

Former Member
0 Likes
419

Dear All,

Can anyone of you please explain me the concept and real life usage of transient programs.

How does transient programs affect memory consumption?

Thank you.

Regards,

Prosenjit.

2 REPLIES 2
Read only

manthanraja
Active Participant
0 Likes
377

Hi,

I will list some important features of transient programs

These are used when,

1.

Frequent change of dynamic input data

2.

code generation of a subroutine pool.

and only accessible in internal mode.

how to generate transient program


DATA: code TYPE TABLE OF string,
prog TYPE program,
msg(120) TYPE c,
lin(10) TYPE c,
wrd(10) TYPE c,
off(3) TYPE c.
APPEND 'PROGRAM SUBPOOL.' TO code.
APPEND 'FORM DYN1.' TO code.
APPEND 'WRITE / ''Hello, I am a temporary subroutine!''.' TO code.
APPEND 'ENDFORM.' TO code.
GENERATE SUBROUTINE POOL code NAME prog MESSAGE msg
LINE lin WORD wrd OFFSET off.
IF sy-subrc <> 0.
WRITE: / 'Error during generation in line', lin,
/ msg, / 'Word:', wrd, 'at offset', off.
ENDIF.
PERFORM dyn1 IN PROGRAM (prog).

Refer ABAP 351 for more details ..

hope this information helps ..

Read only

Subhankar
Active Contributor
0 Likes
377

Hi ,

Transient programs are mainly used when you don't know the exact program or table structure until run time.

Suppose you created one dynamic internal table and you want to delete the table records based on one field which is created in run time. Here you don't know the field name..In this you need t write the transient programs.

GENERATE SUBROUTINE POOL source_code NAME run_time_prog_name MESSAGE msg

One thing : You can create more than 36 transient program at one instance.

Thanks..

Subhankar

Edited by: Subhankar Garani on Feb 23, 2010 8:16 AM