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

Problem in Object Oriented ALV -Select column issue

Former Member
0 Likes
3,721

Hi,

I am working on one assignment where i m using Object Oriented ALV (OO ALV). I am displaying this ALV in Module pool screen container as a ALV object.

I have took one field 'SELKZ' in Itab for row selection. I have passed 'SELKZ' in 'box_fname' of structure 'lvc_s_layo'. Finally m calling method 'set_table_for_first_display' for grid display

But while executing the program i can't see selection column. Due to that i can't select any row from grid.

Please help

8 REPLIES 8
Read only

Former Member
0 Likes
1,830

Hi,

Please pass wa_layout-sel_mode = 'D'.

It will work.

Affable

Arbind

Read only

0 Likes
1,830

Hi,

I have passed sel_mode = 'D' and now i can view select column on ALV display

but after doing selection there were no changes seen in ITAB-SELKZ field

thanks,

Read only

0 Likes
1,830

Hi,

If u want to see the Selected fields u can see only throgh EVENT HANDLE USER COMMAND

e.g.



FORM sub_handle_user_command  USING   i_ucomm TYPE sy-ucomm.

  REFRESH : gt_selected_rows.
  CLEAR   : wa_selected_rows.

  CALL METHOD gr_alvgrid->get_selected_rows
    IMPORTING
      et_row_no = gt_selected_rows.

  READ TABLE gt_selected_rows INTO wa_selected_rows INDEX 1.
  IF sy-subrc <> 0.
    MESSAGE s000 WITH 'Please Select a row to Creat Vendor Master !'
  ENDIF.

  CASE i_ucomm.
    WHEN 'SUBMIT'.
      ...............
Endcase.
EndForm.

Try this.

It will work....

Please do let me know for any other queries.

Regards

Arbind

Read only

0 Likes
1,830

Hi,

CL_GUI_ALV_GRID won't fill SELKZ field automatically. If you really need this field filled, you have to determine selected rows with get_selected_rows method and fill the field by yourself.

Read only

Former Member
0 Likes
1,830

Hi,

In the screen layout check the checkbox for w/ SelColumn

and provide the name for it as wa-selcolumn

where wa is work area of the internal table. Add selcolumn field in the internal table.

Read only

Former Member
0 Likes
1,830

Hi,

Check this link,

Let me know if you want further help.

regards,

Abhijit G. Borkar

Read only

0 Likes
1,830

HI,

it should be a field in ALV data table for select , for example CHK ( Character len 1 ) see bellow :

"----


TYPES: BEGIN OF wa_out ,

CHK TYPE C LENGTH 1 ."MARK ROW

INCLUDE STRUCTURE ZPP_BARCODE .

TYPES : cellcolors TYPE lvc_t_scol ,

SERNR TYPE objk-SERNR ,

VORNR TYPE afru-VORNR ,

ROWNO TYPE i ,

end of wa_out.

"----


you should update ALV data table with X or space in field CHK

data:

ET_INDEX_ROWS TYPE LVC_T_ROW ,

ET_ROW_NO TYPE LVC_T_ROID ,

wa_ROW_NO LIKE LINE OF ET_ROW_NO.

data: w_cellcolor TYPE lvc_s_scol. "For cell color

data: gt_out TYPE STANDARD TABLE OF wa_out , "ALV data table

wa_out1 type wa_out .

"----


in layout table put CHK to BOX_FNAME field

ls_layout-edit = ''.

ls_layout-zebra = 'X'.

ls_layout-CWIDTH_OPT = 'X' .

ls_layout-BOX_FNAME = 'CHK' .

"----


after user select ALV rows and before process

"----- call GET_SELECTED_ROWS to read selected rows:

CALL METHOD GI_GRID->GET_SELECTED_ROWS

IMPORTING

ET_INDEX_ROWS = ET_INDEX_ROWS

ET_ROW_NO = ET_ROW_NO.

"------now modify ALV table :

LOOP AT ET_ROW_NO INTO wa_ROW_NO .

WA_OUT1-chk = 'X' .

MODIFY GT_out index wa_ROW_NO-ROW_ID FROM WA_OUT1 TRANSPORTING chk .

ENDLOOP.

"----


now you can read selected rows from ALV

loop at gt_out into WA_OUT1 where CHK = 'X' .

.....

....

endloop.

Regards ,

REZA ROSTAMI / MAPNA / ABAP

Read only

sarang_gujrati2
Explorer
0 Likes
1,830

Hi,

You have to modify itab by yourself. use 'data_changed' event in ur local class then loop on to er_data_changed->mt_good_cells and get the index of ROW.

Sarang