Application Development 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: 

How to mark row in OO ALV ?

Former Member
0 Kudos

Hi ,

I am using OO editable ALV . Method set_table_for_first_display has been used . In the report, user can select a row /rows and click on button 'EDIT' in the toolbar . Then one pop up screen will be displayed where user can change the fields . The changed fields will be copied to original ALV output .

In order to reflect changes in the ALV ouput , I am using method refresh_table_display to refresh the ALV display . After refresh I am using method set_selected_rows to mark row/rows which were selected earlier but, the issue is that row/rows are not getting marked in the ALV output .

Any suggestions to mark row/rows after using method refresh_table_display to refresh the ALV display would be of helpful .

Thanks in advance .

1 ACCEPTED SOLUTION

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

Are you also updating the Checkbox in the original ALV ?

3 REPLIES 3

Sandeep_Kumar
Product and Topic Expert
Product and Topic Expert
0 Kudos

Are you also updating the Checkbox in the original ALV ?

0 Kudos

Yes I tried the option of box_fname also in layout . This is also not working .

0 Kudos

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