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: 

fALV_OOPS field catalog using classes

Former Member
0 Kudos

how to create and populate a fieldcatalog in ALV using Classes ?plz give sample coding example

1 ACCEPTED SOLUTION

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

data i_fieldcat TYPE lvc_t_fcat.

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

EXPORTING

  • I_BUFFER_ACTIVE =

i_structure_name = 'ZZZ_TABLE'

  • I_CLIENT_NEVER_DISPLAY = 'X'

  • I_BYPASSING_BUFFER =

CHANGING

ct_fieldcat = i_fieldcat[]

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE i000 with 'Error'.

LEAVE LIST-PROCESSING.

ENDIF.

CALL METHOD o_alvgrid->set_table_for_first_display

...

CHANGING

it_outtab = itab

it_fieldcatalog = i_fieldcat[]

  • IT_SORT =

  • IT_FILTER =

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE i278.

LEAVE LIST-PROCESSING.

ENDIF.

2 REPLIES 2

jayanthi_jayaraman
Active Contributor
0 Kudos

Hi,

data i_fieldcat TYPE lvc_t_fcat.

CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'

EXPORTING

  • I_BUFFER_ACTIVE =

i_structure_name = 'ZZZ_TABLE'

  • I_CLIENT_NEVER_DISPLAY = 'X'

  • I_BYPASSING_BUFFER =

CHANGING

ct_fieldcat = i_fieldcat[]

EXCEPTIONS

inconsistent_interface = 1

program_error = 2

OTHERS = 3.

IF sy-subrc <> 0.

MESSAGE i000 with 'Error'.

LEAVE LIST-PROCESSING.

ENDIF.

CALL METHOD o_alvgrid->set_table_for_first_display

...

CHANGING

it_outtab = itab

it_fieldcatalog = i_fieldcat[]

  • IT_SORT =

  • IT_FILTER =

EXCEPTIONS

invalid_parameter_combination = 1

program_error = 2

too_many_lines = 3

OTHERS = 4.

IF sy-subrc <> 0.

MESSAGE i278.

LEAVE LIST-PROCESSING.

ENDIF.

anversha_s
Active Contributor
0 Kudos

hi,

chk this. these are the standard programs.

go to se 38- > and take this program.

they are very good tutorials

The ALV object Grid methods allow the same functionality as ALV grid report function modules but are displayed within

a screen (dialog program). SAP has provided a suit of programs which demonstrate how to For examples see standard SAP

programs as detailed below:

BCALV_EDIT_01 This report illustrates the simplest case of using an editable/noneditable ALV Grid Control.

BCALV_EDIT_02 This report illustrates how to set chosen cells of an ALV Grid Control editable.

BCALV_EDIT_03 In this example the user may change values of fields SEATSOCC (occupied seats) and/or PLANETYPE.

The report checks the input value(s) semantically and provides protocol messages in case of error

BCALV_EDIT_04 This report illustrates how to add and remove lines to a table using the ALV Grid Control and how to

implement the saving of the new data.

BCALV_EDIT_05 This example shows how to use checkboxes within an ALV Grid Control. You learn:

(1) how to define a column for editable checkboxes for an attribute of your list

(2) how to evaluate the checked checkboxes

(3) how to switch between editable and non-editable checkboxes

BCALV_EDIT_06 This example shows how to define a dropdown listbox for all cells of one column in an editable ALV

Grid Control.

BCALV_EDIT_07 This example shows how to define dropdown listboxes for particular cells of your output table.

BCALV_EDIT_08 This report implements an ALV Grid Control with an application specific F4 help. The following aspects

are dealt with:

(1) how to replace the standard f4 help

(2) how to pass the selected value to the ALV Grid Control

(3) how to build an f4 help, whose value range depend on a value of another cell.

regards,

anver

if helped pls mark points