2006 Dec 28 11:28 AM
Hi all,
My requirement is to develop a Report where one of the columns can be updated with the help of Checkbox and based on some other information few values in the check box column should not be non editable.
And ultimately on an event these values to be saved in my Z-table.
Can anyone please guide me.
Regards,
Sudipto.
Yeah u can do that .
1.
First u need to display all the employees with the check box option .
declare a field in ur itab as cb (say ) character for displaying this .
write:/ cb as check box.
will display the result in check boxes .
2.use the logic of screen
to disable the check boxes into non editable where the employess are not allowed to go for a loan .
this will be like
loop at screen .
screen -group
screen input = '0'. "for that check box
or (screen active = '0' )
modify screen.
endloop.
for this effect .
regards,
vijay
2006 Dec 28 11:50 AM
hi ,
//My requirement is to develop a Report where one of the columns can be updated with the help of Checkbox
how u want to update? is this field change in the output list based on the check box?
Still you need to elaborate the query with an example .
regards,
vijay
2006 Dec 28 11:55 AM
hi
can u jst clarify me which one should not be non editable s the checkbox or the columns tht u diplay n the report
is tht u mean the phrase SHOULD NOT BE NON EDITABLE as editable
2006 Dec 28 12:05 PM
Yeah, thanks for ur replies.
Suppose I have a list of employees in my report. Now there I have to put a checkbox column where I can update the table thru report that these employees can apply for loans and for those who have already applied this check-box column should be made non-editable.
Hope I have made myself clear.
Regards,
Sudipto.
2006 Dec 28 12:15 PM
Hi Barman,
Check this sample code ...
data vchk1 type c.
data : begin of it_test occurs 0,
vchk(1) type c,
kunnr like kna1-kunnr,
end of it_test.
start-of-selection.
clear it_test.
it_test-kunnr = 2000.
append it_test.
it_test-kunnr = 3000.
append it_test.
it_test-kunnr = 4000.
append it_test.
it_test-kunnr = 5000.
append it_test.
end-of-selection.
loop at it_test.
if it_test-kunnr = 5000.
write 😕 vchk1 as checkbox INPUT OFF,
5(10) it_test-kunnr.
else.
write 😕 vchk1 as checkbox,
5(10) it_test-kunnr.
endif.
endloop.
Regards,
Jayaram..
2006 Dec 28 12:15 PM
Yeah u can do that .
1.
First u need to display all the employees with the check box option .
declare a field in ur itab as cb (say ) character for displaying this .
write:/ cb as check box.
will display the result in check boxes .
2.use the logic of screen
to disable the check boxes into non editable where the employess are not allowed to go for a loan .
this will be like
loop at screen .
screen -group
screen input = '0'. "for that check box
or (screen active = '0' )
modify screen.
endloop.
for this effect .
regards,
vijay
2006 Dec 28 12:28 PM
Hi Barman,
Check the sample code given above and code your program according to your
requirement.
Create an Update Button in the tool bar. After displaying the report , check the check boxes based on your requirements. Then at the event At User Commnd update the ztable with the values dispalyed in the report.
I think this will definitely fulfill your requirement.
Regards,
Jayaram..
2006 Dec 29 5:17 AM
Hi Jayaram,
Thanks for your reply. But I wanted the same in ALV grid format if possible. Or at least that the user selects the repective employees and clicks on some corresponding update button to update the z-table.
Not very conversant with ALV. Can someone guide please.
Regards,
Sudipto.
2006 Dec 29 5:20 AM
Hi Vijay,
Thanks for your reply. But if I m using a simple report how can I use a screen flow logic.
Could u plz. elaborate...
Regards,
Sudipto.
2006 Dec 29 5:27 AM
Hi,
1.To display checkbox in ALV,declare a field of type char and length 1 in output table.
2.In the field catalog,make checkbox = 'X' for the field.
3.To make the checkbox editable for few cells,use one field called cellstyle of type char and length 4 in output table.Read the particular row.
READ TABLE itab2 INTO wa2 index 2.
IF sy-subrc EQ 0.
w_style-fieldname = 'CHECKBOX'.
w_style-style = cl_gui_alv_grid=>mc_style_enabled.
REFRESH wa2-cellstyles.
APPEND w_style TO wa2-cellstyles.
MODIFY itab2 FROM wa2 TRANSPORTING cellstyles
WHERE matnr = wa2-matnr.
4.In layout,
w_layout-stylefname = 'CELLSTYLES' .
5.Pass the layout in set_table_for_first_display.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |