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: 

ALV with select all option

Former Member
0 Kudos

Hi All,

i have written a ALV report program. One of the field in the output is a check box. The progarm has a button in the PF-status to select all the check boxes. I have written the below code to achive this functionality.

CASE u_comm.

WHEN 'SELECT_ALL'.

LOOP AT gi_postprv INTO gw_postprv.

IF gw_postprv-chk_box NE 'X'.

gw_postprv-chk_box = 'X'.

MODIFY gi_postprv FROM gw_postprv INDEX

sy-tabix TRANSPORTING chk_box .

ENDIF.

clear gw_postprv.

ENDLOOP.

where gi_postprv is my output table.

The above is not achieving the desired functionality. I want to know if the above is correct? if not what else modification do i need to make.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

code seems to be ok.

put a break-point just before CALL FUCTION for ALV and check the values of the internal table.

If you are using OOPS ALV

use

IF grid is not initial.

REFRESH_TABLE_DISPLAY method

ENDIF.

8 REPLIES 8

Former Member
0 Kudos

Balu

You should refresh the ALV Grid once you do the modifications to the Internal Table.

Thanks

Amol Lohade

Former Member
0 Kudos

code seems to be ok.

put a break-point just before CALL FUCTION for ALV and check the values of the internal table.

If you are using OOPS ALV

use

IF grid is not initial.

REFRESH_TABLE_DISPLAY method

ENDIF.

0 Kudos

what Function do i need to call? i am not calling any function

0 Kudos

Hi,

You need to re-call the FM that you are using for Display of ALV Grid...

Regards,

Kunjal

0 Kudos

HI,

Thnks for ur suggestions. I got my prblm solved.

0 Kudos

see you need not call it again.

form user_command using .....
CASE u_comm.
WHEN 'SELECT_ALL'.
LOOP AT gi_postprv INTO gw_postprv.
IF gw_postprv-chk_box NE 'X'.
gw_postprv-chk_box = 'X'.
MODIFY gi_postprv FROM gw_postprv INDEX 
sy-tabix TRANSPORTING chk_box .
ENDIF.
clear gw_postprv.
ENDLOOP.
selfield-refresh = 'X'. "<-----THis is must
endform.

Former Member
0 Kudos

Hi Balu,

Please refer to the below thread

Hope this helps you.

Thanks,

Ruthra

Former Member
0 Kudos

Hi ,

Try using some counter instead of sy-tabix .check what vales you are getting for sy-tabix.

You will have to refresh the ALV or call again