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 reports

Former Member
0 Likes
528

Hi friends,

How can I make check box enabled/disabled in ALV report can any one give me the solution .

Thanks In advance,

sasi.

1 ACCEPTED SOLUTION
Read only

asik_shameem
Active Contributor
0 Likes
444

Hi

go thru in this pgm.

report zreport.

TYPE-POOLS : slis.

DATA : BEGIN OF itab OCCURS 0.

INCLUDE STRUCTURE t001.

<b>DATA : flag tyPE c,</b>

END OF itab.

DATA : alvfc TYPE slis_t_fieldcat_alv.

DATA : alvly TYPE slis_layout_alv.

SELECT * FROM t001 INTO TABLE itab.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = sy-repid

i_internal_tabname = 'ITAB'

i_inclname = sy-repid

CHANGING

ct_fieldcat = alvfc

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

<b>alvly-box_fieldname = 'FLAG'.</b>

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

it_fieldcat = alvfc

i_callback_program = sy-repid

i_callback_user_command = 'USER_COMMAND'

is_layout = alvly

TABLES

t_outtab = itab

EXCEPTIONS

program_error = 1

OTHERS = 2.

FORM user_command USING whatcomm TYPE sy-ucomm whatrow TYPE

slis_selfield.

data : msg(100) type c.

LOOP AT itab.

if itab-flag = 'X'.

msg = sy-tabix.

condense msg.

concatenate 'Row Number ' msg ' ' into msg

separated by space.

message msg type 'I'.

endif.

ENDLOOP.

ENDFORM. "user_command

Hi friends,

How can I make check box enabled/disabled in ALV report can any one give me the solution .

Thanks In advance,

sasi.

2 REPLIES 2
Read only

0 Likes
444

Hi,

If you want to show a check box in the alv, you will have to add an field in the table which have the information with type char, and in the field catalog, you will have to put a X in the check box´s field (ls_fieldcat-checkbox = 'X'), then the alv shows a checkbox correctly.

Luck with yout report

Read only

asik_shameem
Active Contributor
0 Likes
445

Hi

go thru in this pgm.

report zreport.

TYPE-POOLS : slis.

DATA : BEGIN OF itab OCCURS 0.

INCLUDE STRUCTURE t001.

<b>DATA : flag tyPE c,</b>

END OF itab.

DATA : alvfc TYPE slis_t_fieldcat_alv.

DATA : alvly TYPE slis_layout_alv.

SELECT * FROM t001 INTO TABLE itab.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

i_program_name = sy-repid

i_internal_tabname = 'ITAB'

i_inclname = sy-repid

CHANGING

ct_fieldcat = alvfc

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

<b>alvly-box_fieldname = 'FLAG'.</b>

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

it_fieldcat = alvfc

i_callback_program = sy-repid

i_callback_user_command = 'USER_COMMAND'

is_layout = alvly

TABLES

t_outtab = itab

EXCEPTIONS

program_error = 1

OTHERS = 2.

FORM user_command USING whatcomm TYPE sy-ucomm whatrow TYPE

slis_selfield.

data : msg(100) type c.

LOOP AT itab.

if itab-flag = 'X'.

msg = sy-tabix.

condense msg.

concatenate 'Row Number ' msg ' ' into msg

separated by space.

message msg type 'I'.

endif.

ENDLOOP.

ENDFORM. "user_command