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

alv

Former Member
0 Likes
1,307

hi,

what for slis_layout_alv is used?

Regards,

siri

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,152

Hi

It is used to for defining the layout of your ALV report

like

ls_layout TYPE slis_layout_alv.

and we define different paramters of this layout like

ls_layout-group_change_edit = 'X'.

ls_layout-colwidth_optimize = 'X'.

ls_layout-zebra = 'X'.

ls_layout-detail_popup = 'X'.

ls_layout-get_selinfos = 'X'.

ls_layout-max_linesize = '200'.

Reward points if useful

Regards

Anji

hi,

what for slis_layout_alv is used?

Regards,

siri

6 REPLIES 6
Read only

sreeramkumar_madisetty
Active Contributor
0 Likes
1,152

Hi

<b>alv_layout TYPE slis_layout_alv.</b>

Based on this declaration only we can ccreate the ALV Report.

Regards,'

Sree

Read only

Former Member
0 Likes
1,152

Hi,

that is for setting the layout of the alv input.

see the below example.

&----


*& Report ZBHALV_LIST1 *

*& *

&----


*& *

*& *

&----


REPORT ZBHALV_LIST1.

TABLES:MARA.

SELECT-OPTIONS: MATNR FOR MARA-MATNR.

DATA:BEGIN OF ITAB OCCURS 0,

MATNR LIKE MARA-MATNR,

ERSDA LIKE MARA-ERSDA,

MTART LIKE MARA-MTART,

MBRSH LIKE MARA-MBRSH,

END OF ITAB.

SELECT * FROM MARA INTO CORRESPONDING FIELDS OF TABLE ITAB WHERE MATNR

IN MATNR.

TYPE-POOLS SLIS.

DATA:FCAT TYPE slis_t_fieldcat_alv.

DATA:LAYOUT TYPE slis_layout_alv.

DATA:EVE TYPE slis_t_event WITH HEADER LINE.

DATA:HEAD TYPE slis_t_listheader WITH HEADER LINE.

DATA:SORT TYPE slis_t_sortinfo_alv WITH HEADER LINE.

SORT-UP = 'X'.

SORT-SPOS = 1.

SORT-FIELDNAME = 'ERSDA'.

SORT-tabname = 'MARA'.

APPEND SORT.

SORT-SPOS = 2.

SORT-FIELDNAME = 'MTART'.

SORT-tabname = 'MARA'.

APPEND SORT.

EVE-NAME = 'TOP_OF_PAGE'.

EVE-FORM = 'TOPOFPAGE'.

APPEND EVE.

EVE-NAME = 'TOP_OF_LIST'.

EVE-FORM = 'TOPOFLIST'.

APPEND EVE.

EVE-NAME = 'END_OF_LIST'.

EVE-FORM = 'ENDOFLIST'.

APPEND EVE.

LAYOUT-ZEBRA = 'X'.

LAYOUT-no_hline = 'X'.

LAYOUT-NO_VLINE = 'X'.

LAYOUT-window_titlebar = 'MATERIAL DETAILS'.

CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'

EXPORTING

I_PROGRAM_NAME = SY-REPID

I_INTERNAL_TABNAME = 'ITAB'

  • I_STRUCTURE_NAME =

  • I_CLIENT_NEVER_DISPLAY = 'X'

I_INCLNAME = SY-REPID

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE =

CHANGING

CT_FIELDCAT = FCAT

  • 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_LIST_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER =

  • I_BUFFER_ACTIVE = ' '

I_CALLBACK_PROGRAM = SY-REPID

  • I_CALLBACK_PF_STATUS_SET =

  • I_CALLBACK_USER_COMMAND =

  • I_STRUCTURE_NAME =

IS_LAYOUT = LAYOUT

IT_FIELDCAT = FCAT

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

IT_SORT = SORT[]

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

IT_EVENTS = EVE[]

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 5

  • I_SCREEN_START_LINE = 5

  • I_SCREEN_END_COLUMN = 120

  • I_SCREEN_END_LINE = 25

  • IMPORTING

  • E_EXIT_CAUSED_BY_CALLER =

  • ES_EXIT_CAUSED_BY_USER =

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.

FORM TOPOFPAGE.

REFRESH HEAD.

HEAD-TYP = 'H'.

HEAD-INFO = 'MATERIALS'.

APPEND HEAD.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

IT_LIST_COMMENTARY = HEAD[]

  • I_LOGO =

  • I_END_OF_LIST_GRID =

.

ENDFORM.

FORM TOPOFLIST.

REFRESH HEAD.

HEAD-TYP = 'H'.

HEAD-INFO = 'MATERIALS-LISTTOP'.

APPEND HEAD.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

