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: 

Recall ALV grid display

Former Member
0 Kudos

Hi,

I used ALV grid display to generate a report, the end-user will select a record from the report and press a push button so that the value will be changed automatically and will be reflected in the alv.

I have done this by recalling the alv function module. The problem is when alv FM is recalled the changed data is displayed in a new screen and when i select to GO BACK by pressing [ F3 ] im getting the old alv display screen, but i want the controll to go to the selection screen. Please help me to fix this,

Points will be awarded for helpful replies,

Regds,

Sarath.C

3 REPLIES 3

Former Member
0 Kudos

You can dop this without calling the FM again.

When u r calling the FM - REUSE_ALV_GRID_DISPLAY , pass value to the parameter I_CALLBACK_USER_COMMAND. It takes a sub routine name as input

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

  • * * *

I_CALLBACK_USER_COMMAND = 'SUB_PROC_CMD' "name of a Sub routine

  • * * *

FORM SUB_PROC_CMD USING r_ucomm LIKE sy-ucomm

rs_selfield TYPE slis_selfield.

IF SY-UCOMM = 'PROC' "Processing code of ur func.

RS_SELFIELD-REFRESH = 'X'.

ENDIF.

ENDFORM.

This will serve ur purpose. Revert back in case of problem.

Refer to documentation of the FM in case of further information.

0 Kudos

Hi SKC,

I tried but the changed data is not reflecting on the screen, only the data in the internal table is being reflected, but i want to display the changed data in the database table

0 Kudos

refer to this sample - I ve just written and is working -

*&---------------------------------------------------------------------*
*& Report  ZSKC_TEST4
*&
*&---------------------------------------------------------------------*
*&
*&
*&---------------------------------------------------------------------*

REPORT  ZSKC_TEST4.
TYPE-POOLS : SLIS.

DATA : ITAB LIKE T100 OCCURS 0 WITH HEADER LINE.
DATA : G_REPID TYPE SY-REPID.
START-OF-SELECTION.

SELECT * UP TO 10 ROWS
FROM   T100
INTO   TABLE ITAB
WHERE  SPRSL = SY-LANGU.

CHECK SY-SUBRC EQ 0.

G_REPID = SY-REPID.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    I_CALLBACK_PROGRAM             = G_REPID
    I_CALLBACK_PF_STATUS_SET       = 'SUB_PF_STAT'
    I_CALLBACK_USER_COMMAND        = 'SUB_USER_CMD'
    I_STRUCTURE_NAME               = 'T100'

  TABLES
    T_OUTTAB                       = ITAB[]
 EXCEPTIONS
   PROGRAM_ERROR                  = 1
   OTHERS                         = 2
          .
IF SY-SUBRC <> 0.
ENDIF.

FORM SUB_USER_CMD  USING r_ucomm LIKE sy-ucomm
                         rs_selfield TYPE slis_selfield.
CHECK R_UCOMM EQ 'PROC'.

*Insert 2 blank lines.
append itab.
append itab.
RS_SELFIELD-REFRESH = 'X'.

ENDFORM.

FORM SUB_PF_STAT USING rt_extab TYPE slis_t_extab.
* Copy from a Standard Prog - SAPLKKBL - STANDARD_FULLSCREEEN.
* USe SE80 and right click on the PF-STAT and copy.
  SET PF-STATUS 'PF_ALV'.
ENDFORM.