2012 Oct 19 6:48 PM
Hi,
Need Help in below Scenario.
User asked me to create Dynamic selection screen such that
it should display checkbox based on entries in Table.
If there are 2 entries in Table then REPORT should display 2 checkbox.
and if 3 , REPORT should display 3 checkbox.
more over if user add another entry in table then it should display that many checkbox on selecton screen.
Just need to ask you whether is it possible or not?
Regards,
Muniyappan.
2012 Oct 19 7:30 PM
hello,
For this...
Create an Internal table as :
data: Begin itab occurs 0,
cb_field type char1,
vbeln like likp-vbeln,
.....
end of
itab.
Now you fetch the data into the internal table of itab using
some
query...
select * ......
Now you are going to display it as....
Loop at itab.
write:/ cb_field as checkbox...
......
at this time only write the Hide statement.... as...
HIDE: values.... u want...
Endloop..
Now capturing of selected data process...
This can be done by clicking on some USER Command button...
for suppose you're clicking F8 means...
AT pf8.
IF SY-LSIND = 1.
describe table itab lines VARIABLE
NAME.
cnt = 3. " Initiate value for Count 3 if you're including page
header.
do VARIABLE NAME times.
read line cnt. " Above
counter....
if sy-lisel(1) = 'X'.
WRITE:/ 'SELECTED
RECORDS:', itab-cb_field,.....
endif.
COUNTER = COUNTER - 1.
cnt = cnt + 1.
enddo.
ENDIF.
best regards,
swanand
Hi,
Need Help in below Scenario.
User asked me to create Dynamic selection screen such that
it should display checkbox based on entries in Table.
If there are 2 entries in Table then REPORT should display 2 checkbox.
and if 3 , REPORT should display 3 checkbox.
more over if user add another entry in table then it should display that many checkbox on selecton screen.
Just need to ask you whether is it possible or not?
Regards,
Muniyappan.
2012 Oct 19 7:30 PM
hello,
For this...
Create an Internal table as :
data: Begin itab occurs 0,
cb_field type char1,
vbeln like likp-vbeln,
.....
end of
itab.
Now you fetch the data into the internal table of itab using
some
query...
select * ......
Now you are going to display it as....
Loop at itab.
write:/ cb_field as checkbox...
......
at this time only write the Hide statement.... as...
HIDE: values.... u want...
Endloop..
Now capturing of selected data process...
This can be done by clicking on some USER Command button...
for suppose you're clicking F8 means...
AT pf8.
IF SY-LSIND = 1.
describe table itab lines VARIABLE
NAME.
cnt = 3. " Initiate value for Count 3 if you're including page
header.
do VARIABLE NAME times.
read line cnt. " Above
counter....
if sy-lisel(1) = 'X'.
WRITE:/ 'SELECTED
RECORDS:', itab-cb_field,.....
endif.
COUNTER = COUNTER - 1.
cnt = cnt + 1.
enddo.
ENDIF.
best regards,
swanand
2012 Oct 19 7:42 PM
Hello,
Please go through this link ,it ll help u
http://www.erpgreat.com/abap/regarding-runtime-creation-of-check-boxes.htm
Regards,
Sam
2012 Oct 19 8:05 PM
I had a similar case recently where the numbr of checkboxes ranged from 0-40. Instead of using Selection Screen Checkbox Controls, I created a custom screen with an editable ALV, and I displayed each checkbox as a single row in the ALV with the checkbox in one column, and descriptive texts in other columns (see screenshot). It worked pretty well. If you're skilled in Object Oriented programming, you can even wrap it all in a more generic class so that it can be reused in other programs without any modification. The drawbacks of this approach though is that it won't work with variants or background execution.