How to display subtotal in ALV, where the field is not a numeric.

Hi
We are having a requirement to display the sub total for a field using ALV grid display, where the field is not numeric.
The field is characte, Status field(consists of values Submit, Approve ,Reject), where the subtotal should be value of count of group by status .
say status with submit are 10 records, so after all records with submit status are, displyed, we need to display its subtotal as 10.
Thanks & Advance

Hi Satya,
REPORT z_alv_subtotal.*&---------------------------------------------------------------------*
*& Table declaration
*&---------------------------------------------------------------------*TABLES: ekko.*&---------------------------------------------------------------------*
*& Type pool declaration
TYPE-POOLS: slis. " Type pool for ALV*&---------------------------------------------------------------------*
*& Selection screen
SELECT-OPTIONS: s_ebeln FOR ekko-ebeln.*&---------------------------------------------------------------------*
*& Type declaration
*&---------------------------------------------------------------------** Type declaration for internal table to store EKPO data
TYPES: BEGIN OF x_data,
       ebeln  TYPE char30,  " Document no.
       ebelp  TYPE ebelp,   " Item no
       matnr  TYPE matnr,   " Material no
       matnr1 TYPE matnr,   " Material no
       werks  TYPE werks_d, " Plant
       werks1 TYPE werks_d, " Plant
       ntgew  TYPE entge,   " Net weight
       gewe   TYPE egewe,   " Unit of weight                          
       END OF x_data.*&---------------------------------------------------------------------*
*& Internal table declaration
DATA:* Internal table to store EKPO data
  i_ekpo TYPE STANDARD TABLE OF x_data INITIAL SIZE 0,
* Internal table for storing field catalog information
  i_fieldcat TYPE slis_t_fieldcat_alv,
* Internal table for Top of Page info. in ALV Display
  i_alv_top_of_page TYPE slis_t_listheader,
* Internal table for ALV Display events
  i_events TYPE slis_t_event,
* Internal table for storing ALV sort information
  i_sort TYPE  slis_t_sortinfo_alv,
  i_event TYPE slis_t_event.*&---------------------------------------------------------------------*
*& Work area declaration
*&---------------------------------------------------------------------*DATA:
  wa_ekko TYPE x_data,
  wa_layout     TYPE slis_layout_alv,
  wa_events         TYPE slis_alv_event,
  wa_sort TYPE slis_sortinfo_alv.*&---------------------------------------------------------------------*
*& Constant declaration
*&---------------------------------------------------------------------*CONSTANTS:
   c_header   TYPE char1
              VALUE 'H',                    "Header in ALV
   c_item     TYPE char1
              VALUE 'S'.*&---------------------------------------------------------------------*
*& Start-of-selection event
*&---------------------------------------------------------------------*START-OF-SELECTION.* Select data from ekpo
  SELECT ebeln " Doc no
         ebelp " Item
         matnr " Material
         matnr " Material
         werks " Plant
         werks " Plant
         ntgew " Quantity
         gewei " Unit
         FROM ekpo
         INTO TABLE i_ekpo
         WHERE ebeln IN s_ebeln
         AND ntgew NE '0.00'.  IF sy-subrc = 0.
    SORT i_ekpo BY ebeln ebelp matnr .
  ENDIF.* To build the Page header
  PERFORM sub_build_header.* To prepare field catalog
  PERFORM sub_field_catalog.* Perform to populate the layout structure
  PERFORM sub_populate_layout.* Perform to populate the sort table.
  PERFORM sub_populate_sort.* Perform to populate ALV event
  PERFORM sub_get_event.END-OF-SELECTION.* Perform to display ALV report
  PERFORM sub_alv_report_display.
*&      Form  sub_build_header
*       To build the header
*       No Parameter
FORM sub_build_header .* Local data declaration
  DATA: l_system     TYPE char10 ,          "System id
        l_r_line     TYPE slis_listheader,  "Hold list header
        l_date       TYPE char10,           "Date
        l_time       TYPE char10,           "Time
        l_success_records TYPE i,           "No of success records
        l_title(300) TYPE c.                " Title
* Title  Display
  l_r_line-typ = c_header.               " header
  l_title = 'Test report'(001).
  l_r_line-info = l_title.
  APPEND l_r_line TO i_alv_top_of_page.
  CLEAR l_r_line.* Run date Display
  CLEAR l_date.
  l_r_line-typ  = c_item.                " Item
  WRITE: sy-datum  TO l_date MM/DD/YYYY.
  l_r_line-key = 'Run Date :'(002).
  l_r_line-info = l_date.
  APPEND l_r_line TO i_alv_top_of_page.
  CLEAR: l_r_line,
         l_date.ENDFORM.                    " sub_build_header
