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

List update

Former Member
0 Likes
651

Hii,

I want a list to be populated based on the selection criteria of another list. I have a screen in which I have 2 listbox. I have populated the list box using VRM_SET_VALUES. If I select 1st listbox the 2nd listbox should be automatically populated.

Thanks.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
620

Hi,

You can use the DYNP_VALUES_READ to read the value selected in the First parameter in the AT SELECTION-SCREEN ON <field2>.

AT SELECTION-SCREEN ON P_FIELD2.
* Read the first record as only one record will be present
  read table li_dynpread into lwa_dynpread index 1.
  P_FIELD1 = lwa_dynpread-fieldvalue.

  lwa_dynpread-fieldname = 'P_FIELD1'.
  append lwa_dynpread to li_dynpread.
  clear lwa_dynpread.
* Read Screen Field Values.
  call function 'DYNP_VALUES_READ'
    exporting
      dyname     = sy-repid
      dynumb     = sy-dynnr
    tables
      dynpfields = li_dynpread.

5 REPLIES 5
Read only

Former Member
0 Likes
620

Hi,

Pass the value to the second list box in the at selection-screen event.

Regards,

Himanshu

Read only

Former Member
0 Likes
621

Hi,

You can use the DYNP_VALUES_READ to read the value selected in the First parameter in the AT SELECTION-SCREEN ON <field2>.

AT SELECTION-SCREEN ON P_FIELD2.
* Read the first record as only one record will be present
  read table li_dynpread into lwa_dynpread index 1.
  P_FIELD1 = lwa_dynpread-fieldvalue.

  lwa_dynpread-fieldname = 'P_FIELD1'.
  append lwa_dynpread to li_dynpread.
  clear lwa_dynpread.
* Read Screen Field Values.
  call function 'DYNP_VALUES_READ'
    exporting
      dyname     = sy-repid
      dynumb     = sy-dynnr
    tables
      dynpfields = li_dynpread.

Read only

0 Likes
620

Hii,

I want the listbox to be populated in a screen. its a module pool program wherin in 1st screen I have 2 listbox and when user selects any value from 1st listbox the other should be automatically populated. I tried to populate the data in PAI event of the screen using VRM_SET_VALUES but it does not populate it in 2nd listbox.

Thanks.

Read only

0 Likes
620

Hi,

Check the demo program DEMO_DYNPRO_DROPDOWN_LISTBOX

Check the MODULE init_listbox in the PAI of screen 200 ...how list box field is getting populated in the screen 200.

In the same you need to populate the on the selecting the value in Field1. You need to assign the Function code to Field1 listbox.

Which get's triggered when you select the value in Field1. In the PBO check for this function code and call the MODULE init_listbox

Read only

0 Likes
620

Thanks avinash it solved my problem.....