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 PF-STATUS update

Former Member
0 Kudos

Hi All,

I am using REUSE_ALV_GRID_DISPLAY and assigning my own PF-STATUS using callback pf status form (i_callback_pf_status_set) . I want to deactivate some button of this PF-STATUS based on some condition which will be determined after USER_COMMAND .

I coded SET PF-STATUS ... EXCLUDING... in USER_COMMAND but it is not getting reflected on screen.

Anyone have any idea...

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi Pawan,

Set RS_SELFIELD-REFRESH = 'X'. in the user_command routine. This one will trigger the subroutine set for I_CALLBACK_PF_STATUS_SET.

Here is the sample code.

  • Global data declaration

INCLUDE VSD11TOP.

DATA FLAG .

  • Initialization fieldcatalog

INITIALIZATION.

G_REPID = SY-REPID.

PERFORM FIELDCAT_INIT USING GT_FIELDCAT[].

  • Data selection

START-OF-SELECTION.

PERFORM SELECT_DATA TABLES GT_OUTTAB.

  • Display list

END-OF-SELECTION.

  • Set options: Save variants userspecific or general

  • A = U & X, U = userspecific, X = general user

G_SAVE = 'A'.

PERFORM VARIANT_INIT.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = G_REPID

I_CALLBACK_PF_STATUS_SET = G_STATUS

I_CALLBACK_USER_COMMAND = G_USER_COMMAND

I_SAVE = G_SAVE

IS_VARIANT = G_VARIANT

IT_FIELDCAT = GT_FIELDCAT[]

TABLES

T_OUTTAB = GT_OUTTAB.

*----


  • FORM PF_STATUS_SET

*----


FORM STANDARD_02 USING EXTAB TYPE SLIS_T_EXTAB.

DATA : LS_EXTAB TYPE SLIS_EXTAB.

IF FLAG IS INITIAL.

SET PF-STATUS 'STANDA02' OF PROGRAM 'BALVSD11' EXCLUDING EXTAB.

FLAG = 'X'.

ELSE.

LS_EXTAB-FCODE = 'WAHL'.

APPEND LS_EXTAB TO EXTAB.

SET PF-STATUS 'STANDA02' OF PROGRAM 'BALVSD11' EXCLUDING EXTAB.

ENDIF.

ENDFORM. "STANDARD_02

*----


  • FORMS

*----


  • Initialization fieldcatalog

FORM FIELDCAT_INIT

USING RT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.

DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-TABNAME = G_TABNAME.

LS_FIELDCAT-FIELDNAME = 'CARRID'.

LS_FIELDCAT-KEY = 'X'. "sets key field

APPEND LS_FIELDCAT TO RT_FIELDCAT.

Let me know, if u have any issues,

Best Regards,

Vijay

4 REPLIES 4

Former Member
0 Kudos

Hi Pawan,

Set PF-STATUS should work.

Check the following code for sample:

DATA: LW_EXTAG TYPE SLIS_EXTAB.

CLEAR LW_EXTAG.

LW_EXTAG-FCODE = GC_POST.

APPEND LW_EXTAG TO RT_EXTAG.

SET PF-STATUS GC_ZSTATUS EXCLUDING RT_EXTAG.

If it doesn't work, please post the code sample

Regards,

Phani

Message was edited by: Phani Kumar Sivapuram

Former Member
0 Kudos

Hi Pawan,

Set RS_SELFIELD-REFRESH = 'X'. in the user_command routine. This one will trigger the subroutine set for I_CALLBACK_PF_STATUS_SET.

Here is the sample code.

  • Global data declaration

INCLUDE VSD11TOP.

DATA FLAG .

  • Initialization fieldcatalog

INITIALIZATION.

G_REPID = SY-REPID.

PERFORM FIELDCAT_INIT USING GT_FIELDCAT[].

  • Data selection

START-OF-SELECTION.

PERFORM SELECT_DATA TABLES GT_OUTTAB.

  • Display list

END-OF-SELECTION.

  • Set options: Save variants userspecific or general

  • A = U & X, U = userspecific, X = general user

G_SAVE = 'A'.

PERFORM VARIANT_INIT.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = G_REPID

I_CALLBACK_PF_STATUS_SET = G_STATUS

I_CALLBACK_USER_COMMAND = G_USER_COMMAND

I_SAVE = G_SAVE

IS_VARIANT = G_VARIANT

IT_FIELDCAT = GT_FIELDCAT[]

TABLES

T_OUTTAB = GT_OUTTAB.

*----


  • FORM PF_STATUS_SET

*----


FORM STANDARD_02 USING EXTAB TYPE SLIS_T_EXTAB.

DATA : LS_EXTAB TYPE SLIS_EXTAB.

IF FLAG IS INITIAL.

SET PF-STATUS 'STANDA02' OF PROGRAM 'BALVSD11' EXCLUDING EXTAB.

FLAG = 'X'.

ELSE.

LS_EXTAB-FCODE = 'WAHL'.

APPEND LS_EXTAB TO EXTAB.

