Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

generate subroutine pool

Former Member
0 Kudos

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 .

3 REPLIES 3

Former Member
0 Kudos

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

0 Kudos

thanks

former_member222860
Active Contributor
0 Kudos

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).