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: 

Reuse_Alv_Grid_Display - Refresh - Cursor Issue

maulik
Contributor
0 Kudos

I did do a basic search but couldn't find anything relevant and thought maybe some gurus here may have the answer.

I have used REUSE_ALV_GRID_DISPLAY with a hotspot.

The hotspot allows to navigate to a standard SAP Transaction.

After coming back from the Transaction. I do a refresh to change the row color.

The refresh resets the cursor and displays the list from row one.

Is there a way to do a refresh but not reset the cursor.

Appreciate any pointers or help you can provide.

Regards,

Maulik

1 ACCEPTED SOLUTION

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

I think that you will have to use a combination of these function modules to get the current scroll info, then refresh your grid, then set the scroll info. Check the parameter IS_GRID_SCROLL.

REUSE_ALV_GRID_LAYOUT_INFO_GET

REUSE_ALV_GRID_LAYOUT_INFO_SET

Regards,

Rich Heilman

4 REPLIES 4

RichHeilman
Developer Advocate
Developer Advocate
0 Kudos

I think that you will have to use a combination of these function modules to get the current scroll info, then refresh your grid, then set the scroll info. Check the parameter IS_GRID_SCROLL.

REUSE_ALV_GRID_LAYOUT_INFO_GET

REUSE_ALV_GRID_LAYOUT_INFO_SET

Regards,

Rich Heilman

0 Kudos

Thank you Rich,

It definitely got me started....

This is what I did, but it still did not work.

I tried other combinations with & without initializing e_grid_scroll.

I know I'm missing something very trivial.

Will continue tomorrow with this idea.

However, if I'm headed in the wrong directions, I can take a smack on my wrist.

1)Get the Layout info.

CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'

IMPORTING

ES_LAYOUT = er_layout

ET_FIELDCAT = er_fieldcat[]

ES_GRID_SCROLL = e_grid_scroll

EXCEPTIONS

NO_INFOS = 1

PROGRAM_ERROR = 2

OTHERS = 3.

2) Set color 'C500' in er_output_tab-color

Modify er_output_tab.

3) Clear e_grid_scroll

4) Set the Layout info.

CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_SET'

IMPORTING

IS_LAYOUT = er_layout

IET_FIELDCAT = er_fieldcat[]

IS_GRID_SCROLL = e_grid_scroll.

5) rs_selfield-refresh = 'X'.

0 Kudos

I think you are on your way. I am confident that this will solve your problem. Please come back and let us know how it turns out.

REgards,

Rich Heilman

0 Kudos

Thank you Rick. Appreciate your help.

Additionally, it needed a flag

rs_selfield-row_stable = 'X'.

Step 1: Get Layout Info


  CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_GET'
   IMPORTING
     ES_LAYOUT                 = er_layout
     ET_FIELDCAT               = er_fieldcat[]
     ES_GRID_SCROLL            = e_grid_scroll
   EXCEPTIONS
     NO_INFOS                  = 1
     PROGRAM_ERROR             = 2
     OTHERS                    = 3.

Step 2: Process ET_OUTPUT_TAB.

Change ET_OUTPUT_TAB-COLOR

MODIFY ET_OUTPUT_TAB.

Step 3: Initialize e_grid_scroll

Step 4: Set Layout Info

      
     CALL FUNCTION 'REUSE_ALV_GRID_LAYOUT_INFO_SET'
        IMPORTING
          IS_LAYOUT                 = er_layout
          IT_FIELDCAT               = er_fieldcat[]
          IS_GRID_SCROLL            = e_grid_scroll.

Step 5: Set Refresh


rs_selfield-refresh    = 'X'.

Step 6: Set Row_Stable

      
rs_selfield-row_stable = 'X'.