Hello,
I am strugling with a report. I use the REUSE_ALV_FIELDCATALOG_MERGE quite often, and it never caused any troubles until now. I basically copy pasted the alv functionality from another report, however this time it doesnt work. Maybe some of you can look at it and identify the obvious mistake I cant see. I cannot find any solution in other topics.
Here is a code abstract (report is made in 72characters lines):
...
type-pools: slis.
...
*/ final internal table definition
TYPES:
begin of POMTAB,
BSART like EKKO-BSART,
EBELN like EKKO-EBELN,
EBELP like EKPO-EBELP,
LIFNR like EKKO-LIFNR,
FRGKE like EKKO-FRGKE,
FRGZU like EKKO-FRGZU,
FRGSX like EKKO-FRGSX,
LUSER like EBAN-AFNAM,
LADAT like EBAN-BEDAT,
AUSER like EBAN-AFNAM,
HUSER like EBAN-AFNAM,
ERNAM like EKKO-ERNAM,
AEDAT like EKKO-AEDAT,
WERKS like EKPO-WERKS,
BEDNR like EKPO-BEDNR,
MATNR like EKPO-MATNR,
TXZ01 like EKPO-TXZ01,
MENGE like EKPO-MENGE,
MEINS like EKPO-MEINS,
NETPR like EKPO-NETPR,
PEINH like EKPO-PEINH,
NETWR like EKPO-NETWR,
KNTTP like EKPO-KNTTP,
KOSTL like EKKN-KOSTL,
AUFNR like EKKN-AUFNR,
line_color(4) type c, "Used to store row color attribute
end of POMTAB.
DATA: I type POMTAB,
ITAB type standard table of POMTAB with header line.
*/ the code follows...
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: c_user_command TYPE slis_formname VALUE 'USER_COMMAND'....
*/ selection is made and the final internal table is filled, so I try to build the ALV
perform build_fieldcatalog.
perform build_layout.
perform display_alv_report.
form build_fieldcatalog.
DATA: w_repid type sy-repid.
move sy-repid to w_repid.*/ I tried to pass the sy-repid directly to the function, no success
*&---------------------------------------------------------------------*
*& Form BUILD_FIELDCATALOG
*&---------------------------------------------------------------------*
* Build Fieldcatalog for ALV Report
*----------------------------------------------------------------------*
form build_fieldcatalog.
DATA: w_repid type sy-repid.
move sy-repid to w_repid.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
EXPORTING
i_program_name = w_repid
i_internal_tabname = 'ITAB'
i_inclname = w_repid
i_bypassing_buffer = 'X'
CHANGING
ct_fieldcat = fieldcatalog[]
EXCEPTIONS
inconstistent_interface = 1
program_error = 2
other = 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.*/..and got no fieldcatalog
Any help appreciated.
Thank you.