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: 

question about the "goback" opterations in ALV GRID control.

Former Member
0 Kudos

Hi everyone,

I have a little situation here:

in my ALV ,I deactive some of the standard toolbar functions and add one button of mine

on the toolbar. I leave 3 standard toolbar functions: insert a row ,delete a row and go back.

after I used standard toolbar functions to insert/delete a row, I can use the function "go back" and

It really goes back to the previous status. But after I used my own button(the function is insert a

row too) to insert a row, I can never go back to the previous status by pressing the button "go back".

I want to know why and how can I make my own button able to go back.

thanks for your help.

2 REPLIES 2

Former Member
0 Kudos

Hi Aoron,

I think you are using a custom pf status instead of the standard one . Now you have to handle the operations that should be carried out when user selects each of these. If you are using object oriented ALV, this should be handled in the PAI of the screen.

CASE ok_code.

WHEN 'BACK'.

LEAVE SCREEN.

ENDCASE.

Hope this helps you.

Thanks,

Deepti

Former Member
0 Kudos

see example

  • Button > : displays the next N records *

  • Button < : displays the previous N records *

  • Button I< : displays the first page *

  • Button >I : displays the last page *

  • When the buttons Sort up, sort down, Filter, Delete Filter are *

  • pressed, N record are still displayed

-


FORM f_read_data USING u_ucomm TYPE syucomm.

STATICS :

l_1 TYPE sytabix,

l_2 TYPE sytabix.

DATA l_max TYPE sytabix. " Internal table size

DESCRIBE TABLE gt_mara_ftr LINES l_max.

CASE u_ucomm.

WHEN c_first_page. " 1st page

l_1 = 1.

WHEN c_prev_page. " Previous page

SUBTRACT p_max FROM l_1.

IF l_1 < 1.

l_1 = 1.

ENDIF.

WHEN c_next_page. " Next page

IF l_1 IS INITIAL.

l_1 = 1.

ELSE.

ADD p_max TO l_1.

ENDIF.

IF l_1 > l_max.

l_1 = l_max.

ENDIF.

WHEN c_last_page. " Last page

l_1 = l_max - p_max + 1.

IF l_1 < 1.

l_1 = 1.

ENDIF.

ENDCASE.

l_2 = l_1 + p_max - 1.

IF l_2 > l_max.

l_2 = l_max.

ENDIF.

REFRESH gt_mara.

IF l_max > 0.

APPEND LINES OF gt_mara_ftr FROM l_1

TO l_2

TO gt_mara.

ENDIF.

ENDFORM. " F_READ_DATA

-


FORM user_command USING u_ucomm TYPE syucomm

us_selfield TYPE slis_selfield. "#EC CALLED

CASE u_ucomm.

WHEN c_first_page OR c_next_page OR

c_prev_page OR c_last_page. " Page F, P, N, L

PERFORM f_read_data USING u_ucomm. " Update gt_mara

us_selfield-refresh = 'X'.

WHEN '&OUP' OR '&ODN'. " Sort

PERFORM f_sort_big_table.

PERFORM f_read_data USING c_first_page.

us_selfield-refresh = 'X'.

WHEN '&ILT'. " Filter

PERFORM f_filter_data.

PERFORM f_read_data USING c_first_page.

us_selfield-refresh = 'X'.

WHEN '&ILD'. " Delete filter

gt_mara_ftr[] = gt_mara_all[].

PERFORM f_read_data USING c_first_page.

us_selfield-refresh = 'X'.

ENDCASE.

ENDFORM. " USER_COMMAND