Application Development and Automation 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: 
Read only

how to read checkbox value

Former Member
0 Likes
4,237

hi experts,

I have a reqiurement .If i select certain records by using the check box and press execute(push button) ,these records must be displayed in next screen but i am facing problem in getting the selected records as the status of checkbox is not getting saved in my internal table.

LOOP AT IT_MAKT INTO WA_MAKT.

WRITE: / WA_MAKT-CHECK AS CHECKBOX,

WA_MAKT-MATNR,

WA_MAKT-MAKTX.

ENDLOOP.

Please guide me.

hi experts,

I have a reqiurement .If i select certain records by using the check box and press execute(push button) ,these records must be displayed in next screen but i am facing problem in getting the selected records as the status of checkbox is not getting saved in my internal table.

LOOP AT IT_MAKT INTO WA_MAKT.

WRITE: / WA_MAKT-CHECK AS CHECKBOX,

WA_MAKT-MATNR,

WA_MAKT-MAKTX.

ENDLOOP.

Please guide me.

10 REPLIES 10
Read only

Former Member
0 Likes
2,336

You must uset the READ REPORT statement. Please read the help on this.

Rob

Read only

awin_prabhu
Active Contributor
0 Likes
2,336

Hi manasa,

Use READ LINE statement.

Ex:


READ LINE sy-index FIELD VALUE  WA_MAKT-CHECK . " Sy-index is line no in list
IF WA_MAKT-CHECK  EQ 'X'.
" When check box is checked
ENDIF.

Read only

0 Likes
2,336

>

> Use READ LINE statement.

Yes - what was I thinking??

Rob

Read only

Former Member
0 Likes
2,336

hi,

READ LINE sy-index FIELD VALUE WA_MAKT-CHECK . " Sy-index is line no in list

IF WA_MAKT-CHECK EQ 'X'.

" When check box is checked

ENDIF.

The problem is WA_MAKT-CHECK is not getting populated with value 'X' when i check the boxes.

Thanks .

Read only

0 Likes
2,336

As I said, you have to read the documentation. This is done inside a DO/ENDDO.

Rob

Read only

0 Likes
2,336

check the below one.

LOOP AT t_load_tab3.

READ LINE t_load_tab3-line_no OF PAGE t_load_tab3-page_no

FIELD VALUE w_sel INTO lw_sel.

t_load_tab3-sel = lw_sel.

MODIFY t_load_tab3 TRANSPORTING sel.

CLEAR lw_sel.

ENDLOOP.

In the above code, w_sel is the check box.

Read only

Former Member
0 Likes
2,336

hi experts,

I have tried with this code given below to prepare a classical report having checkbox.But when select records by checking the check box and pressing execute , in the next screen i am getting all the records and not the selected ones.

Please can anyone guide me how to proceed.

Moderator message - Please respect the 2,500 character maximum when posting. Post only the relevant portions of code

Thanks.

Edited by: Rob Burbank on Apr 7, 2010 8:54 AM

Read only

0 Likes
2,335

Hi,

Please refer to this [Check box functionality in interactive classical report |http://wiki.sdn.sap.com/wiki/display/Snippets/Checkboxfunctionalityininteractiveclassicalreport]

Hope this helps.

Regards,

Chandravadan

Read only

Former Member
0 Likes
2,335

Hi Manasa,

Write the code to read the checkbox (READ LINE...) under AT LINE-SELECTION command.

Regards,

Santosh

Read only

former_member418469
Participant
0 Likes
2,335

hi,

Write code as under:

At user-command [if you want to read check box values based upon button click]

do.

read line sy-index.

[ This will store line contents into sy-lisel ]

if sy-lisel+1(3) = 'X' [ Check box]

process it.

endif.

if sy-index > 1 and sy-lisel = space.

exit.

endif.

lv_message = 'Processed successfully'

modify line sy-lilli field value wa_xxxx from lv_message

[ if you want to assign any message after processing]

clear sy-lisel.

enddo.