cancel
Showing results for 
Search instead for 
Did you mean: 

FIELD CAT USAGE?

Former Member
0 Kudos

HI EXPERTS,

CAN ANY BODY EXPLAIN ME ABT THE USAGE OF FIELD CAT IN ALV.

PLEASE DESCRIBE ME ABOUT FIELDCAT USAGE AND FUNCTIONS OF FIELDCAT IN ALV.

THANKS,

SAKTHI

*VALUABLE POSTS WILL BE REWARDED--*

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Field cataloge is to create columna heading. In this you need to fill an internal table which contains the heading of all the fields which needs to be displayed. e.g.: customer no, Customer name etc.

Field_catalog:

Field catalog with field descriptions

2.7.1. Description

Field catalog containing descriptions of the list output fields (usually a subset of the internal output table fields). A field catalog is required for every ALV list output.

The field catalog for the output table is built-up in the caller's coding. The build-up can be completely or partially automated by calling the REUSE_ALV_FIELDCATALOG_MERGE module

See also the documentation of the function module REUSE_ALV_FIELDCATALOG_MERGE.

The minimal field catalog is documented under 'default'. The caller can use the other optional parameters to assign output attributes to a field which differ from the default.

A field catalog need not be built-up and passed explicitly only under the following conditions:

• The internal table to be output has the same structure as a Data Dictionary structure which is referred to in the internal table declaration using LIKE or INCLUDE STRUCTURE.

• all fields in this structure are to be output

• the structure name is passed to ALV in the parameter I_STRUCTURE_NAME.

See also the documentation of the IMPORTING paramter I_STRUCTURE_NAME.

Positioning

• row_pos (row position)

value set: 0, 1 - 3

Only relevant if the list output is to be multi-line (two or three lines) by default.

A multi-line list can also be defined by the user interactively if the default list is one-line.

The parameter specifies the relative output line of the column in a multi-line list.

• col_pos (column position)

value set: 0, 1 - 60

only relevant when the default relative column positions differ from the field catalog field sequence. The parameter specifies the relative column position of the field in the list output. The column order can be changed interactively by the user. If this parameter is initial for all field catalog entries, columns appear in the field catalog field sequence.

Identification

• fieldname (field name)

value set: internal output table field name (required parameter)

Name of the internal output table field which is described by this field catalog entry

• tabname (internal output table)

value set: SPACE, internal output table name

This parameter is used in 'manual' field catalog build-up only for hierarchical-sequential lists.

Name of the internal output table which contains the field FIELDCAT-FIELDNAME.

Data Dictionary reference

• ref_fieldname (reference field name)

value set: SPACE, Data Dictionary field name

Name of the Data Dictionary field referred to.

This parameter is only used when the internal output table field described by the current field catalog entry has a reference to the Data Dictionary (not a program field), and the field name in the internal output table is different from the name of the field in the Data Dictionary. If the field names are identical, naming the Data Dictionary structure or table in the FIELDCAT-REF_TABNAME parameter is sufficient.

• ref_tabname (reference table/structure field name)

value set: SPACE, name of a Data Dictionary structure or table

Structure or table name of the referred Data Dictionary field.

This parameter is only used when the internal output table field described by the current field catalog entry has a Data Dictionary reference (not a program field).

Reference to fields with currency/measurement unit

Each internal output table sum or quantity field whose decimal places are to be formatted appropriately for the unit in the list must follow the convention:

• the field is of data type QUAN or CURR (internal type P) (the field must really have this physical data type. Overwriting the physical data type with the parameter FIELDCAT-DATATYPE has no effect)

• There is a field in the internal output table which contains the associated unit.

• There is also an entry in the field catalog for the unit field.

(If the unit is not to appear as a column in the list, and cannot be interactively displayed as a column, e.g. because it is always unambiguous and is therefore explicitly output by the caller in the list header, the field catalog units field entry can take the parameter FIELDCAT-TECH = 'X'.

The association of a value field to a unit affects the output as follows:

• appropriate decimal places display for the unit

• an initialized field with a link to a non-initial unit is output as '0' for the unit (if FIELDCAT-NO_ZERO is initial). When this field is summed, this unit affects whether the units are homogeneous.

• an initialized field with a link to an initial unit is output as SPACE. When this field is summed, the unit SPACE does not affect the homogeneity of the units.

• When non-initial fields with an initial unit are summed, the unit SPACE is considered to be a unit.

Link to currency unit

• cfieldname (currency unit field name)

value set: SPACE, output table field name

Only relevant for amount columns with associated unit.

Name of the internal output table field containing the currency unit associated with the amount field FIELDCAT-FIELDNAME. The field in FIELDCAT-CFIELDNAME must have its own field catalog entry.

• ctabname (internal currency unit field output table)

value set: SPACE, output table field name

only relevant for hierarchical-sequential lists

Name of the internal output table containing the FIELDCAT-CFIELDNAME field.

Link to measurement unit

• qfieldname (measurement unit field name)

value set: SPACE, output table field name

only relevant for quantity columns with unit link.

Name of the internal output table field containing the measurement unit associated with the quantity field FIELDCAT-FIELDNAME.

The field in FIELDCAT-QFIELDNAME must have its own field catalog entry.

• qtabname (internal measurement unit field output table)

value set: SPACE, output table field name

only relevant for hierarchical-sequential lists

Name of the internal output table containing the FIELDCAT-QFIELDNAME field.

Column output options

• outputlen (column width)

value set: 0 (initial), n

For fields with a Data Dictionary link this parameter can be left initial.

For fields without a Data Dictionary link (program field) the parameter must be given the value of the desired field list output length (column width).

initial = column width is the output length of the referred Data Dictionary field (domain).

n = column width is n characters

• key (key column)

value set: SPACE, 'X' 'X' = kex field (key field output in color)

Key fields can not be interactively hidden. Parameter FIELDCAT-NO_OUT must be left initial.

For exceptions see the documentation of the FIELDCAT-KEY_SEL parameter.

• key_sel (hideable key column)

value set: SPACE, 'X'

only relevant when FIELDCAT-KEY = 'X'

Key field which can be hidden interactively.

The key column sequence cannot be changed interactively by the user.

The output is controlled by the FIELDCAT-NO_OUT parameter analogously to non-key fields.

• no_out (field in field list)

value set: SPACE, 'X' 'X' = field is not displayed in the current list.

The user can interactively choose the field for output from the field list.

The user can display the contents of these fields at line level using the 'Detail' function.

See also the 'Detail screen' documentation of the parameter IS_LAYOUT.

• tech (technical field)

value set: SPACE, 'X' 'X' = technical field

Field cannot be output in the list and cannot be displayed interactively.

Field can only be used in the field catalog (not in IT_SORT, ...).

• emphasize (highlight columns in color)

value set: SPACE, 'X' or 'Cxyz' (x:'1'-'9'; y,z: '0'=off '1'=on)

'X' = column is colored with the default column highlight color.

'Cxyz' = column is colored with a coded color:

• C: Color (coding must begin with C)

• x: color number

• y: bold

• z: inverse

• hotspot (column as hotspot)

value set: SPACE, 'X'

'X' = column cells are output as hotspots

• fix_column (fix column)

value set: SPACE, 'X'

Not relevant for block lists (output of several lists consecutively)

'X' = column fixed (does not scroll horizontally)

All columns to be fixed must have this flag, starting from the left. If a column without this flag is output, only the columns to the left of this column are fixed. The user can change the column fixing interactively. See also the documentation of the Layout parameter

IS_LAYOUT-NO_KEYFIX of the IMPORTING paramter IS_LAYOUT.

• do_sum (sum over column)

value set: SPACE, 'X' 'X' = a sum is to be calculated over this internal output table field.

This function can also be called by the user interactively.

• no_sum (sums forbidden)

value set: SPACE, 'X' 'X' = no sum can be calculated over this field, although the data type of the field would allow summing.

• input (column ready for input)

Function not available

Format column contents

• icon

value set: SPACE, 'X' 'X' = column contents to be output as an icon.

The caller must consider the printability of icons.

• symbol

value set: SPACE, 'X' 'X' = column contents are to be output as a symbol.

The internal output table column must be a valid symbol character.

The caller must consider the printability of symbols.

Symbols can usually be printed, but may not always be output correctly, depending on the printer configuration.

• just (justification)

value set: SPACE, 'R', 'L', 'C'

Only relevant for fields of data type CHAR or NUMC

' ' = default justification for this data type

'R' = right-justified output

'L' = left-justified output

'C' = centered output

The justification of the column header always follows the justification of the columns. Independent justification of the column neader is not possible.

• lzero (leading zeros)

value set: SPACE, 'X'

Only relevant for fields of data type NUMC

ALV outputs NUMC fields right-justified without leading zeros by default.

'X' = output with leading zeros

Note: If a NUMC field is output left-justified or centered by FIELDCAT-JUST, leading zeros are output. If the output of leading zeros is suppressed by a Data Dictionary reference ALPHA conversion exit, the output is always left-justified.

• no_sign (no +/- sign) Only relevant for value fields

value set: SPACE, 'X' 'X' = value output without +/ sign

• no_zero (suppress zeros) Only relevant for value fields

value set: SPACE, 'X' 'X' = suppress zeros

• edit_mask (field formatting)

value set: SPACE, template

template = see documentation of WRITE formatting option USING EDIT MASK template

The output conversion conv can be made by template = '== conv'.

Texts

The following text parameters should be specified for program fields without a Data Dictionary reference. The texts are taken from the Data Dictionary for fields with a Data Dictionary reference. If this is not desired, the text parameters can also be specified. The Data Dictionary texts are then ignored. If the user changes the column width interactively, the column header text with the appropriate length is always used. The interactive function 'Optimize column width' takes account of both the field contents and the column headers: if all field contents are shorter than the shortest column header, the column width depends on the column header.

The 'long field label' is also used in display variant definition, sort, etc. popups.

• seltext_l (long field label)

• seltext_m (medium field label)

• seltext_s (short field label)

• reptext_ddic (header)

analogous to the Data element maintenance 'Header'

The specified text is not necessarily output in the list, an optimum among all texts is sought.

• ddictxt (specify text)

value set: SPACE, 'L', 'M', 'S'

You can specify with values 'L', 'M', and 'S', the keyword that should always be used as column header. If the column width changes, no attempt is made in this case to find an appropriate header for the new output width.

Parameters for program fields without Data Dictionary reference

see also 'Text' parameters

• datatype (data type)

value set: SPACE, Data Dictionary data type (CHAR, NUMC,...)

Only relevant for fields without Data Dictionary reference

Program field data type

• ddic_outputlen (external output length)

value set: 0 (initial), n

Only relevant for fields without Data Dictionary reference whose output is nevertheless to be modified by a conversion exit.

Prerequisites:

• FIELDCAT-EDIT_MASK = '==conv'

see also the documentation of the parameter FIELDCAT-EDIT_MASK

• FIELDCAT-INTLEN = n

see also the documentation of the parameter FIELDCAT-INTLEN

n = external format field output length

The column width FIELDCAT-OUTPUTLEN need not be the same as the external format output length (FIELDCAT-DDIC_OUTPUTLEN).

• intlen (internal output length)

value set: 0 (initial), n

Only relevant for fields without Data Dictionary reference whose output is nevertheless to be modified by a conversion exit.

Prerequisites:

• FIELDCAT-EDIT_MASK = '==conv'

see also the documentation of the parameter FIELDCAT-EDIT_MASK

• FIELDCAT-DDIC_OUTPUTLEN = n

see also the documentation of the parameter FIELDCAT-DDIC_OUTPUTLEN

n = internal format field output length

• rollname (data element)

value set: SPACE, Data Dictionary data element name

F1 help can be provided for a program field without a Data Dictionary reference, or F1 help which differs from the Data Dictionary help can be provided for a field with a Data Dictionary reference, using this parameter.

When F1 help is called for this field, the documentation of the specified data element is displayed.

If the FIELDCAT-ROLLNAME is initial for fields with a Data Dictionary reference, the documentation of the data element of the referred Data Dictionary field is output.

Others

• sp_group (field group key)

value set: SPACE, CHAR(1)

Field group key.

Keys are assigned to group names in the IT_SPECIAL_GROUPS parameter (see also the documentation of the parameter IT_SPECIAL_GROUPS).

When such an assignment is made in the field catalog and in IT_SPECIAL_GROUPS, the fields are grouped correspondingly in the display variant popup.

• reprep (Report/Report interface selection criterion)

value set: SPACE, 'X'

Prerequisites:

• The system contains the Report/Report interface (function group RSTI, table TRSTI)

• Parameter LAYOUT-REPREP = 'X'

(see also the documentation of the parameter LAYOUT-REPREP of the IMPORTING parameter IS_LAYOUT )

'X' = When the Report/Report interface is called, the value of this field is passed in the selected interface start record as a selection criterion.

2.7.2. Default

• The following entries are usually sufficient for internal table fields with a reference to a field defined in the Data Dictionary :

• fieldname

• ref_tabname

Notes:

ALV gets the remaining information from the Data Dictionary.

If no relative column position (COL_POS) is specified, the fields are output in the list in the order in which they were added to the field catalog.

REF_FIELDNAME need only be specifid when the name of the internal table field differs from the name of the referred Data Dictionary field.

Information which is explicitly entered in the field catalog is not overwritten by information from the Data Dictionary.

Priority rule:

Entries in the field catalog have priority over differing entries in the Data Dictionary.

• The following entries are usually sufficient for internal table fields without a reference to the Data Dictionary (program fields):

• fieldname

• outputlen

• datatype

• seltext_s

• seltext_m

• seltext_l

Notes:

F1 help can be provided for program fields by assigning a data element to the parameter ROLLNAME.

If the parameters SELTEXT_S, SELTEXT_M, SELTEXT_L, and REPTEXT_DDIC contain appropriate field labels, the program field column headers are also adjusted appropriately when the column width changes.

Answers (7)

Answers (7)

Former Member
0 Kudos

HI

it is used to format the output fileds like write in classical report

Hi,

STEPS

1) Add a field CHECKBOX to your internal table..

