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: 

Possible functionalities in ALV

Former Member
0 Kudos

hi all

Can anyone tel me the possible functionalities in ALV..? and tel me all the fields in fieldcatalog..?

Rgds

Asha

6 REPLIES 6

Former Member
0 Kudos

hi,

1. Please give me general info on ALV.

http://www.sapfans.com/forums/viewtopic.php?t=58286

http://www.sapfans.com/forums/viewtopic.php?t=76490

http://www.sapfans.com/forums/viewtopic.php?t=20591

http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.

2. How do I program double click in ALV?

http://www.sapfans.com/forums/viewtopic.php?t=11601

http://www.sapfans.com/forums/viewtopic.php?t=23010

3. How do I add subtotals (I have problem to add them)...

http://www.sapfans.com/forums/viewtopic.php?t=20386

http://www.sapfans.com/forums/viewtopic.php?t=85191

http://www.sapfans.com/forums/viewtopic.php?t=88401

http://www.sapfans.com/forums/viewtopic.php?t=17335

4. How to add list heading like top-of-page in ABAP lists?

http://www.sapfans.com/forums/viewtopic.php?t=58775

http://www.sapfans.com/forums/viewtopic.php?t=60550

http://www.sapfans.com/forums/viewtopic.php?t=16629

5. How to print page number / total number of pages X/XX in ALV?

http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)

6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.

http://www.sapfans.com/forums/viewtopic.php?t=64320

http://www.sapfans.com/forums/viewtopic.php?t=44477

7. How can I set the cell color in ALV?

http://www.sapfans.com/forums/viewtopic.php?t=52107

8. How do I print a logo/graphics in ALV?

http://www.sapfans.com/forums/viewtopic.php?t=81149

http://www.sapfans.com/forums/viewtopic.php?t=35498

http://www.sapfans.com/forums/viewtopic.php?t=5013

9. How do I create and use input-enabled fields in ALV?

http://www.sapfans.com/forums/viewtopic.php?t=84933

http://www.sapfans.com/forums/viewtopic.php?t=69878

10. How can I use ALV for reports that are going to be run in background?

http://www.sapfans.com/forums/viewtopic.php?t=83243

http://www.sapfans.com/forums/viewtopic.php?t=19224

11. How can I display an icon in ALV? (Common requirement is traffic light icon).

http://www.sapfans.com/forums/viewtopic.php?t=79424

http://www.sapfans.com/forums/viewtopic.php?t=24512

12. How can I display a checkbox in ALV?

http://www.sapfans.com/forums/viewtopic.php?t=88376

http://www.sapfans.com/forums/viewtopic.php?t=40968

http://www.sapfans.com/forums/viewtopic.php?t=6919

Link containing all the important PDFS. ( There is a PDF for ALV Grid in this link)

http://www.easymarketplace.de/online-pdfs.php

Hope this is helpful, Do reward.

Former Member
0 Kudos

hi,

In the control, you can adjust the column width by dragging, or use the 'Optimum width' function to adjust the column width to the data currently displayed. You can also change the column sequence by selecting a column and dragging it to a new position.

Standard functions are available in the control toolbar. The details pushbutton displays the fields in the

line on which the cursor is positioned in a modal dialog box.

The sort function in the ALV Control is available for as many columns as required. You can set complex

sort criteria and sort columns in either ascending or descending order.

You can use the 'Search' function to search for a string (generic search without *) within a selected area

by line or column.

You can use the 'Sum' function to request totals for one or more numeric columns. You can then use the

"Subtotals" function to set up control level lists. Select the columns (non-numeric columns only) that you

want to use and the corresponding control level totals are displayed.

For 'Print' and 'Download' the whole list is always processed, not just the sections displayed on the

screen.

You also have the option of setting display variants.

Hope this is helpful, Do reward.

Former Member
0 Kudos

hi

good

ALV is Application List viewer.

