Skip to Content
avatar image
Former Member

exceptionreport

hi ,

i have two tables namely zemplease and zcustemer . zemplease has the feilds like

EMPLOYEE_NUMBER

ID_NUMBER

LANGUAGE

GENDER

MARITAL_STATUS

|NATIONALITY

|RACE

ANNUAL_SALARY

TAX_IND

NO_CHILDREN

BIRTH_DATE

EMPLOYMENT_DATE.

and zcustermer table has one extra field calld custernumber.

A report that compares customer data to the employee table and highlights exceptions will have to be developed.

so can anyone expailn me so as how to proceed pls

and zcustmer.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

2 Answers

  • avatar image
    Former Member
    Sep 02, 2008 at 06:56 AM

    Use ALV Block List display and where u can highlight the things.

    Ricky

    Add comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi,

      Just check out this code sample.

      Sample Program on BLOCK LISTS

      Do help me regarding ALV BLOCK LIST DISPLAY...

      Can you people send some sample progs on BLOCK LISTS function modules.

      Sivakumar

      -


      ----


      • Declarations for BLOCK ALV DISPLAY

      ----


      *--type pools

      TYPE-POOLS:slis.

      DATA:x_layout TYPE slis_layout_alv,

      t_field TYPE slis_t_fieldcat_alv,

      *--field catalog

      x_fldcat LIKE LINE OF t_field,

      *--to hold all the events

      t_events TYPE slis_t_event,

      x_events TYPE slis_alv_event,

      t_sort TYPE slis_t_sortinfo_alv,

      x_sort LIKE LINE OF t_sort ,

      *--Print Layout

      x_print_layout TYPE slis_print_alv.

      *----Macro to add field catalog.

      *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN

      DEFINE add_catalog.

      clear x_fldcat.

      x_fldcat-fieldname = &1.

      x_fldcat-seltext_m = &2.

      x_fldcat-outputlen = &3.

      x_fldcat-tech = &4.

      x_fldcat-col_pos = &5.

      x_fldcat-no_zero = 'X'.

      x_fldcat-ddictxt = 'M'.

      x_fldcat-datatype = &6.

      x_fldcat-ddic_outputlen = &7.

      if &6 = 'N'.

      x_fldcat-lzero = 'X'.

      endif.

      *--build field catalog

      append x_fldcat to t_field.

      END-OF-DEFINITION.

      *----- data declerations.

      data: v_repid like sy-repid.

      data: begin of itab occurs 0,

      matnr like mara-matnr,

      ernam like mara-ernam,

      meins like mara-meins,

      end of itab.

      data: begin of jtab occurs 0,

      matnr like makt-matnr,

      maktx like makt-maktx,

      end of jtab.

      select matnr ernam meins

      up to 20 rows

      from mara

      into table itab.

      select matnr maktx

      up to 20 rows

      from makt

      into table jtab.

      v_repid = sy-repid.

      *DISPLAY alv

      • Initialize Block

      call function 'REUSE_ALV_BLOCK_LIST_INIT'

      exporting

      i_callback_program = v_repid.

      *Block 1:

      *INITIALIZE

      refresh t_field. clear t_field.

      refresh t_events.

      *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN

      add_catalog:

      'MATNR' 'Material' '18' '' '1' 'C' '18',

      'ERNAM' 'Created By' '12' '' '2' 'C' '12',

      'MEINS' 'Unit' '5' '' '3' 'C' '3'.

      *--build table for events.

      x_events-form = 'TOP_OF_LIST1'.

      x_events-name = slis_ev_top_of_list.

      append x_events to t_events.

      call function 'REUSE_ALV_BLOCK_LIST_APPEND'

      exporting

      is_layout = x_layout

      it_fieldcat = t_field

      i_tabname = 'ITAB'

      it_events = t_events

      it_sort = t_sort

      tables

      t_outtab = itab

      exceptions

      program_error = 1

      maximum_of_appends_reached = 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.

      *--BLOCK 2(SUMMARY REPORT)

      *INITIALIZE

      refresh t_field. clear t_field.

      refresh t_events.

      *field "text "length "tech "COL_POS "DATATYPE "DDIC_OUTPUTLEN

      add_catalog:

      'MATNR' 'Material' '20' '' '1' 'C' '18',

      'MAKTX' 'Description' '40' '' '2' 'C' '40'.

      *--build table for events.

      x_events-form = 'TOP_OF_LIST2'.

      x_events-name = slis_ev_top_of_list.

      append x_events to t_events.

      • Append table block.

      call function 'REUSE_ALV_BLOCK_LIST_APPEND'

      exporting

      is_layout = x_layout

      it_fieldcat = t_field

      i_tabname = 'JTAB'

      it_events = t_events

      tables

      t_outtab = jtab

      exceptions

      program_error = 1

      maximum_of_appends_reached = 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 FM TO DISPLAY THE BLOCK REPORT.

      call function 'REUSE_ALV_BLOCK_LIST_DISPLAY'

      • exporting

      • is_print = x_print_layout

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

      skip 1.

      write: 10 'List 1',

      /5 '----


      '.

      skip 1.

      format reset.

      endform.

      form top_of_list2.

      skip 1.

      write: 10 'List 2',

      /5 '----


      '.

      skip 1.

      format reset.

      endform.

      Regards

      ricky

  • avatar image
    Former Member
    Sep 02, 2008 at 08:06 AM

    Hi Kata,

    Check the following code for block list display:

    REPORT YMS_BLOCKALVTEST.

    TABLES : MARA,

    MARC,

    MARD.

    TYPE-POOLS : SLIS.

    TYPES : BEGIN OF TP_MARA,

    MATNR TYPE MARA-MATNR,

    MTART TYPE MARA-MTART,

    MBRSH TYPE MARA-MBRSH,

    END OF TP_MARA.

    TYPES : BEGIN OF TP_MARC,

    MATNR TYPE MARC-MATNR,

    WERKS TYPE MARC-WERKS,

    EKGRP TYPE MARC-EKGRP,

    END OF TP_MARC.

    TYPES : BEGIN OF TP_MARD,

    MATNR TYPE MARD-MATNR,

    WERKS TYPE MARD-WERKS,

    LGORT TYPE MARD-LGORT,

    LABST TYPE MARD-LABST,

    END OF TP_MARD.

    *----


    • INTERNAL TABLE DECLARATION

    *----


    DATA : IG_MARA TYPE STANDARD TABLE OF TP_MARA,

    WG_MARA TYPE TP_MARA.

    DATA : IG_MARC TYPE STANDARD TABLE OF TP_MARC,

    WG_MARC TYPE TP_MARC.

    DATA : IG_MARD TYPE STANDARD TABLE OF TP_MARD,

    WG_MARD TYPE TP_MARD.

    • Internal table and work area related to ALV

    DATA : IG_FIELDCAT1 TYPE SLIS_T_FIELDCAT_ALV,

    IG_FIELDCAT2 TYPE SLIS_T_FIELDCAT_ALV,

    IG_FIELDCAT3 TYPE SLIS_T_FIELDCAT_ALV,

    WG_FIELDCAT TYPE SLIS_FIELDCAT_ALV,

    WG_KEYINFO TYPE SLIS_KEYINFO_ALV,

    IG_LAYOUT TYPE SLIS_LAYOUT_ALV,

    IG_EVENTS1 TYPE SLIS_T_EVENT,

    IG_EVENTS2 TYPE SLIS_T_EVENT,

    IG_EVENTS3 TYPE SLIS_T_EVENT,

    WG_EVENTS1 LIKE LINE OF IG_EVENTS1,

    WG_EVENTS2 LIKE LINE OF IG_EVENTS2,

    WG_EVENTS3 LIKE LINE OF IG_EVENTS3.

    *----


    • SELECTION SCREEN

    *----


    SELECT-OPTIONS : S_MATNR FOR MARA-MATNR.

    *----


    • START OF SELECTION

    *----


    *SELECT DATA

    PERFORM SELECT_DATA.

    *POPULATING FIELD CATELOGUE

    PERFORM BUILD_FIELD_CAT.

    *DISPLAYING FINAL OUTPUT

    PERFORM DISPLAY_OUTPUT.

    *&----


    *-

    *

    *& Form select_data

    *&----


    *-

    *

    FORM SELECT_DATA .

    SELECT MATNR

    MTART

    MBRSH

    FROM MARA

    INTO TABLE IG_MARA

    WHERE MATNR IN S_MATNR.

    IF IG_MARA IS NOT INITIAL.

    SELECT MATNR

    WERKS

    EKGRP

    FROM MARC

    INTO TABLE IG_MARC

    FOR ALL ENTRIES IN IG_MARA

    WHERE MATNR = IG_MARA-MATNR.

    ENDIF.

    IF IG_MARC IS NOT INITIAL.

    SELECT MATNR

    WERKS

    LGORT

    LABST

    FROM MARD

    INTO TABLE IG_MARD

    FOR ALL ENTRIES IN IG_MARC

    WHERE WERKS = IG_MARC-WERKS.

    ENDIF.

    ENDFORM. " select_data

    *&----


    *-

    *

    *& Form build_field_cat

    *&----


    *-

    *

    FORM BUILD_FIELD_CAT .

    DEFINE M_FIELDCAT1.

    WG_FIELDCAT-TABNAME = &1.

    WG_FIELDCAT-FIELDNAME = &2.

    WG_FIELDCAT-SELTEXT_L = &3.

    APPEND WG_FIELDCAT TO IG_FIELDCAT1.

    CLEAR WG_FIELDCAT.

    END-OF-DEFINITION.

    DEFINE M_FIELDCAT2.

    WG_FIELDCAT-TABNAME = &1.

    WG_FIELDCAT-FIELDNAME = &2.

    WG_FIELDCAT-SELTEXT_L = &3.

    APPEND WG_FIELDCAT TO IG_FIELDCAT2.

    CLEAR WG_FIELDCAT.

    END-OF-DEFINITION.

    DEFINE M_FIELDCAT3.

    WG_FIELDCAT-TABNAME = &1.

    WG_FIELDCAT-FIELDNAME = &2.

    WG_FIELDCAT-SELTEXT_L = &3.

    APPEND WG_FIELDCAT TO IG_FIELDCAT3.

    CLEAR WG_FIELDCAT.

    END-OF-DEFINITION.

    M_FIELDCAT1 'MARA' 'MATNR' 'Material Number'.

    M_FIELDCAT1 'MARA' 'MTART' 'Material type'.

    M_FIELDCAT1 'MARA' 'MBRSH' 'Industry Sector'.

    M_FIELDCAT2 'MARC' 'MATNR' 'Material Number'.

    M_FIELDCAT2 'MARC' 'WERKS' 'Plant'.

    M_FIELDCAT2 'MARC' 'EKGRP' 'Purchasing Group'.

    M_FIELDCAT3 'MARD' 'MATNR' 'Material Number'.

    M_FIELDCAT3 'MARD' 'WERKS' 'Plant'.

    M_FIELDCAT3 'MARD' 'LGORT' 'Storage Location'.

    M_FIELDCAT3 'MARD' 'LABST' 'Valued Stock'.

    WG_EVENTS1-NAME = 'TOP_OF_PAGE'.

    WG_EVENTS1-FORM = 'F_TOP_OF_PAGE_ONE'.

    APPEND WG_EVENTS1 TO IG_EVENTS1.

    CLEAR WG_EVENTS1.

    WG_EVENTS2-NAME = 'TOP_OF_PAGE'.

    WG_EVENTS2-FORM = 'F_TOP_OF_PAGE_TWO'.

    APPEND WG_EVENTS2 TO IG_EVENTS2.

    CLEAR WG_EVENTS2.

    WG_EVENTS3-NAME = 'TOP_OF_PAGE'.

    WG_EVENTS3-FORM = 'F_TOP_OF_PAGE_THREE'.

    APPEND WG_EVENTS3 TO IG_EVENTS3.

    CLEAR WG_EVENTS3.

    IG_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.

    IG_LAYOUT-ZEBRA = 'X'.

    IG_LAYOUT-CELL_MERGE = 'X'.

    ENDFORM. " build_field_cat

    *----


    • Form top_of_page_one

    *----


    FORM F_TOP_OF_PAGE_ONE.

    DATA: HEADER TYPE SLIS_T_LISTHEADER,

    WA TYPE SLIS_LISTHEADER.

    • TITLE AREA

    WA-TYP = 'S'.

    WA-INFO = TEXT-H04.

    APPEND WA TO HEADER.

    WA-TYP = 'S'.

    WRITE SY-DATUM TO WA-INFO MM/DD/YYYY.

    CONCATENATE TEXT-H03 WA-INFO INTO WA-INFO SEPARATED BY SPACE.

    APPEND WA TO HEADER.

    WA-TYP = 'S'.

    CONCATENATE TEXT-H02 SY-UNAME INTO WA-INFO SEPARATED BY SPACE.

    APPEND WA TO HEADER.

    WA-TYP = 'S'.

    CONCATENATE TEXT-H01 SY-REPID INTO WA-INFO SEPARATED BY SPACE.

    APPEND WA TO HEADER.

    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'

    EXPORTING

    IT_LIST_COMMENTARY = HEADER

    I_LOGO = 'VODAFONE'

    • I_END_OF_LIST_GRID =

    • I_ALV_FORM =

    .

    WRITE: / 'Header details (MARA)'.

    ENDFORM. "top_of_page_one

    *----


    • Form top_of_page_two

    *----


    FORM F_TOP_OF_PAGE_TWO.

    WRITE: / 'Plant details (MARC)'.

    ENDFORM. "top_of_page_one

    *----


    • Form top_of_page_three

    *----


    FORM F_TOP_OF_PAGE_THREE.

    WRITE: / 'Storage location details (MARD)'.

    ENDFORM. "top_of_page_one

    *&----


    *-

    *

    *& Form display_output

    *&----


    *-

    *

    FORM DISPLAY_OUTPUT .

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'

    EXPORTING

    I_CALLBACK_PROGRAM = SY-REPID.

    CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'

    EXPORTING

    IS_LAYOUT = IG_LAYOUT

    IT_FIELDCAT = IG_FIELDCAT1

    I_TABNAME = 'IG_MARA'

    IT_EVENTS = IG_EVENTS1

    • IT_SORT =

    • I_TEXT = ' '

    TABLES

    T_OUTTAB = IG_MARA

    EXCEPTIONS

    PROGRAM_ERROR = 1

    MAXIMUM_OF_APPENDS_REACHED = 2

    OTHERS = 3

    .

    IF SY-SUBRC EQ 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_BLOCK_LIST_APPEND'

    EXPORTING

    IS_LAYOUT = IG_LAYOUT

    IT_FIELDCAT = IG_FIELDCAT2

    I_TABNAME = 'IG_MARC'

    IT_EVENTS = IG_EVENTS2

    • IT_SORT =

    • I_TEXT = ' '

    TABLES

    T_OUTTAB = IG_MARC

    EXCEPTIONS

    PROGRAM_ERROR = 1

    MAXIMUM_OF_APPENDS_REACHED = 2

    OTHERS = 3

    .

    IF SY-SUBRC EQ 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_BLOCK_LIST_APPEND'

    EXPORTING

    IS_LAYOUT = IG_LAYOUT

    IT_FIELDCAT = IG_FIELDCAT3

    I_TABNAME = 'IG_MARD'

    IT_EVENTS = IG_EVENTS3

    • IT_SORT =

    • I_TEXT = ' '

    TABLES

    T_OUTTAB = IG_MARD

    EXCEPTIONS

    PROGRAM_ERROR = 1

    MAXIMUM_OF_APPENDS_REACHED = 2

    OTHERS = 3

    .

    IF SY-SUBRC EQ 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_BLOCK_LIST_DISPLAY'

    • EXPORTING

    • I_INTERFACE_CHECK = ' '

    • IS_PRINT =

    • I_SCREEN_START_COLUMN = '0'

    • I_SCREEN_START_LINE = '0'

    • I_SCREEN_END_COLUMN = '0'

    • I_SCREEN_END_LINE = '0'

    • IMPORTING

    • E_EXIT_CAUSED_BY_CALLER =

    • ES_EXIT_CAUSED_BY_USER =

    EXCEPTIONS

    PROGRAM_ERROR = 1

    OTHERS = 2

    .

    IF SY-SUBRC EQ 0.

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

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

    ENDIF.

    ENDFORM. " display_output

    Hope this will help.

    Regards,

    Nitin.

    Add comment
    10|10000 characters needed characters exceeded