2007 Nov 28 12:38 PM
Hi friends,
How can I make check box enabled/disabled in ALV report can any one give me the solution .
Thanks In advance,
sasi.
2007 Nov 28 12:48 PM
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.
2007 Nov 28 12:47 PM
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
2007 Nov 28 12:48 PM
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
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |