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: 

Question Related to Check-box in Dialog Program

Former Member
0 Kudos

Hi All-

I desgined check box in Table Control... In my Internal table I have 41 records, When user click on Select all button it selects only first 14 records from the table control...When the user uses page-down, then click on Select all, selects remaining 14 records and so on...

But how to select all the records at a time instead of using page-down...

Please advice me how to solve my problem!!!!

Thanks,

Sony

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You should simply be able to loop at the internal table and set the flag.

case ok_code.

when 'SEL_ALL'.

Loop at itab.
  itab-check = 'X'.
  modify itab.
endloop.

when 'DES_ALL'.

Loop at itab.
  itab-check = space.
  modify itab.
endloop.

endcase.

Regards,

RIch Heilman

4 REPLIES 4

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

You should simply be able to loop at the internal table and set the flag.

case ok_code.

when 'SEL_ALL'.

Loop at itab.
  itab-check = 'X'.
  modify itab.
endloop.

when 'DES_ALL'.

Loop at itab.
  itab-check = space.
  modify itab.
endloop.

endcase.

Regards,

RIch Heilman

0 Kudos

Thanks Rich-

But I was using the same logic...

PROCESS AFTER INPUT.

LOOP AT i_x002 .

MODULE user_command_0600.

ENDLOOP.

CASE sy-ucomm.

WHEN 'SELA'.

i_x002-flag = 'X'.

MODIFY i_x002 INDEX tc_itab3-current_line.

WHEN 'DELA'.

i_x002-flag = ' '.

MODIFY i_x002 INDEX tc_itab3-current_line.

ENDCASE.

0 Kudos

I would not suggest doing it like that. Instead move the MODULE USER_COMMAND outside of that loop.



*** 
*  Screen Flow Logic  
***

PROCESS AFTER INPUT.
LOOP AT i_x002 .
ENDLOOP.

MODULE user_command_0600 .




*** 
*  Module coding
***

MODULE user_command_0600 input..

CASE sy-ucomm.
WHEN 'SELA'.
loop at i_x002.
i_x002-flag = 'X'.
MODIFY i_x002.
endloop.

WHEN 'DELA'.
loop at i_x002.
i_x002-flag = space.
MODIFY i_x002.
endloop.

ENDCASE. 

endmodule.

Regards,

Rich Heilman

0 Kudos

Rich-

Thanks for your quick response...Thanks for your solution...It is solved my problem and assgined 10 points for your answer...

Thanks,

Sony