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

module pool

Former Member
0 Likes
602

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.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
585

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

5 REPLIES 5
Read only

Former Member
0 Likes
586

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

Read only

0 Likes
585

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.

Read only

0 Likes
585

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

Read only

0 Likes
585

hey pavithra thank you for ur reply can you send me total code that you have , i cant understand this peace of code.

Read only

Former Member
0 Likes
585

sxsx