2016 Aug 23 2:07 PM
Hi friends,
When i am selecting one record and doing some funtion working fine . but when selecting another row and doing some function second record not displaying i debug my program in get_selected row not taking 2nd index .
Hi friends,
When i am selecting one record and doing some funtion working fine . but when selecting another row and doing some function second record not displaying i debug my program in get_selected row not taking 2nd index .
2016 Aug 23 2:17 PM
2016 Aug 23 2:22 PM
Hi peter here on oops alv report when i am selecting one record and clicking on modify button one screen is dispalying with selected record . again i m coming back on alv reort and selecting another row and clicking on modify screen is coming blank not showing data.
2016 Aug 23 2:24 PM
2016 Aug 23 2:26 PM
Yes i m using refresh after calling screen.
CALL METHOD c_alvgd->refresh_table_display
EXPORTING
is_stable = stable.
2016 Aug 23 2:48 PM
2016 Aug 23 3:27 PM
2016 Aug 23 2:51 PM
Hi Rakhi,
Please can you paste your code snippet, atleast the alv part .
2016 Aug 23 4:02 PM
Hi,
The Blank screen may be because you are refreshing the table that was used to display the content in the screen. In stead of refresh the fields used in the screen, control it before the screen is called.
CALL METHOD <grid>->get_selected_rows
If row_id is not initial.
call the modify screen.
ENDIf.
This logic will avoid calling the modify screen with the blank screen. Also check by removing the Refresh / Flush command within the screen that is called after the user command.
Let me know if it works.
2016 Aug 23 5:38 PM
No I m not refresing internal table only user clear for work area.
WHEN 'MOD'. " modify button
CALL METHOD c_alvgd->check_changed_data.
CALL METHOD c_alvgd->get_selected_rows " here second time i_selected_rowss is showing zero.
IMPORTING
et_index_rows = i_selected_rowss.
*
* Through the index capturing the values of selected rows
LOOP AT i_selected_rowss INTO w_selected_rowss.
READ TABLE it_final INTO wa_final INDEX w_selected_rowss-index.
ENDLOOP.
CALL SCREEN xyz STARTING AT 12 18
ENDING AT 155 42.
CALL METHOD c_alvgd->refresh_table_display
EXPORTING
is_stable = stable.
2016 Aug 23 5:55 PM
Hi,
The Flow looks perfect. I got the similar error in one of my program, then I got to know that the row selection was not captured but the cell selection was fine. I made the code like below.
DATA: lt_cells TYPE lvc_t_cells,
ls_cells TYPE lvc_s_cells.
CALL METHOD grid->get_selected_rows
IMPORTING index rows.
IF row_id is INITIAL.
CALL METHOD grid->get_selected_cells
IMPORTING et_cell = lt_cells
IF sy-subrc EQ 0.
READ TABLE lt_cells INTO ls_cells INDEX 1.
then use ls_cells-row_id for the further selection.
** READ TABLE it_final INTO wa_final INDEX ls_cells-row_id.
ENDIF.
ENDIF.
I will also look for the another solution that I used for similar issues. Let me know if it works.
2016 Aug 23 7:15 PM
i used that one also but not getting.
WHEN 'MOD'.
CLEAR: wa_final.
* REFRESH i_selected_rowss.
CALL METHOD c_alvgd->check_changed_data.
CALL METHOD c_alvgd->get_selected_rows
IMPORTING
et_row_no = i_selected_rowss.
LOOP AT i_selected_rowss INTO w_selected_rowss.
READ TABLE it_final INTO wa_final INDEX w_selected_rowss-row_id.
ENDLOOP.
CALL SCREEN xyz STARTING AT 12 18
ENDING AT 155 42.
endif.
CALL METHOD c_alvgd->refresh_table_display
EXPORTING
is_stable = stable.
2016 Aug 23 8:15 PM
Hi,
Upon save and back to screen, the cursor is moved to a cell. So using the below code will choose the next one.
DATA: l_row TYPE i, l_col TYPE i.
Another Solution:-
CALL METHOD <grid>->get_current_cell
IMPORTING
e_row = l_row
e_col = l_col.
IF l_row GE 1.
READ TABLE it_final INTO wa_final INDEX row.
ENDIF.
2016 Aug 24 9:05 AM
In this case whn selecting one row taht is dispalying and aftr coming back again if selecting another row only first row data is displaying.
2016 Aug 24 3:11 PM
Hi,
I have tested all the possibilities and it worked fine for me. Could you please remove that stable while refreshing table? I am not sure what are the values you pass to the structure lvc_s_stbl.
Also can you test by selecting the last row (anything other than first row) at first time and then selecting different row at the second time? The get_current_cell row should give the exact row where the cursor is.
2016 Aug 24 3:25 PM
Not working even my if i m doing two button functionality same time like if i m selecting any row on alv oops report and click on update button after that if selecting another row and clicking on delete button it is not working and if i am coming back and doing individually it is working.
issue is only get_selected_rows.
thanx for your help .
but still not solved.
2016 Aug 24 3:44 PM
Hi,
Yes. The Method get_current_cell will select only one row. So call this Method only when the get_selected_rows returns zero rows. Is it possible for you to provide the logic while you create the grid object and set_table_for_first_display?
2016 Aug 24 3:50 PM
2016 Aug 24 3:52 PM
if i m changing that method and using this method same thing happening only when selecting second time only first row data is displaying.
DATA: l_row TYPE i, l_col TYPE i.
clear:l_row.
CALL METHOD c_alvgd->check_changed_data.
CALL METHOD c_alvgd->get_current_cell
IMPORTING
e_row = l_row
e_col = l_col.
READ TABLE it_final INTO wa_final INDEX l_row.
2016 Aug 25 10:35 AM
Solved my issue .
Problem is only when i ma displaying oops alv here i have to check frst object is initail aor grid is initial only these two if condition solved my issue.
IF c_ccont IS INITIAL.********** important
CREATE OBJECT c_ccont
EXPORTING
container_name = 'CC_CONT'.
ENDIF.
*create object of alv grid
IF c_alvgd IS INITIAL. ******** important
CREATE OBJECT c_alvgd
EXPORTING
i_parent = c_ccont.
ENDIF.
thanx all for your help .
| User | Count |
|---|---|
| 6 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |