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- Report

Former Member
0 Likes
909

Hi,

How can we design the CHECK BOXCES in the ALV Report?

Hi,

How can we design the CHECK BOXCES in the ALV Report?

8 REPLIES 8
Read only

Former Member
0 Likes
891

Check this for all info on ALV:

Regards

Neha

Read only

Former Member
0 Likes
891

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...

Read only

0 Likes
891

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..

Read only

Former Member
0 Likes
891

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

Read only

Former Member
0 Likes
891

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

Read only

Former Member
0 Likes
891

Hi,

Check this demo program BCALV_EDIT_05. This help you..

Read only

Former Member
0 Likes
891

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.

Read only

Former Member
0 Likes
891

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