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: 

ALV REPORT

Former Member
0 Kudos

Hi everyone,

I have a doubt. I wrote the following code and while executing i am getting an error "fieldcatalog not found".. Please do help out.

type-pools : SLIS.

tables : aufk,afih,iflot,ordpar.

data : int_fcat type SLIS_T_FIELDCAT_ALV.

data i_repid like sy-repid.

data : begin of i_iflot occurs 0,

tplnr like iflot-tplnr,

end of i_iflot,

begin of i_aufk occurs 0,

aufnr like afih-aufnr,

end of i_aufk,

begin of i_afih occurs 0,

aufnr like afih-aufnr,

end of i_afih,

begin of it_output occurs 0,

pwert like ordpar-pwert,

waers like ordpar-waers,

end of it_output.

DATA : BEGIN OF i_tree OCCURS 0.

INCLUDE STRUCTURE iflo.

DATA : END OF i_tree.

DATA : ITAB LIKE I_TREE OCCURS 0 WITH HEADER LINE.

select-options : s_catgry for aufk-category, "obligatory,

s_auart for aufk-auart,

s_ilart for afih-ilart,

s_termab for sy-datum, "obligatory,

s_tplnr for iflot-tplnr,

s_iwerk for afih-iwerk,

s_ingpr for afih-ingpr.

parameters : chk_func as checkbox.

*if chk_func = 'X'.

*perform r_select_orders_heirarchy.

*else.

*perform r_select_orders.

*endif.

*

*form r_select_orders_heirarchy.

select tplnr from iflot into table i_iflot where tplnr in s_tplnr.

CALL FUNCTION 'FUNC_LOCATION_ARRAY'

EXPORTING

SELFIELD = 'TPLNR'

  • SPRAS = SY-LANGU

TABSTRUCTURE = 'IFLO'

TABLES

iflo_sel = I_IFLOT

iflo_tab = i_tree

  • EXCEPTIONS

  • NO_ENTRY_FOUND = 1

  • READ_ERROR = 2

  • SELECTION_NOT_POSSIBLE = 3

  • STRUCTURE_NOT_POSSIBLE = 4

  • OTHERS = 5

.

IF sy-subrc <> 0.

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

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

ENDIF.

i_repid = sy-repid.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

  • I_PROGRAM_NAME = i_repid

I_INTERNAL_TABNAME = 'I_TREE'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = i_repid

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

CHANGING

ct_fieldcat = int_fcat

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

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 = 'IFLO'

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

  • IS_LAYOUT =

  • IT_FIELDCAT = int_fcat

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

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

8 REPLIES 8

Former Member
0 Kudos

i think in ur reuse_alv_grid_display function module the field catalog is still commented, so pls remove the * b4 field catalog

abdulazeez12
Active Contributor
0 Kudos

Uncomment the program name parameter

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

<b> I_PROGRAM_NAME = i_repid</b>

I_INTERNAL_TABNAME = 'I_TREE'

  • I_STRUCTURE_NAME =

Former Member
0 Kudos

hi,

i think it will show u debugging error.

y because in AUFK table no field name is CATEGORY..

I THINK SO..

regards

baskaran

Former Member
0 Kudos

hi deepayan,

this might be useful.

remove the comment from * I_PROGRAM_NAME = i_repid

and instead of using i_repid use the actual program name eg. 'ZTEST_PROG'.

do the same with I_INCLNAME = i_repid also.

Former Member
0 Kudos

Hi,

<b>* IT_FIELDCAT = int_fcat</b>

Remove the * and try again.

Thanks,

Reward If Helpful.

Former Member
0 Kudos

u have to creste a structure in se11 with the same fields as in I_TREE......bcoz ......for alv's if the db tab exists in database u can directly give that tab name in tables parameter........but in u r scenario u r retriving frm different tables......so create a structure similar to i_tree and pass the z structure name in I_STRUCTURE_NAME parameter

reward points if helpful......

Former Member
0 Kudos

remove the comment from i_program_name

regards

Giridhar Yadav

Former Member
0 Kudos

hi deepayan,

create a data statement as this:

DATA: lt_fieldcat TYPE slis_t_fieldcat_alv,

lf_fieldcat TYPE slis_fieldcat_alv.

repeat these few lines for all fields u want to be displayed.

CLEAR lf_fieldcat.

lf_fieldcat-fieldname = 'field name'.

lf_fieldcat-ref_tabname = 'table name'.

lf_fieldcat-ref_fieldname = 'field name'.

APPEND lf_fieldcat TO lt_fieldcat.

and now in the function call uncomment the it_fieldcat n the i_callback_program

also put

IT_FIELDCAT = lt_fieldcat

I_CALLBACK_PROGRAM = program name

in the call

hopefully this will help u.

regards,

sohi