‎2010 Feb 23 6:12 AM
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.
‎2010 Feb 23 6:45 AM
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 ..
‎2010 Feb 23 7:16 AM
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