‎2009 May 13 9:09 AM
Hi there,
I'm experiencing a problem with GENERATE SUBROUTINE POOL instruction.
Indeed, it has a limitation of 36 temporary subroutine pools per session.
I wrote a class and in one of my methods I need to create and run a dynamic program.
Problem is that this class is to be used in an eCatt environment.
So my objects are created many times, and in the same session.
So if my eCatt has more than 36 lines, the process stops (dumps because too many subroutine pools have been generated).
Problem is that it generates a new subroutine pool. I only need to generate a new form.
My question is: can we generate a new form in an existing subroutine pool, and how?
Thus I would just have to produce a new form name and generate it in a unique subpool (using IMPORT/EXPORT to keep the name, for example), avoiding the 36 limit.
Thanks for your help,
Quentin
‎2009 May 13 3:38 PM
Try to write the subroutine generation code in a function module and to call this function module from your method
‎2009 May 13 4:10 PM
Use INSERT REPORT, READ REPORT etc. to create programs in the repository. You can always delete them later.
Read the ABAP help for details
matt
‎2009 May 13 4:16 PM
Why don't you put your code generate subroutine pool code in fm and call that fm with
call fm <......> starting a new task.
a®
‎2009 May 13 5:01 PM
Hi,
First, thanks for your help, all of you.
Actually, we use eCatt because we have cases were we need to run all test cases in the same session.
Indeed, we have a system with trasactional and non transactional mode.
In the first one, we have a buffer layer, which must be kept between each test case.
If I understood well your suggestions (using a function module), the aim was to generate my code in a new session (the call to function module would create a new session, and delete it at the end of process).
I'll give it a try, of course, but I'm afraid this would prevent our transactgional mode to work.
That's why I thought of generating a new foorm in an existing subroutine pool.
But anyway, I'll try the function module then I'll tell you how it was.
Thank you very much,
Quentin
‎2009 May 19 2:12 PM
Hi,
I tried to encapsulate the generation of code in a function module, as you suggested.
Unfortunately, tu use the "STARTING NEW TASK" addition, I need to declare my function module as RFC.
The problem is that I have objects in my parameters, which are references.
And references are not allowed in RFC function modules.
So, does anyone know how to pass objects to a RFC function module?
Thank you for your help,
Quentin
‎2009 Jul 08 10:30 AM
Well, the solution was to generate function module instead of forms.
I reserved a function pool for my generations, and I generate function modules.
Used function modules:
- FUNCTION_POOL_CREATE to create the function pool if it does not exist
- RS_FUNCTION_DELETE to delete the function module if it exists (check in TFDIR table for that)
- RS_FUNCTIONMODULE_INSERT to create the function module (be careful to provide 72 characters long source code lines)