Skip to Content
0
Former Member
Jun 21, 2007 at 11:23 AM

Very urgent report on FI

37 Views

hi all,

please help.

i have my code below , i am using bkpf , bseg tables extract data.

my last intrnal table it_bseg is getting poplulated ,but the final o/p in grid is not getting displayed.

wht 2 do?....please reply with suggestions which can enhance my performance

or which can bring me a o/p

REPORT ZBH_FI_ALV1 No Standard Page Heading.

TABLES:T001,SKA1,SKB1,BKPF,BSEG.

TYPE-POOLS:slis.

----


  • TYPES DECLARTIONS

----


TYPES:begin of str_bkpf,

blart type blart,

bukrs type bukrs,

belnr type bseg-belnr,

gjahr type gjahr,

budat type budat,

end of str_bkpf.

TYPES: begin of str_bseg,

belnr type belnr_d,

gjahr type gjahr,

buzei type buzei,

bschl type bschl,

hkont type hkont,

bukrs type bukrs,

blart type blart,

budat type bkpf-budat,

saknr type saknr,

fstag type fstag,

ktopl type ktopl,

bilkt type bilkt,

end of str_bseg.

TYPES:begin of str_t001,

bukrs type bukrs,

ktopl type ktopl,

end of str_t001.

TYPES:begin of str_ska1,

bilkt type bilkt,

ktopl type ktopl,

saknr type saknr,

end of str_ska1.

TYPES:begin of str_skb1,

fstag type fstag,

bukrs type bukrs,

saknr type saknr,

end of str_skb1.

----


  • DATA DECLARATIONS

----


DATA:it_bkpf type standard table of str_bkpf with header line,

it_bseg type standard table of str_bseg with header line,

it_t001 type table of str_t001 with header line,

it_ska1 type table of str_ska1 with header line,

it_skb1 type table of str_skb1 with header line,

fieldcat type slis_t_fieldcat_alv WITH HEADER LINE,

events type slis_t_event WITH HEADER LINE,

layout type slis_layout_alv,

ALV type SY-REPID.

data:w_index type sy-tabix.

*field-symbols:<f1> type str_bsid.

----


  • INPUT VARIABLES

----


SELECT-OPTIONS:s_BUKRS FOR BKPF-BUKRS obligatory,

s_BLART FOR BKPF-BLART obligatory,

s_BUDAT FOR BKPF-BUDAT,

s_BSCHL FOR BSEG-BSCHL,

s_HKONT FOR BSEG-HKONT.

----


  • SELECT STATEMENTS

----


START-OF-SELECTION.

select blart "Document type

bukrs "Company Code

belnr "Accounting Document Number

gjahr

budat

from bkpf

into table it_bkpf

where bukrs in s_bukrs

and blart in s_blart

and budat in s_BUDAT.

if not it_bkpf[] is initial.

select belnr

gjahr

buzei

bschl

hkont

bukrs

from bseg

into table it_bseg

for all entries in it_bkpf

where belnr = it_bkpf-belnr

and gjahr = it_bkpf-gjahr

and bukrs = it_bkpf-bukrs.

endif.

if not s_BSCHL[] is initial.

delete it_bseg where not bschl in s_bschl.

endif.

if not s_HKONT[] is initial.

delete it_bseg where not hkont in s_hkont.

endif.

if it_bseg[] is not initial.

sort it_bseg.

refresh it_t001.

SELECT bukrs "Company Code

ktopl "Chart of Accounts

from T001

into table it_t001

where bukrs in s_bukrs.

if not it_t001[] is initial.

sort it_t001.

refresh it_ska1.

SELECT bilkt "Group Account Number

ktopl "Chart of Accounts

saknr "G/L account number

from SKA1

into table it_ska1

for all entries in it_t001

where ktopl = it_t001-ktopl.

if not it_ska1[] is initial.

sort it_ska1.

refresh it_skb1.

SELECT fstag "Field status group

bukrs "Company code

saknr "G/L account number

from skb1

into table it_skb1

for all entries in it_bseg

where bukrs = it_bseg-bukrs.

endif.

endif.

endif.

loop at it_bseg.

w_index = sy-tabix.

Read Table it_t001 with key bukrs = it_bseg-bukrs.

if sy-subrc = 0.

it_bseg-ktopl = it_t001-ktopl.

if sy-subrc = 0.

Read table it_ska1 with key ktopl = it_bseg-ktopl.

it_bseg-saknr = it_ska1-saknr.

it_bseg-bilkt = it_ska1-bilkt.

if sy-subrc = 0.

Read Table it_skb1 with key bukrs = it_bseg-bukrs.

it_bseg-fstag = it_skb1-fstag.

modify it_bseg index w_index transporting ktopl bilkt saknr fstag.

endif.

endif.

endif.

endloop.

*loop at it_bsid.

*Assign it_bsid to <f1>.

*endloop.

perform field_cat.

&----


*& Form field_cat

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM field_cat .

--


DEFINING FIELDCATALOG--

fieldcat-col_pos = 1.

fieldcat-fieldname = 'BUKRS'.

fieldcat-seltext_l = 'Company Code'.

fieldcat-ref_tabname = 'it_bseg'.

APPEND fieldcat.

clear fieldcat.

fieldcat-col_pos = 2.

fieldcat-fieldname = 'BLART'.

fieldcat-seltext_l = 'Document Type'.

fieldcat-ref_tabname = 'it_bseg'.

APPEND fieldcat.

fieldcat-col_pos = 3.

fieldcat-fieldname = 'BUZEI'.

fieldcat-seltext_l = 'Number of Line Item Within Accounting Document'.

fieldcat-ref_tabname = 'it_bseg'.

APPEND fieldcat.

fieldcat-col_pos = 4.

fieldcat-fieldname = 'BSCHL'.

fieldcat-seltext_l = 'Posting Key'.

fieldcat-ref_tabname = 'it_bseg'.

APPEND fieldcat.

fieldcat-col_pos = 5.

fieldcat-fieldname = 'HKONT'.

fieldcat-seltext_l = 'General Ledger Account'.

fieldcat-ref_tabname = 'it_bseg'.

APPEND fieldcat.

fieldcat-col_pos = 6.

fieldcat-fieldname = 'BILKT'.

fieldcat-seltext_l = 'Group Account Number'.

fieldcat-ref_tabname = 'it_bseg'.

APPEND fieldcat.

fieldcat-col_pos = 7.

fieldcat-fieldname = 'FSTAG'.

fieldcat-ref_tabname = 'it_bseg'.

fieldcat-seltext_l = 'Field status group'.

APPEND fieldcat.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

  • I_CALLBACK_PROGRAM = ' '

  • 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 = 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

  • I_HTML_HEIGHT_TOP = 0

  • I_HTML_HEIGHT_END = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • IR_SALV_FULLSCREEN_ADAPTER =

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

TABLES

T_OUTTAB = it_bseg[].

  • 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. " field_cat