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

alv report

Former Member
0 Likes
626

how can i assign a checkbox beside each row in a table using alv grid display.how can i get without using field catalog.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
605

hi,

use this function module

reuse_alv_grid_display

and define an internal table of your own and in that select one field as type c

and while filling your field catalog

just make the value as 'X'

itab-checkbox = 'X.

you wil get the check boxes.

for more information just go through these links..

hope this will solve your problem and don't forget to reward points.

regards,

5 REPLIES 5
Read only

sharadendu_agrawal
Active Participant
0 Likes
605

use the layout as shown below and u will get the checkbox

*--ALV layout Settings

wa_alv_layout-box_fieldname = 'CHECKBOX'.

wa_alv_layout-zebra = 'X'.

wa_alv_layout-colwidth_optimize = 'X'.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

it_fieldcat = t_fieldcat

i_callback_program = w_repid

i_callback_pf_status_set = 'PF_STATUS'

i_callback_user_command = 'USER_COMMAND'

is_layout = wa_alv_layout

it_events = t_alv_events[]

TABLES

t_outtab = t_output_data[].

IF sy-subrc <> 0.

ENDIF.

Reward if useful

Read only

Former Member
0 Likes
606

hi,

use this function module

reuse_alv_grid_display

and define an internal table of your own and in that select one field as type c

and while filling your field catalog

just make the value as 'X'

itab-checkbox = 'X.

you wil get the check boxes.

for more information just go through these links..

hope this will solve your problem and don't forget to reward points.

regards,

Read only

Former Member
0 Likes
605

Hi Mahesh,

in the internal table declaration add one more field of type c and length 1, say the name of the field is check.

DATA : BEGIN OF T_MARA occurs 0,

MATNR LIKE MARA-MATNR,

SPRAS LIKE MAKT-SPRAS,

MAKTX LIKE MAKT-MAKTX,

check,

END OF T_MARA.

mention this field name in the layout..

s_layout-box_fieldname = 'CHECK'.

now use this in the

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

i_callback_program = sy-repid

<b>is_layout = s_layout</b>

i_callback_pf_status_set = 'SET_PF_STATUS'

i_callback_user_command = 'USER_COMMAND'

it_fieldcat = t_fcat

TABLES

t_outtab = t_mara.

if you are using grid display then you need to sepcify it in the field catalog.

wa_fcat-fieldname = 'CHECK'.

wa_fcat-tabname = 'T_MARA'.

wa_fcat-checkbox = 'X'.

wa_fcat-colpos = 1.

append wa_fcat to t_fcat.

then no need to specify in the s_layout..

Regards,

Vidya.

Read only

Former Member
0 Likes
605

Hi,

Specify your field name which you have been using for check box in layout and pass the layout to FM.

Cheers,

Bujji

Read only

Former Member
0 Likes
605

Hi , just a follow on from what was said before, I had the same issue to resolve and my main sticking point was the field as a checkbox was not editable. In the examples in the thread they have assigned as field as a checkbox:

fieldcat-checkbox = 'X'.

What they have neglected is the needed entry:

fieldcat-edit = 'X'

Without edit you have a checkbox that you can work with but the user cannot manually change 'tick'.

Ian