*&      Form  sub_field_catalog
*       Build Field Catalog
*       No Parameter
FORM sub_field_catalog .*  Build Field Catalog
  PERFORM sub_fill_alv_field_catalog USING:     '01' '01' 'EBELN' 'I_EKPO' 'L'
     'Doc No'(003) ' ' ' ' ' ' ' ',     '01' '02' 'EBELP' 'I_EKPO' 'L'
     'Item No'(004) 'X' 'X' ' ' ' ',     '01' '03' 'MATNR' 'I_EKPO' 'L'
     'Material No'(005) 'X' 'X' ' ' ' ',     '01' '03' 'MATNR1' 'I_EKPO' 'L'
     'Material No'(005) ' ' ' ' ' ' ' ',
     '01' '04' 'WERKS' 'I_EKPO' 'L'
     'Plant'(006) 'X' 'X' ' ' ' ',     '01' '04' 'WERKS1' 'I_EKPO' 'L'
     'Plant'(006) ' ' ' ' ' ' ' ',     '01' '05' 'NTGEW' 'I_EKPO' 'R'
     'Net Weight'(007) ' ' ' ' 'GEWE' 'I_EKPO'.ENDFORM.                    " sub_field_catalog*&---------------------------------------------------------------------*
*&     Form  sub_fill_alv_field_catalog
*&     For building Field Catalog
*&     p_rowpos   Row position
*&     p_colpos   Col position
*&     p_fldnam   Fldname
*&     p_tabnam   Tabname
*&     p_justif   Justification
*&     p_seltext  Seltext
*&     p_out      no out
*&     p_tech     Technical field
*&     p_qfield   Quantity field
*&     p_qtab     Quantity table
FORM sub_fill_alv_field_catalog  USING  p_rowpos    TYPE sycurow
                                        p_colpos    TYPE sycucol
                                        p_fldnam    TYPE fieldname
                                        p_tabnam    TYPE tabname
                                        p_justif    TYPE char1
                                        p_seltext   TYPE dd03p-scrtext_l
                                        p_out       TYPE char1
                                        p_tech      TYPE char1
                                        p_qfield    TYPE slis_fieldname
                                        p_qtab      TYPE slis_tabname.* Local declaration for field catalog
  DATA: wa_lfl_fcat    TYPE  slis_fieldcat_alv.  wa_lfl_fcat-row_pos        =  p_rowpos.     "Row
  wa_lfl_fcat-col_pos        =  p_colpos.     "Column
  wa_lfl_fcat-fieldname      =  p_fldnam.     "Field Name
  wa_lfl_fcat-tabname        =  p_tabnam.     "Internal Table Name
  wa_lfl_fcat-just           =  p_justif.     "Screen Justified
  wa_lfl_fcat-seltext_l      =  p_seltext.    "Field Text
  wa_lfl_fcat-no_out         =  p_out.        "No output
  wa_lfl_fcat-tech           =  p_tech.       "Technical field
  wa_lfl_fcat-qfieldname     =  p_qfield.     "Quantity unit
  wa_lfl_fcat-qtabname       =  p_qtab .      "Quantity table  IF p_fldnam = 'NTGEW'.
    wa_lfl_fcat-do_sum  = 'X'.
  ENDIF.
  APPEND wa_lfl_fcat TO i_fieldcat.
  CLEAR wa_lfl_fcat.
ENDFORM.                    " sub_fill_alv_field_catalog*&---------------------------------------------------------------------*
*&      Form  sub_populate_layout
*       Populate ALV layout
*       No Parameter
FORM sub_populate_layout .  CLEAR wa_layout.
  wa_layout-colwidth_optimize = 'X'." Optimization of Col widthENDFORM.                    " sub_populate_layout*&---------------------------------------------------------------------*
*&      Form  sub_populate_sort
*       Populate ALV sort table
*       No Parameter
FORM sub_populate_sort .* Sort on material
  wa_sort-spos = '01' .
  wa_sort-fieldname = 'MATNR'.
  wa_sort-tabname = 'I_EKPO'.
  wa_sort-up = 'X'.
  wa_sort-subtot = 'X'.
  APPEND wa_sort TO i_sort .
  CLEAR wa_sort.* Sort on plant
  wa_sort-spos = '02'.
  wa_sort-fieldname = 'WERKS'.
  wa_sort-tabname = 'I_EKPO'.
  wa_sort-up = 'X'.
  wa_sort-subtot = 'X'.
  APPEND wa_sort TO i_sort .
  CLEAR wa_sort.
ENDFORM.                    " sub_populate_sort*&---------------------------------------------------------------------*
*&      Form  sub_get_event
*       Get ALV grid event and pass the form name to subtotal_text
*       event
*       No Parameter
FORM sub_get_event .
  CONSTANTS : c_formname_subtotal_text TYPE slis_formname VALUE
'SUBTOTAL_TEXT'.  DATA: l_s_event TYPE slis_alv_event.
  CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
    EXPORTING
      i_list_type     = 4
    IMPORTING
      et_events       = i_event
    EXCEPTIONS
      list_type_wrong = 0
      OTHERS          = 0.* Subtotal
  READ TABLE i_event  INTO l_s_event
                    WITH KEY name = slis_ev_subtotal_text.
  IF sy-subrc = 0.
    MOVE c_formname_subtotal_text TO l_s_event-form.
    MODIFY i_event FROM l_s_event INDEX sy-tabix.
  ENDIF.ENDFORM.                    " sub_get_event*&---------------------------------------------------------------------*
*&      Form  sub_alv_report_display
*       For ALV Report Display
*       No Parameter
FORM sub_alv_report_display .
  DATA: l_repid TYPE syrepid .
  l_repid = sy-repid .* This function module for displaying the ALV report
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program       = l_repid
      i_callback_top_of_page   = 'SUB_ALV_TOP_OF_PAGE'
      is_layout                = wa_layout
      it_fieldcat              = i_fieldcat
      it_sort = i_sort
      it_events                = i_event
      i_default                = 'X'
      i_save                   = 'A'
    TABLES
      t_outtab                 = i_ekpo
    EXCEPTIONS
      program_error            = 1
      OTHERS                   = 2.
  IF sy-subrc <> 0.
*    MESSAGE i000 WITH 'Error in ALV report display'(055).
  ENDIF.ENDFORM.                    " sub_alv_report_display*&---------------------------------------------------------------------*
*       FORM sub_alv_top_of_page
*       Call ALV top of page
*       No parameter
*---------------------------------------------------------------------*FORM sub_alv_top_of_page.                                   "#EC CALLED* To write header for the ALV
  CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    EXPORTING
      it_list_commentary = i_alv_top_of_page.
ENDFORM.                    "alv_top_of_page*&---------------------------------------------------------------------*
*&      Form  subtotal_text
*       Build subtotal text
*       P_total  Total
*       p_subtot_text Subtotal text info
FORM subtotal_text CHANGING
               p_total TYPE any
               p_subtot_text TYPE slis_subtot_text.
* Material level sub total
  IF p_subtot_text-criteria = 'MATNR'.
    p_subtot_text-display_text_for_subtotal
    = 'Material level total'(009).
  ENDIF.* Plant level sub total
  IF p_subtot_text-criteria = 'WERKS'.
    p_subtot_text-display_text_for_subtotal = 'Plant level total'(010).
  ENDIF.
ENDFORM.                    "subtotal_text
Regards,
Pravin

Similar Messages

  • How to display HTML formatted text in the field with Item Style: Raw Text

    How can I display HTML formatted text in the field with Item Style: Raw Text.
    Currently the Item Style is Raw Text, but the text is being displayed along with HTML tags without formatting.
    Regards

    Hi,
    Use Item Style formattedText.
    Regards,
    Gyan

  • How to display subtotal description depending on the group name in ALV

    Hi,
    In my ALV report, i need to display with different descriptions for each subtotal text and i dont want to do any subtotal for the  final group.
    EX:-
    groupId Material numbers
    1 1
    1 2
    1 3
    1 4
    total of first group (Subtotal text)
    Group id Material numbers
    2 1
    2 2
    2 3
    2 4
    total of the Second group (subtotal text)
    3rd group i dont want to do any subtotal.
    Please help me how to do this one.

    Hi,
    I think standard ALV couldn't satisfy the requirements, unless there are some methods I don't know. But I am thinking of using ABAP list or form to display the report.
    Regards,
    Teddy Kurniawan

  • How can i connect to sites where the connection is not encripted?

    I do a search in google and continue to not be able to open the sited and when I point at the icon next to the site name I see "This web site does not present identity information. Your connection to this site is not encripted and the site won't open". How do open these sites?

    1.Verify that airplane mode is off by tapping Settings > Airplane Mode.
    2.Reset the network settings by tapping Settings > General > Reset > Reset Network Settings. 
