11-19-2007 7:06 PM
I get the following error when I use FM REUSE_ALV_GRID_DISPLAY:
"Field catalog not found".
I realize that it is looking for the parameter it_fieldcat but I don't remember ever passing that parameter before; it also says that it is optional. Below is my call to the FM. Does the addition of it_sort mean that I must pass it_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 = it_fieldcat
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS =
it_sort = it_sort
* IT_FILTER =
* IS_SEL_HIDE =
* I_DEFAULT = 'X'
* I_SAVE = ' '
* IS_VARIANT =
* IT_EVENTS =
* IT_EVENT_EXIT =
* is_print = 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_out
* EXCEPTIONS
* PROGRAM_ERROR = 1
* OTHERS = 2
.
Davis
11-19-2007 7:21 PM
populate the catalogue table as follows
CLEAR alv_fieldcat_line.
alv_fieldcat_line-fieldname = 'PERNR'. " Name of the field
alv_fieldcat_line-tabname = 'it_out'. " Name of the internal table
alv_fieldcat_line-seltext_m = 'Personnel number'. " Lable of the field
alv_fieldcat_line-hotspot = ' '.
APPEND alv_fieldcat_line TO it_fieldcat. " Append the field to the it_fieldcat table
A
11-19-2007 7:08 PM
Hi,
Please check this line and I think should be uncommented.
it_fieldcat = it_fieldcat
Regards,
Ferry Lianto
11-19-2007 7:16 PM
Ferry,
It is asking for something to be passed but so I put that in there but I don't have it populated so I commented it out. I am not sure what I need to populate in that table or if I need to populate it at all.
Davis
11-19-2007 7:21 PM
You need to populat it for your all internal table.
DATA: WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
DATA: T_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
WA_FIELDCAT-COL_POS = 1.
WA_FIELDCAT-FIELDNAME = 'FIELD1.
WA_FIELDCAT-TABNAME = 'T_FINAL_TAB'.
WA_FIELDCAT-SELTEXT_L = L_SELTEXT_L.
APPEND WA_FIELDCAT TO T_FIELDCAT.
Fill this table T_FIELDCAT for all the fields which you want to display in the output.
Pass the field table T_FIELDCAT to the ALV.
Regards,
Naimesh Patel
11-19-2007 7:21 PM
populate the catalogue table as follows
CLEAR alv_fieldcat_line.
alv_fieldcat_line-fieldname = 'PERNR'. " Name of the field
alv_fieldcat_line-tabname = 'it_out'. " Name of the internal table
alv_fieldcat_line-seltext_m = 'Personnel number'. " Lable of the field
alv_fieldcat_line-hotspot = ' '.
APPEND alv_fieldcat_line TO it_fieldcat. " Append the field to the it_fieldcat table
A
11-19-2007 8:05 PM
Amandeep,
Thanks a lot for that code. I was doing just what you posted except I was doing it inside a loop so my it_fieldcat had too many entries.
Thanks a lot!
Davis
11-19-2007 7:41 PM
Why don't you read the documentation for the FM? It's quite helpful.
Rob
11-19-2007 7:44 PM
Rob,
Don't you think that it was the first thing that I did? Thanks for your input though.
Everybody else,
Thanks for the tips; I'll take a look at what you posted shortly.
Davis
11-19-2007 7:58 PM
Davis,
I dont know how much it will be of help to you. But this is how I used in one of my programs.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
I_BACKGROUND_ID = 'ALV_BACKGROUND'
I_CALLBACK_PROGRAM = G_REPID
* I_STRUCTURE_NAME = 'SFLIGHT'
IS_LAYOUT = GS_LAYOUT
IT_FIELDCAT = f_cat[]
* IT_EXCLUDING =
* IT_SPECIAL_GROUPS = GT_SP_GROUP[]
* IT_SORT = GT_SORT[]
* IT_FILTER =
* IS_SEL_HIDE =
* i_default = g_default
I_SAVE = G_SAVE
IS_VARIANT = G_VARIANT
IT_EVENTS = GT_xEVENTS
* IT_EVENT_EXIT =
* IS_PRINT = GS_PRINT
* I_SCREEN_START_COLUMN = 0
* I_SCREEN_START_LINE = 0
* I_SCREEN_END_COLUMN = 0
* I_SCREEN_END_LINE = 0
* IMPORTING
* E_EXIT_CAUSED_BY_CALLER =
TABLES
T_OUTTAB = bestand.
Regards
Aneesh.
11-19-2007 8:01 PM
Didn't the documentation help?
You can also do a where used list to see how it is called.
Rob
11-19-2007 8:07 PM
The documentation told me how to use it but it still wasn't working. It wasn't until I checked my code with the posted code that I realized I had my code in a loop so it was appending too many lines to the table.
Davis
11-19-2007 8:09 PM