2) In the layout structure pass BOX_FIELDNAME = 'CHECKBOX'..and then pass the layout structure to the ALV function module..

3) Modify the internal table row with CHECKBOX = 0.

Check this sample code..

TYPE-POOLS: slis.

DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv.

DATA: s_fieldcatalog TYPE slis_fieldcat_alv.

DATA: s_layout TYPE slis_layout_alv.

DATA: BEGIN OF itab OCCURS 0,

vbeln TYPE vbeln,

checkbox TYPE c,

END OF itab.

DATA: v_repid TYPE syrepid.

START-OF-SELECTION.

  • Get the data.

SELECT vbeln UP TO 100 ROWS

FROM vbak

INTO CORRESPONDING FIELDS OF TABLE itab.

IF sy-subrc <> 0.

MESSAGE s208(00) WITH 'No data found'.

LEAVE LIST-PROCESSING.

ENDIF.

v_repid = sy-repid.

  • Modify the check box.

LOOP AT itab.

ITAB-checkbox = 0.

MODIFY ITAB.

ENDLOOP.

CLEAR: s_fieldcatalog.

s_fieldcatalog-col_pos = '2'.

s_fieldcatalog-fieldname = 'VBELN'.

s_fieldcatalog-tabname = 'ITAB'.

s_fieldcatalog-rollname = 'VBELN'.

