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

ALV list button press query!

Former Member
0 Likes
1,338

hello all,

I displaying alv list with the help of reuse_alv_listdislay..... i had 2 command button on application tool and the list contians a check box and a editable field.... when one command button is pressed i the check box should get ticked .... untill here is working fine.

But when the i press the other command button to detick the check box it is not working ( it is working if it pressed double time). how to fix it?

ty

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,293

in your user_command form, do like this:

case sy-ucomm.

when <FCODE for first button>.

check_box = 'X'.

when <FCODE for second button>.

check_box = space.

endcase.

Regards,

Ravi

hello all,

I displaying alv list with the help of reuse_alv_listdislay..... i had 2 command button on application tool and the list contians a check box and a editable field.... when one command button is pressed i the check box should get ticked .... untill here is working fine.

But when the i press the other command button to detick the check box it is not working ( it is working if it pressed double time). how to fix it?

ty

10 REPLIES 10
Read only

Former Member
0 Likes
1,294

in your user_command form, do like this:

case sy-ucomm.

when <FCODE for first button>.

check_box = 'X'.

when <FCODE for second button>.

check_box = space.

endcase.

Regards,

Ravi

Read only

0 Likes
1,293

IF l_ucomm = 'ASEL'.

loop at i_final where aufnr <> ' '

and arbpl <> ' '

and matnr <> ' '.

i_final-release = 'X'.

modify i_final from i_final.

clear i_final.

endloop.

ENDIF.

*

IF l_ucomm = 'DSEL'.

loop at i_final where aufnr <> ' '

and arbpl <> ' '

and matnr <> ' '.

i_final-release = ' '.

modify i_final from i_final.

clear i_final.

endloop.

ENDIF.

*

this is my coding.... i am finding i_final too filling up with the check_box = 'X'. but that is not reflecting in the list after the press of the button

Read only

0 Likes
1,293

Hi Suresh,

Is your code working for ASEL and not working for DSEL?

Regards,

ravi

Read only

0 Likes
1,293

yes Ravi that is not working for DESEl.... but that works when press the button twice

Read only

0 Likes
1,293

Hi Suresh,

Did you try debugging it? Keep a break point as the when 'DSEl' statement.

Regards,

ravi

Read only

0 Likes
1,293

Hi,

You have to place this code...

in the user_command form.

FORM USER_COMMAND USING    P_UCOMM    LIKE SY-UCOMM
                           P_SELFIELD TYPE SLIS_SELFIELD.

"your logic here...after that place these two lines
<b>      P_SELFIELD-ROW_STABLE = 'X'.
      P_SELFIELD-REFRESH = 'X'.</b>

ENDFORM.

Regards

vijay

Read only

0 Likes
1,293

ty that solved.

Please let me know what extactly does row_stable and refresh does

Read only

0 Likes
1,293

Hi,

Actually what happened in your case is First time when you click on DESEL button it is space but frontend it is not updated. because you need to refresh explicitly if you change any thing to the list. and Row_stable is used along with refrsh, it is used cases like this..

when you press page down and did some operation, then in triggered some user_command then in user_command you will call refresh , so it will go to top of page )first page. if you want to avoid you have to use row_stable. that means where ever you are before button click, you will be there only even after button click if you use row_stable = 'X'.

Regards

vijay

Read only

Former Member
0 Likes
1,293

may be u had written the code for the second button by using double click use command like this

WHEN '&IC1'. " this is for double click

instead of &IC1 use the user command for the second button and try out

Read only

0 Likes
1,293

IF l_ucomm = 'ASEL'.

loop at i_final where aufnr <> ' '

and arbpl <> ' '

and matnr <> ' '.

i_final-release = 'X'.

modify i_final from i_final.

clear i_final.

endloop.

ENDIF.

*

IF l_ucomm = 'DSEL'.

loop at i_final where aufnr <> ' '

and arbpl <> ' '

and matnr <> ' '.

i_final-release = ' '.

modify i_final from i_final.

clear i_final.

endloop.

ENDIF.

*

this is my coding.... i am finding i_final too filling up with the check_box = 'X' under debug. but that is not reflecting in the list after the press of the button