Additional Blogs by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Former Member
0 Kudos

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

       

       

       

       

       

   

Program_Name.  

   

    • To Get the dynamically generated Program Name *



With the following additions:

   

       

       

       

       

       

Message.

       

      

    • Contains Error Message*


   

       

       

       

       

       

Include.

       

       

 

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


   

       

       

       

       

       

Line.

       

       

     

    • Line Number in Transient program*


   

       

       

       

       

       

Word.

 

       

       

 

    • Incorrect word that caused the error*


   

       

       

       

       

       

Offset

 

       

       

  

    • Position of the incorrect word*


   

       

       

       

       

       

Trace-file.

       

      

    • 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 

Program_Name

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


The syntax for calling the routine in

dynamic program

is:



PERFORM UPLOAD IN PROGRAM (PROGRAM_NAME).



   

       

       

       

       

       

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




The

Transient code

required to dynamically update a database table is written below:



** Begin of Code*


       
       

append:    
'Report ztrans.'
       
       
       
       

to git_abaplist,


       
       
       
     
  
'tables: '
       
  
       
       
       
       
to git_abaplist,


       
       
       
     
   
p_tabnam
      
       
       
       
       
to git_abaplist,


       
       
       
     
   
'.'
      
     
     
       
       
       
       

to git_abaplist,




Internal table declaration




       
       
       
   
   
'DATA tabname like '
       
       
      
to git_abaplist,


       
       
       
   
   
p_tabnam
   
      
      
       
       
      
to git_abaplist,


       
       
       
      

'Occurs 0 with header line.'
 
       
      
to git_abaplist,


Start of Selection




       
       
       
   
   
'Start-of-selection'.
       
      
      
    
to git_abaplist,


Perform upload




       
       
       
   
   
'form upload.'
       
      
      
      
     
to git_abaplist,


GUI Upload




       
       
       
   
   
'CALL FUNCTION ''GUI_UPLOAD'' '
 
to git_abaplist,


       
       
       
   
   

'EXPORTING '
       
   
   
       
   
  
to git_abaplist,


       
       
       
   
   
'Filename = '
       
      
    

       
   
   

to git_abaplist.


       
       
       
   
   
concatenate '''' p_flname ''''
   
      
   
into git_abaplist.


       
       
       
   
   

append git_abaplist.



       
       
append:   
'FILETYPE = ''ASC'' '
       
       
      
to git_abaplist,


       
       
       
   
   

'HAS_FIELD_SEPARATOR = ''X'' '

to git_abaplist,


       
       
       
   
   
'tables'
       
       
   
       
       
   
      
to git_abaplist,


       
       
       
   
   
'data_tab = tabname.'
       
       
   
    
to git_abaplist,



Updating the database table





       
       
       
   
   
'modify'
       
       
       
       
       
     

to git_abaplist,


       
       
       
   
   
p_tabnam
       
       
    
       
       
     

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.




Note:

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

4 Comments