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: 

populating select-options dynamically

former_member192818
Active Participant
0 Kudos

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.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

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.

5 REPLIES 5

Former Member
0 Kudos

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.

0 Kudos

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

0 Kudos

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.

0 Kudos

Thanks Rich, That was what I was looking for.

Sumit.

0 Kudos

Cool, please make sure mark your post as solved when solved completely. Thanks.

Regards,

Rich Heilman