09-05-2008 11:27 AM
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.
09-05-2008 11:36 AM
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.
09-05-2008 11:35 AM
Balu
You should refresh the ALV Grid once you do the modifications to the Internal Table.
Thanks
Amol Lohade
09-05-2008 11:36 AM
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.
09-05-2008 11:41 AM
09-05-2008 11:53 AM
Hi,
You need to re-call the FM that you are using for Display of ALV Grid...
Regards,
Kunjal
09-05-2008 12:16 PM
09-05-2008 12:20 PM
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.
09-05-2008 11:53 AM
09-05-2008 11:53 AM
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