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: 

Refresh_table display problem

former_member421418
Participant
0 Kudos

Hi Experts,

I created editable ALV  Program.

Ctrated copy button in tool bar.

user has to select the row and click on copy based on that i am identifying the row and inserting the internal table.

using cl_gui_alv_grid->get_selectd->rows.

First time i clicked on copy it is getting copied but in second time by selecting the row and clicking copy it is not coping and not showing row.

see below code .

WHEN 'COPY'.
     v_alvgd->check_changed_data( ).
     CALL METHOD v_alvgd->get_selected_rows
       IMPORTING
         et_index_rows = lv_row
         et_row_no     = lv_id.

    READ TABLE lv_id into lv_id1 INDEX 1.


*Read table lv_id into lv_id1 INDEX 1.

lv_index1 = lv_id1-ROW_ID  .

DESCRIBE TABLE i_final LINES lv_no.

   READ TABLE i_final2 into w_final2 INDEX lv_index1.
   lv_index2 = lv_index1 + lv_no.
   INSERT w_final2 INTO i_final index lv_index2.
       i_pbo = i_final.

CALL METHOD v_alvgd->refresh_table_display
     EXPORTING
       is_stable = i_re_alv
     EXCEPTIONS
       finished  = 1
       OTHERS    = 2.
   IF sy-subrc <> 0.

Please check and let me know how to resolve it <whenever you get a chance.>

Thanks & regards

Kiran

Message was edited by: Gareth Ryan - Please don't ask for anything "urgent".  People on this forum (mostly) have a day job to do, so handling your urgent issues isn't going to be an urgent problem for them.

20 REPLIES 20

Former Member
0 Kudos

Hi Kiran,

Move this piece of code v_alvgd->check_changed_data( ). to bottom.

regards,

Archer

0 Kudos

I moved it still its not working.

Former Member
0 Kudos

hi venkat,

There is already a duplicaterow button. Why don't you use it?

Anyway to get the result as per your requirement you have to replace

lv_index2 = lv_index1 + lv_no.


with

lv_index2 = lv_index1 + 1.

0 Kudos

I used the logic you mentioned but still its not working

jayanthi_jayaraman
Active Contributor
0 Kudos

HI,

Make sure you refer the inserted table again for final table once you are done with copying the row first time. Internal table is not getting refreshed, that should be the problem. If you put breakpoint and check the final internal table getting referred, you can find this.

0 Kudos

i checked it values are coming into final internal table , I am passing the same internal table to ALV but in display it is not showing

Former Member
0 Kudos

have you set i_re_alv-row = 'X' ?

0 Kudos

Yes I am using it but still it is not working.

ipravir
Active Contributor
0 Kudos

Hi,

Try the below code.

Call method

v_ALVgrd->check_changed_data

importing

e_valid = l_valid (take a local variable to check the data changed)

changing

c_refresh = l_refresh (take a local variable to check the refresh of alv).

and

Call method

v_alvgrd->REFRESH_TABLE_DISPLAY

exporting

     I_soft_refresh = 'X'.

Remove the IS_TABLE parameter.

Regards.

Praveer.

0 Kudos

i written above code as well its not working

0 Kudos

Hi Kiran,

Try using FM 'GET_GLOBALS_FROM_SLVC_FULLSCR'.


  IF v_ALVgrd IS INITIAL.

    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'

      IMPORTING

        E_GRID = v_ALVgrd.

  ENDIF.

  IF NOT v_ALVgrd IS INITIAL.

    CALL METHOD v_ALVgrd->check_changed_data

  ENDIF.

ipravir
Active Contributor
0 Kudos

Hi,

As per your requirement, I have made the same logic and it's working fine.

Please find the above logic and it's working fine.

regards.

Praveer.

0 Kudos

Hi Praveen,

No problem with the code its working fine here problem with refresh.

suppose in output i got one line.

first i selected the row and copied it is coping and displaying the 2 rows with the above code you mentioned.

again i am selecting and coping the row this time that copied row is not displaying . Actually it should display 3 row but displaying only 2 rows.

even in final internal table also  showing 3 rows  while displaying only 2 rows.

0 Kudos

Hi Praveen,

Can you try with your code by coping 2 or 3 times weather it is displaying correctly or not.

ipravir
Active Contributor
0 Kudos

Hi,

Problem with Refresh, I am not clear with this, how it could be problem with Refresh, it's a standard Program / Method. And if it's working 1st time, then it should work second and time also.

The code, what I have provided, I have executed same as your scenario, and I am able to get the same output, what exist in internal table.

Regards.

Praveer.

0 Kudos

This message was moderated.

ipravir
Active Contributor
0 Kudos

Hi,

You can reach me on <any contact details that are set to public in my profile as I won't share contact details in posts any more>

Regards.

Praveer.

Message was edited by: Gareth Ryan - Please don't share contact details in posts.

Former Member
0 Kudos

Can you provide me your contact details so that i will call you


Hi,

You can reach me on ipra**** @gmail.com

We are not suppose to discuss anything on your personal mailing address using SCN. Please next time onwards don't ask and share personal mailing address.

ipravir
Active Contributor
0 Kudos

Hi,

Use the below code to refresh and copy the records in internal table.


And in PBO of screen.

Regards.

Praveer.

Former Member
0 Kudos

hi venkat,

This is my code which is working fine.

You can try it by changing your code as per this code:

WHEN 'COPY'.

        DATA: lv_row   TYPE   LVC_T_ROW,
              LS_ROW          TYPE  LVC_S_ROW.
        DATA: ls_data    TYPE ts_data,
              lv_no TYPE I,
              lv_index1 TYPE i,
              lv_index2 type i.


         go_grid->check_changed_data( ).
         CALL METHOD go_grid->get_selected_rows
         IMPORTING
            et_index_rows = lv_row.           
       
        LOOP AT  lv_row INTO LS_ROW   .
               READ TABLE   gt_data  INTO ls_data  INDEX LS_ROW-INDEX.

               lv_index1 = LS_ROW-INDEX  .

               lv_index2 = lv_index1 + 1.
               INSERT LS_DATA INTO GT_DATA INDEX lv_index2.
        ENDLOOP.
 
       CALL METHOD go_grid->refresh_table_display.