10-11-2007 9:28 AM
can anyone tell me how to read in an internal table whether checkbox are marked or not....
i m finding difficulty in identifiyng my checkboxes as marked or not....dynamically....
Thanks in Advance.......
KARTIKEY
10-11-2007 9:30 AM
read tabel itab with key checkboxfield = 'X'.
if sy-subrc = 0.
*--check box is marked for this record....
endif.
loop at itab where checkboxfield = 'X'.
*---do ur operations for all marked as 'X'
endloop.
10-11-2007 9:30 AM
Hi,
If you display a field as a checkbox, then the corresponding values are
' ' (Blank) -> Checkbox not checked
'X' -> Checkbox checked
Regards, Joerg
10-11-2007 9:32 AM
Hi,
are u using ALV LIST or GRID?
Find the sample code.
TYPES:
BEGIN OF ty_output,
chk TYPE c,
number TYPE i,
name(20) TYPE c,
END OF ty_output.
DATA: gt_output TYPE STANDARD TABLE OF ty_output,
gs_output TYPE ty_output.
<<populate the internal table>>
CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
EXPORTING
I_INTERFACE_CHECK = ' '
I_BYPASSING_BUFFER =
I_BUFFER_ACTIVE = ' '
i_callback_program = sy-repid
i_callback_pf_status_set = 'PF_STATUS'
i_callback_user_command = 'USER_COMMAND'
I_STRUCTURE_NAME =
is_layout = wa_layout
it_fieldcat = it_fieldcatalog
IT_EXCLUDING =
IT_SPECIAL_GROUPS =
IT_SORT =
IT_FILTER =
IS_SEL_HIDE =
I_DEFAULT = 'X'
I_SAVE = ' '
IS_VARIANT =
IT_EVENTS =
IT_EVENT_EXIT =
IS_PRINT =
IS_REPREP_ID =
I_SCREEN_START_COLUMN = 0
I_SCREEN_START_LINE = 0
I_SCREEN_END_COLUMN = 0
I_SCREEN_END_LINE = 0
IMPORTING
E_EXIT_CAUSED_BY_CALLER =
ES_EXIT_CAUSED_BY_USER =
TABLES
t_outtab = gt_output
EXCEPTIONS
PROGRAM_ERROR = 1
OTHERS = 2
.
&----
*& Form USER_COMMAND
&----
FORM user_command USING p_ucomm TYPE sy-ucomm
p_selfld TYPE slis_selfield.
CASE p_ucomm.
WHEN 'HELLO'.
loop at gt_output into gs_output where chk = 'X'.
< <ur code>>
endloop.
ENDCASE.
ENDFORM.
Note: HELLO is a button in the PF status,
Regards,
Niyaz