IT_LIST_COMMENTARY = HEAD[]

  • I_LOGO =

  • I_END_OF_LIST_GRID =

.

ENDFORM.

FORM ENDOFLIST.

REFRESH HEAD.

HEAD-TYP = 'H'.

HEAD-INFO = 'MATERIALS-LISTEND'.

APPEND HEAD.

CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

EXPORTING

IT_LIST_COMMENTARY = HEAD[]

  • I_LOGO =

  • I_END_OF_LIST_GRID =

.

ENDFORM.

rgds,

bharat.

Read only

Former Member
0 Likes
1,153

Hi

It is used to for defining the layout of your ALV report

like

ls_layout TYPE slis_layout_alv.

and we define different paramters of this layout like

ls_layout-group_change_edit = 'X'.

ls_layout-colwidth_optimize = 'X'.

ls_layout-zebra = 'X'.

ls_layout-detail_popup = 'X'.

ls_layout-get_selinfos = 'X'.

ls_layout-max_linesize = '200'.

Reward points if useful

Regards

Anji

Read only

Former Member
0 Likes
1,152

hi,

slis_layout_alv is used in ALV to create a layout while displaying thae output.

like we can insert logo ,header,footer according to clients requirement.

Reward with points if helpful.

Read only

Former Member
0 Likes
1,152

hi,

slis_layout_alv is a type defined in type pool SLIS..

YOu can fine many fields in that ..

its mainly use to maintain the layout..

eg:

slis_layout_alv-zebra = 'X' -- gives you the design in the ALV output..

no_colhead(1) type c, " no headings

no_hotspot(1) type c, " headings not as hotspot

zebra(1) type c, " striped pattern

no_vline(1) type c, " columns separated by space

no_hline(1) type c, "rows separated by space B20K8A0N5D

cell_merge(1) type c, " not suppress field replication

edit(1) type c, " for grid only

edit_mode(1) type c, " for grid only

numc_sum(1) type c, " totals for NUMC-Fields possib.

no_input(1) type c, " only display fields

f2code like sy-ucomm, "

reprep(1) type c, " report report interface active

no_keyfix(1) type c, " do not fix keycolumns

expand_all(1) type c, " Expand all positions

no_author(1) type c, " No standard authority check

  • PF-status

def_status(1) type c, " default status space or 'A'

item_text(20) type c, " Text for item button

countfname type lvc_fname,

go to se11 , typegroup - SLIS and you can fiind this..

rewards if useful..

regards,

nazeer

Read only

Former Member
0 Likes
1,152

it is the layout structure for ALV

A layout is build for the report output list description USING the internal table declared above (I_LAYOUT).

Output list description structure.

The parameters are described under the following heads:

• Display options

• Exceptions

• Totals

• Interaction

• Detail screen

• Display variants (only for hierarchical-sequential lists)

• Color

• Other

The layout table is of type slis_layout_alv_spec and has the following fields:

Display options

1. Colwidth_optimize (1) TYPE c: This parameter optimizes the length of the different columns in the output. The width of the different col. now depends on the max. Length of the data in the column.

Value set: SPACE, 'X'

'X' = optimizes the column width so that all contents are displayed completely.

2. No_colhead (1) TYPE c: This parameter suppresses the column headings

Value set: SPACE, 'X'.

'X' = column headers are not output

3. No_hotspot (1) TYPE c: The heading of the report output are not output as hotspot.

Value set: SPACE, 'X'.

'X' = column headers are not output as hotspot

4. Zebra (1) TYPE c : The report is output in the striped pattern.

Value set: SPACE, 'X'.

'X' = striped pattern (e.g. for wide lists)

5. No_vline (1) TYPE c: The report output contains columns only separated by space and no lines. It is not relevant for: hierarchical-sequential lists and multiple-line lists.

Value set: SPACE, 'X'.

'X' = columns separated by SPACE

6. No_min_linesize (1) TYPE c: The report line size is equal to the width of the list. It is not relevant for block lists.

Value set: SPACE, 'X’.

'X' = line size depends on list width

‘‘= Line size is set to 80 or MIN_LINESIZE (if > 0).

7. Min_linesize LIKE sy-linsz: The report output contains a minimum possible length of line. If initial min_linesize is set to 80 by default, then this parameter is used to customize it. The prerequisite for this is that the parameter no_min_linesize should be ' '.

Value set: 0, 10 - 250

If the list is wider, the format uses the list width (maximum 250 or MAX_LINESIZE (if > 0)).

8. Max_linesize LIKE sy-linsz: The default max. Linesize is 250. To change this default value, this parameter can interactively-define the maximum list width setting.

Value set: 0, 80 - 1020

9. Window_titlebar LIKE rsmpe-tittext: To set the titlebar on the report output.

10. No_uline_hs (1) TYPE c.