‎2006 Aug 24 2:32 PM
Hi all,
I created a schema to generate some lines of code at runtime. I stored the generated code in a table and now I want to execute those lines using some standard FM.
I called FUNCTION 'SCHEME_INSTANTIATE'
EXPORTING
CALLING_PROGRAM = sy-repid
SCHEME_PROGRAM = 'Z_TEST_SCHEME'
SCHEME_NAME = 'DD_CLOG_FUNC'
TABLES
RESULT_TAB = LT_RESULT.
At this point I have lines of code in lt_result. But it has not been executed yet.
What should be my approach next?
‎2006 Aug 24 2:42 PM
Hi Shikha,
Did you check the GENERATE command in ABAP. Guess you can use it for your purpose. It will create a new program during runtime.
Cheers
VJ
‎2006 Aug 24 2:42 PM
Hi Shikha,
Did you check the GENERATE command in ABAP. Guess you can use it for your purpose. It will create a new program during runtime.
Cheers
VJ
‎2006 Aug 24 2:44 PM
PL use the following statement..
GENERATE SUBROUTINE POOL itab NAME name.
~Suresh
‎2006 Aug 24 2:46 PM
If you are creating an entire program, use the INSERT REPORT statement followed by GENERATE REPORT. Alternatively you can create a subroutine using GENERATE SUBROUTINE POOL.
‎2006 Aug 25 9:23 AM
Hi,
again I am facing a problem here. I have some global variables in the calling program but when I generated program for my scheme, these variables are not recognised. How do we make a call in these case?
‎2006 Aug 25 9:51 AM
Hi,
In the generated program, write your lines of code in a subroutine. Call that subroutine of generated program from your program by passing the parameters.
Regards,
Sailaja.