Sap provides a set of ALV (ABAP LIST VIEWER) function modules which can be put into use to embellish the output of a report. This set of ALV functions is used to enhance the readability and functionality of any report output. Cases arise in sap when the output of a report contains columns extending more than 255 characters in length.

In such cases, this set of ALV functions can help choose selected columns and arrange the different columns from a report output and also save different variants for report display. This is a very efficient tool for dynamically sorting and arranging the columns from a report output.

The report output can contain up to 90 columns in the display with the wide array of display options.

The commonly used ALV functions used for this purpose are;

1. REUSE_ALV_VARIANT_DEFAULT_GET

2. REUSE_ALV_VARIANT_F4

3. REUSE_ALV_VARIANT_EXISTENCE

4. REUSE_ALV_EVENTS_GET

5. REUSE_ALV_COMMENTARY_WRITE

6. REUSE_ALV_FIELDCATALOG_MERGE

7. REUSE_ALV_LIST_DISPLAY

8. REUSE_ALV_GRID_DISPLAY

9. REUSE_ALV_POPUP_TO_SELECT

Purpose of the above Functions are differ not all the functions are required in all the ALV Report.

But either no.7 or No.8 is there in the Program.

How you call this function in your report?

After completion of all the data fetching from the database and append this data into an Internal Table. say I_ITAB.

Then use follwing function module.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

I_CALLBACK_PROGRAM = 'Prog.name'

I_STRUCTURE_NAME = 'I_ITAB'

I_DEFAULT = 'X'

I_SAVE = 'A'

TABLES

T_OUTTAB = I_ITAB.

IF SY-SUBRC <> 0.

WRITE: 'SY-SUBRC: ', SY-SUBRC .

ENDIF.

ENDFORM. " GET_FINAL_DATA

thanks

mrutyun^

Former Member
0 Kudos

Hi,

Please refer to the type-pools SLIS.

GO to the source code, you can find all the possible functionalities with necessary comments.

Thanks,

Sriram Ponna.

Former Member
0 Kudos

DEFININING OUTPUT CHARACTERISTICS: PREPARING DISPLAY FIELDS CATALOG

A field catalog is prepared using the internal table (I_FIELDCAT) of type SLIS_T_FIELDCAT_ALV. 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 to add desired functionality (i.e. Key, Hotspot, Specific headings, Justify, Col. position etc) to certain fields of the output. If not mentioned specifically, then the defaults are taken. The possible values and defaults are listed below.

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.

The minimal field catalog is documented below. This can be done in a routine using a local variable. The user can use the other optional parameters to assign output attributes to different fields in the output, which differ from the default.

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

1. 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. In this case the attributes of the different fields is taken directly from the table and the attributes (key fields, length, texts etc) need to state explicitly.

2. all fields in this structure are to be output

3. The structure name is passed to ALV in the parameter I_STRUCTURE_NAME of the function module REUSE_ALV_LIST_DISPLAY.

All the values entered in the catalog are specific to the particular field whose name is entered in the fieldname FIELDNAME of the fieldcat structure. The name of the table is also entered in the corr. Fieldname TABNAME of the structure.

The different possible attributes are:

· Row_pos (row position): Only relevant if the list output is to be multi-line (two or three lines) by default. So, this attribute can be used maintain certain level of alignment in the output.

Value set: 0, 1 – 3

· Col_pos (column position): This parameter is relevant when the fields in the output are to be different from the sequence of the fields in the internal table used for display. 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 internal table field sequence.

Value set: 0, 1 – 60

· Fieldname (field name): This is the name of the internal table field for which the parameters are passed in the catalog.

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

· Tabname (internal output table): Name of the internal output table that contains the field FIELDCAT-FIELDNAME above.

Value set: SPACE, internal output table name.

· Ref_fieldname (reference 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.

Value set: SPACE, Data Dictionary field name.

· Ref_tabname (reference table/structure field name): 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).

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

Link to currency unit

· Cfieldname (currency unit field name): This is used for currency fields that have a reference to any unit field. This is only relevant for amount columns with associated unit. This parameter contains the 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.

Value set: SPACE, output table field name.

· Ctabname (internal currency unit field output table): Name of the internal output table containing the FIELDCAT-CFIELDNAME field.

Value set: SPACE, output table field name.

Link to measurement unit

· Qfieldname (measurement unit 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.

Value set: SPACE, output table field name.

· Qtabname (internal measurement unit field output table): Name of the internal output table containing the FIELDCAT-QFIELDNAME field.

Value set: SPACE, output table field name.

· Outputlen (column width): This parameter is used if the desired output length for a field is desired to be different from the internal output table field. 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.

Value set: 0 (initial), n.

· Key (key column): By default, the system makes some fields in the output as key fields, provided the fields are key fields in their referencing table. Using this parameter, fields other than key fields of the referencing table can be made key field. This parameter is most important if the output needs to contain some field, which are not scrollable or cannot be hidden.

If the internal output table contains fields that are key fields from different tables, then all those fields in the report output becomes unscrollable and cannot be hidden. So, the fields in the output internal table should not be referenced from tables in which they are key fields. Instead, they should be referenced to the tables in which they are not key fields, incase they are not desired as key field in the output.

'X' = key field (key field output in color) and Key fields cannot be interactively hidden. Parameter FIELDCAT-NO_OUT must be left initial.

Value set: SPACE, 'X'.

· Key_sel (hideable key column): This parameter is only relevant for the fields which are made key fields using FIELDCAT-KEY = 'X'. Using this parameter the Key field 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.

Value set: SPACE, 'X'.

· No_out (field in field list): This parameter is used to remove certain fields from the output during initial display. The user can however interactively choose the field for output from the field list in the display variant.

'X' = field is not displayed in the current list.

Value set: SPACE, 'X'.

· Tech (technical field): This parameter is used to make certain field display only in the field catalog. The fields with this parameter set cannot be output in the list nor can they be displayed interactively from the catalog.

'X' = technical field.

Value set: SPACE, 'X'.

· Emphasize (highlight columns in color): As name suggests, this field parameter is used to highlight certain field with chosen colors.

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): This parameter is used to make certain field appear as hotspot i.e. a hand is displayed if the cursor is positioned on the field value. Single click on such fields cause the PICK OR F2 events to happen.

Value set: SPACE, 'X'.

'X' = column cells are output as hotspots.

· Fix_column (fix column): This parameter is used to fix certain columns in the output. 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.

Value set: SPACE, 'X'.

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

· Do_sum (sum over column): the user can also call this function interactively.

Value set: SPACE, 'X'.

'X' = a sum is calculated over this internal output table field.

· No_sum (sums forbidden): No sum can be calculated over this field, although the data type of the field would allow summing.

Value set: SPACE, 'X'.

· Icon: The parameter displays certain column contents as icons. The internal output table column contents must be valid icon strings.

Value set: SPACE, 'X'.

'X' = column contents to be output as an icon.

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

Value set: SPACE, 'X'

'X' = column contents are to be output as a symbol.

· Just (justification): This parameter is used for alignment of the contents of the output table. This is only relevant for CHAR or NUMC fields in the output internal table. The justification of the column header always follows the justification of the columns. Independent justification of the column header is not possible.

Value set: SPACE, 'R', 'L', and ‘C’.

' ' = Default justification for this data type

'R' = right-justified output

'L' = left-justified output

'C' = centered output.

· Lzero (leading zeros): By default ALV outputs NUMC fields right-justified without leading zeros. Using this parameter only the NUMC fields can be displayed with leading zeroes.

Value set: SPACE, 'X'.

'X' = output with leading zeros.

· No_sign (no +/- sign): This parameter is used to suppress the signs of the output fields. It is only relevant for the 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): To apply the report output formatting options same as in the WRITE statement in report writing.

Value set: SPACE, template.

PLZ REWARD IF HELPFUL

VIVEK