‎2008 Jun 16 7:42 AM
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
‎2008 Jun 16 7:44 AM
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.
‎2008 Jun 16 7:46 AM
BUt
i am creating some fields automatically and some fields manuallly so how can i do for this .
PLS
‎2008 Jun 16 7:46 AM
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
‎2008 Jun 16 7:49 AM
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.