Hi,
Apologies in advance, I'm very new to ABAP.
I know there are loads of threads on this subject matter already - but I cant seem to find a solution to my issue.
I'm receiving the following error - "exception condition no_fieldcatalog_available raised"
This is my code... hopefully someone might be able to help
Many Thanks
PARAMETERS material TYPE MATNR.
PARAMETERS stor TYPE LGORT_D.
types: begin of my_type,
MATNR LIKE mard-matnr,
SERNR LIKE objk-sernr,
CHARGE LIKE EQUI-CHARGE,
WERKS LIKE mard-werks,
LGORT LIKE MARD-LGORT,
LABST LIKE MARD-LABST,
DATLWB LIKE EQUI-DATLWB,
end of my_type.
*DATA: my_type TYPE STANDARD TABLE OF ZRES_STOCK.
data it_mats type table of my_type.
data st_mats like LINE OF it_mats.
data date type d.
date = sy-datum - 7.
data: r_container type ref to CL_GUI_CUSTOM_CONTAINER,
r_grid type ref to CL_GUI_ALV_GRID.
Call SCREEN 100.
select MATNR SERNR CHARGE WERKS LGORT LABST DATLWB from ZRES_STOCK
into CORRESPONDING FIELDS OF TABLE it_mats
where MATNR = material.
* and LGORT = stor.
if sy-subrc <> 0.
write 'Error'.
ELSE.
loop at it_mats into st_mats.
write:/ st_mats-MATNR,
st_mats-SERNR,
st_mats-CHARGE,
st_mats-WERKS,
st_mats-LGORT,
st_mats-LABST,
st_mats-DATLWB.
ENDLOOP.
ENDIF.
MODULE CREATE_ALV OUTPUT.
if r_container is initial.
CREATE OBJECT R_CONTAINER
EXPORTING
CONTAINER_NAME = 'CONTAINER_1'.
IF SY-SUBRC <> 0.
ENDIF.
* Now create the instance of the ALV grid, remembering to specify
* the container control as the parent of this grid
CREATE OBJECT R_GRID
EXPORTING
I_PARENT = r_container.
IF SY-SUBRC <> 0.
* Handle any exceptions
ENDIF.
* Read the data to be output from the database
* Now we've got the data, load it into the grid and display it
* I must specify the structure name aswell as the data internal
* table
CALL METHOD R_GRID->SET_TABLE_FOR_FIRST_DISPLAY
EXPORTING
I_STRUCTURE_NAME = 'my_type'
CHANGING
IT_OUTTAB = it_mats.
* IT_FIELDCATALOG = .
IF SY-SUBRC <> 0.
ENDIF.
endif.
ENDMODULE. " STATUS_0100 OUTPUT
INCLUDE ZRESMED_STOCK_CREATE_ALVO01.