‎2008 Feb 28 6:49 AM
hi gurus
how to handle select all and deselect all in table control , i declared the set pf-status. inthat i declared application tool bar icons are select all and deselect all. how handle these function codes in abap program i need this very urgent please help me.
‎2008 Feb 28 6:57 AM
Hi,
SELECTALL / DESELECT ALL
When you create the table control you would have give a variable for column selection.
Selection col. name GV_LINESEL..I am assuming it to be GV_LINESEL.
Have a column called LINSEL in your internal table ITAB for the table control.
PROCESS AFTER INPUT.
LOOP AT ITAB.
MODULE CHECK.
ENDLOOP.
MODULE USER_COMMAND.
MODULES CODE.
MODULE CHECK.
ITAB-LINESEL = GV_LINESEL.
MODIFY ITAB INDEX tc_crossover-current_line.
ENDMODULE.
MODULE USER_COMMAND.
CASE SY-UCOMM.
WHEN 'SELECTALL'.
ITAB = 'X'.
MODIFY ITAB TRANSPORTING LINESEL WHERE LINESEL IS INITIAL.
WHEN 'DESELECTALL'.
ITAB = ' '.
MODIFY ITAB TRANSPORTING LINESEL WHERE NOT LINESEL IS INITIAL.
ENDCASE.
ENDMODULE.
PROCESS BEFORE OUTPUT.
LOOP AT ITAB WITH CONTROL TC.
MODULE SET_CHECK.
ENDLOOP.
MODULE SET_CHECK.
GV_LINESEL = ITAB-LINESEL.
ENDMODULE.
regards
prashanth
‎2008 Feb 28 6:57 AM
Hi,
SELECTALL / DESELECT ALL
When you create the table control you would have give a variable for column selection.
Selection col. name GV_LINESEL..I am assuming it to be GV_LINESEL.
Have a column called LINSEL in your internal table ITAB for the table control.
PROCESS AFTER INPUT.
LOOP AT ITAB.
MODULE CHECK.
ENDLOOP.
MODULE USER_COMMAND.
MODULES CODE.
MODULE CHECK.
ITAB-LINESEL = GV_LINESEL.
MODIFY ITAB INDEX tc_crossover-current_line.
ENDMODULE.
MODULE USER_COMMAND.
CASE SY-UCOMM.
WHEN 'SELECTALL'.
ITAB = 'X'.
MODIFY ITAB TRANSPORTING LINESEL WHERE LINESEL IS INITIAL.
WHEN 'DESELECTALL'.
ITAB = ' '.
MODIFY ITAB TRANSPORTING LINESEL WHERE NOT LINESEL IS INITIAL.
ENDCASE.
ENDMODULE.
PROCESS BEFORE OUTPUT.
LOOP AT ITAB WITH CONTROL TC.
MODULE SET_CHECK.
ENDLOOP.
MODULE SET_CHECK.
GV_LINESEL = ITAB-LINESEL.
ENDMODULE.
regards
prashanth
‎2008 Feb 28 7:13 AM
hey dude i got you . but ther is one problem with this right now i am using lfa1 table fields in internal table it is not posiible to declare linesel field in this internal table so , tell me how to gefine linesel foeld in internal table itab . plzz reply me little bit early .
advance thank you.
‎2008 Feb 28 7:24 AM
It is not necessary to have it in the internal table instead use this logic:
I have a table control called tbl_skill,
Now when the user clicks on the SELLALL or DESELLALL
Include the following code in the PAI(outsides the Loop..End Loop):
CASE ok_code.
WHEN 'SELALL'.
LOOP AT tbl_skil INTO wa_skil.
APPEND wa_skil TO tbl_sel_skil.
ENDLOOP.
WHEN 'DESELALL'.
CLEAR tbl_sel_skil.
REFRESH tbl_sel_skil.
ENDCASE.
In the PBO:
Add the following code within the loop:
MODULE set_select OUTPUT.
READ TABLE tbl_sel_skil INTO wa_sel_skil WITH KEY posnr = wa_skil-posnr.
IF sy-subrc = 0.
list_index = 'X'.
ELSE.
list_index = space.
ENDIF.
ENDMODULE
where LIST_INDEX is the Selection col.Name of the Table Control and POSNR is the Key of the Table used in the TC
Hope this solves your problem.
Regards,
Pavithra
Edited by: Pavithra Lakshmi Kesavaram on Feb 28, 2008 8:25 AM
‎2008 Feb 28 8:02 AM
hey pavithra thank you for ur reply can you send me total code that you have , i cant understand this peace of code.
‎2008 Feb 28 9:33 AM