‎2008 May 13 2:34 PM
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
‎2008 May 13 2:40 PM
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.
‎2008 May 13 2:40 PM
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.
‎2008 May 13 2:44 PM
‎2008 May 13 2:51 PM
Hi
It's not easy to do it, try to see the statament:
GENERATE DYNPRO
Max
‎2008 May 13 2:54 PM
Hi Rahul,
Check FM's RS_SCREEN_CREATE/RS_DYNPRO_CREATE_INITIAL
Thanks
Lakshman