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: 

check boxes in table control

Former Member
0 Kudos
189

Hi,

Can any one explain me how to insert check boxes in table control?

points guaranteed

cheers

kaki

1 ACCEPTED SOLUTION

athavanraja
Active Contributor
0 Kudos
116

go to the edit mode of the screen select the table control column you want to make it as check box and follow the menu EDIT->CONVERT->check box.

(make sure that column definition in itab/ddtab is of size 1 char)

Regards

Raja

4 REPLIES 4

Former Member
0 Kudos
116

see this example

DEMO_DYNPRO_TABCONT_LOOP_AT

Former Member
0 Kudos
116

while creating table control put check box in the table control and internal table with a field char one and see below example code DEMO_DYNPRO_TABCONT_LOOP_AT

REPORT demo_dynpro_tabcont_loop_at.

CONTROLS flights TYPE TABLEVIEW USING SCREEN 100.

DATA cols LIKE LINE OF flights-cols.

DATA: ok_code TYPE sy-ucomm,

save_ok TYPE sy-ucomm.

DATA: itab TYPE TABLE OF demo_conn.

TABLES demo_conn.

SELECT * FROM spfli INTO TABLE itab.

LOOP AT flights-cols INTO cols WHERE index GT 2.

cols-screen-input = '0'.

MODIFY flights-cols FROM cols INDEX sy-tabix.

ENDLOOP.

CALL SCREEN 100.

MODULE status_0100 OUTPUT.

SET PF-STATUS 'SCREEN_100'.

ENDMODULE.

MODULE cancel INPUT.

LEAVE PROGRAM.

ENDMODULE.

MODULE read_table_control INPUT.

MODIFY itab FROM demo_conn INDEX flights-current_line.

ENDMODULE.

MODULE user_command_0100 INPUT.

save_ok = ok_code.

CLEAR ok_code.

CASE save_ok.

WHEN 'TOGGLE'.

LOOP AT flights-cols INTO cols WHERE index GT 2.

IF cols-screen-input = '0'.

cols-screen-input = '1'.

ELSEIF cols-screen-input = '1'.

cols-screen-input = '0'.

ENDIF.

MODIFY flights-cols FROM cols INDEX sy-tabix.

ENDLOOP.

WHEN 'SORT_UP'.

READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.

IF sy-subrc = 0.

SORT itab STABLE BY (cols-screen-name+10) ASCENDING.

cols-selected = ' '.

MODIFY flights-cols FROM cols INDEX sy-tabix.

ENDIF.

WHEN 'SORT_DOWN'.

READ TABLE flights-cols INTO cols WITH KEY selected = 'X'.

IF sy-subrc = 0.

SORT itab STABLE BY (cols-screen-name+10) DESCENDING.

cols-selected = ' '.

MODIFY flights-cols FROM cols INDEX sy-tabix.

ENDIF.

WHEN 'DELETE'.

READ TABLE flights-cols INTO cols WITH KEY screen-input = '1'.

IF sy-subrc = 0.

LOOP AT itab INTO demo_conn WHERE mark = 'X'.

DELETE itab.

ENDLOOP.

ENDIF.

ENDCASE.

ENDMODULE.

Cheers,

Satya

athavanraja
Active Contributor
0 Kudos
117

go to the edit mode of the screen select the table control column you want to make it as check box and follow the menu EDIT->CONVERT->check box.

(make sure that column definition in itab/ddtab is of size 1 char)

Regards

Raja

Former Member
0 Kudos
116

Hi,

Checkout this post:

Hope it helps you.

Best Regards,

Anjali