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: 

NO_FIELDCATALOG_AVAILABLE in ALV grid with OO for my program?

Former Member
0 Kudos

Hi Guys ,

When i am executing my ALV Grid with OO concepts i fot this type of error.

"hort text

Exception condition "NO_FIELDCATALOG_AVAILABLE" raised.

hat happened?

The current ABAP/4 program encountered an unexpected

situation.

rror analysis

A RAISE statement in the program "CL_GUI_ALV_GRID===============CP" raised the

exception

condition "NO_FIELDCATALOG_AVAILABLE".

Since the exception was not intercepted by a superior

program, processing was terminated.

Short description of exception condition:

For detailed documentation of the exception condition, use

Transaction SE37 (Function Library). You can take the called

function module from the display of active calls.

-

rigger Location of Runtime Error

Program CL_GUI_ALV_GRID===============CP

Include CL_GUI_ALV_GRID===============CM01J

Row 14

Module type (METHOD)

Module Name SET_SORT_CRITERIA"

Can anybody please tell me how to solve this problem.I am not getting field catalog populated.

Thanks,

Gopiu.

3 REPLIES 3

Former Member
0 Kudos

can u please send ur code.

0 Kudos

Hi Dinesh,

I was not getting that type of error but i was not able to see any output.

Can i know what's the reason

Here is my code

Data : grid1 type ref to cl_gui_alv_grid,

g_custom_container type ref to cl_gui_custom_container,

i_FCAT TYPE LVC_T_FCAT,

i_FCAT_str type lvc_s_fcat,

************************************************************************

Initialization.

v_repid = sy-repid.

set screen '101'.

MODULE STATUS_0101 output.

if g_custom_container is initial .

create object g_custom_container

Exporting

Container_name = 'CCCONTAINER'

Exceptions

cntl_error = 1

cntl_system_error = 2

create_error = 3

lifetime_error = 4

Others = 5.

If sy-subrc <> 0.

ENDIF.

Create Object grid1

Exporting

I_Parent = g_custom_container

Exceptions

error_cntl_create = 1

error_cntl_init = 2

error_cntl_link = 3

error_dp_create = 4

Others = 5.

If sy-subrc <> 0.

ENDIF.

Endif.

*

  • CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

  • EXPORTING

  • I_STRUCTURE_NAME = 'T_FINAL_OUT'

  • CHANGING

  • CT_FIELDCAT = i_FCAT[].

ENDMODULE.

if not grid1 is Initial.

If sy-SUBRC = 0.

Call Method grid1->set_table_for_first_display

  • Exporting I_Structure_name = 'T_FINAL_OUT'

Changing it_outtab = gt_final1[]

it_fieldcatalog = I_FCAT

Exceptions

Invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

Others = 4.

If sy-subrc <> 0.

ENDIF.

ENDIF.

Else.

if g_custom_container is initial .

create object g_custom_container

Exporting

Container_name = 'CCCONTAINER'

Exceptions

cntl_error = 1

cntl_system_error = 2

create_error = 3

lifetime_error = 4

Others = 5.

If sy-subrc <> 0.

ENDIF.

Create Object grid1

Exporting

I_Parent = g_custom_container

Exceptions

error_cntl_create = 1

error_cntl_init = 2

error_cntl_link = 3

error_dp_create = 4

Others = 5.

If sy-subrc <> 0.

ENDIF.

  • CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

  • EXPORTING

  • I_STRUCTURE_NAME = 'T_FINAL_OUT'

    • I_Program_name = v_repid

  • I_INTERNAL_TABNAME = 'I_FINAL'

  • CHANGING

  • CT_FIELDCAT = FCAT[].

i_FCAT_str-col_pos = 1.

i_FCAT_str-fieldname = 'MATNR'.

i_FCAT_str-tabname = 'I_FINAL_OUT1'.

i_fcat_str-seltext = Text-024.

append i_FCAT_str to i_FCAT.

clear i_FCAT_str.

i_FCAT_str-col_pos = 2.

i_FCAT_str-fieldname = 'GJAHR'.

i_FCAT_str-tabname = 'I_FINAL_OUT1'.

i_fcat_str-seltext = Text-012.

append i_FCAT_str to i_FCAT.

clear i_FCAT_str.

i_FCAT_str-col_pos = 3.

i_FCAT_str-fieldname = 'PERIO'.

i_FCAT_str-tabname = 'I_FINAL_OUT1'.

i_fcat_str-seltext = Text-013.

append i_FCAT_str to i_FCAT.

clear i_FCAT_str.

i_FCAT_str-col_pos = 4.

i_FCAT_str-fieldname = 'LIFNR_ND1'.

i_FCAT_str-tabname = 'I_FINAL_OUT1'.

i_fcat_str-seltext = Text-014.

append i_FCAT_str to i_FCAT.

clear i_FCAT_str

.

Call Method grid1->set_table_for_first_display

  • Exporting I_Structure_name = 'T_FINAL_OUT'

Changing it_outtab = gt_final1[]

it_fieldcatalog = I_FCAT

Exceptions

Invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

Others = 4.

If sy-subrc <> 0.

ENDIF.

Endif.

ENDIF.

i was not able to see the Output.

Can u please solve this problem.Full marks will be awarded.

Thanks,

Gopi.

0 Kudos

Hi u have called set_table_for_first_display two times in ur report. before u called it for the first time, u did not build the i_cat. so, u r getting the error.

u comment that, or build the field cat above that.