cancel
Showing results for 
Search instead for 
Did you mean: 

Filter for Dropdwon by key is not working in Alv

Former Member
0 Kudos

hi i have made two columns as dropdown by key in alv.

i have given the fixed values at domain level.

Dropdowns are working fine in alv but when i use the filter option those two are not working fine. one additional value comes as "Not defined"

When I select any of the values from drop down which are already present in table I get empty table in result.

Accepted Solutions (1)

Accepted Solutions (1)

former_member210266
Active Participant
0 Kudos

Hi Shivam

The additional value "Not defined" will come automatically just like a blank line always gets added in the dropdown list values.

And for the filter, it doesn't work when it doesn't get the corresponding records matching to the list of the filter values, and this can happen when some space gets added in the ALV list values.Eg. In the filter list you have values from "4", but in the ALV list you have value "   4".So it wont match.

Just check in the debugger, and remove any unnecessary blank spaces before the actual value.

I faced the same problem once, and this was the reason for that.

I hope the explanation is clear.Please let me know in case the issue persist.

Regards

Swati

Former Member
0 Kudos

hi Swati,

when i am filling the AlV table i get the text values instead of there fix values.

you can see the zmonth and same i get in the filter dropdown.

i am saving them in r3 table in code :

please guide me what can be done ?

former_member210266
Active Participant
0 Kudos

Hi Shivam

I think you have exchanged the Fix value and text value for ZMONTH and ZTNSTS. Because the current behaviour is opposite to the normal behaviour,where the fix value should be at the backend(i.e internal table) and the description should be visible in the ALV.

Regards

Swati

Former Member
0 Kudos

swati,

in first pic i have shown  the debugger values

in second i have shown  the r/3 table,

i am getting the values in alv same as i have shown in the debugger.

to fetch them i have written one normal select query and values are coming like this.

should i go with the drop down by index ? as by key is not working..

former_member210266
Active Participant
0 Kudos

Hi Shivam

In the dropdown the conversion takes place automatically. You dont have to write an extra code for it. If you are getting the code value in the R/3 table,then what is the issue? It works that way only.I think I am unable to undestand your issue.Please be more specific.

Regards

Swati

Former Member
0 Kudos

hi Swati,

There are no issues in displaying data in Alv and saving it in back end.

problem is only with the filter. when i use the filter for Month it won't work. please share your email id i will send you the screenshot for the same

Answers (2)

Answers (2)

former_member213957
Participant
0 Kudos

Hi Shivam, I am also facing same problem. if you solved the issue requested to reply me how you solved. My issue also like after click on filter, then i give the value in dropdown, data is not populating in the alv table. thanks & regards, Kishorekumar SVS

Former Member
0 Kudos

Hi,

You need t set the lead selection index for the dropdown in on_select method.

Check the following to give you some idea..

  lt_set = node->get_elements( ).
   loop at lt_set INTO ls_set.
    call METHOD ls_set->get_attribute
           exporting name = 'DELIVERY'
           importing value = lv_del .
    lv_del1 = lv_del.
    if  lv_del1 = ls_header-vbeln.
      lv_index = ls_set->get_index( ).
     exit.
    endif.
   endloop.
node->set_lead_selection_index( index = lv_index ).