2006 Dec 13 3:00 PM
Hi all,
I have create an internal table it_tab
data: begin of it_tab occurs 0,
chq(1) type C,
matnr like mara-matnr,
endof it_tab.
Thus while displaying I have written as
loop at it_tab.
Write:/ it_tab-chq as checkbox, it_tab-matnr.
endloop.
There is a button on the Menu which I have created. When I click on the button
I want to fetch all the material no whose checkbox is selected by me.
For this I have used
at user-command, However in the internal table it_tab the (chq) field is blank even after I have selected all the checkboxes on the output screen . Is there any way that could pass on the data from the screen into the internal table and then we could process the selected lines?.
Thanks in Adv
Hi all,
I have create an internal table it_tab
data: begin of it_tab occurs 0,
chq(1) type C,
matnr like mara-matnr,
endof it_tab.
Thus while displaying I have written as
loop at it_tab.
Write:/ it_tab-chq as checkbox, it_tab-matnr.
endloop.
There is a button on the Menu which I have created. When I click on the button
I want to fetch all the material no whose checkbox is selected by me.
For this I have used
at user-command, However in the internal table it_tab the (chq) field is blank even after I have selected all the checkboxes on the output screen . Is there any way that could pass on the data from the screen into the internal table and then we could process the selected lines?.
Thanks in Adv
2006 Dec 13 3:10 PM
Have a look at the code...
You can have a look at this code :
REPORT ZRAVI_CHECKBOXES_IN_REPORT .
*Creating checkboxes in report
tables : ZRAVI_DEPT.
data : counter type i,
pick,
it_dept like ZRAVI_DEPT occurs 0 with header line.
top-of-page.
format color col_heading.
write at 5 'Dept code'.
write at 35 'Department'.
format color off.
start-of-selection.
set pf-status 'BASIC'.
perform write_report.
top-of-page during line-selection.
case sy-pfkey.
when 'SELECT'.
write 'Selected department list'.
uline.
format color 6 inverse on.
write at 5 'Dept code'.
write at 35 'Department'.
format color off inverse off.
endcase.
at user-command.
case sy-ucomm.
when 'EXIT'.
leave program.
when 'SHOW'.
set pf-status 'SELECT'.
SY-LSIND = 1.
window starting at 15 2 ending at 80 15.
do counter times.
read line sy-index.
if sy-lisel(1) = 'X'.
***********************************************
Sy-lisel contains contents of the selected line
************************************************
select single * from ZRAVI_DEPT where dept_code =
it_dept-dept_code.
write : /5 zravi_dept-dept_code,
35 zravi_dept-department.
endif.
enddo.
when 'BACK'.
sy-lsind = 0.
perform write_report.
endcase.
&----
*& Form WRITE_REPORT
&----
text
----
--> p1 text
<-- p2 text
----
FORM WRITE_REPORT.
SELECT * FROM zravi_dept into it_dept.
write : / pick as checkbox,
5 it_dept-dept_code,
35 it_dept-department.
hide it_dept-dept_code.
endselect.
counter = sy-dbcnt + 1. "For header data.
ENDFORM. " WRITE_REPORT
Gopi Narendra
Posts: 735
Questions: 10
Registered: 5/22/06
Forum points: 944
Re: checkbox on interactie list
Posted: 25.09.2006 11:42 ????????? in response to: maui bayog Reply E-mail this post
Hi
Check if this is included or not
Calling of the Function Module should be given the user command
call function 'REUSE_ALV_LIST_DISPLAY'
exporting
I_CALLBACK_PROGRAM = SY-REPID
IS_LAYOUT = IS_LAYOUT
IT_FIELDCAT = IT_FIELDCAT
I_CALLBACK_USER_COMMAND = 'USER_COMMAND' IT_EVENTS = IT_EVENTS
I_SAVE = C_ISAVE
tables
T_OUTTAB = IT_OUTPUT
exceptions
PROGRAM_ERROR = 1
others = 2.
if SY-SUBRC <> 0.
message id SY-MSGID type SY-MSGTY number SY-MSGNO
with SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
endif.
*******************************
Check............
2006 Dec 13 3:20 PM
u can process the same using READ LINE .
check this .
regards,
vijay
2006 Dec 13 3:26 PM
hi,
You could use the AT SELECTION SCREEN OUTPUT command and then loop into itab. You should select the necessay details you need and have a where condition tat corresponds to whether your check box is checked or not (ie. true or false). Then it would work.
Hope this was helpful !
2006 Dec 13 3:44 PM
Hi sanjay
plz follow the code below :
" Readline command would suffice ur requirement
" write the following command after ur inital code lines
describe table itab lines len.
at line-selection.
do len times.
read line sy-index field value chq itab-matnr .
if chq = 'X'.
write : /5 itab-matnr.
endif.
enddo.
This would work . It would display the matnr no. for all the records that have checkbox selected.
Regards
Pankaj
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |