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.
Showing results for 
Search instead for 
Did you mean: 

List Box values based on previous selected list box value.

Former Member
0 Kudos


I have an issue related to list box.i have 2 list box in selection scren

a) p_bst_ty

b) p_bst_id.

in p_bst_ty there is one drop down list which is populated with values like 1C 1F 1Z etc.

suppose user select 1C then all the object id corresponding to 1C object shud be selected from table HRP100.

i am not using F4 help .p_bst_id list should be populated in the same manner as p_bst_ty is populated.

can anybody help.

Regards ,

Mona Singh


Former Member
0 Kudos


Can you be more clear in your requirement...

0 Kudos

In p_bst_ty i am populating object types from table T777O ...user can select any object type from the drop down list.

Now based on this Object id should come in the 2nd one p_bst_id from table HRP1000.

like if i select 1C as object type then all the object id which belong to object type 1C should come to the drop down list of the 2nd list (p_bst_id).

Former Member
0 Kudos


Depending on the value which you get from the first list... Select the value from the database table and then pass that internal table to the function module 'F4IF_INT_TABLE_VALUE_REQUEST'.

gv_repid = sy-repid.

  IF not p_bst_ty IS INITIAL.
    SELECT f2 FROM HRP1000
           INTO TABLE gt_f4table
           WHERE field1 = p_bst_ty.

            retfield     = your field
            dynpprog     = gv_repid
            dynpnr       = sy-dynnr
            window_title = text-002
            value_org    = 'S'
            value_tab    = gt_f4table
            return_tab   = gt_matnr_returned.

  IF sy-subrc EQ 0.
    IF NOT gt_matnr_returned[] IS INITIAL.
      READ TABLE gt_matnr_returned INTO gs_matnr_returned INDEX 1.
      p_matnr = gs_matnr_returned-fieldval.

Former Member
0 Kudos


You need to use the function module DYNP_VALUES_READ.

You have to get the value selected in the first list box ..after that based on that value you nee dto write query on HRP1000 to get the related values. Correct me if I understood diffrently.


Kumar Bandanadham