APPEND s_fieldcatalog TO t_fieldcatalog.

  • Set the layout.

s_layout-box_fieldname = 'CHECKBOX'.

CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'

EXPORTING

i_callback_program = v_repid

is_layout = s_layout

it_fieldcat = t_fieldcatalog[]

TABLES

t_outtab = itab.

ENDFORM.

Former Member
0 Kudos

Hi,

1.Field catalog is used to display number of colums in the output window.

2.We can change the columns order in display by using Field catalog.

3.If we want display any Hotspot in any one field we can give for individual field

This is the example progrm to Field Catalog.

REPORT ZE0232_ALV_SAMPLE.

TYPE-POOLS: SLIS.

TABLES: KNA1.

DATA: HEADER TYPE SLIS_T_LISTHEADER,

WA TYPE SLIS_LISTHEADER.

*DATA: I_KNA1 LIKE KNA1 OCCURS 0 WITH HEADER LINE.

DATA: BEGIN OF I_KNA1 OCCURS 0,

KUNNR LIKE KNA1-KUNNR,

LAND1 LIKE KNA1-LAND1,

NAME1 LIKE KNA1-NAME1,

END OF I_KNA1.

TYPE-POOLS: SLIS.

DATA: I_REPID LIKE SY-REPID.

DATA: I_FLDCAT TYPE SLIS_T_FIELDCAT_ALV.

