2008 Nov 28 9:17 AM
Hi,
How can we design the CHECK BOXCES in the ALV Report?
2008 Nov 28 9:19 AM
2008 Nov 28 9:33 AM
Hi,
Do this
DATA: BEGIN OF i_outtab OCCURS 0.
INCLUDE STRUCTURE sflight.
*DATA: w_chk TYPE c. "For multiple selection*
DATA: END OF i_outtab.
* I_OUTTAB TYPE SFLIGHT OCCURS 0,
DATA: i_private TYPE slis_data_caller_exit,
i_selfield TYPE slis_selfield,
W_exit(1) TYPE c.
PARAMETERS: p_title TYPE sy-title.
*
START-OF-SELECTION.
SELECT * FROM sflight INTO TABLE i_outtab.
CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
EXPORTING
i_title = p_title
i_selection = 'X'
i_zebra = 'X'
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
i_checkbox_fieldname = 'W_CHK'
* I_LINEMARK_FIELDNAME =
* I_SCROLL_TO_SEL_LINE = 'X'
i_tabname = 'I_OUTTAB'
i_structure_name = 'SFLIGHT'
* IT_FIELDCAT =
* IT_EXCLUDING =
* I_CALLBACK_PROGRAM =
* I_CALLBACK_USER_COMMAND =
* IS_PRIVATE = I_PRIVATE
IMPORTING
es_selfield = i_selfield
*e_exit = w_exit*
TABLES
t_outtab = i_outtab
EXCEPTIONS
program_error = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE i000(0k) WITH sy-subrc.
ENDIF.
*****the internal table is modified with a cross sign for marking the
***rows selected
LOOP AT i_outtab WHERE w_chk = 'X'.
WRITE: / i_outtab-carrid, i_outtab-price.
ENDLOOP.
Thanks & Regards,
Krishna...
2008 Nov 28 9:37 AM
Sorry Buddy,
By mistake i have commented the req lines rather than highlighing the lines:
DATA: w_chk TYPE c. "For multiple selection
i_checkbox_fieldname = 'W_CHK'
rest all ok.
Thanks & Regards,
Krishna..
2008 Nov 28 10:44 AM
Hi vasudha,
for designing the chekboxes in Alv report add following :
SELECTION-SCREEN BEGIN OF BLOCK b2(name of block) WITH FRAME TITLE t02.
PARAMETERS: invoiced(whatever name u want to give of checkbox) AS CHECKBOX,
goods (whatever name u want to give of checkbox) AS CHECKBOX.
SELECTION-SCREEN END OF BLOCK b2.
hope this will help you.
regards
Saurabh
2008 Nov 29 8:09 AM
Please use the search before asking questions which you can reasonably imagine to have been answered several times before.
Such questions and threads were others simply do a search for you will be deleted in future.
Thanks for your understanding,
Julius
2008 Nov 29 8:17 AM
2008 Nov 29 8:52 AM
Hi Vasudha,
While defining your field catalog for the check box column define as below
wa_fieldcat-checkbox = 'X'.
e.g.
l_pos = l_pos + 1.
wa_fieldcat-col_pos = l_pos.
wa_fieldcat-input = 'X'.
wa_fieldcat-seltext_m = 'Check Box'.
wa_fieldcat-tabname = 'ITAB.
wa_fieldcat-checkbox = 'X'.
wa_fieldcat-edit = abap_true.
wa_fieldcat-fieldname = 'CHKBX'.
APPEND wa_fieldcat TO it_fieldcat.
CLEAR wa_fieldcat.
2008 Nov 29 10:25 AM
Hi,
1) Add a field for check box in your internal table
Example:
sel type c,
2) Declare a variable for layout of type slis_layout_alv and assign the checkbox field to attribute box_fieldname
Example:
data: ls_layout type slis_layout_alv.
ls_layout-box_fieldname = 'SEL'.
3) Assign the layout to is_layout which is a exporting field to the ALV call function u201CREUSE_ALV_GRID_DISPLAYu201D
Example :
is_layout = ls_layout
Regards
shanthi
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |