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: 

Hi friends, ALV INTERACTIVE USING SET PF-STATUS.

Former Member
0 Kudos

I have normal interactive report.Which is having

SET PF-STATUS 'STATUS 1'......SET PF-STATUS'STATUS 5' PUSHBUTTONS IN APPLICATION TOOL BAR.

Now i want to convert into ALV interactive.In this report in first page (i.e in basic list) I need to place the 5 pushbttons.If i click first push button i want to display related data in ALV INTERACTIVE LIST IN FIRST INTERACTIVE PAGE.

So,in REUSE_ALV_GRID_DISPLAY FUNCTION MODULE we have SET PF-STATUS PARAMETER.

Finally how to pass this parameter in this F.M for FIVE PUSHBUTTONS.

Please help me,This is urgent requirement.And thanks for the same.

Thanks&Regards

Thummala Krishna REddy

3 REPLIES 3

former_member181962
Active Contributor
0 Kudos

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = W_REPID

I_CALLBACK_PF_STATUS_SET = 'SET_PF_STATUS'

.

.

..

FORM set_pf_status USING rt_extab TYPE slis_t_extab

SET PF-STATUS 'STATUS' EXCLUDING rt_extab.

ENDFORM.

Double click on the 'STATUS' to create a pf status with the buttons you want.

You don't need to set 5 set pf-status statemnet for 5 buttons.

One set pf-status statement is enough.

You can have multiple buttons on the application toolbar in the PF-STATUS 'STATUS'.

Regards,

Ravi

Former Member
0 Kudos

check this

Regards

Prabhu

p291102
Active Contributor
0 Kudos

Hi,

Herewith i am sending the alv interactive report.

REPORT YMS_ALVINTER.

&----


*& tables declaration

&----


TABLES: VBRK,VBRP.

&----


*& type-pools declaration

&----


TYPE-POOLS: SLIS.

&----


*& data declaration

&----


DATA: G_REPID TYPE SY-REPID.

DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV, "mara

WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV,

WA_LAYOUT TYPE SLIS_LAYOUT_ALV,

WA_EVENT TYPE SLIS_ALV_EVENT,

T_EVENT TYPE SLIS_T_EVENT.

DATA: V_VBELN LIKE VBRK-VBELN,

V_MATNR LIKE VBRP-MATNR.

DATA: BEGIN OF IT_VBRK OCCURS 0,

VBELN LIKE VBRK-VBELN,

WAERK LIKE VBRK-WAERK,

VKORG LIKE VBRK-VKORG,

FKDAT LIKE VBRK-FKDAT,

BUKRS LIKE VBRK-BUKRS,

NETWR LIKE VBRK-NETWR,

END OF IT_VBRK.

DATA: BEGIN OF IT_VBRP OCCURS 0,

VBELN LIKE VBRP-VBELN,

POSNR LIKE VBRP-POSNR,

FKIMG LIKE VBRP-FKIMG,

VRKME LIKE VBRP-VRKME,

NETWR LIKE VBRP-NETWR,

MATNR LIKE VBRP-MATNR,

ARKTX LIKE VBRP-ARKTX,

END OF IT_VBRP.

&----


*& selection screen

&----


SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME TITLE TEXT-001.

SELECT-OPTIONS: S_VBELN FOR VBRK-VBELN,

S_FKDAT FOR VBRK-FKDAT,

S_MATNR FOR VBRP-MATNR.

SELECTION-SCREEN END OF BLOCK B.

**INITIALIZATION.

INITIALIZATION.

G_REPID = SY-REPID.

S_FKDAT-LOW = SY-DATUM - 200.

S_FKDAT-HIGH = SY-DATUM.

APPEND S_FKDAT.

***AT SELECTION-SCREEN.

AT SELECTION-SCREEN.

IF NOT S_VBELN IS INITIAL.

SELECT SINGLE VBELN FROM VBRK

INTO V_VBELN

WHERE VBELN IN S_VBELN.

IF SY-SUBRC <> 0.

MESSAGE E001(ZZ2).

ENDIF.

ENDIF.

IF NOT S_MATNR IS INITIAL.

SELECT SINGLE MATNR FROM MARA

INTO V_MATNR

WHERE MATNR IN S_MATNR.

IF SY-SUBRC <> 0.

MESSAGE E001(ZZ2).

ENDIF.

ENDIF.

***START-OF-SELECTION.

START-OF-SELECTION.

PERFORM GET_DATA_VBRK.

&----


*& Form GET_DATA_VBRK

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM GET_DATA_VBRK .

SELECT VBELN

WAERK

VKORG

FKDAT

BUKRS

NETWR

INTO TABLE IT_VBRK

FROM VBRK

WHERE VBELN IN S_VBELN

AND FKDAT IN S_FKDAT.

ENDFORM. " GET_DATA_VBRK

&----


*& Form GET_DATA_VBRP

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM GET_DATA_VBRP .

SELECT VBELN

POSNR

FKIMG

VRKME

NETWR

MATNR

ARKTX

FROM VBRP

INTO TABLE IT_VBRP

WHERE VBELN = IT_VBRK-VBELN.

ENDFORM. " GET_DATA_VBRP

***END-OF-SELECTION.

END-OF-SELECTION.

PERFORM EVENT_LIST.

PERFORM GET_FIELD_CATALOG.

PERFORM LIST_DISP .

&----


*& Form list_disp

&----


  • text

----


FORM LIST_DISP .

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = G_REPID

  • I_CALLBACK_PF_STATUS_SET = 'POPUP'

I_CALLBACK_USER_COMMAND = 'USER_COMMAND'

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT = WA_LAYOUT

IT_FIELDCAT = IT_FIELDCAT

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB = IT_VBRK

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM. " LIST_DISP

&----


*& Form GET_FIELD_CATALOG

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM GET_FIELD_CATALOG .

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = G_REPID

I_INTERNAL_TABNAME = 'IT_VBRK'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = G_REPID

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

CHANGING

CT_FIELDCAT = IT_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.

ENDFORM. " GET_FIELD_CATALOG

&----


*& Form event_list

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM EVENT_LIST .

CLEAR WA_EVENT.

WA_EVENT-NAME = 'USER_COMMAND'.

WA_EVENT-FORM = 'USER_COMMAND'.

APPEND WA_EVENT TO T_EVENT.

CLEAR WA_EVENT.

ENDFORM. " event_list

&----


*& Form user_command

&----


  • text

----


  • -->R_UCOMM text

  • -->RS_SELFIELDtext

----


FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM

RS_SELFIELD TYPE SLIS_SELFIELD.

CASE R_UCOMM.

WHEN '&IC1'.

READ TABLE IT_VBRK INDEX RS_SELFIELD-TABINDEX.

PERFORM GET_DATA_VBRP.

PERFORM BUILD_FIELDCATALOG_VBRP .

PERFORM DISPLAY_ALV_VBRP.

ENDCASE.

ENDFORM. "user_command

&----


*& Form BUILD_FIELDCATALOG_VBRP

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM BUILD_FIELDCATALOG_VBRP .

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = G_REPID

I_INTERNAL_TABNAME = 'IT_VBRP'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = G_REPID

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

CHANGING

CT_FIELDCAT = IT_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.

ENDFORM. " BUILD_FIELDCATALOG_VBRP

&----


*& Form DISPLAY_ALV_VBRP

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM DISPLAY_ALV_VBRP .

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = G_REPID

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT =

IT_FIELDCAT = IT_FIELDCAT

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB = IT_VBRP

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2

.

IF SY-SUBRC <> 0.

MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM. " DISPLAY_ALV_VBRP

Thanks,

Shankar