05-12-2006 6:15 PM
Hey Everybody,
I've done some reports with Select-options, but all the fields directly related to some field in a transparent table. As many of you might have experienced, things changed with the latest report that I have to develop.
I have to derive the drop-down for the select-options dynamically.
Could anybody provide me with the details, code snippets, hints on how to do this.
Thank You.
Sumit.
05-12-2006 6:18 PM
Hi,
<b>drop-down for the select-options dynamically</b>
Can u please elaborate..
<b>Dynamic selection..</b>
SELECTION-SCREEN DYNAMIC SELECTIONS FOR NODE|TABLE <node>.
allows you to define further nodes for dynamic selections. If the node has type T, you can use TABLE instead of NODE. The user can then decide at runtime the components of the node for which he or she wants to enter selections. Dynamic selections require special handling in the database program.
Regards,
Tanveer.
05-12-2006 6:18 PM
Hi,
<b>drop-down for the select-options dynamically</b>
Can u please elaborate..
<b>Dynamic selection..</b>
SELECTION-SCREEN DYNAMIC SELECTIONS FOR NODE|TABLE <node>.
allows you to define further nodes for dynamic selections. If the node has type T, you can use TABLE instead of NODE. The user can then decide at runtime the components of the node for which he or she wants to enter selections. Dynamic selections require special handling in the database program.
Regards,
Tanveer.
05-12-2006 6:26 PM
Here is an example program where you are generically defining the select-option and building its F4 help at runtime.
report zrich_0001 .
data: begin of ihelp occurs 0,
field type char10,
ftext type char50,
end of ihelp.
data: a_field(20) type c.
select-options s_field for a_field.
initialization.
ihelp-field = 'A'.
ihelp-ftext = 'Description A'.
append ihelp.
ihelp-field = 'B'.
ihelp-ftext = 'Description B'.
append ihelp.
ihelp-field = 'C'.
ihelp-ftext = 'Description C'.
append ihelp.
at selection-screen on value-request for s_field-low.
call function 'F4IF_INT_TABLE_VALUE_REQUEST'
exporting
retfield = 'FIELD'
dynprofield = 'S_FIELD'
dynpprog = sy-cprog
dynpnr = sy-dynnr
value_org = 'S'
tables
value_tab = ihelp.
start-of-selection.
REgards,
Rich Heilman
05-12-2006 7:36 PM
Hey Tanveer,
Thanks for the quick reply. Rich Heilman responded with the code snippet I was looking for. I dont know whether that is a NODE or a TABLE. I presume a table, what do you say.
Thank You.
Sumit.
05-12-2006 7:36 PM
05-12-2006 7:46 PM