I_REPID = SY-REPID.

SELECT KUNNR LAND1 NAME1 FROM KNA1 INTO CORRESPONDING FIELDS OF TABLE

I_KNA1 WHERE LAND1 = 'IN'.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = I_REPID

I_INTERNAL_TABNAME = 'I_KNA1'

I_INCLNAME = I_REPID

CHANGING

CT_FIELDCAT = I_FLDCAT

EXCEPTIONS

INCONSISTENT_INTERFACE = 1

PROGRAM_ERROR = 2

OTHERS = 3

.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = I_REPID

IT_FIELDCAT = I_FLDCAT

TABLES

T_OUTTAB = I_KNA1

EXCEPTIONS

PROGRAM_ERROR = 1

OTHERS = 2.

IF SY-SUBRC <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

IF HELPFULL REWARD

Former Member
0 Kudos

Hi Sakthi,

Fieldcatalog is describtion of fields structure for output fields list,

This function module is used to populate a fieldcatalog which is essential to display the data in ALV. If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter(I_structure_name) in the <b>REUSE_ALV_LIST_DISPLAY</b>. But in other cases we need to create it.

The important parameters are:

1. Export:

a. I_program_name : report id

b. I_internal_tabname : the internal output table

c. I_inclname : include or the report name where all the dynamic forms are handled.

2. Changing

ct_fieldcat : an internal table with the type <b>SLIS_T_FIELDCAT_ALV</b> which is declared in

the type pool <b>SLIS</b>.

Regards,

Vijay

Former Member
0 Kudos

hI sakthi,

Field catalogue is the internal table which holds characteristics and value of the field u want to display in the output...

u need to declare a int table as..

DATA: t_fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE.

perform fill_fields_of_fieldcatalog...

FORM fill_fields_of_fieldcatalog TABLES fp_t_fieldcatalog STRUCTURE

t_fieldcatalog

USING fp_table

fp_field

fp_key

fp_text

fp_out_len

fp_pos.

fp_t_fieldcatalog-tabname = fp_table.

fp_t_fieldcatalog-fieldname = fp_field.

fp_t_fieldcatalog-seltext_l = fp_text.

fp_t_fieldcatalog-key = fp_key.

fp_t_fieldcatalog-outputlen = fp_out_len.

fp_t_fieldcatalog-col_pos = fp_pos.

APPEND fp_t_fieldcatalog.

CLEAR: fp_t_fieldcatalog.

fp_pos = fp_pos + 1.

ENDFORM. " FILL_FIELDS_OF_FIELDCATALOG

then in the FM alv

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = w_repid

is_layout = gs_layout

it_fieldcat = t_fieldcatalog[]

it_sort = w_sort

i_save = 'A'

it_events = gt_events[]

TABLES

t_outtab = t_final

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno

WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.

ENDIF.

Regards,

Kaveri

former_member188829
Active Contributor
0 Kudos

Deleted..

Message was edited by:

Vishnu Reddy

Former Member
0 Kudos

hi,

fieldcat is used to define Output format in ALV means How many columns u want, with which column heading, from which table and all that.

TYPE-POOLS:slis.

TABLES:mara,

makt,

marc.

DATA:BEGIN OF itab OCCURS 0,

matnr LIKE mara-matnr,

maktx LIKE makt-maktx,

werks LIKE marc-werks,

mtart LIKE mara-mtart,

matkl LIKE mara-matkl,

meins LIKE mara-meins,

