04-07-2009 12:23 PM
hi friends,
Is it possible to display a input (parameters or select-options) fields dynamically using subroutine pool statement.
eg:
data : tab TYPE STANDARD TABLE OF string,
prog TYPE string,
mess TYPE string.
append 'parameters matnr like mara-matnr.' to tab.
append 'select single * from mara where matnr = matnr.' to tab.
GENERATE SUBROUTINE POOL tab NAME prog
MESSAGE mess .
04-07-2009 2:57 PM
hi,
It is not advisable to use that statement since it is internal to SAP. Anyway, to generate a dynamic screen you could use the complex GENERATE DYNPRO instruction or the simpler GENERATE REPORT (both of them internal too).
The subroutine pool is not a repository for screens.
regards,
Edgar
04-08-2009 9:27 AM
04-08-2009 9:57 AM
Check this :
data: begin of itab occurs 0,
line(150),
end of itab.
data: v_name like sy-repid.
parameters: p_table like dd02l-tabname.
itab-line = 'Report sy-repid.'.
append itab. clear itab.
itab-line = 'tables:'.
append itab. clear itab.
concatenate p_table '.' into itab.
itab-line = 'data: begin of itab occurs 0.'.
append itab. clear itab.
concatenate 'include structure' p_table '.' into itab separated by space.
itab-line = 'data:end of itab.'.
append itab. clear itab.
itab-line = 'form f_select.'.
append itab. clear itab.
itab-line = 'select * into table itab'.
append itab. clear itab.
concatenate 'FROM' p_table '.' INTO itab separated by space.
itab-line = 'endform.'.
append itab. clear itab.
generate subroutine pool itab name v_name.
perform f_select in program (v_name).