Skip to Content
0
Former Member
Dec 21, 2007 at 07:57 AM

Unable to get the standrad tool bar in the ALV grid..

12 Views

Hi All,

i have devveloed a report, but i am unable to get the standard tool bar with optins like sort sum etc...in my ALV. please check the below code and let me know why its not happening.. More over i am addding two custom buttons in the toolbar. you can check the below code.

----


FORM FM_DISP_REPORT .

*-Sub Routine to fill color data

perform FM_FILL_COLOR.

*-Sub Routine to build feild catalog

perform FM_FILL_CATALOG.

*-Sub Routine To Write Report

perform FM_BUILD_REPORT.

ENDFORM. " FM_DISP_REPORT

&----


*& Form FM_FILL_CATALOG

&----


  • text

----


FORM FM_FILL_CATALOG .

IT_LAYOUT-COLWIDTH_OPTIMIZE = C_X.

IT_LAYOUT-INFO_FIELDNAME = 'COLOR_LINE'.

WA_FCAT-COL_POS = 0.

WA_FCAT-FIELDNAME = 'KLVAR'.

WA_FCAT-TABNAME = 'IT_KKPA'.

WA_FCAT-SELTEXT_L = 'Costing Variant'(H01).

WA_FCAT-OUTPUTLEN = 4.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_FCAT.

WA_FCAT-COL_POS = 1.

WA_FCAT-FIELDNAME = 'MATNR'.

WA_FCAT-TABNAME = 'IT_KEPA'.

WA_FCAT-SELTEXT_L = 'Material Number'(H02).

WA_FCAT-OUTPUTLEN = 18.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_FCAT.

WA_FCAT-COL_POS = 2.

WA_FCAT-FIELDNAME = 'WERKS'.

WA_FCAT-TABNAME = 'IT_KKPA'.

WA_FCAT-SELTEXT_L = 'Plant'(H03).

WA_FCAT-OUTPUTLEN = 4.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_FCAT.

WA_FCAT-COL_POS = 3.

WA_FCAT-FIELDNAME = 'TVERS'.

WA_FCAT-TABNAME = 'IT_KKPA'.

WA_FCAT-SELTEXT_L = 'Costing Version'(H04).

WA_FCAT-OUTPUTLEN = 2.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_FCAT.

WA_FCAT-COL_POS = 4.

WA_FCAT-FIELDNAME = 'STLAN'.

WA_FCAT-TABNAME = 'IT_KKPA'.

WA_FCAT-SELTEXT_L = 'BOM Usage'(H08).

WA_FCAT-OUTPUTLEN = 1.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_FCAT.

WA_FCAT-COL_POS = 5.

WA_FCAT-FIELDNAME = 'KADAT'.

WA_FCAT-TABNAME = 'IT_KKPA'.

WA_FCAT-SELTEXT_L = 'Costing From Date'(H05).

WA_FCAT-OUTPUTLEN = 10.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_FCAT.

WA_FCAT-COL_POS = 6.

WA_FCAT-FIELDNAME = 'BIDAT'.

WA_FCAT-TABNAME = 'IT_KKPA'.

WA_FCAT-SELTEXT_L = 'Costing To Date'(H06).

WA_FCAT-OUTPUTLEN = 10.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_FCAT.

WA_FCAT-COL_POS = 7.

WA_FCAT-FIELDNAME = 'BWDAT'.

WA_FCAT-TABNAME = 'IT_KKPA'.

WA_FCAT-SELTEXT_L = 'Costing Date'(H09).

WA_FCAT-OUTPUTLEN = 10.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_FCAT.

WA_FCAT-COL_POS = 8.

WA_FCAT-FIELDNAME = 'MESSAGE'.

WA_FCAT-TABNAME = 'IT_KKPA'.

WA_FCAT-SELTEXT_L = 'Message Text'(H07).

WA_FCAT-OUTPUTLEN = 200.

APPEND WA_FCAT TO IT_FCAT.

CLEAR WA_FCAT.

ENDFORM. " FM_FILL_CATALOG

&----


*& Form FM_BUILD-REPORT

&----


  • text

----


FORM FM_BUILD_REPORT .

SORT IT_KKPA_DATA BY FLAG MATNR WERKS.

*- CALL ABAP LIST VIEWER (ALV)

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = SY-REPID

I_CALLBACK_PF_STATUS_SET = 'FM_GUI_STAT'

I_CALLBACK_USER_COMMAND = 'FM_STAT'

IS_LAYOUT = IT_LAYOUT

IT_FIELDCAT = IT_FCAT

TABLES

T_OUTTAB = IT_KKPA_DATA.

ENDFORM. " FM_BUILD_REPORT

&----


*& Form FM_GUI_STAT

&----


  • text

----


FORM FM_GUI_STAT USING RT_EXTAB TYPE SLIS_T_EXTAB.

SET PF-STATUS 'STATUS_ALV1'.

ENDFORM. "FM_GUI_STAT

&----


*& Form FM_STAT

&----


  • text

----


FORM FM_STAT USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE SLIS_SELFIELD.

CASE R_UCOMM.

WHEN '&EXF'.

V_EXE_FLAG = C_X.

EXPORT V_EXE_FLAG TO MEMORY ID 'V_EXE_FLAG'.

SUBMIT ZCOCOI004_COSTEST_BDC AND RETURN.

PERFORM FM_SUB_FOREGROUND.

WHEN '&EXB'.

V_EXE_FLAG = C_Y.

EXPORT V_EXE_FLAG TO MEMORY ID 'V_EXE_FLAG'.

SUBMIT ZCOCOI004_COSTEST_BDC AND RETURN.

ENDCASE.

ENDFORM. "FM_STAT

-


please check and let me know the propable reason for not geting standard tool bar with optins like sort sum etc...

Many Thanks,

Raghu.