2008 May 09 6:53 AM
Hi All,
Please tell me how to put the check boxes in the table control.
My requirement is to get the entries from a Z table having a check box infront of every line. Later when user ticks any check box or selects multiple check boxes should be saved after PRESSING the save button.
Please help ASAP.
Regards,
Maddu.
Hi All,
Please tell me how to put the check boxes in the table control.
My requirement is to get the entries from a Z table having a check box infront of every line. Later when user ticks any check box or selects multiple check boxes should be saved after PRESSING the save button.
Please help ASAP.
Regards,
Maddu.
2008 May 09 7:02 AM
Hi,
What you can do is, declare your internal table that you will be using for your table control, with the first field as :
Begin of itab,
chk_bx type C,
..
...
..
end of itab.
Then after you create the table control using the wizard, go to the screen layout, right click on the first column (which would be 1 char field) and select Convert -> Checkbox.
If this option is not available, you can drag the checkbox element from the toolbar of the screen painter and drop it at the first position of the table control. Then rename it as,
itab-chk_bx.
Do let me know if this helped.
Thanks,
Pranjal.
2008 May 09 7:28 AM
Hi,
You need to first declare the check box variable in your internal table of length 1 char like
data : begin of it1 occurs 0 ,
chk(1) type c,
field1.........
field2.........
.................
end of it1.
Go to the screen layout create a table control using wizard selecting all the fields you want in the table. then you can click on the coloumn for check box and right click. There u will find the option to convert the field to checkbox.
Hope this helps.
Reward if useful.
Regards,
Anu.
2008 May 09 11:58 AM
Thanks Pranjal and Anu.
I have followed the process which you people told me.
Now the check box is appearing in the table control.
I have given name CHECK in my internal table and same name I have mentioned in my TABLE CONTROL layout.
But since a long am fighing with one issue is, when I select
any check box, line related to that should be stored with CHECK value 'X' somewhere. And when I deselect the same
it should be stored with CHECK's value ''.
At the end when user presses the MODIFY button which I have on my screen the value with the 'X' should be stored in my Z table.
Please suggest if anyone knows.
2008 May 09 12:19 PM
For this,
Check the code taht was craeted when u inserted table control on the screen.
In PBO , there should be the foll loop stmnt created :
loop at itab ...WITH CURSOR ...
Endloop.
In PAI, there would be the code:
loop at itab.
endloop.
What you need to do is, in the PAI, between the loop-endloop, modify the internal table itab from the headerline.For that create a module modify bet the loop-endloop.
But the value X or space will only be captured if in PBO, the 'with cursor' addition was tehre, if not, add manually.
let me know if this helped and reward accordingly.
Pranjal.
2008 May 09 12:34 PM
This loop is given in the PBO.
LOOP AT g_tbc_itab
INTO g_tbc_wa
WITH CONTROL tbc
CURSOR tbc-current_line .
MODULE tbc_move.
MODULE tbc_get_lines.
Does the CURSOR statement is witten correct here ?
When I tick any record appearing in that table control.
TICK is not showing there, its disappering right on the time.
Please tell excatly what should I to make it appear.
2008 May 09 12:42 PM
Hi,
The code in PBO is correct.
ALso, unless u do not code for modifyin the table row in PAI, your tick mark will go.
Do the foll :
In PAI, between the statements
LOOP AT g_tbc_itab
INTO g_tbc_wa
WITH CONTROL tbc.
ENDLOOP.
Add the line :
Module modif_tab.
The code in the newly crated module wil b
modify g_tbc_itab from g_tbc_wa index sy-index transporting CHECK.
This will update the internal tabel n u wil b able to c the cheked box.
Reward if helpful.
PRanjal.
2008 May 09 1:20 PM
Pranjal a strange errror has started coming.
When I put this code in PAI event:
loop at g_tbc_itab.
modify-itab.
endif.
Its giving the error as "LOOP" CAN NOT BE ASSIGNED TO ANY FIELD.
I am even not getting the hang of it what it want to communicate.
Help please.
2008 May 09 1:24 PM
You had to use the foll code:
LOOP AT g_tbc_itab
INTO g_tbc_wa
WITH CONTROL tbc.
module modif_tab]
endloop.
Edited by: Pranjal Gadkari on May 9, 2008 2:24 PM
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |