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 box in module pool table control

Former Member
0 Likes
1,095

Hi All,

I have a requirement in which i need to create a table control ( with 3 columns eg:employee ,age,name).

I need to create a drop down list for employee where user can choose multiple employee for a row in table control.

I was trying to achieve it using listbox but as listbox can only contain one value in field.

is there any soln for that?

Please let me know....

thanks in advance

Regards

Neha

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,058

Hi Neha,

you can't use a listbox like that.

We have a developed program with several fields of multiple values, called by search help (F4) or a button. We achieved it by creating a function module with a popup screen that presents a table control with two columns, key and description. User can select whatever lines he wanted.

If user only selects one line the original text field or table cell is filled with that value. If more than one value is selected the field is closed for input and an asterisk is written on the field.

It can be done also with an ALV.

regards,

Edgar

7 REPLIES 7
Read only

Arun_Prabhu_K
Active Contributor
0 Likes
1,058

Hello Neha.

     My suggestion is to create two table controls: one for employees and another for other data.

     By this way, you can choose multiple employees and perform the desired business logic.

Regards.

Read only

0 Likes
1,058

Hi Arun,

Thanks for your reply but this is an enhancement in a screen where i need to add one more column and that column (field) may contain mutiple values.

Thanks

Read only

Former Member
0 Likes
1,059

Hi Neha,

you can't use a listbox like that.

We have a developed program with several fields of multiple values, called by search help (F4) or a button. We achieved it by creating a function module with a popup screen that presents a table control with two columns, key and description. User can select whatever lines he wanted.

If user only selects one line the original text field or table cell is filled with that value. If more than one value is selected the field is closed for input and an asterisk is written on the field.

It can be done also with an ALV.

regards,

Edgar

Read only

0 Likes
1,058

Hi Edger,

Can you please share your code or guide me how can i achive that.

Regards

Neha

Read only

0 Likes
1,058

We have the original screen element that can be stored in something like this:

types: begin of t_sel,

             selected, "this is were we keep the keys that are selected at a given moment

             key(40),

             text(60),

          end of t_sel.

data: begin of l_var,

            text(40),

            selections type t_sel occurs 0,

         end of l_var.

at search-help event the search function is called with the t_sel part, like:

call function 'Z_SEARCH_MULTIPLE'

      changing c_text = l_var-text

      tables

               ct_selections = l_var-selections.

this function would  then call popup:

CALL SCREEN '0900' starting at......

this popup would present a table control were selection column would be "ct_selections[]-selected" and "key" and "text" as columns . At ok_code='OK' we would:

LEAVE TO SCREEN 0.

This would terminate screen processing and return to function were we'd count selected lines:

describe table ct_selections lines l_count.

if l_count = 1.

     read table ct_selections with key selected = 'X'.

     c_text = ct_selections-key.

elseif l_count = 0.

     clear c_text.

else.

     c_text = '*'.

endif.

That's about it! Let me know if I can be of more assistance.

regards,

Edgar

Read only

0 Likes
1,058

Hi Edgar,

As per your code if user choose multiple values field is closed for input and an asterisk is written on the field.

but if user want to change those values how can we achive that.

Regards

Neha

Read only

0 Likes
1,058

Hi Neha,

Using F4 or the search help.

regards,

Edgar