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: 

alv

Former Member
0 Kudos

hi all,

wht is ZEBRA PATTERN IN alv?

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Hi,

in ur programe if u take zebra is equal 'X' then final output u will get 2 different colours like animal zebra colours.

<b>reward me if it is use full answer</b>

praveen

6 REPLIES 6

Former Member
0 Kudos

Hi,

When u gave this value, output appears like..

one line dark, next line light ...so on..

to differentiate the lines.....

Former Member
0 Kudos

Hi

It will print the records in stripped pattern like zebra.

you need to write the code for layout

CONSTANTS:lc_chk TYPE c VALUE 'X'.

wa_layout-no_input = lc_chk.

wa_layout-colwidth_optimize = lc_chk.

wa_layout-zebra = lc_chk.

wa_layout-totals_text = text-201.

regards

Shiva

Former Member
0 Kudos

Hi,

It is a pattern in ALV, you can change the Layout set to ZEBRA in ALV

IS_LAYOUT-ZEBRA: X=striped (zebra) pattern

Regards

Sudheer

Former Member
0 Kudos

hi,

shows alternating color for the output

regards

Nicole

Former Member
0 Kudos

sample code.....output in zebra pattern........

TABLES : VBAP.

TYPE-POOLS : SLIS.

DATA : BEGIN OF ITAB OCCURS 0,

VBELN LIKE VBAP-VBELN,

POSNR LIKE VBAP-POSNR,

ERNAM LIKE VBAP-ERNAM,

ERDAT LIKE VBAP-ERDAT.

DATA : END OF ITAB.

DATA : IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,

WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.

DATA : WA_LAYOUT TYPE SLIS_LAYOUT_ALV.

SELECT-OPTIONS : S_VBELN FOR VBAP-VBELN.

START-OF-SELECTION.

SELECT VBELN

POSNR

ERNAM

ERDAT

FROM VBAP

INTO CORRESPONDING FIELDS OF TABLE ITAB

WHERE VBELN IN S_VBELN.

PERFORM MODIFY_CAT.

CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'

EXPORTING

  • I_INTERFACE_CHECK = ' '

  • I_BYPASSING_BUFFER = ' '

  • I_BUFFER_ACTIVE = ' '

  • I_CALLBACK_PROGRAM = ' '

  • I_CALLBACK_PF_STATUS_SET = ' '

  • I_CALLBACK_USER_COMMAND = ' '

  • I_CALLBACK_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_TOP_OF_PAGE = ' '

  • I_CALLBACK_HTML_END_OF_LIST = ' '

  • I_STRUCTURE_NAME =

  • I_BACKGROUND_ID = ' '

  • I_GRID_TITLE =

  • I_GRID_SETTINGS =

IS_LAYOUT = WA_LAYOUT

IT_FIELDCAT = IT_FIELDCAT

  • IT_EXCLUDING =

  • IT_SPECIAL_GROUPS =

  • IT_SORT =

  • IT_FILTER =

  • IS_SEL_HIDE =

  • I_DEFAULT = 'X'

  • I_SAVE = ' '

  • IS_VARIANT =

  • IT_EVENTS =

  • IT_EVENT_EXIT =

  • IS_PRINT =

  • IS_REPREP_ID =

  • I_SCREEN_START_COLUMN = 0

  • I_SCREEN_START_LINE = 0

  • I_SCREEN_END_COLUMN = 0

  • I_SCREEN_END_LINE = 0

  • IT_ALV_GRAPHICS =

  • IT_HYPERLINK =

  • IT_ADD_FIELDCAT =

  • IT_EXCEPT_QINFO =

  • I_HTML_HEIGHT_TOP =

  • I_HTML_HEIGHT_END =

  • 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.

*END-OF-SELECTION.

*LOOP AT ITAB.

*WRITE : / ITAB-VBELN,

  • ITAB-POSNR,

  • ITAB-ERNAM,

  • ITAB-ERDAT.

*ENDLOOP.

&----


*& Form MODIFY_CAT

&----


  • text

----


  • --> p1 text

  • <-- p2 text

----


FORM MODIFY_CAT .

WA_FIELDCAT-TABNAME = 'ITAB'..

WA_FIELDCAT-FIELDNAME = 'VBELN'.

WA_FIELDCAT-SELTEXT_L = 'SALES DOC'.

WA_FIELDCAT-COL_POS = 1.

WA_FIELDCAT-OUTPUTLEN = 10.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'ITAB'..

WA_FIELDCAT-FIELDNAME = 'POSNR'.

WA_FIELDCAT-SELTEXT_L = 'ITEM'.

WA_FIELDCAT-COL_POS = 2.

WA_FIELDCAT-OUTPUTLEN = 6.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'ITAB'..

WA_FIELDCAT-FIELDNAME = 'ERNAM'.

WA_FIELDCAT-SELTEXT_L = 'PERSON NAME'.

WA_FIELDCAT-COL_POS = 3.

WA_FIELDCAT-OUTPUTLEN = 12.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_FIELDCAT-TABNAME = 'ITAB'..

WA_FIELDCAT-FIELDNAME = 'ERDAT'.

WA_FIELDCAT-SELTEXT_L = 'DATE'.

WA_FIELDCAT-COL_POS = 4.

WA_FIELDCAT-OUTPUTLEN = 8.

APPEND WA_FIELDCAT TO IT_FIELDCAT.

CLEAR WA_FIELDCAT.

WA_LAYOUT-ZEBRA = 'X'.

*WA_LAYOUT-INFO_FIELDNAME = 'COLOR'.

ENDFORM. " MODIFY_CAT

Former Member
0 Kudos

Hi,

in ur programe if u take zebra is equal 'X' then final output u will get 2 different colours like animal zebra colours.

<b>reward me if it is use full answer</b>

praveen