Application Development and Automation 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: 
Read only

Refresh ALV ( Internal Table Will Be Change)

Former Member
0 Likes
691

Hi friends

I am using 2 internal table. And they have their own field catalog. I can refresh alv grid.

If my refresh data have stuation 1 I am using Inta another stuation I am using Intb.

How can I refresh my ALV grid with different catalog and internal table?

Hi friends

I am using 2 internal table. And they have their own field catalog. I can refresh alv grid.

If my refresh data have stuation 1 I am using Inta another stuation I am using Intb.

How can I refresh my ALV grid with different catalog and internal table?

3 REPLIES 3
Read only

Former Member
0 Likes
578

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM

P_SELFLD TYPE SLIS_SELFIELD.

case p_ucomm.

when 'REFRESH'.

call the same function module with different data and

field catalog information

endcase.

ENDFORM.

Read only

0 Likes
578

Hi,

FORM USER_COMMAND USING P_UCOMM TYPE SY-UCOMM

P_SELFLD TYPE SLIS_SELFIELD.

case p_ucomm.

when 'REFRESH'.

p_selfld-refresh = 'X'.

get different data and field catalog.

endform.

regards

Olaf

Read only

Former Member
0 Likes
578

Hi,

yes you can do that,

Check this sample code, in your case you have to use two performs for display. with the help of SELFIELD-EXIT = 'X'. you can get what you want.


REPORT  ZTEST_ALV.
type-pools:slis.
DATA: GT_SFLIGHT TYPE TABLE OF SFLIGHT.
DATA: GT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
      FIELDCAT type SLIS_FIELDCAT_ALV.
data: l_layout type SLIS_LAYOUT_ALV.
SELECT * FROM SFLIGHT INTO TABLE GT_SFLIGHT.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
  EXPORTING
    I_PROGRAM_NAME         = sy-repid
    I_STRUCTURE_NAME       = 'SFLIGHT'
    I_INCLNAME             = sy-repid
  CHANGING
    CT_FIELDCAT            = gt_fieldcat
  EXCEPTIONS
    INCONSISTENT_INTERFACE = 1
    PROGRAM_ERROR          = 2
    OTHERS                 = 3.
IF SY-SUBRC <> 0.
  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.

perform alv_display.

*&--------------------------------------------------------------------*
*&      Form  status
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
form status USING P_EXTAB TYPE SLIS_T_EXTAB  .

  set pf-status 'AAA' excluding p_extab.
endform.                    "status


*&--------------------------------------------------------------------*
*&      Form  USER_COMMAND
*&--------------------------------------------------------------------*
*       text
*---------------------------------------------------------------------*
*      -->P_UCOMM    text
*      -->P_SELFIELD text
*---------------------------------------------------------------------*
FORM USER_COMMAND USING    P_UCOMM    LIKE SY-UCOMM
      P_SELFIELD TYPE SLIS_SELFIELD.
  case p_ucomm.
    when 'TEST'.

        fieldcat-no_out = 'X'.
        modify gt_fieldcat from fieldcat
               transporting no_out where fieldname = 'PRICE'.

p_selfield-exit = 'X'.
perform alv_display.
endcase.
 ENDFORM.                    "USER_COMMAND
*&---------------------------------------------------------------------*
*&      Form  alv_display
*&---------------------------------------------------------------------*
*       text
*----------------------------------------------------------------------*
FORM alv_display .
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    IS_LAYOUT                = l_layout
    I_CALLBACK_PROGRAM       = sy-repid
    I_STRUCTURE_NAME         = 'SFLIGHT'
    I_CALLBACK_PF_STATUS_SET = 'STATUS'
    I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'
    IT_FIELDCAT              = GT_FIELDCAT[]
  TABLES
    T_OUTTAB                 = GT_SFLIGHT.
ENDFORM.                    " alv_display

Regards

vijay