2007 Mar 26 4:03 PM
How to create a screen dynamically at runtime.
ie.
I have following fields
MATNR
MATKX
DESCR
NAME1
I need to generate a screen at runtime. like this
MATNR MATKX
DESCR NAME1
I don't need to use fm POPUP_GET_VALUES for this.
Any info on this.
aRs
2007 Mar 26 4:07 PM
2007 Mar 26 4:12 PM
Rich,
This is only example. The field are decided only at runtime.
My requirement is i am writing a ALV grid program to eliminate the cumbersome table maintenance generator screens. Input for this program is table name. But now user wants in the Grid select a line and go for details ,here user want a cusom screen to be displayed with all fields from table (input selection)
aRs
2007 Mar 26 4:17 PM
I see. You can generate a screen at runtime, but it uses internal SAP statements which are not supposed to be used. Here is a sample program.
Please be extremely careful.
report zrich_0001
no standard page heading.
data: h type table of d020s with header line,
f type table of d021s with header line,
e type table of d022s with header line,
m type table of d023s with header line.
data: mess(50) type c,
line(50) type c,
word(50) type c.
data: dynproid(44).
dynproid = sy-repid.
dynproid+40(4) = '0100'.
h-prog = sy-repid.
h-dnum = '0100'.
append h.
f-fnam = 'P_TEST1'.
f-flg1 = '80'.
f-flg3 = '80'.
f-line = '01'.
f-coln = '03'.
f-type = 'CHAR'.
f-ityp = 'C'.
f-leng = '20'.
f-stxt = '____________________'.
append f.
f-fnam = 'P_TEST2'.
f-flg1 = '80'.
f-flg3 = '80'.
f-line = '02'.
f-coln = '03'.
f-type = 'CHAR'.
f-ityp = 'C'.
f-leng = '40'.
f-stxt = '________________________________________'.
append f.
e-line = 'PROCESS BEFORE OUTPUT.'.
append e.
e-line = 'PROCESS AFTER INPUT.'.
append e.
generate dynpro h f e m id dynproid
message mess
line line
word word.
call screen 100.
Regards,
RIch Heilman
2007 Mar 26 4:23 PM
Rich,
Thanks for your reply.
I have more question regarding this.
If two users are using at the same time
generate dynpro h f e m id dynproid
message mess
line line
word word.
Whether this command give any issue. My question is any sharing violation?
aRs
2007 Mar 26 4:28 PM
2007 Mar 26 4:39 PM