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

check box

Former Member
0 Likes
680

user has given the specification to display the check boxes on the list,how we can handle the situation.?could u plzz tell

7 REPLIES 7
Read only

Former Member
0 Likes
653

Hi Soniya,

I think u r talking about ALV report right? If it is, take one field in the final internal table as CHKBX(1) type C. while preparing the field catalog activate the property CHECK BOX means for this field in feild catalog mark as 'X'. Thne in the output u will be find the check box, Hope this helps you. Reply for queries.

Regards,

Kumar.

Read only

Former Member
0 Likes
653

Hi soniya,

include a field in ur internal table say chk type c.

now in end-of-selection.

loop.

write:/ chk as checkbox,itab-fld1.

endloop.

A check box will be displayed with every record.

regards,

keerthi

Read only

Former Member
0 Likes
653

hi soniya,

if u r talking abt reports then define a variable of type c length 1

and write statement as checkbox.

data:

w_c(1) type 1.

write:

w_c as checkbox.

regards,

kiran kumar k

Read only

Former Member
0 Likes
653

Hi Soniya,

Please refer the link,

Best Regards.

    • Reward points if it is useful.

Read only

p291102
Active Contributor
0 Likes
653

Hi,

This is the simple report for checkbox alv report.

It may clear your doubt.

REPORT YMS_CHECKBOXALV.

TYPE-POOLS: slis.

DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.

DATA: s_fieldcatalog TYPE slis_fieldcat_alv.

DATA: s_layout TYPE slis_layout_alv.

DATA: BEGIN OF itab OCCURS 0,

icon TYPE icon-id,

vbeln TYPE vbeln,

kunnr TYPE kunnr,

erdat TYPE erdat,

box TYPE c,

END OF itab.

DATA: v_repid TYPE syrepid.

START-OF-SELECTION.

  • Get the data.

SELECT vbeln kunnr erdat UP TO 100 ROWS

FROM vbak

INTO CORRESPONDING FIELDS OF TABLE itab.

IF sy-subrc <> 0.

MESSAGE s208(00) WITH 'No data found'.

LEAVE LIST-PROCESSING.

ENDIF.

  • Modify the record with red light.

itab-icon = '@0A@'.

MODIFY itab TRANSPORTING icon WHERE NOT vbeln IS initial.

v_repid = sy-repid.

  • Get the field catalog.

CLEAR: s_fieldcatalog.

s_fieldcatalog-col_pos = '1'.

s_fieldcatalog-fieldname = 'ICON'.

s_fieldcatalog-tabname = 'ITAB'.

s_fieldcatalog-seltext_l = 'Status'.

s_fieldcatalog-icon = 'X'.

APPEND s_fieldcatalog TO t_fieldcatalog.

CLEAR: s_fieldcatalog.

s_fieldcatalog-col_pos = '2'.

s_fieldcatalog-fieldname = 'VBELN'.

s_fieldcatalog-tabname = 'ITAB'.

s_fieldcatalog-rollname = 'VBELN'.

APPEND s_fieldcatalog TO t_fieldcatalog.

CLEAR: s_fieldcatalog.

s_fieldcatalog-col_pos = '3'.

s_fieldcatalog-fieldname = 'KUNNR'.

s_fieldcatalog-tabname = 'ITAB'.

s_fieldcatalog-rollname = 'KUNNR'.

APPEND s_fieldcatalog TO t_fieldcatalog.

CLEAR: s_fieldcatalog.

s_fieldcatalog-col_pos = '4'.

s_fieldcatalog-fieldname = 'ERDAT'.

s_fieldcatalog-tabname = 'ITAB'.

s_fieldcatalog-rollname = 'ERDAT'.

APPEND s_fieldcatalog TO t_fieldcatalog.

  • Set the layout.

s_layout-box_fieldname = 'BOX'.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

i_callback_program = v_repid

is_layout = s_layout

i_callback_pf_status_set = 'SET_PF_STATUS'

i_callback_user_command = 'USER_COMMAND'

it_fieldcat = t_fieldcatalog[]

TABLES

t_outtab = itab.

----


  • FORM SET_PF_STATUS *

----


  • ........ *

----


  • --> EXTAB *

----


FORM set_pf_status USING extab TYPE slis_t_extab.

SET PF-STATUS 'TEST2'.

ENDFORM.

----


  • FORM user_command *

----


  • ........ *

----


  • --> UCOMM *

  • --> SELFIELD *

----


FORM user_command USING ucomm LIKE sy-ucomm

selfield TYPE slis_selfield.

  • Check the ucomm.

IF ucomm = 'DETAIL'.

LOOP AT itab WHERE box = 'X'.

itab-icon = '@08@'.

MODIFY itab TRANSPORTING icon.

ENDLOOP.

ENDIF.

selfield-refresh = 'X'.

ENDFORM.

Thanks,

Shankar

Read only

Former Member
0 Likes
653

Hi Soniya,

You can do this with Normal Report as well as ALV reports also.


**For ALV reports
add a field in the field catalog having type c length 1. and mark it to be displayed as Checkbox while filling the Field Catalog.

**For Normal Reprt
**when you are printing the data, at that point itself you can inset a checkbox.

LOOP AT INTERNAL_TABLE INTO WORK_AREA.

WRITE: CHK AS CHECKBOX, WORK_AREA-A, WORK_AREA-B.

ENDLOOP.

Regards,

Kunjal

Read only

Former Member
0 Likes
653

Hi Sonyia!

For displaying checkbox in

ALV,

1. add a field of char(1) to the output internal table ex. check (1).

2. assign this fieldname to the IS_LAYOUT importing structure , IS_LAYOUT-BOX_FIELDNAME.

ex. DATA T_LAYOUT TYPE SLIS_LAYOUT_ALV.

T_LAYOUT-BOX_FIELDNAME = 'CHECK'.

3. pass this structure to the func module REUSE_ALV_LIST_DISPLAY.

for REPORT programs,

simply write,

WRITE check as checkbox.

where check is of char(1) type.

Reward points if it is helpful.

Regards,

Neha Bansal.