‎2006 Dec 18 9:57 AM
I do have such message!
I know there is a limit in the GENERATE_SUBROUTINE_POOL but I'm only generating 13...
sap dump say :
An exception occurred that is explained in detail below.
The exception, which is assigned to class 'CX_SY_GENERATE_SUBPO
not caught and
therefore caused a runtime error.
The reason for the exception is:
No more than 36 temporary subroutine pools can be generated.
This maximum value has been exceeded.But 13 is lower than 36 !
Thanks for the help
‎2006 Dec 18 10:09 AM
Can u explain bit more as to what u are doing which gave this error?
‎2006 Dec 18 10:22 AM
‎2006 Dec 18 10:39 AM
form sr_gen_exec_sql.
data : lwt_fcat like line of lit_fcat.
** internal table of the field catalog
data : lwt_abap(72) ,
lit_abap like lwt_abap occurs 0,
l_field like line of lit_abap.
data l_report type programm .
append 'report dummy.' to lit_abap .
append 'types : begin of ty_data ,' to lit_abap.
loop at lit_fcat into lwt_fcat.
if lwt_fcat-decimals ne 0.
lwt_fcat-intlen = lwt_fcat-intlen - lwt_fcat-decimals + 1.
endif.
concatenate lwt_fcat-fieldname
'('
lwt_fcat-intlen
') TYPE@'
lwt_fcat-inttype into l_field.
** if there are decimals generate the decimals
if lwt_fcat-decimals ne 0.
concatenate l_field
' decimals@'
lwt_fcat-decimals
into l_field.
endif.
** the end of the statement
concatenate l_field
','
into l_field.
** replace all occurences of the @
do.
replace '@' with space into l_field.
if sy-subrc ne 0.
exit.
endif.
enddo.
** add the field to the output
append l_field to lit_abap.
endloop.
append 'end of ty_data.' to lit_abap.
append 'types : tt_data type standard table of ty_data.' to lit_abap.
append ' data : it_data type standard table of ty_data,' to lit_abap.
append ' wt_data like line of it_data.' to lit_abap.
append 'data lit_temp type ref to data.' to lit_abap.
append 'data lwt_temp type ref to data. ' to lit_abap.
append 'field-symbols <fs_it> type standard table.' to lit_abap.
append 'field-symbols <fs_wt> type any .' to lit_abap.
append 'form get_data using ' to lit_abap.
append ' lit_fcat type lvc_t_fcat.' to lit_abap.
concatenate 'data l_mandt type mandt value '''
sy-mandt '''.' into l_field.
append l_field to lit_abap.
append 'call method cl_alv_table_create=>create_dynamic_table' to
lit_abap.
append 'exporting' to lit_abap.
append ' it_fieldcatalog = lit_fcat' to lit_abap.
append ' importing' to lit_abap.
append ' ep_table = lit_temp' to lit_abap.
append ' exceptions' to lit_abap.
append ' generate_subpool_dir_full = 1' to lit_abap.
append ' others = 2' to lit_abap.
append ' .' to lit_abap.
append ' assign lit_temp->* to <fs_it>.' to lit_abap.
append ' create data lwt_temp like line of <fs_it>.' to lit_abap.
append ' assign lwt_temp->* to <fs_wt>.' to lit_abap.
append '' to lit_abap.
** SELECT STATEMENT
append 'EXEC SQL PERFORMING sr_store.' to lit_abap.
append 'SELECT' to lit_abap.
** select clause
loop at lit_fcat into lwt_fcat.
append lwt_fcat-fieldname to lit_abap.
append ',' to lit_abap.
at last.
delete lit_abap index sy-tabix.
endat.
endloop.
append 'from' to lit_abap.
concatenate lwt_source-ps_struct
'@'
c_db into l_field.
append l_field to lit_abap.
append 'INTO ' to lit_abap.
** into clause
loop at lit_fcat into lwt_fcat.
concatenate ':wt_data-' lwt_fcat-fieldname into l_field.
append l_field to lit_abap.
append ',' to lit_abap.
at last.
delete lit_abap index sy-tabix.
endat.
endloop.
append 'where sb_sap_mandant = :l_mandt' to lit_abap.
append 'endexec.' to lit_abap.
append 'export <fs_it> to memory id ''ZTMP''. ' to lit_abap.
append 'endform.' to lit_abap.
append 'form sr_store.' to lit_abap.
append 'move-corresponding wt_data to <fs_wt>.' to lit_abap.
append 'append <fs_wt> to <fs_it>.' to lit_abap.
append 'endform.' to lit_abap.
generate subroutine pool lit_abap name l_report.
perform get_data in program (l_report)
using lit_fcat[]
if found.
import <fs_it> from memory id 'ZTMP'.
free memory id 'ZTMP'.
endform. "sr_gen_exec_sql
‎2006 Dec 18 11:21 AM
Hello Stephan,
maybe you are not alone in the dark and some mechansim beside yours is using a similar technique. Have you already set a break-point on statement generate?
If you are on relase 7.00 you may use cl_AbapType_Descr (RTTC) to create types without such a limitation.
But as your form seems not to rely on the generated code, encapsulating in a rfc module might be the most easy cure.
Regards,
Klaus
‎2006 Dec 18 12:05 PM
Klaus,
its available as of WAS6.40
check this weblog (subtitle WAS6.40 approach) for code sample
/people/subramanian.venkateswaran2/blog/2004/11/19/dynamic-internal-table
Regards
Raja
‎2006 Dec 18 1:38 PM
Klaus,
It is not the problem about creating the structure! The routine is also geenrating EXEC SQL statament!
stephan,
‎2006 Dec 18 2:27 PM
Hi Stefan,
if you are only doing the generation stuff due to have an optimal query, dynamic programming might also do. I have attached an according sample.
Good Luck
Klaus
REPORT x.
start-of-selection.
perform sub_Main.
form sub_Main.
types: ty_T_Rows type standard table of TADIR with default key.
data:
db_Rows type ty_T_Rows.
field-symbols:
<db_Row> type line of ty_T_Rows.
perform sub_Query changing db_Rows.
loop at db_Rows assigning <db_Row>.
write : /
<db_Row>-Author,
<db_Row>-Obj_Name,
<db_Row>-Object,
<db_Row>-SrcSystem color col_Positive.
endloop.
endform.
form sub_Query changing db_Rows type standard table.
data:
query_Columns type standard table of sychar32 with default key.
clear db_Rows.
append 'AUTHOR' to query_columns.
append 'MIN( OBJECT ) AS OBJECT' to query_columns.
append 'MIN( OBJ_NAME ) AS OBJ_NAME' to query_columns.
select (query_Columns) from ('TADIR')
into corresponding fields of table db_Rows
where
('PGMID eq ''R3TR'' AND AUTHOR LIKE ''A%'' AND SRCSYSTEM EQ SY-SYSID')
group by ('AUTHOR')
order by ('AUTHOR').
endform.