Application Development and Automation 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: 
Read only

How to create screen dynamically?

Former Member
0 Likes
2,828

Hi SDN,

I want to create a screen dynamically.

With out creating the screen in screen painter or in SE80.

Please let me know how to create it Dynamically?

Regards,

Rahul

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,221

Hi,

Check the below code.

Example: how to create a dynamic selection screen

selection-screen begin of block b1 with frame title f1_ttl.

parameters: p_rbcnt type i default 5.

selection-screen end of block b1.

initialization.

f1_ttl = 'Number of radio buttons'.

start-of-selection.

  • The dynamic program source table

data: begin of inctabl occurs 10,

line(72),

end of inctabl.

data: lv_radiocount type string.

data: lv_currentcount type i.

data: lv_radioname type string.

  • Create the dynamic internal table definition in the dyn. program

inctabl-line = 'program zdynpro.'. append inctabl.

*inctabl-line = 'data: begin of dyntab occurs 10,'. append inctabl.

do p_rbcnt times.

lv_radiocount = lv_currentcount.

concatenate 'rb_' lv_radiocount into lv_radioname.

concatenate 'parameter:' lv_radioname 'radiobutton group rg01.'

into inctabl-line separated by space.

append inctabl.

lv_currentcount = lv_currentcount + 1.

enddo.

inctabl-line = 'start-of-selection.'. append inctabl.

inctabl-line = 'write: rb_0.'. append inctabl.

  • Create and run the dynamic program

insert report 'ZDYNPRO' from inctabl.

if sy-subrc = 0.

submit zdynpro VIA SELECTION-SCREEN.

else.

write : / 'error'.

endif.

4 REPLIES 4
Read only

Former Member
0 Likes
1,222

Hi,

Check the below code.

Example: how to create a dynamic selection screen

selection-screen begin of block b1 with frame title f1_ttl.

parameters: p_rbcnt type i default 5.

selection-screen end of block b1.

initialization.

f1_ttl = 'Number of radio buttons'.

start-of-selection.

  • The dynamic program source table

data: begin of inctabl occurs 10,

line(72),

end of inctabl.

data: lv_radiocount type string.

data: lv_currentcount type i.

data: lv_radioname type string.

  • Create the dynamic internal table definition in the dyn. program

inctabl-line = 'program zdynpro.'. append inctabl.

*inctabl-line = 'data: begin of dyntab occurs 10,'. append inctabl.

do p_rbcnt times.

lv_radiocount = lv_currentcount.

concatenate 'rb_' lv_radiocount into lv_radioname.

concatenate 'parameter:' lv_radioname 'radiobutton group rg01.'

into inctabl-line separated by space.

append inctabl.

lv_currentcount = lv_currentcount + 1.

enddo.

inctabl-line = 'start-of-selection.'. append inctabl.

inctabl-line = 'write: rb_0.'. append inctabl.

  • Create and run the dynamic program

insert report 'ZDYNPRO' from inctabl.

if sy-subrc = 0.

submit zdynpro VIA SELECTION-SCREEN.

else.

write : / 'error'.

endif.

Read only

Former Member
0 Likes
1,221

hi check this..

regards,

venkat

Read only

Former Member
0 Likes
1,221

Hi

It's not easy to do it, try to see the statament:

GENERATE DYNPRO

Max

Read only

Lakshmant1
Active Contributor
0 Likes
1,221

Hi Rahul,

Check FM's RS_SCREEN_CREATE/RS_DYNPRO_CREATE_INITIAL

Thanks

Lakshman