Note: This will reset all network settings, including Bluetooth pairing records, Wi-Fi passwords, VPN, and APN settings
    3.Ensure that your device is using the latest software. To do so, connect your device to your computer and check for updates in iTunes.
    4.If your issue is still unresolved, perform a software restore in iTunes

  • How to do subtotal in alv?

    Hi,
    I have a problem to do the subtotal in alv.
    The outlook of alv now is as following:
    Specimen Adversary Amount
    ZZZ 300100089 1050
    ZZZ 300100089 -1050
    90256243 300100000 193410
    90256242 300100000 173250
    90256241 300100000 173250
    90256240 300100000 173250
    90256239 300100000 173250
    90256238 300100000 173250
    90256237 300100000 173250
    What I need to do it to sum up the amount for same "ADVERSARY"
    The out-come image should be
    Specimen Adversary Amount
    ZZZ 300100089 1050
    ZZZ 300100089 -1050
    subtotal 0
    90256243 300100000 193410
    90256242 300100000 173250
    90256241 300100000 173250
    90256240 300100000 173250
    90256239 300100000 173250
    90256238 300100000 173250
    90256237 300100000 173250
    subtotal 1232910
    Question:
    How can I add the subtotal in alv?
    Please help!!
    The following is the original coding:
    END-OF-SELECTION.
    SORT t.
    LOOP AT t.
    AT NEW bukrs.
    CLEAR anz_dl.
    CLEAR htext-anzahl.
    CLEAR htext-datei.
    htext-text1 = ' records writen in file '.
    CLEAR p_pfad.
    CONCATENATE
    i_pfad
    'CU_CC'
    t-bukrs
    sy-datum+6(2)
    sy-datum+4(2)
    sy-datum(4)
    sy-uzeit
    '.txt'
    INTO p_pfad.
    CLEAR outtab.
    REFRESH outtab.
    REFRESH: gt_outalv. "INS MG020207
    ENDAT.
    IF t-shkzg = 'H'.
    h_betrg = t-wrbtr * -1.
    ELSE.
    h_betrg = t-wrbtr.
    h_dmbtr = t-dmbtr.
    ENDIF.
    s-filler1 = s-filler2 = s-filler3 = s-filler4 = s-filler5 = ';'.
    s-filler6 = s-filler7 = s-filler8 = ';'.
    s-filler9 = s-filler10 = s-filler11 = s-filler12 = s-filler13 = ';'.
    s-filler14 = ';'.
    s-belnr = t-belnr.
    IF t-xblnr NE space. "WD041005a
    s-xblnr = t-xblnr. "WD041005a
    ELSE. "WD041005a
    s-xblnr = t-belnr. "WD041005a
    ENDIF. "WD041005a
    WHILE s-xblnr(1) EQ '0'. "INS MG130606
    SHIFT s-xblnr LEFT. "INS MG130606
    ENDWHILE. "INS MG130606
    WRITE t-kunnr TO s-kunnr NO-ZERO.
    s-lifn2 = s-kunnr.
    shift s-lifn2 RIGHT.
    s-lifn2(1) = 'R'.
    S-KUNNR = T-KUNNR+5(5).
    s-bldat+2(1) = '/'.
    s-bldat+5(1) = '/'.
    s-bldat0(2) = t-bldat4(2).
    s-bldat3(2) = t-bldat6(2).
    s-bldat6(4) = t-bldat0(4).
    s-budat+2(1) = '/'.
    s-budat+5(1) = '/'.
    s-budat0(2) = t-budat4(2).
    s-budat3(2) = t-budat6(2).
    s-budat6(4) = t-budat0(4).
    s-netdt+2(1) = '/'.
    s-netdt+5(1) = '/'.
    s-netdt0(2) = t-netdt4(2).
    s-netdt3(2) = t-netdt6(2).
    s-netdt6(4) = t-netdt0(4).
    s-waers = t-waers.
    s-dmbtr = t-dmbtr.
    s-sgtxt = t-sgtxt.
    CLEAR s-twaer.
    SELECT SINGLE waers INTO s-twaer
    FROM t001
    WHERE bukrs = t-bukrs.
    IF h_betrg < 0.
    hs_betrg+0(1) = '-'.
    ELSE.
    hs_betrg+0(1) = ' '.
    ENDIF.
    WRITE h_betrg CURRENCY t-waers TO hs_betrg+1 NO-GROUPING
    NO-SIGN
    LEFT-JUSTIFIED.
    REPLACE ',' WITH '.' INTO hs_betrg.
    WRITE hs_betrg TO s-betrg.
    IF h_dmbtr < 0.
    hs_betrg+0(1) = '-'.
    ELSE.
    hs_betrg+0(1) = ' '.
    ENDIF.
    WRITE h_dmbtr CURRENCY t-waers TO hs_betrg+1 NO-GROUPING
    NO-SIGN
    LEFT-JUSTIFIED.
    REPLACE ',' WITH '.' INTO hs_betrg.
    WRITE hs_betrg TO s-dmbtr.
    s-compcode = t-bukrs. "fw070905
    IF p_downl = 'X'.
    MOVE s TO outtab-s.
    APPEND outtab.
    ADD 1 TO anz_dl.
    ENDIF.
    gs_outalv-belnr = s-belnr. "INS MG020207
    *<<<< CR01 START ADD as_outalv-zuonr
    gs_outalv-zuonr = s-zuonr. "CR01
    *>>>> CR01 EDD ADD as_outalv-zuonr
    gs_outalv-kunnr = s-kunnr. "INS MG020207
    gs_outalv-bldat = s-bldat. "INS MG020207
    gs_outalv-netdt = s-netdt. "INS MG020207
    gs_outalv-betrg = s-betrg. "INS MG020207
    gs_outalv-waers = s-waers. "INS MG020207
    gs_outalv-compcode = s-compcode. "INS MG020207
    gs_outalv-budat = s-budat. "INS MG020207
    gs_outalv-sgtxt = s-sgtxt.
    gs_outalv-kmmnt = s-kmmnt.
    gs_outalv-vbeln = s-vbeln.
    gs_outalv-xblnr = s-xblnr.
    gs_outalv-lifn2 = s-lifn2.
    gs_outalv-dmbtr = s-dmbtr.
    gs_outalv-twaer = s-twaer.
    APPEND gs_outalv TO gt_outalv. "INS MG020207
    AT END OF bukrs.
    WRITE anz_dl TO htext-anzahl.
    WRITE p_pfad TO htext-datei.
    CONDENSE htext.
    IF p_downl = 'X'.
    SKIP 2.
    WRITE: / htext.
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filename = p_pfad
    filetype = 'ASC'
    TABLES
    data_tab = outtab
    EXCEPTIONS
    file_write_error = 1
    no_batch = 2
    gui_refuse_filetransfer = 3
    invalid_type = 4
    no_authority = 5
    unknown_error = 6
    header_not_allowed = 7
    separator_not_allowed = 8
    filesize_not_allowed = 9
    header_too_long = 10
    dp_error_create = 11
    dp_error_send = 12
    dp_error_write = 13
    unknown_dp_error = 14
    access_denied = 15
    dp_out_of_memory = 16
    disk_full = 17
    dp_timeout = 18
    file_not_found = 19
    dataprovider_exception = 20
    control_flush_error = 21
    OTHERS = 22.
    IF sy-subrc 0.
    write: / 'Error creating File:', P_Pfad, sy-subrc.
    MESSAGE e405 WITH text-002 p_pfad.
    ENDIF.
    ENDIF.
    *<<<<< INS MG020207
    IF p_alvd EQ 'X'.
    PERFORM build_layout_data.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    i_callback_program = sy-repid
    i_structure_name = 'GT_OUTALV'
    is_layout = gs_layout
    it_fieldcat = gt_fieldcat[]
    i_callback_top_of_page = 'TOP-OF-PAGE'
    TABLES
    t_outtab = gt_outalv.
    ENDIF.
    *>>>>> INS MG020207
    ENDAT.
    ENDLOOP.

    Check this code....it will help you...reward if useful.
    REPORT  ZPP473_VEHICLE_REVERSAL_REP NO STANDARD PAGE HEADING
                                        MESSAGE-ID ZPP.
    TABLES:ZPP18_RT_CORR.
    TYPE-POOLS:SLIS.
    DATA:BEGIN OF WA_VEH_REV,
    VEHNO TYPE ZPP18_RT_CORR-VEHNO,
    MATNR TYPE ZPP18_RT_CORR-MATNR,
    WERKS TYPE ZPP18_RT_CORR-WERKS,
    MDV01 TYPE ZPP18_RT_CORR-MDV01,
    ENGNO TYPE ZPP18_RT_CORR-ENGNO,
    FRMNO TYPE ZPP18_RT_CORR-FRMNO,
    ERFMG TYPE ZPP18_RT_CORR-ERFMG,
    SHIFT TYPE ZPP18_RT_CORR-SHIFT,
    ZUNAME TYPE ZPP18_RT_CORR-ZUNAME,
    ZDATE TYPE ZPP18_RT_CORR-ZDATE,
    MAKTX TYPE MAKT-MAKTX,
    ZREASON_DES TYPE ZPP17_REASON_COD-ZREASON_DES,
    *VTEXT TYPE T179T-VTEXT,
    END OF WA_VEH_REV.
    DATA:IT_VEH_REV LIKE STANDARD TABLE OF WA_VEH_REV.
    DATA:  ALVFLD TYPE SLIS_FIELDCAT_ALV,
           FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA:  WK_LAYOUT TYPE SLIS_LAYOUT_ALV,
           I_SORT TYPE SLIS_T_SORTINFO_ALV,
           W_SORT LIKE LINE OF I_SORT.
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS:
    SO_ZDATE FOR ZPP18_RT_CORR-ZDATE OBLIGATORY,
    SO_WERKS FOR ZPP18_RT_CORR-WERKS,
    SO_SHIFT FOR ZPP18_RT_CORR-SHIFT,
    SO_MDV01 FOR ZPP18_RT_CORR-MDV01,
    SO_MATNR FOR ZPP18_RT_CORR-MATNR,
    SO_VEHNO FOR ZPP18_RT_CORR-VEHNO,
    SO_ENGNO FOR ZPP18_RT_CORR-ENGNO,
    SO_FRMNO FOR ZPP18_RT_CORR-FRMNO,
    SO_UNAME FOR ZPP18_RT_CORR-ZUNAME.
    SELECTION-SCREEN END OF BLOCK B1.
    START-OF-SELECTION.
    **GET REVERSAL,MATERIAL DESCRIPTIONS, REASON DESCRIPTIONS
      SELECT ZPP18_RT_CORR~VEHNO
             ZPP18_RT_CORR~MATNR
             ZPP18_RT_CORR~WERKS
             ZPP18_RT_CORR~MDV01
             ZPP18_RT_CORR~ENGNO
             ZPP18_RT_CORR~FRMNO
             ZPP18_RT_CORR~ERFMG
             ZPP18_RT_CORR~SHIFT
             ZPP18_RT_CORR~ZUNAME
             ZPP18_RT_CORR~ZDATE
             MAKT~MAKTX
             ZPP17_REASON_COD~ZREASON_DES
      INTO TABLE IT_VEH_REV FROM
      ZPP18_RT_CORR INNER JOIN MAKT
      ON ( ZPP18_RT_CORRMANDT = MAKTMANDT AND
      ZPP18_RT_CORRMATNR = MAKTMATNR )
      INNER JOIN ZPP17_REASON_COD
      ON ( ZPP18_RT_CORRMANDT = ZPP17_REASON_CODMANDT AND
      ZPP18_RT_CORRZREASON = ZPP17_REASON_CODZREASON )
      CLIENT SPECIFIED
      WHERE ZPP18_RT_CORR~MANDT = SY-MANDT
      AND ZPP18_RT_CORR~ZDATE IN SO_ZDATE
      AND ZPP18_RT_CORR~WERKS IN SO_WERKS
      AND ZPP18_RT_CORR~SHIFT IN SO_SHIFT
      AND ZPP18_RT_CORR~MATNR IN SO_MATNR
      AND ZPP18_RT_CORR~MDV01 IN SO_MDV01
      AND ZPP18_RT_CORR~VEHNO IN SO_VEHNO
      AND ZPP18_RT_CORR~ENGNO IN SO_ENGNO
      AND ZPP18_RT_CORR~FRMNO IN SO_FRMNO
      AND ZPP18_RT_CORR~ZUNAME IN SO_UNAME
      AND MAKT~SPRAS = SY-LANGU.
      IF SY-SUBRC = 0.
          SORT IT_VEH_REV ASCENDING BY ZDATE SHIFT WERKS MDV01 MATNR.
      ELSE.
        MESSAGE I961 WITH 'No Data Found...Try Again !!!'.
        STOP.
      ENDIF.
    **BUILD ALV DISPLAY.
      DEFINE ALV_MACRO.
        ALVFLD-FIELDNAME = &1.
        ALVFLD-SELTEXT_M = &2.
        ALVFLD-COL_POS = &3.
        IF &1 = 'ERFMG'.
          ALVFLD-DO_SUM = 'X'.
        ENDIF.
        APPEND ALVFLD TO FIELDCAT.
        CLEAR ALVFLD.
      END-OF-DEFINITION.
      REFRESH FIELDCAT.
      WK_LAYOUT-COLWIDTH_OPTIMIZE = 'X'.
      ALV_MACRO 'ZDATE' 'Rev.Date' '1'.
      ALV_MACRO 'SHIFT' 'Shift' '2'.
      ALV_MACRO 'WERKS' 'Plant' '3'.
      ALV_MACRO 'MDV01' 'Conveyor' '4'.
      ALV_MACRO 'MATNR' 'Material.No' '5'.
      ALV_MACRO 'MAKTX' 'Description' '6'.
      ALV_MACRO 'VEHNO' 'Veh.No' '7'.
      ALV_MACRO 'ENGNO' 'Eng.No' '8'.
      ALV_MACRO 'FRMNO' 'Frame.No' '9'.
      ALV_MACRO 'ERFMG' 'Qty' '10'.         <----Do Sum Here
      ALV_MACRO 'ZREASON_DES' 'Reason' '11'.
      ALV_MACRO 'ZUNAME' 'User.Reversed' '12'.
      REFRESH I_SORT.
      W_SORT-SPOS      = 1.
      W_SORT-FIELDNAME = 'ZDATE'.
      W_SORT-UP        = 'X'.
      APPEND W_SORT TO I_SORT.
      CLEAR W_SORT.
      W_SORT-SPOS      = 6.
      W_SORT-FIELDNAME = 'MAKTX'.
      W_SORT-UP        = 'X'.
      W_SORT-SUBTOT      = 'X'.
      APPEND W_SORT TO I_SORT.
      CLEAR W_SORT.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          I_GRID_TITLE  = 'Vehicle Reversal Report'
          IS_LAYOUT     = WK_LAYOUT
          IT_FIELDCAT   = FIELDCAT[]
          IT_SORT       = I_SORT[]
        TABLES
          T_OUTTAB      = IT_VEH_REV[]
        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.

  • How to display total in ALV Header

    How to display total in ALV Header?

    Hi Venkey,
    As far as your issue is concerned I would like to quote my perception.
    Create a header internal table with title and number of records.
    At the later part of your program you should have found the total number of records ,now assign it to the header internal table and print it.
    For further clarification you can go check this link:
    http://wiki.sdn.sap.com/wiki/display/ABAP/AddHeadertoALVreport
    Thanks
    P.Srikanth

  • In standard programmes how to know where the fields are in the code...Urge.

    How to find where the coding of the fields displayed in the standard transactions is written.FOr example In XD0l if I want to find out where the 'key term' is coded in the stadard programe of the transaction XD01.When I go into sytem--->status,I will get to see a window showing the details,In that we can see 3 PRAGRAMS-PROGRAM(SCREEN),PROGRAM(SUB SCREEN) AND PROGRAM (GUI).Can nay one explain the significance of these 3 programs.

    Hi Henry,
    I don't think this is the easiest way to look at the code around a particular field on the screen. Debugging standard programs also can be very tedious, if not impossbile. So, instead of this question, I would like to find out exactly what you want to do if you know the code.
    If you are in a transaction and you want to know where the code of a particular field is, the fastest way to get to it is by pressing the F1 key on the field and then press the Technical info button on the help screen. In here you will typically see the same kind of information but it is very specific to the field you selected.
    PROGRAM(SCREEN) tells you which program is manipulating the main screen, in which your field is embedded. Remember your field may be included in a sub-screen and that subscreen may be the one included in the main screen.
    PROGRAM(SUB SCREEN) tells you which program is directly responsible for the field on the subscreen it is included in. This is where you should find the code most appropriate for the field, but not necessarily.
    PROGRAM(GUI) controls how your push buttons and the menu options in the screen behave and controlled.
    Srinivas

  • How to display properties of dimension on the input form and report in bpc

    Dear Expert,
    Please tell me how to display properties of dimension on the input form and report in bpc. I can only display dimension number.
    thanks so much
    hungth

    Hi Hungh,
    If your are using BPC 10 with EPM add in client, you can use the function:
    EPMDimensionProperty ()
    This function retrieves the properties of a specified dimension in a specified cell range.
    Thanks, Safa

  • How do I create a separate Address Book? I'm not asking about a mailing list but an address book where the addresses are not mixed in with my regular address b

    How do I create a separate Address Book? I'm not asking about a mailing list but an address book where the addresses are not mixed in with my regular address book. I already have three address books created for me by Thunderbird. I add all new addresses to one of those but am afraid to delete the other address books because some of their addresses are not repeated in my "main" address book. So if I don't delete all the names in one of the existing books, I need to create an empty book that will not mix the addresses with those in another address book. HOW DO I CREATE A NEW, EMPTY ADDRESS BOOK? I want to be able to create various mailing LISTS using the addresses in this new book so I will eventually have a special address book with a variety of mailing lists I can use as I wish.

    In 24.4.0 there is no File|New|Address Book. There is File|New|Address Book Contact. How do I create a new address book ?

  • How to display multi-channel image in the 'proxy'?

    There're many examples to show how to display composite channels in the 'proxy'. But I don't find any example to show how to display multi-channel image in the 'proxy'. I found that I can use PSPixelOverlay to display alpha channel data like this:
    int nSpotChannel = gChannelCount - 4;
    PSPixelOverlay* overlay = new PSPixelOverlay[nSpotChannel];
    for(int i = 0; i < nSpotChannel; i++){
           if( i != (nSpotChannel - 1) )
                 overlay[i].next = overlay + i + 1;
           else
           overlay[i].next = NULL;
           overlay[i].data = gChannelData + (4 + i) * nPlaneBytes;
           overlay[i].rowBytes = gProxyRect.Width() * gDocDesc->depth / 8;
           overlay[i].colBytes = 1;
           overlay[i].r  = 230;
           overlay[i].g = 161;
           overlay[i].b = 174;
           overlay[i].opacity = 255;
           overlay[i].overlayAlgorithm = kStandardAlphaOverlay;
    pixels.pixelOverlays = overlay;
    Then, Seeing red part, it will trigger a new problem, that is how to get the color value of the alpha channel by plung-in itself? It seems that no channel color value info is in FilterRecord.
    If you have other solution, please tell me. Many thanks!

    This is what I've been doing - was just curious if there was a way to see a more cohesive image.
    If the individual EQ plugins are in fact the answer, is there any way to smooth how the Analyzer displays? The image I posted above, all of the tonal curves are very smooth. The analyzer tool shows a lot of peaks and valleys within the overall curve and it's hard to pinpoint each instrument's "sweet spot." Vocals for example are very hard to spot.
    - Morgan

  • How to display language key (0LANGU) in the query for BW report

    Hi,
    Can someone tell me how to display language key (0LANGU) in the query? I want to display which language (English or French) is used for material description in BW report. Thx.

    hi,
    check if the infoobject is kept as lang dependent or not  for material text, else you need to create a masterdata attribute with text and lang keys and do corresponding mapping, so then it can be displayed in your report
    regards
    laksh

  • How to display my country flag on the task bar in osx mavericks?

    How to display my country flag on the task bar in osx mavericks?

    System Preferences > Keyboard > Input Sources
    Checkmark the box beside "Show Input menu in menu bar".

  • How to delete unreleased transport request where the objects are locked

    Hi Experts,
      I was created a transport request, but I am facing some probelms with taht request, now I want to delete transport request. I tried to delete them in SE10, I am getting message that the objects are locked. Please tell me how to delete unreleased transport requests where the objects belong to this transport request are locked.

    Hi,
    First go to transaction se03 Choose "Unlock Objects (Expert Tool)" option under "Requests/Tasks" and unlock your task,
    Than go to se10 and delete what you want.
    I hope it helps.
    Bulent

  • I have paid for the Mountain Lion. But for some reason, I cannot seem to download it, despite software being upgraded. Anyone facing this problem where the download does not begin? How can I solve this?

    I have paid for the Mountain Lion. But for some reason, I cannot seem to download it, despite software being upgraded. Anyone facing this problem where the download does not begin? How can I solve this?

    Make sure your Mac qualifies to run Mountain Lion >  Apple - Upgrade your Mac to OS X Mountain Lion.
    Try disabling anti virus software and turn off the Firewall in System Preferencs > Security & Privacy
    Apps such as Little Snitch and Net Nanny can prevent apps from downloading from the App store including Mountain Lion.
    Third party download managers are not compatible with the App Store.
    Keep in mind, for downloading Mountain Lion from the App Store, a high speed (broadband) internet connection is strongly recommended by Apple as noted here > iTUNES STORE - MAC APP STORE - TERMS AND CONDITIONS
    If you need to reinstall OS X or repair the the startup disk using Mountain Lion Recovery, that requires broadband access to the internet via Wi-Fi or an Ethernet connection. OS X is downloaded over the internet form Apple when OS X Recovery is used for reinstallation.

  • How to compare two currency form fields and display a message if the fields do not equal?

    My form has 2 fields named Total_1 and Total_2. If one of the fields does not equal the other, a hidden field will display a message in red on the form alerting the user. Otherwise, the message does not display. Looks like a validation script but I would greatly appreciate help in getting it started. Any ideas?
    Thanks, Charlie
    charlie6067

    Since the field values that you want to compare are the results of calculations, you should not normally compare their string values, but rather their numeric values when rounded appropriately (and perhaps then converted to a string). For example, if you have two values that display as 3.14, one could be 3.1400000001 and the other could be 3.13999999999991234. When you get the field values as strings and compare them, they won't be equal though they appear to be. Even some values that are numerically identical won't be equal when compared as strings ("0.0" != "0.00") So the code could be changed to:
    // Get the two field values, rounded to two decimals
    var v1 = util.printf("%.2f", getField("Total_1").value);
    var v2 = util.printf("%.2f", getField("Total_2").value);
    // Hide/Show the error message
    event.value = (v1 === v2 || (+v1 === 0 && +v2 === 0)) ? "" : "Error message here.";

Maybe you are looking for