SET PF-STATUS 'STANDA02' OF PROGRAM 'BALVSD11' EXCLUDING EXTAB.

ENDIF.

ENDFORM. "STANDARD_02

*----


  • FORMS

*----


  • Initialization fieldcatalog

FORM FIELDCAT_INIT

USING RT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.

DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-TABNAME = G_TABNAME.

LS_FIELDCAT-FIELDNAME = 'CARRID'.

LS_FIELDCAT-KEY = 'X'. "sets key field

APPEND LS_FIELDCAT TO RT_FIELDCAT.

Let me know, if u have any issues,

Best Regards,

Vijay

Former Member
0 Kudos

Hi Pawan,

Sorry, Here is the complete sample source code .

  • Global data declaration

INCLUDE VSD11TOP.

DATA FLAG .

  • Initialization fieldcatalog

INITIALIZATION.

G_REPID = SY-REPID.

PERFORM FIELDCAT_INIT USING GT_FIELDCAT[].

  • Data selection

START-OF-SELECTION.

PERFORM SELECT_DATA TABLES GT_OUTTAB.

  • Display list

END-OF-SELECTION.

  • Set options: Save variants userspecific or general

  • A = U & X, U = userspecific, X = general user

G_SAVE = 'A'.

PERFORM VARIANT_INIT.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = G_REPID

I_CALLBACK_PF_STATUS_SET = G_STATUS

I_CALLBACK_USER_COMMAND = G_USER_COMMAND

I_SAVE = G_SAVE

IS_VARIANT = G_VARIANT

IT_FIELDCAT = GT_FIELDCAT[]

TABLES

T_OUTTAB = GT_OUTTAB.

*----


  • FORM PF_STATUS_SET

*----


FORM STANDARD_02 USING EXTAB TYPE SLIS_T_EXTAB.

DATA : LS_EXTAB TYPE SLIS_EXTAB.

IF FLAG IS INITIAL.

SET PF-STATUS 'STANDA02' OF PROGRAM 'BALVSD11' EXCLUDING EXTAB.

FLAG = 'X'.

ELSE.

LS_EXTAB-FCODE = 'WAHL'.

APPEND LS_EXTAB TO EXTAB.

SET PF-STATUS 'STANDA02' OF PROGRAM 'BALVSD11' EXCLUDING EXTAB.

ENDIF.

ENDFORM. "STANDARD_02

*----


  • FORMS

*----


  • Initialization fieldcatalog

FORM FIELDCAT_INIT

USING RT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.

DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV.

CLEAR LS_FIELDCAT.

LS_FIELDCAT-TABNAME = G_TABNAME.

LS_FIELDCAT-FIELDNAME = 'CARRID'.

LS_FIELDCAT-KEY = 'X'. "sets key field

APPEND LS_FIELDCAT TO RT_FIELDCAT.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = G_REPID

I_INTERNAL_TABNAME = G_TABNAME

I_STRUCTURE_NAME = 'SIMLISTRUC'

I_CLIENT_NEVER_DISPLAY = 'X'

CHANGING

CT_FIELDCAT = RT_FIELDCAT.

ENDFORM. "fieldcat_init

  • Data selection

FORM SELECT_DATA

TABLES RT_OUTTAB LIKE GT_OUTTAB[].

SELECT DISTINCT SCARRCARRID SCARRCARRNAME

SPFLICONNID SPFLICITYFROM

SPFLIAIRPFROM SPFLICITYTO

SPFLIAIRPTO SPFLIDEPTIME

SPFLIARRTIME SPFLIDISTANCE

SPFLI~DISTID

INTO (RT_OUTTAB-CARRID, RT_OUTTAB-CARRNAME,

RT_OUTTAB-CONNID, RT_OUTTAB-CITYFROM,

RT_OUTTAB-AIRPFROM, RT_OUTTAB-CITYTO,

RT_OUTTAB-AIRPTO, RT_OUTTAB-DEPTIME,

RT_OUTTAB-ARRTIME, RT_OUTTAB-DISTANCE,

RT_OUTTAB-DISTID)

FROM SCARR INNER JOIN SPFLI

ON SCARRCARRID = SPFLICARRID

WHERE SCARR~CARRID BETWEEN 'AA' AND 'LH'.

APPEND RT_OUTTAB.

ENDSELECT.

ENDFORM. "SELECT_DATA

----


  • FORM USER_COMMAND *

----


FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD.

DATA: L_TA TYPE SY-TCODE VALUE 'SLIS_DUMMY'.

*

CASE R_UCOMM.

WHEN 'WAHL'. "menubutton

RS_SELFIELD-REFRESH = 'X'.

WHEN '&IC1'. "doubleclick

ENDCASE.

ENDFORM. "USER_COMMAND

&----


*& Form VARIANT_INIT

&----


FORM VARIANT_INIT.

CLEAR G_VARIANT.

G_VARIANT-REPORT = G_REPID.

ENDFORM. " VARIANT_INIT

Best Regards,

Vijay

Former Member
0 Kudos

Hi Vijay ,

This works... Thanks A lot...

Pawan.