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: 

doubt in table control

Former Member
0 Kudos

hi all

my requirment is to design a table control which contains mblnr,menge( original qty) ,approved qty,three check boxes....one for approval of quantities entered ,one for rejection and another for do nothing.so how to add check box in the table control.....secondly i should have a select all and deselect all icon in the screen ...once user press select all ...all the approval check box should be selected ..... please help me out in doing this two things

thanks in advance

lokesh

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hiii..

1)For having a check box in table control just drag the check box control into the table control [in the Screen Painter].Then name those checkboxes.In my program i have given them the name like wa_spfli-mark for approval,

wa_spfli-mark2 for rejection and wa_spfli-mark3 for do nothing.

2) Then the code for selecting approved alone..

Declarations:

TABLES: spfli.

Structure Declaration:

TYPES: BEGIN OF st_spfli.

INCLUDE STRUCTURE spfli.

TYPES: mark TYPE c, “for approval checkbox

mark2 TYPE c, “for rejection checkbox

mark3 TYPE c, “for donothing checkbox

END OF st_spfli.

****Declaration of internal table and workarea as that *****of structure type defined above.

DATA: it_spfli TYPE TABLE OF st_spfli,

wa_spfli LIKE LINE OF it_spfli.

CONTROLS tc TYPE TABLEVIEW USING SCREEN 9000.

----


***INCLUDE MZDEMO_TC_USER_COMMAND_9000I01 .

----


&----


*& Module USER_COMMAND_9000 INPUT

&----


  • text

----


MODULE user_command_9000 INPUT.

DATA:okcode TYPE sy-ucomm.

CASE okcode.

WHEN 'ALL'. “okcode for the button select all

  • wa_spfli-mark = 'X'.

LOOP AT it_spfli INTO wa_spfli.

wa_spfli-mark = 'X'. “for approval

MODIFY it_spfli FROM wa_spfli.

ENDLOOP.

ENDCASE.

ENDMODULE. " USER_COMMAND_9000 INPUT

If helped do notify..otherwise also make us know..

Thanks and Regards,

simy

4 REPLIES 4

ferry_lianto
Active Contributor
0 Kudos

Hi Lokesh,

Please check this demo programs.

<b>DEMO_DYNPRO_TABCONT_LOOP_AT

RSDEMO02</b>

Hope this will help.

Regards,

Ferry Lianto

Please reward points if helpful.

gopi_narendra
Active Contributor
0 Kudos

in the table control property in the layout

give a name to the property <b>w/SelColumn</b>

then chagne the structre of tab control having a chk type C.

data : begin of tabc_data occurs 0,

chk type c,

......

end of tabc_data.

and now have a button select all abve the tab ctrl and if u press that in the PAI make chk = 'X'.

for having a check box in table control just drag the check box control into the table control and ahve diff names chk1 chk2 chk3 in the tabc_data table.

now if chk = 'X'

change all the chk1 chk2 chk3 to 'X'.

<b>PLEASE CLOSE THIS THREAD</b>

Regards

- Gopi

Former Member
0 Kudos

Hiii..

1)For having a check box in table control just drag the check box control into the table control [in the Screen Painter].Then name those checkboxes.In my program i have given them the name like wa_spfli-mark for approval,

wa_spfli-mark2 for rejection and wa_spfli-mark3 for do nothing.

2) Then the code for selecting approved alone..

Declarations:

TABLES: spfli.

Structure Declaration:

TYPES: BEGIN OF st_spfli.

INCLUDE STRUCTURE spfli.

TYPES: mark TYPE c, “for approval checkbox

mark2 TYPE c, “for rejection checkbox

mark3 TYPE c, “for donothing checkbox

END OF st_spfli.

****Declaration of internal table and workarea as that *****of structure type defined above.

DATA: it_spfli TYPE TABLE OF st_spfli,

wa_spfli LIKE LINE OF it_spfli.

CONTROLS tc TYPE TABLEVIEW USING SCREEN 9000.

----


***INCLUDE MZDEMO_TC_USER_COMMAND_9000I01 .

----


&----


*& Module USER_COMMAND_9000 INPUT

&----


  • text

----


MODULE user_command_9000 INPUT.

DATA:okcode TYPE sy-ucomm.

CASE okcode.

WHEN 'ALL'. “okcode for the button select all

  • wa_spfli-mark = 'X'.

LOOP AT it_spfli INTO wa_spfli.

wa_spfli-mark = 'X'. “for approval

MODIFY it_spfli FROM wa_spfli.

ENDLOOP.

ENDCASE.

ENDMODULE. " USER_COMMAND_9000 INPUT

If helped do notify..otherwise also make us know..

Thanks and Regards,

simy

Former Member
0 Kudos

thanks a lot to all

regards

lokesh