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: 

drop down list box in screen painter ERROR

Former Member
0 Kudos

In screen there is list box name

DEPARTMENT when i click it shows the drop down list box.

there it shows all the departments.

FINANCE

COSTING

HR

HR

HR

HR

MATERIALS

MATERIALS

If i select finance and click SAVE button. It inserted into my table corresponding department field.

dept is my field. The field entry i fetched from ZTABLE-DEPT.

After entering new entry it shows

FINANCE

FINANCE

COSTING

HR

HR

HR

HR

MATERIALS

MATERIALS

I want only the list of deparment not the repeated entry. How can i overcome this. May be it basic.

Thanks and regards

arvind

5 REPLIES 5

Former Member
0 Kudos

Hi,

Before passing department table to VRM_SET_VALUES to get the list box drown..Do the SORT first and then use DELETE DUPLICATE ADJACENT statement to delete duplicate entries from department table.

Former Member
0 Kudos

what you can do is create an internal table with only field as department.

Now for all entries in your previous internal table copy all corresponding department in this new table.

Now sort this department internal table and delete adjacent duplicates comparing the field.

This table now gives you unique department.

Now you can refer your drop down to this internal table field.

Regards,

Lalit Mohan Gupta.

Former Member
0 Kudos

Hi,

when u click SAVE at the moment sort your internal table and apply the following select query ..

code

module drop_down input.

case ok_code.

when 'SAVE'.

select dept from <tablename> into table <itab>.
endcase.
loop at itab into <work_area>.

delete adjacent duplicate form <itab> comparing <dept>.

endloop.

thanks

ravi

Former Member
0 Kudos

Hi Arvind,

From your problem representation, as per understanding, same entries are getting repeated. And hence at the time of Save, the date is not getting saved properly.

The internal Table that you need to pass to the VRM_SET_VALUES should have a unique Key - Value pair combination. So, before calling the function module, you need to Sort the internal table by the keys of the table. And then you can delete adjacent duplicates comparing the key fields.

After the Save action, you need to call the VRM_SET_VALUES in the Process Before Output Event of the flow logic. Once again the internal table along with proper data will be passed to the UI for dropdown value list.

Hope this helps.

Thanks,

Samantak.

Former Member
0 Kudos

Hi Arvind,

Check this Program RSDEMO_DROPDOWN_LISTBOX it will solve your problem.