ntgew LIKE mara-ntgew,

  • rowcolor(4) TYPE c,

cellcolors TYPE lvc_t_scol,

END OF itab.

DATA:<b>t_fcat TYPE slis_t_fieldcat_alv</b>,

t_eve TYPE slis_t_event.

DATA : st_layout TYPE slis_layout_alv.

SELECTION-SCREEN:BEGIN OF BLOCK blk1 WITH FRAME TITLE text-001.

SELECT-OPTIONS:mat FOR mara-matnr. " no intervals no-extension.

*PARAMETERS:mat LIKE mara-matnr.

SELECTION-SCREEN:END OF BLOCK blk1.

INITIALIZATION.

PERFORM build_cata USING t_fcat.

PERFORM build_event.

START-OF-SELECTION.

PERFORM data_retrieval.

PERFORM display_data.

&----


*& Form build_cata

&----


  • text

----


  • -->TEMP_FCAT text

----


FORM build_cata USING temp_fcat TYPE slis_t_fieldcat_alv.

<b>DATA:wa_fcat TYPE slis_fieldcat_alv.

wa_fcat-tabname = 'ITAB'.

wa_fcat-fieldname = 'MATNR'.

wa_fcat-seltext_m = 'Material'.

APPEND wa_fcat TO temp_fcat.

wa_fcat-tabname = 'ITAB'.

wa_fcat-fieldname = 'MAKTX'.

wa_fcat-seltext_m = 'Description'.

wa_fcat-fix_column = 'x'.

wa_fcat-key = 'X'. "To color a column

APPEND wa_fcat TO temp_fcat.

wa_fcat-tabname = 'ITAB'.

wa_fcat-fieldname = 'WERKS'.

wa_fcat-seltext_m = 'Plant'.

wa_fcat-key = ' '.

APPEND wa_fcat TO temp_fcat.

wa_fcat-tabname = 'ITAB'.

wa_fcat-fieldname = 'MTART'.

wa_fcat-seltext_m = 'Type'.

APPEND wa_fcat TO temp_fcat.

wa_fcat-tabname = 'ITAB'.

wa_fcat-fieldname = 'MATKL'.

wa_fcat-seltext_m = 'Group'.

APPEND wa_fcat TO temp_fcat.

wa_fcat-tabname = 'ITAB'.

wa_fcat-fieldname = 'MEINS'.

wa_fcat-seltext_m = 'Measurement Unit'.

APPEND wa_fcat TO temp_fcat.

wa_fcat-tabname = 'ITAB'.

wa_fcat-fieldname = 'NTGEW'.

wa_fcat-seltext_m = 'Net Value'.

APPEND wa_fcat TO temp_fcat.</b>

ENDFORM. "build_cata

&----


*& Form build_event

&----


  • text

----


FORM build_event.

CALL FUNCTION 'REUSE_ALV_EVENTS_GET'

EXPORTING

i_list_type = 0

IMPORTING

et_events = t_eve

EXCEPTIONS

list_type_wrong = 1

OTHERS = 2.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM. "build_event

&----


*& Form data_retrieval

&----


  • text

----


FORM data_retrieval.

SELECT maramatnr maramtart maramatkl marameins mara~ntgew

maktmaktx marcwerks

INTO CORRESPONDING FIELDS OF TABLE itab

FROM mara INNER JOIN makt ON

maramatnr = maktmatnr

INNER JOIN marc ON

maramatnr = marcmatnr

WHERE mara~matnr IN mat.

SORT itab BY matnr.

DELETE ADJACENT DUPLICATES FROM itab.

ENDFORM. "data_retrieval

&----


*& Form display_data

&----


  • text

----


FORM display_data.

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

*******************************For setting Cell Color*******************************************

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

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

i_callback_program = 'ZALV_DS'

is_layout = st_layout

i_save = 'A'

<b>it_fieldcat = t_fcat</b>

it_events = t_eve

TABLES

t_outtab = itab

EXCEPTIONS

program_error = 1

OTHERS = 2.

IF sy-subrc <> 0.

  • MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO

  • WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.

ENDIF.

ENDFORM. "display_data

former_member188829
Active Contributor
0 Kudos