Skip to Content
0
Former Member
Dec 14, 2012 at 05:46 AM

In ALV header and data is not showing

422 Views

Hi ,

I have created one report in FI,which have to show the data,which is match with GR 55...its has to show opening balance,credit transaction, debit transaction, and closing balance.code is given below, pls correct me where I am doing wrong.

*&---------------------------------------------------------------------*

*& Report ZPAN105 *

*& *

*&---------------------------------------------------------------------*

*& *

*& *

*&---------------------------------------------------------------------*

REPORT ZPAN105.

TABLES: BSIS,KNC1.

TYPE-POOLS: SLIS.

TYPES: BEGIN OF t_BSIS,

BUKRS TYPE BSIS-BUKRS,

GJAHR TYPE BSIS-GJAHR,

MONAT TYPE BSIS-MONAT,

HKONT TYPE BSIS-HKONT,

SHKZG TYPE BSIS-SHKZG,

END OF t_BSIS.

DATA: IT_BSIS TYPE STANDARD TABLE OF t_BSIS WITH HEADER LINE,

WA_BSIS TYPE T_BSIS.

DATA: Opening_bal TYPE p DECIMALS 2.

**ALV DATA DECLARTION

DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,

gd_tab_group type slis_t_sp_group_alv,

GD_LAYOUT TYPE SLIS_LAYOUT_ALV,

GD_REPID LIKE SY-REPID.

*data declaration for sorting.

data : it_sortcat type slis_sortinfo_alv occurs 1,

wa_sort like line of it_sortcat.

data : i_list_comments type slis_t_listheader.

*header

data: t_header type slis_t_listheader,

wa_header type slis_listheader,

t_line like wa_header-info,

ld_lines type i,

ld_linesc(10) type c.

PARAMETERS: P_COCOD TYPE BSIS-BUKRS,

P_FYEAR TYPE BSIS-GJAHR.

SELECT-OPTIONS: PO_PER FOR BSIS-MONAT,

GL_AC FOR BSIS-HKONT.

select bukrs gjahr monat hkont shkzg from bsis into corresponding fields of IT_bsis

where monat in po_per.

endselect.

FIELDCATALOG-FIELDNAME = 'BUKRS'.

FIELDCATALOG-SELTEXT_M = 'Company Code'.

FIELDCATALOG-COL_POS = 0.

APPEND FIELDCATALOG TO FIELDCATALOG.

CLEAR FIELDCATALOG.

FIELDCATALOG-FIELDNAME = 'GJAHR'.

FIELDCATALOG-SELTEXT_M = 'Fiscal year'.

FIELDCATALOG-COL_POS = 1.

APPEND FIELDCATALOG TO FIELDCATALOG.

CLEAR FIELDCATALOG.

FIELDCATALOG-FIELDNAME = 'MONAT'.

FIELDCATALOG-SELTEXT_M = 'Period'.

FIELDCATALOG-COL_POS = 2.

APPEND FIELDCATALOG TO FIELDCATALOG.

CLEAR FIELDCATALOG.

FIELDCATALOG-FIELDNAME = 'HKONT'.

FIELDCATALOG-SELTEXT_M = 'GL Account'.

FIELDCATALOG-COL_POS = 3.

APPEND FIELDCATALOG TO FIELDCATALOG.

CLEAR FIELDCATALOG.

FIELDCATALOG-FIELDNAME = 'SHKZG'.

FIELDCATALOG-SELTEXT_M = 'D/C indicator'.

FIELDCATALOG-COL_POS = 4.

APPEND FIELDCATALOG TO FIELDCATALOG.

CLEAR FIELDCATALOG.

*GD_REPID = SY-REPID.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

* I_INTERFACE_CHECK = ' '

* I_BYPASSING_BUFFER = ' '

* I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = 'zpan105'

* I_CALLBACK_PF_STATUS_SET = ' '

* I_CALLBACK_USER_COMMAND = ' user_command '

I_CALLBACK_TOP_OF_PAGE = 'top-of-page'

* I_CALLBACK_HTML_TOP_OF_PAGE = ' '

* I_CALLBACK_HTML_END_OF_LIST = ' '

* I_STRUCTURE_NAME =

* I_BACKGROUND_ID = ' '

* I_GRID_TITLE = V_GRIDTITLE

* I_GRID_SETTINGS =

IS_LAYOUT = GD_LAYOUT

IT_FIELDCAT = FIELDCATALOG[]

* IT_EXCLUDING =

* IT_SPECIAL_GROUPS =

* IT_SORT = it_sortcat

* IT_FILTER =

* IS_SEL_HIDE =

I_DEFAULT = 'X'

I_SAVE = 'A'

* IS_VARIANT = G_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_bsis

* 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.

*ALV Header declarations

Form top-of-page.

* Title

wa_header-typ = 'S'.

wa_header-info = 'GL Balance as per GR 55'.

append wa_header to t_header.

clear wa_header.

* Date

* wa_header-typ = 'S'.

* wa_header-key = 'Date: '.

* CONCATENATE sy-datum+6(2) '.'

* sy-datum+4(2) '.'

* sy-datum(4) INTO wa_header-info. "todays date

* append wa_header to t_header.

* clear: wa_header.

endform.

FORM top.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

it_list_commentary = t_header.

* I_LOGO =

* I_END_OF_LIST_GRID =

.

endform.