Application Development and Automation 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: 
Read only

fieldcatalog

Former Member
0 Likes
545

HI ,

in CALL METHOD ob_grid1->set_table_for_first_display

method how we can delcare the fieldcatalog , manually i created field catalog how we can pass this to this method ,

i am getting NO_FIELDCATALOG_FOUND exception ,

i am creating fieldcatalog automatically through " REUSE_ALV_FIELDCATALOG_MERGE "

so how this fieldcatalog will assing in this method.

pls tell me

4 REPLIES 4
Read only

Former Member
0 Likes
516

Hi,

Create a structure same the internal table used for fieldcatalog in SE11 and pass the structure to I_STRUCTURE expotr parameter of fieldcatalog merge FM.

Thanks,

Sriram Ponna.

Read only

0 Likes
516

BUt

i am creating some fields automatically and some fields manuallly so how can i do for this .

PLS

Read only

Former Member
0 Likes
516

CALL METHOD cls_grid->set_table_for_first_display

EXPORTING

is_layout = ws_layout

i_save = 'A'

CHANGING

it_outtab = t_soheaderdata[]

it_fieldcatalog = t_fieldcat[].

in this delete 'cls_grid' and give ur grid name

Read only

vinod_vemuru2
Active Contributor
0 Likes
516

Hi Chayaa,

When u use ABAP Objects u have to buid the field cat in different manner. U can't use REUSE ALV FMS for this.

Declare ur field cat table like below.


DATA: i_fieldcat       TYPE STANDARD TABLE OF lvc_s_fcat.
DATA: wa_fieldcat TYPE lvc_s_fcat.
FORM fieldcat USING fname tname pos edit.
  CLEAR wa_fieldcat.
  wa_fieldcat-fieldname = fname.
  wa_fieldcat-tabname   = tname.
  wa_fieldcat-scrtext_l = fname.
  wa_fieldcat-scrtext_m = fname.
  wa_fieldcat-scrtext_s = fname.
  wa_fieldcat-just      = ' '.
  wa_fieldcat-col_pos   = pos.
  wa_fieldcat-edit = edit.
  APPEND wa_fieldcat TO i_fieldcat.
ENDFORM.                    " fieldcat

  CALL METHOD grid->set_table_for_first_display
*    EXPORTING
*      is_layout                     = wa_layout
    CHANGING
      it_outtab                     = i_mara
      it_fieldcatalog               = i_fieldcat
    EXCEPTIONS
      invalid_parameter_combination = 1
      program_error                 = 2
      too_many_lines                = 3
      OTHERS                        = 4.
  IF sy-subrc <> 0.
*   MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
*              WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
  ENDIF.

Thanks,

Vinod.