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: 

Object Oriented ALV

Former Member
0 Kudos

Hello, a question.

I created an object oriented ALV:

- I created the container

- The subject ALV

- Catalog

- Layout:

g_layout_a-sel_mode = 'A'.

g_layout_a-box_fname = 'Mark'.

g_layout_a-col_opt = 'X'.

g_layout_a-cwidth_opt = 'X'.

zebra-g_layout_a = 'X'.

- The sample ALV table I say: i_mail []

All right.

Imagine that there are several lines in the ALV, and we mark the 1st and 3rd.

I want when I press a button, marked with an X is a field in the table is called i_mail-mark (char1).

I do not know read from ALV the cell that I make and write according to an internal table.

Thanks in advance

4 REPLIES 4

Former Member
0 Kudos

hi,

First check this Forum, the post by Vijay babu dudla, It will solve your problem.

or

Check this forum

0 Kudos

Thanks Anup Verma .

I solved this way:

DATA: lf_et_index_rows TYPE lvc_t_row,

lf_et_row_no TYPE lvc_t_roid.

CALL METHOD go_grid_listado->get_selected_rows

IMPORTING

et_index_rows = lf_et_index_rows

et_row_no = lf_et_row_no.

I got the lanes in the table lf_et_row_no. The field of this table has ROW_ID numbers of the lanes, for example (2 and 4).

I have an internal table (i_tabla) with a MARCAR field (char1) that have for example 5 rows.

And I want to make a (i_tabla-marcar [2] = 'X') and

(i_tabla-marcar [4] = 'X')

I guess it will be an insert or an update, but you can set the field and the position of the internal table that you want to get the value you want?

I guess that will not be very complicated, but I can not see it.

Thanks again in advance

0 Kudos

Update all the rows in your internal table according to the rows from method GET_SELECTED_ROWS'. Next call method refresh_table_display.

0 Kudos

Solved, but I have not marked the X in the field. As I select the lines that interest me, I lame emails to which I will send the information.

I put the code I used if anyone can come either:

  • Bag of those emails to be sent

DATA: lv_emails_a TYPE string.

  • Get the number of row that has been given in alv_a

  • To keep these numbers in email strings

DATA: li_indices_filas_a TYPE lvc_t_row,

li_numeros_filas_a TYPE lvc_t_roid.

  • Lanes in alv_a

CALL METHOD g_grid_a-> get_selected_rows

Importing

et_index_rows = li_indices_filas_a

et_row_no = li_numeros_filas_a.

  • Save emails to a

IF NOT li_numeros_filas_a IS INITIAL.

LOOP AT li_numeros_filas_a assigning <lw_numeros_filas>.

READ TABLE i_mail_a assigning <w_tab_mail_a> INDEX <lw_numeros_filas>-row_id.

CONCATENATE lv_emails_a <w_tab_mail_a>-email ',' INTO lv_emails_a.

ENDLOOP.

ENDIF.

Thanks for everything.