Calculation in ALV

Hi,
In my ALV grid,I have few columns.If i give a value for one of the column,it should do a calculation in the background and if i click Enter it should display the result in the next column.how do i do this?Kindly explain me in detail.

HI Sheeba,
If it is not OOPS-ALV, then you need to check in "SLIS", if there are any events available for this functionality. That would be similar to TOP-OF-PAGE event in SLIS.
If there is any event that is triggered automatically on "focus change" i.e., from one column to other OR if there is any event that gets triggered after data is changed in ALV, you need to use it for obtaining the functionality.
Instead, You can use the FM REUSE_ALV_EVENTS_GET and check the available events during RunTime in DEBUG mode.
I am not sure if there is any such functionality available. Try your luck in SLIS
Best Regards,
Ram.
Edited by: ram Kumar on Sep 10, 2008 1:52 PM

Similar Messages

  • Problem with subtotal calculation in ALV reports

    Hi All,
       I am doing one program for calculating subtoals in ALV . For this i want to display subtotal text at each envey subtotal 's row.
    For that i have created one form 'SUB_SUBTOT_TEXT' and it has given to IT_EVENTS-FORM. But SUB_SUBTOT_TEXT Form is not called by IT_EVENTS event.
    what are all the mandatories for displaying subtotal text.
    Can any one please help me.
    Thanks in Advance.

    Hi Sree,
    *& 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
    Hopes its helpful.
    Regards,
    Raj.

  • Calculations in ALV Tree

    Hi folks,
    I've done a report with an ALV TREE (CL_GUI_ALV_TREE) and I want to get on the first node the totals of its children.
    I have used the method UPDATE_CALCULATIONS and FRONT_END_UPDATE, everything it's ok when displaying the values, but when
    I try to get top node's calculated values by using the GET_OUTTAB_LINE method I get old values instead of updated ones.
    How can I get calculated values?
    Thnx in advance.

    refer this link
    Re: alv tree
    Class CL_GUI_ALV_TREE has two methods for refreshing the display:
    - FRONTEND_UPDATE (Sends Changed/Inserted Nodes to Control)
    - UPDATE_CALCULATIONS (Recalculate Columns)
    The second methods implicitly calls method FRONTEND_UPDATE except if you suppress it using parameter NO_FRONTEND_UPDATE = 'X'.

  • Calculation in Alv Report

    Hi SDN's
    I need to calculate Total(Cost1Cost2Cost3 = Total) in my alv report
    Date          Acc.no  Doc.Typ   Cost1  Cost2  cost3   Total
    20061206   123        GG         121     23        45       ????
    20070203   405         BL         234     67        89       ????
    How to calculate the total
    Thanks
    Kumar

    Hi Kumar,
    It is not possible to calculate total using ALV. We can calculate cost1 cost2 cost3 separately. You have to calculate separately and build internal table. You can color that column as total.
    giving sample code.
    1.
    LOOP AT i_tab .
      i_tab-total = i_tab-cost1 + i_tab-cost2 + i_tab-cost3.
      MODIFY i_tab INDEX sy-tabix TRANSPORTING total.
      CLEAR i_tab.
    ENDLOOP.
    2.
    Change the color of the column. While building fieldcatalog set emphasize = 'C25' like that . u will get the color.
    emphasize (highlight column in color)
    Value range: SPACE, 'X' or 'Cxyz' (x:'1'-'9'; y,z: '0'=off '1'=on)
    'X' = The column is highlighted in the default color for color highlighting.
    'Cxyz' = The column is highlighted in the coded color:
    C: Color (coding must start with C)
    x: Color number
    y: Intensified
    z: Inverse
      w_field-fieldname = 'TOTAL' .
      w_field-tabname = 'I_TAB'.
      w_field-emphasize = 'C26'.
      w_field-seltext_m = 'Total'.
      append w_field to i_field.
      clear w_field.
    I hope that it helps u .
    Regards,
    Venkat.O

  • Urgent: dates calculation in alv

    hi,
    i am making ALV report in alv in whihc i ahve to dispaly the difference between two days i.e. DIFFERRENCE = 7 DAYS.
    CAN anybody provide me the example of it as it is urgent for me.
    points will be definately rewarded for correct awnser.

    use function module
    HR_HK_DIFF_BT_2_DATES
    give output format = 03 and get the value in days.
    code is as below :
    data : DATE1 type  P0001-BEGDA,
           DATE2 type  P0001-BEGDA,
          YEARS type  P0347-SCRYY,
          MONTHS type  P0347-SCRMM,
          DAYS type  P0347-SCRDD.
    date1 = '20070331'.
    date2 = '20070101'.
    CALL FUNCTION 'HR_HK_DIFF_BT_2_DATES'
      EXPORTING
        DATE1                         = date1
        DATE2                         = date2
       OUTPUT_FORMAT                 = '03'
    IMPORTING
       YEARS                         = years
       MONTHS                        = months
       DAYS                          = days
    EXCEPTIONS
      INVALID_DATES_SPECIFIED       = 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.
    write : days.
    regards,
    sandeep Kaushik

  • Subtotal calculation in ALV

    hi all,
    i need to calculate montly subtotal value of a field  in ALV ( OO),
    how can i do that.
    plz send the code also.
    thanks in advance.
    regards
    sushant  singh

    Hi,
    1) Create a sort internal table for you to do sub totaling based on the field change..In this example..I have created a sort internal table and it will sum for every change in the field VBELN.
    data: gs_sort     type lvc_s_sort.
    data: gt_sort     type lvc_t_sort.
      gs_sort-fieldname = 'VBELN'.
      gs_sort-UP          = 'X'.
      gs_sort-SUBTOT  = 'X'.
      append gs_sort to gt_sort.
    Pass the internal table GT_SORT to the parameter                   
    it_sort = gt_sort
    of the method set_table_for_first_display..
    2) For the field you have to do sum in the field catalog have the field DO_SUM = 'X'..
    Thanks,
    Naren

  • Calculation in ALV subtotal field

    Hi,
    I have a requirement to display the percentage field in the subtotal and total field in ALV display.
    ie, I have 3 fields, say, A, B and percent. (percent = A/B * 100)
    A              B                     percent
    10             10                     100
    5               10                     50
    15              20                     75
    Currently I am getting like below:-
    A              B                     percent
    10             10                     100
    5               10                     50
    15              20                     150
    Is there any way to display the proper percentage in subtotal field in ALV?
    Thanks in advance.
    Regards,
    Arun Mohan

    Hi,
    As you have mentioned in the question
    A B percent
    10 10 100
    5 10 50
    15 20 75
    Here you can divide the percentage field by the number of rows you have in the report. E.g here you have 2 rows, so sum is 150/2 = 75
    HTH
    Regards,
    Dhruv Shah

  • Query for calculation in ALV Total

    HI All,
    I am using Sub_tot = "X" & do_sum="X" to get the subtotals & Totals for different columns Using REUSE_ALV_LIST_DISPLAY.
    I am calculating percentage in column "C" depending on result of Column "A" & Column "B", which is also achieved.
    My requirement is, Percentage in Total column to be calculated with use of TOTAL OF COLUMN "A" & TOTAL OF COLUMN "B". Because simply totaling all the values of percentage column will not work.
    Any Pointers will be helpful.
    Thanks In advance.
    Regards,
    Siddhesh Sanghvi.

    hi ,
       this is another example  for displaying the subtotals in many times ...
    report  zvg_alv_slist2                          .
    type-pools: slis.
    G L O B A L   I N T E R N  A L   T A B L E S
    data: gt_fieldcat type slis_t_fieldcat_alv,
          gs_layout   type slis_layout_alv,
          gt_events   type slis_t_event.
    data: it_sort type slis_t_sortinfo_alv ,
          wa_sort type slis_sortinfo_alv .
    data: gs_print type slis_print_alv.
    data: begin of it_sflight occurs 0,
            carrid     like sflight-carrid,
            connid     like sflight-connid,
            fldate     like sflight-fldate,
            price      like sflight-price,
            planetype  like sflight-planetype,
            seatsmax   like sflight-seatsmax,
            seatsocc   like sflight-seatsocc,
            paymentsum like sflight-paymentsum,
         end of it_sflight.
    *DATA: GI_SFLIGHT LIKE STANDARD TABLE OF ST_SFLIGHT.
    data: g_repid like sy-repid.
    data: gt_list_top_of_page type slis_t_listheader.
    data: v_total(5).
    start-of-selection.
      g_repid = sy-repid.
      perform init_fieldcat  using gt_fieldcat[].
      perform build_eventtab using gt_events[].
      perform build_comment  using gt_list_top_of_page[].
      perform get_data.
      perform set_layout using gs_layout.
    SORTING
      clear wa_sort.
      wa_sort-fieldname = 'CARRID'.
      wa_sort-up = 'X'.
      wa_sort-group = '*'.
      wa_sort-subtot = 'X'.
      append wa_sort to it_sort.
      clear wa_sort.
      wa_sort-fieldname = 'CONNID'.
      wa_sort-up = 'X'.
      wa_sort-group = 'UL'.
      wa_sort-subtot = 'X'.
      append wa_sort to it_sort.
    DISPLAY LIST
      call function 'REUSE_ALV_LIST_DISPLAY'
        exporting
          i_interface_check       = ' '
          i_callback_program      = g_repid
          i_callback_user_command = 'USER_COMMAND'
          is_layout               = gs_layout
          it_fieldcat             = gt_fieldcat[]
          it_sort                 = it_sort[]
          it_events               = gt_events
          is_print                = gs_print
        tables
          t_outtab                = it_sflight
        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  INIT_FIELDCAT
    form init_fieldcat using    p_gt_fieldcat type slis_t_fieldcat_alv.
      data: ls_fieldcat type slis_fieldcat_alv,
            l_index type sy-tabix.
      data :rep like sy-repid.
      rep = sy-repid.
      call function 'REUSE_ALV_FIELDCATALOG_MERGE'
        exporting
          i_program_name         = rep
          i_internal_tabname     = 'IT_SFLIGHT'
          i_inclname             = rep
        changing
          ct_fieldcat            = gt_fieldcat
        exceptions
          inconsistent_interface = 1
          program_error          = 2
          others                 = 3.
      if sy-subrc <> 0.
        message id sy-msgid type 'S' number sy-msgno
             with sy-msgv1 sy-msgv2 sy-msgv3 sy-subrc.
      endif.
      sort gt_fieldcat by col_pos.
      loop at gt_fieldcat into ls_fieldcat.
        l_index = sy-tabix.
        if ls_fieldcat-fieldname = 'PRICE'.
          ls_fieldcat-do_sum = 'X'.
          ls_fieldcat-sp_group = 'X'.
          modify gt_fieldcat from ls_fieldcat index l_index .
        endif.
      endloop.
    endform.                    " INIT_FIELDCAT
    *&      Form  BUILD_EVENTTAB
    form build_eventtab using  p_gt_events type slis_t_event.
      data: ls_event type slis_alv_event.
      clear ls_event.
      ls_event-name = slis_ev_top_of_page.
      ls_event-form = 'XTOP_OF_PAGE'.
      append ls_event to p_gt_events.
      clear ls_event.
      ls_event-name = slis_ev_top_of_list.
      ls_event-form = 'XTOP_OF_LIST'.
      append ls_event to p_gt_events.
      clear ls_event.
      clear ls_event.
      ls_event-name = slis_ev_end_of_page.
      ls_event-form = 'XEND_OF_PAGE'.
      append ls_event to p_gt_events.
      ls_event-name = slis_ev_end_of_list.
      ls_event-form = 'XEND_OF_LIST'.
      append ls_event to p_gt_events.
      clear ls_event.
    endform.                    " BUILD_EVENTTAB
    *&      Form  BUILD_COMMENT
    form build_comment using   p_gt_list_top_of_page type slis_t_listheader.
      data: ls_line type slis_listheader.
      ls_line-typ = 'H'." = Header, S = Selection, A = Action
      ls_line-key = 'KEY'.
      ls_line-info = 'INFO'.
      append ls_line to p_gt_list_top_of_page.
    endform.                    " BUILD_COMMENT
    *&      Form  SELECTION
    form get_data..
    data: l_rows type i value 3.
    Read data from table SFLIGHT
      select carrid
             connid
             fldate
             price
             planetype
             seatsmax
             seatsocc
             paymentsum
         from sflight
         into table it_sflight.
        up to l_rows rows.
      sort it_sflight.
    endform.                    " SELECTION
    *&      Form  SET_LAYOUT
    form set_layout using  p_gs_layout type slis_layout_alv.
    *  P_GS_LAYOUT-F2CODE            = P_F2CODE.
      p_gs_layout-zebra          = 'X'.
      p_gs_layout-colwidth_optimize = 'X'.
      p_gs_layout-no_input          = 'X'.
      p_gs_layout-no_colhead        = space.
      p_gs_layout-totals_text       = 'Total Price'.
      p_gs_layout-subtotals_text    = 'Sub Total'.
      p_gs_layout-totals_only       = 'X'.
      p_gs_layout-key_hotspot       = 'X'.
      p_gs_layout-detail_popup      = 'X'.
      p_gs_layout-no_subtotals      = space.
      p_gs_layout-expand_all        = 'X'.
      p_gs_layout-group_buttons     = 'X'."space.
    endform.                    " SET_LAYOUT
          FORM XTOP_OF_PAGE                                             *
    form xtop_of_page.
    data : lv_page(5),
            lv_text(20).
      MOVE SY-PAGNO TO LV_PAGE.
      write:/  'X_TOP_OF_PAGE'.
    endform.                    "xtop_of_page
          FORM XTOP_OF_LIST                                             *
    form xtop_of_list.
      write:/  'X_TOP_OF_LIST'.
    endform.                    "xtop_of_list
          FORM XEND_OF_PAGE                                             *
    form xend_of_page.
      write:/  'X_END_OF_PAGE'.
    endform.                    "xend_of_page
          FORM XEND_OF_LIST                                             *
    form xend_of_list.
      write:/  'X_END_OF_LIST'.
      data : lv_page(5),
             lv_text(20).
      data : l_lines type i,
             l_line  type i.
      clear v_total.
      write sy-pagno to v_total left-justified.
    export v_total to memory id 'V_TOTAL'.
      do sy-pagno times.
        lv_page = sy-index.
        concatenate 'Page' lv_page 'of' v_total
             into lv_text separated by space.
        if sy-index = 1.
          read line 2 of page sy-index.
        else.
          read line 1 of page sy-index.
       endif.
        sy-lisel+60(20) = lv_text.
          modify current line .
      enddo.
    endform.                    "xend_of_list
          USER_COMMAND                                             *
    form user_command  using r_ucomm like sy-ucomm
                              rs_selfield type slis_selfield.
      case r_ucomm.
        when 'EXIT'.
          leave to screen 0.
        when '&IC1'.
          data: text(256),text1(6),text2(5).
          move rs_selfield-tabindex to text1.
          move rs_selfield-sumindex to text2.
          concatenate  'Double clicked on (field:'
                        rs_selfield-fieldname
                        'Value:'
                        rs_selfield-value
                        text1
                        text2
                        into text
                        separated by space.
          call function 'POPUP_TO_DISPLAY_TEXT'
            exporting
              textline1 = text.
      endcase.
    endform.                    "user_command
    regards,
    venkat.

  • ALV Grid( How to calculate percentage) using alv gridfunctional module.

    Dear Gurus,
    In my report first coulmn and second column are sales and margin but third coulmn is margin%. now at last of report i want to display total sales and total margin and overall margin percentage. I am able to do total of sales and margin by using standard functionality of grid. I need to know to calculate overall percentage. I am not using alv oops method . I am using fucntional modules .
    Thanks in advance.
    Regards
    Dave

    Hi Devendra shrama,
    Percentage calculation in ALV
    The following method is a bit of a mission but it
    seems to be the only way around this at the moment.
    Also it only works with an ALV Grid not an ALV List.
    You have to take over the total lines manually.
    1. In the ALV output tab add extra fields that are the
    same as those on which you are sorting and contain the
    same values.
    2. In the Field Catalog you must add these fields but
    they must be hidden i.e. no_out = 'X'.
    3. These fields must be included in the Sort Catalog
    with subtot = 'X'.
    4. In order to handle the final total line in your
    layout for the ALV you must set field no_totalline'X' because you are going to be taking this over as
    well.
    5. Create a form called SUBTOTAL_TEXT or similar
    structured as follows:
    form subtotal_text using ep_subtot_line like
    output_tab
    es_subtottxt type
    slis_subtot_text.
    In this form you will do the percentage calculation
    again at total level. The structure ep_subtot_line
    will contain a field for each of the fields in your
    output_tab i.e. ep_subtot_line-sales,
    ep_subtot_line-cost and ep_subtot_line-margin. Put the
    margin calculation into ep_subtot_line-margin.
    6. In the eventtab that you pass to the ALV_GRID
    function module you must create a record with the
    field name = 'SUBTOTAL_TEXT' and the field form = the
    name of the form you created in step 5 above.
    This works OK.
    i hope it helps you.Happy solving.
    thanks
    karthik

  • How can i use "GT_SORT"  in alv  ?

    hello  ,
    i need to sort alv report by some fields  .
    i use   :
    GT_SORT-FIELDNAME = 'FRGGR'.
    GT_SORT-TABNAME = 'G_TABNAME_ITEM'.
    GT_SORT-SPOS = 1.
    GT_SORT-UP = 'X'.
    GT_SORT-SUBTOT = 'X'.
    GT_SORT-GROUP = '*'.
    APPEND GT_SORT.
    the alv is "REUSE_ALV_HIERSEQ_LIST_DISPLAY"
    but i don't see the change  , what i doing wronge ?

    Hi dakota,
    what are the results of the forum search you di before posting the question?
    Regards,
    Clemens
    Expert Forums
    Forum Search
    Use the form below to search the forum content. You can choose to search all content or restrict it to certain forums or dates. Also, you can filter the results by a username or user ID.
    Search Forum Content
    Search Terms:        Search Tips
    Category or Forum:      
    Date Range:      
    Results Per Page:      
    Welcome, Clemens Li      Help
    Your Control Panel      Your Control Panel
    Your Reward Points      Your Reward Points
    Your Questions      Your Questions
    Search Results » Messages: 339 - Search Terms: GT_SORT      Sort by:
    Pages: 23 1 2 3 4 5 6 7 8 9 10
       1. Re: how can i use "GT_SORT" in alv ?
          Posted on: Jul 15, 2007 3:50 PM, by user: Kiran Sure(skk) -- Relevance: 100% -- Show all results within this thread
          Hi, GT_SORT TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE, GT_SORT-FIELDNAME = 'UOM'. GT_SORT-TABNAME = '1'. GT_SORT-SPOS = 1. GT_SORT-UP = 'X'. GT_SORT-SUBTOT = 'X'.
    Reward points ...   2. Re: "Totals" option in Hierarchical List
          Posted on: Feb 7, 2006 8:40 PM, by user: John Jakabcsin -- Relevance: 17% -- Show all results within this thread
          Vicky, The SORT table is the device that allows the ALV tree to paint in it's hierarchial fashion. Your source might look like this: FORM set_sorting TABLES gt_sort STRUCTURE lvc_s_sort. g ...
       3. Re: Regarding ALV Report
          Posted on: Mar 14, 2007 7:36 AM, by user: Azeem Mohammed -- Relevance: 15% -- Show all results within this thread
          GT_SORT TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE, GT_SORT-FIELDNAME = 'UOM'. GT_SORT-TABNAME = '1'. GT_SORT-SPOS = 1. GT_SORT-UP = 'X'. GT_SORT-SUBTOT = 'X'. Then in FCAT use parameter do ...
       4. Re: ALV display
          Posted on: Aug 31, 2006 1:33 AM, by user: Kishore Maddu -- Relevance: 10% -- Show all results within this thread
          in your example you can see passing sorting table GT_SORT to reuse_....grid function module... just copy that program to one z program and commet and gt_sort parameter and then check... please ...
       5. Re: How to remove horizontal lines in ALV_LIST
          Posted on: Feb 15, 2006 12:48 PM, by user: Hymavathi Oruganti -- Relevance: 10% -- Show all results within this thread
          just check whether in gt_sort if u have mentioned gs_sort-group = 'UL'
       6. Re: Problem Saving ALV Report
          Posted on: Feb 7, 2007 4:12 PM, by user: Clemens Li -- Relevance: 10% -- Show all results within this thread
          Hi Anwarul, parameter it_sort = gt_sort[] will overrirde the sort in the variant. Regards, Clemens ...
       7. Re: Subtotals in ALV
          Posted on: Dec 13, 2006 6:15 PM, by user: krk -- Relevance: 10% -- Show all results within this thread
          Hi You have gs-sort and gt_sort. Make sure which one you are passing and declare the type as for that FM LIST_Display. ...
       8. Re: ALG Grid Same values not grouped!
          Posted on: Mar 17, 2006 11:23 AM, by user: Kumar Prashanth -- Relevance: 9% -- Show all results within this thread
          set_table_for_first_display EXPORTING i_save = gv_save is_layout = gv_layout is_print = gv_print is_variant = gv_variant CH ...
       9. Re: Total amount in ALV report
          Posted on: Dec 12, 2005 9:41 PM, by user: Phani Kiran Nudurupati -- Relevance: 9% -- Show all results within this thread
          Hi Naren, Pass it this way in the structure. DATA: GT_SORT TYPE SLIS_T_SORTINFO_ALV, DATA: GS_SORT TYPE SLIS_SORTINFO_ALV. CLEAR GS_SORT. GS_SORT-FIELDNAME = 'EBELN'. "This should be the fie ...
      10. Re: ALV Subtotal
          Posted on: May 2, 2007 11:29 PM, by user: Alchemi -- Relevance: 8% -- Show all results within this thread
          I have this in one include program GT_SORT_OFFSET TYPE SLIS_T_SORTINFO_ALV WITH HEADER LINE, can i email u the code? ...
      11. Re: ALV Tree Problem
          Posted on: Mar 20, 2007 6:49 PM, by user: Christian CHOULET -- Relevance: 8% -- Show all results within this thread
          Hello aRs, Yes i'm sure KOSTL is available in WT_TEST. The problem is that when i another element in GT_SORT, this error appears... Thanks anyway ...
      12. Re: subtotal calculation in ALV
          Posted on: Nov 14, 2006 5:35 PM, by user: Narendran Muthukumaran -- Relevance: 8% -- Show all results within this thread
          Hi, 1) Create a sort internal table for you to do sub totaling based on the field change..In this example..I have created a sort internal table and it will sum for every change in the field VBELN. ...
      13. Re: ALV grid sort
          Posted on: Oct 4, 2006 1:22 PM, by user: sreejesh purapadiath -- Relevance: 7% -- Show all results within this thread
          set_table_for_first_display EXPORTING is_layout = gs_layout it_toolbar_excluding = gt_excl_func[] CHANGING it_outtab = i_final[] ...
      14. Re: ALV Print about subtotal
          Posted on: Dec 17, 2005 11:35 AM, by user: max bianchi -- Relevance: 7% -- Show all results within this thread
          Hi In the sort table you has to define the field for sorting and subtotal: DATA: LT_SORT TYPE LVC_S_SORT, GT_SORT TYPE LVC_T_SORT. LT_SORT-SPOS = 1. LT_SORT-FIELDNAME = . LT_SORT-UP ...
      15. Re: Subtotals text in ALV
          Posted on: Feb 14, 2006 11:53 AM, by user: Wenceslaus G -- Relevance: 7% -- Show all results within this thread
          To display subtotal text you have to create sort interface GT_SORT TYPE SLIS_T_SORTINFO_ALV, and GS_SORT-FIELDNAME = 'FIELD1'. GS_SORT-SPOS = 1. GS_SORT-UP = 'X'. GS_S ...
    Pages: 23 1 2 3 4 5 6 7 8 9 10

  • T.code ME55

    Hi Experts ,
    I want to know where exactly the ALV GRID DISPLAY Function Module has been called in the program of T.code ME55(RM06BF00) , Actually my requirement is to add one more field (available stock of the material ) in the ALV Output of the T.code ME55 . I tried to find the field catalogue in the prog. RM06BF00 , but could'nt find it anywhere in the prog. Then I copied the prog. into a Z Report and after executing the Z report in the Selection screen I entered Release Code = G3 and Scope of List = ALV .
    But an exit message comes saying ' Scope of list ALV not defined (please correct)' . However for another scope of list it is coming . Plese help .
    Thanks ,
    Suvendu

    *& Report  ZBREAKDOWN
    REPORT  ZBREAKDOWN NO STANDARD PAGE HEADING..
    tables: CRHD, QMEL, QMFE, QMIH, QMUR, TQ80_T, TQ15T, QPGT, QPGR, t001w.
    type-pools slis.
    data : it_list type slis_t_listheader with header line,
           gt_evnt type slis_t_event with header line.
    data : begin of outstand_wa occurs 0,
    ********Work Center Header
    OBJTY       LIKE CRHD-OBJTY    ,  " Object types of the CIM resource
    OBJID       LIKE CRHD-OBJID    ,  " Object ID of the resource
    ARBPL       LIKE CRHD-ARBPL    ,  " Work center
    WERKS       like CRHD-WERKS    ,  " Plant
    VERWE       LIKE CRHD-VERWE    ,  " Work center cat.
    VERAN       LIKE CRHD-VERAN    ,  " Person responsible for the work center
    *********Quality Notification
    CROBJTY     LIKE QMEL-CROBJTY  ,  " Object types of the CIM resource
    ARBPLn      LIKE QMEL-ARBPL    ,  " Object ID of the Work Center
    QMNUM       LIKE QMEL-QMNUM    ,  " Notification No
    QMART       LIKE QMEL-QMART    ,  " Notification Type
    QMTXT       LIKE QMEL-QMTXT    ,  " Short Text
    QMDAT       LIKE QMEL-QMDAT    ,  " Date of Notification
    AUFNR       LIKE QMEL-AUFNR    ,  " Order Number
    **********Notification type texts
    QMARTX      LIKE TQ80_T-QMARTX ,  " Notification Type Texts
    *********Quality notification - items
    FEKAT       LIKE QMFE-FEKAT    ,  " Catalog Type - Problems/Defects
    FEGRP       LIKE QMFE-FEGRP    ,  " Code Group - Problem
    FECOD       LIKE QMFE-FECOD    ,  " Problem or Damage Code
    OTKAT       LIKE QMFE-OTKAT    ,  " Catalog Type - Object Parts
    OTGRP       LIKE QMFE-OTGRP    ,  " Code Group - Object Parts
    KOSTL       LIKE QMFE-KOSTL    ,  " Cost Center
    FETXT       LIKE QMFE-FETXT    ,  " Notification Item Short Text
    ERNAM       LIKE QMFE-ERNAM    ,  " Name of Person who Created the Object
    ERDAT       LIKE QMFE-ERDAT    ,  " Date on Which Record Was Created
    AENAM       LIKE QMFE-AENAM    ,  " Name of Person Who Changed Object
    AEDAT       LIKE QMFE-AEDAT    ,  " Changed On
    *****Inspection catalog type index
    SPRACHE     LIKE TQ15T-SPRACHE    , " Language Key
    KATALOGART  LIKE TQ15T-KATALOGART , " Catalog
    KATALOGTXT  LIKE TQ15T-KATALOGTXT , " Catalog Text
    **********Code group texts
    CODEGRUPPE  LIKE QPGT-CODEGRUPPE  , " Code Group
    KURZTEXT    LIKE QPGT-KURZTEXT    , " Short Description of the Code Group
    **********Inspection catalog code groups
    *KURZTEX     LIKE QPGR-KURZTEXT    , "
    *********Quality message - maintenance data excerpt
    MSAUS       LIKE QMIH-MSAUS    ,  " Breakdown Indicator
    AUSVN       LIKE QMIH-AUSVN    ,  " Start of Malfunction (Date)
    AUSBS       LIKE QMIH-AUSBS    ,  " End of Malfunction (Date)
    AUZTV       LIKE QMIH-AUZTV    ,  " Start of Malfunction (Time)
    AUZTB       LIKE QMIH-AUZTB    ,  " End of Malfunction (Time)
    AUSZT       LIKE QMIH-AUSZT    ,  " Breakdown Duration
    INGRP       LIKE QMIH-INGRP    ,  " Planner Group for Customer Service and Plant Maintenance
    *********Quality notification - causes
    URTXT       LIKE QMUR-URTXT    ,  " Cause Text
    URKAT       LIKE QMUR-URKAT    ,  " Catalog Type - Causes
    URGRP       LIKE QMUR-URGRP    ,  " Code Group - Causes
    URCOD       LIKE QMUR-URCOD    ,  " Cause Code
    *********Person responsible for the work center
    KTEXT       LIKE TC24-KTEXT    ,  " NAME OF THE PERSON RESP.
    *****Plants/Branches
    stras       like t001w-stras   ,
    pstlz       like t001w-pstlz   ,
    adrnr       like t001w-adrnr   ,
    ort01       LIKE t001w-ort01   ,
    BIND(3),
    KATALOG(40),
    ddiff TYPE  p,
    tdiff TYPE  p DECIMALS 2,
    d3 type p,
    t3 type minutes,
    m_break type sy-uzeit,
    t4(16) type p,
    t6 type sy-tabix,
    t7 type swl_pm_cvh-duration,
    t5 type swl_pm_cvh-duration,
    end of outstand_wa.
    *data : outstand_hd type standard table of  outstand_wa initial size 0 with header line.
    data : tab_etab type standard table of etab,
           wa_etab type etab.
    DATA: is_layout TYPE slis_layout_alv.
    DATA: M_TIME TYPE SY-UZEIT VALUE 24.
    data: l_start     type t,
          l_end       type t,
          l_startdate type d,
          l_enddate   type d,
          l_hours     type p decimals 2.
    *DATA :  DATE1 TYPE SY-DATUM,
           TIME1 TYPE SY-UZEIT,
           DATE2 TYPE SY-DATUM,
           TIME2 TYPE SY-UZEIT.
    selection-screen begin of block plant with frame title text-001.
    select-options : m_plant for CRHD-WERKS obligatory .  " Plant
    select-options : m_work  for CRHD-ARBPL .             " Work center
    select-options : m_catg  for CRHD-VERWE .             " Work center cat.
    select-options : m_pern  for CRHD-VERAN .             " Person responsible for the work center
    select-options : m_type  for QMEL-QMART .             " Notification Type
    select-options : m_date  for QMEL-QMDAT obligatory.   " Date of Notification
    select-options : m_ordr  for QMEL-AUFNR .             " Order Number
    select-options : m_cost  for QMFE-KOSTL .             " Cost Center
    selection-screen end of block plant.
    selection-screen begin of block radi with frame title text-004.
    *parameters list      radiobutton group rad1.
    parameters grid      radiobutton group rad1.
    parameters alv       radiobutton group rad1.
    selection-screen end of block radi.
    data: fieldcat type slis_t_fieldcat_alv .
    select CRHDOBJTY   CRHDOBJID CRHDARBPL CRHDWERKS CRHDVERWE CRHDVERAN
           QMELCROBJTY QMELARBPL QMELQMNUM QMELQMART QMELQMTXT QMELQMDAT QMEL~AUFNR
           TQ80_T~QMARTX
           QMFEFEKAT   QMFEFEGRP QMFEFECOD QMFEOTKAT QMFEOTGRP QMFEKOSTL QMFEFETXT QMFEERNAM QMFEERDAT QMFEAENAM QMFE~AEDAT
           TQ15TSPRACHE TQ15TKATALOGART TQ15T~KATALOGTXT
           QPGTCODEGRUPPE QPGTKURZTEXT
           QMIHMSAUS   QMIHAUSVN QMIHAUSBS QMIHAUZTV QMIHAUZTB QMIHAUSZT QMIH~INGRP
           QMURURTXT   QMURURKAT QMURURGRP QMURURCOD
           TC24~KTEXT
           T001WSTRAS  T001WPSTLZ T001WADRNR T001WORT01
    into table outstand_wa
         from CRHD
    INNER JOIN QMEL   ON CRHDOBJID = QMELARBPL
    INNER JOIN QMFE   ON QMELQMNUM = QMFEQMNUM
    INNER JOIN QMIH   ON QMFEQMNUM = QMIHQMNUM
    INNER JOIN QMUR   ON QMIHQMNUM = QMURQMNUM
    INNER JOIN TC24   ON CRHDVERAN = TC24VERAN
    INNER JOIN T001W  ON CRHDWERKS = T001WWERKS
    INNER JOIN TQ80_T ON QMELQMART = TQ80_TQMART
    INNER JOIN TQ15T  ON QMFEFEKAT = TQ15TKATALOGART
    INNER JOIN QPGT   ON QMFEFEGRP = QPGTCODEGRUPPE
    WHERE CRHDWERKS IN m_plant AND CRHDARBPL IN m_work AND CRHDVERWE IN m_catg AND CRHDVERAN IN m_pern
    AND QMELQMART IN m_type AND QMELAUFNR IN m_ordr AND QMFEKOSTL IN m_cost AND TQ15TSPRACHE = 'E' AND QMEL~QMDAT IN m_date.
    *AND QMEL~QMDAT IN m_date
    **AND CRHDARBPL IN m_work AND CRHDVERWE IN m_catg AND CRHD~VERAN IN m_pern
    **AND QMELQMART IN m_type AND QMELQMDAT IN m_date AND QMELAUFNR IN m_ordr AND QMFEKOSTL IN m_cost AND TQ15T~SPRACHE = 'E'.
    *AND QPGTCODEGRUPPE = QMFEOTGRP.
    if sy-subrc = 0.
    LOOP AT outstand_wa.
      if outstand_wa-MSAUS = 'X'.
         outstand_wa-BIND = 'YES'.
         modify outstand_wa transporting BIND.
      endif.
      if outstand_wa-MSAUS = ' '.
         outstand_wa-BIND = 'NO'.
         modify outstand_wa transporting BIND.
      endif.
    if outstand_wa-URKAT = '1'.
       outstand_wa-KATALOG = 'Characteristic Attributes'.
       MODIFY outstand_wa TRANSPORTING KATALOG.
    ENDIF.
    if outstand_wa-URKAT = '2'.
       outstand_wa-KATALOG = 'Tasks'.
       MODIFY outstand_wa TRANSPORTING KATALOG.
    ENDIF.
    if outstand_wa-URKAT = '3'.
       outstand_wa-KATALOG = 'Usage Decisions'.
       MODIFY outstand_wa TRANSPORTING KATALOG.
    ENDIF.
    if outstand_wa-URKAT = '4'.
       outstand_wa-KATALOG = 'Events'.
       MODIFY outstand_wa TRANSPORTING KATALOG.
    ENDIF.
    if outstand_wa-URKAT = '5'.
       outstand_wa-KATALOG = 'Causes'.
       MODIFY outstand_wa TRANSPORTING KATALOG.
    ENDIF.
    if outstand_wa-URKAT = '6'.
       outstand_wa-KATALOG = 'Results of Defects'.
       MODIFY outstand_wa TRANSPORTING KATALOG.
    ENDIF.
    if outstand_wa-URKAT = '8'.
       outstand_wa-KATALOG = 'Activities(QM)'.
       MODIFY outstand_wa TRANSPORTING KATALOG.
    ENDIF.
    if outstand_wa-URKAT = '9'.
       outstand_wa-KATALOG = 'Defect Types'.
       MODIFY outstand_wa TRANSPORTING KATALOG.
    ENDIF.
    if outstand_wa-URKAT = 'A'.
       outstand_wa-KATALOG = 'Activities(PM)'.
       MODIFY outstand_wa TRANSPORTING KATALOG.
    ENDIF.
    if outstand_wa-URKAT = 'B'.
       outstand_wa-KATALOG = 'Object Parts'.
       MODIFY outstand_wa TRANSPORTING KATALOG.
    ENDIF.
    if outstand_wa-URKAT = 'C'.
       outstand_wa-KATALOG = 'Overview of Damage'.
       MODIFY outstand_wa TRANSPORTING KATALOG.
    ENDIF.
    if outstand_wa-URKAT = 'D'.
       outstand_wa-KATALOG = 'Coding'.
       MODIFY outstand_wa TRANSPORTING KATALOG.
    ENDIF.
    if outstand_wa-URKAT = 'E'.
       outstand_wa-KATALOG = 'Defect Locations'.
       MODIFY outstand_wa TRANSPORTING KATALOG.
    ENDIF.
    if outstand_wa-URKAT = 'F'.
       outstand_wa-KATALOG = 'Decision(SPM Returns)'.
       MODIFY outstand_wa TRANSPORTING KATALOG.
    ENDIF.
    if outstand_wa-URKAT = 'G'.
       outstand_wa-KATALOG = 'Defect(SPM Returns)'.
       MODIFY outstand_wa TRANSPORTING KATALOG.
    ENDIF.
    if outstand_wa-URKAT = 'H'.
       outstand_wa-KATALOG = 'Effort(SPM Returns)'.
       MODIFY outstand_wa TRANSPORTING KATALOG.
    ENDIF.
    if outstand_wa-URKAT = 'I'.
       outstand_wa-KATALOG = 'Follow-Up Activity(SPM Returns)'.
       MODIFY outstand_wa TRANSPORTING KATALOG.
    ENDIF.
    ENDLOOP.
    ENDIF.
    IF outstand_wa-MSAUS = 'X'.
    BIND = 'YES'.
    ELSEIF outstand_wa-MSAUS = '  '.
    BIND ='NO'.
    ENDIF.
    *ENDLOOP.
    *ENDIF.
    case 'X'.
        WHEN LIST.
        PERFORM SIMPLE_LIST.
      when grid.
        perform writ_list.
        perform calculation.
      when alv.
        perform writ_alv.
        perform calculation.
       DATA: layout TYPE slis_layout_alv.
       PERFORM build_field_catalog.
       CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
         EXPORTING
           is_layout              = layout
           it_fieldcat            = fieldcat
           i_callback_top_of_page = 'TOP_OF_PAGE'
           it_events              = gt_evnt[]
         TABLES
           t_outtab               = outstand_wa.
    endcase.
    *&      Form  BUILD_LAYOUT
          Build layout for ALV grid report
    *form build_layout.
    gd_layout-no_input          = 'X'.
    gd_layout-colwidth_optimize = 'X'.
    gd_layout-totals_text       = 'Totals'(201).
    *gd_layout-totals_text       = 'Totals'.
    Set layout field for row attributes(i.e. color)
    gd_layout-info_fieldname =      'LINE_COLOR'.
    gd_layout-totals_only        = 'X'.
    gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
                                            "click(press f2)
    gd_layout-zebra             = 'X'.
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text       = 'helllllo'.

  • Re: Sales Delivery Reports. Fields

    Dear All experts.
    How to Initialization of Field Calculatio in ABAP code Syntax. Please Guide me for setting UP in ALV Grid
    Report.
    Also Decleration of Global variable. it can be Used Any where via code.
      wa_fieldcat-tabname = 'ITAB'.
      wa_fieldcat-fieldname = 'NTGEW'.
      wa_fieldcat-seltext_m = 'Net Weight'.
      wa_fieldcat-outputlen = '10'.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Please Give Me Syntax of the following calculation in ALV Grid programs :
    *WEIGHT = WEIGHT + ( ( VBAP-NTGEW / VBAP-KWMENG ) * VBAP-KBMENG ).*
    Thnks in Advance :
    Bhavesh Panchal.

    hi,
    check this.
    REPORT  YMON_ALV2.
    TYPE-POOLS : SLIS.
    *DATA Declaration
    DATA: i_sflight TYPE TABLE OF sflight,
          i_fcat type slis_t_fieldcat_alv,
          wa_fcat TYPE slis_fieldcat_alv.
    wa_fcat-tabname = 'SFLIGHT'.
    WA_FCAT-COL_POS = 1.
    WA_FCAT-FIELDNAME = 'CARRID'.
    WA_FCAT-SELTEXT_L = 'ID'.
    APPEND WA_FCAT TO I_FCAT.
    WA_FCAT-COL_POS = 2.
    WA_FCAT-FIELDNAME = 'FLDATE'.
    WA_FCAT-SELTEXT_L = 'DATE'.
    APPEND WA_FCAT TO I_FCAT.
    WA_FCAT-COL_POS = 3.
    WA_FCAT-FIELDNAME = 'CONNID'.
    WA_FCAT-SELTEXT_L = 'NO.'.
    APPEND WA_FCAT TO I_FCAT.
    WA_FCAT-COL_POS = 4.
    WA_FCAT-FIELDNAME = 'PRICE'.
    WA_FCAT-SELTEXT_L = 'FARE'.
    APPEND WA_FCAT TO I_FCAT.
    WA_FCAT-COL_POS = 5.
    WA_FCAT-FIELDNAME = 'CURRENCY'.
    WA_FCAT-NO_OUT = 'X'.
    APPEND WA_FCAT TO I_FCAT.
    WA_FCAT-FIELDNAME = 'PLANETYPE'.
    WA_FCAT-NO_OUT = 'X'.
    APPEND WA_FCAT TO I_FCAT.
    *DATA SELECTION
    SELECT * FROM SFLIGHT INTO TABLE I_SFLIGHT.
    *CALL ABAP LIST VIEWER
    *  CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
    *        EXPORTING
    **          I_STRUCTURE_NAME     = 'SFLIGHT'
    *          IT_FIELDCAT          = I_FCAT
    *        TABLES
    *          T_OUTTAB             = I_SFLIGHT.
       CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
    *          I_STRUCTURE_NAME     = 'SFLIGHT'
              I_GRID_TITLE         = 'FLIGHT INFORMATION'
              IT_FIELDCAT          = I_FCAT
            TABLES
              T_OUTTAB            = I_SFLIGHT.
    and u can write like this
    WEIGHT = WEIGHT + ( ( VBAP-NTGEW / VBAP-KWMENG ) * VBAP-KBMENG ).*
    or
    WEIGHT = (VBAP-KBMENG * ( VBAP-NTGEW / VBAP-KWMENG ) ) + WEIGHT .

  • Sales Delivery Reports. Fields

    Dear All Experts.
    I making a Sales Order Reports. Using Following Tables.
    VBEP , VBAP ,  VBPA , VBKD , VBAK , LIKP , LIPS , KNA1
    I successfully Search Other Fields.
    But i cant Find exact field for PENDING QTY, PENDING WEIGHT, ORDER QTY, PENDING VALUE, SCHEDULE OR PLANNED delivery & Next Schedule.
    Please Give me help for this Field with table name.
    Bhavesh Panchal
    SAP ABAP.
    Baroda.

    Dear All experts.
    How to Initialization of Field Calculatio in ABAP code Syntax. Please Guide me for setting UP in ALV Grid
    Report.
    Also Decleration of Global variable. it can be Used Any where via code.
      wa_fieldcat-tabname = 'ITAB'.
      wa_fieldcat-fieldname = 'NTGEW'.
      wa_fieldcat-seltext_m = 'Net Weight'.
      wa_fieldcat-outputlen = '10'.
      APPEND wa_fieldcat TO i_fieldcat.
      CLEAR wa_fieldcat.
    Please Give Me Syntax of the following calculation in ALV Grid programs :
    *WEIGHT = WEIGHT + ( ( VBAP-NTGEW / VBAP-KWMENG ) * VBAP-KBMENG ).*
    Thnks in Advance :
    Bhavesh Panchal.

  • Side effects of SP 18

    Hi all,
    Does anyone know what are the side effects with support package 18 for BI 7.00
    Thanks,
    Joseph M

    Hi Joseph,
    Please find the list of Side effects that might come during SP upgrade:
    Transaction BUP3 opens BP in change mode on first access
    PPOM: search function dumps
    HRALXSYNC: No repair if BP-integration is partly active
    Generation of testplan, testcase, project - long runtime
    Unable to logon to due to updating of INDX table
    ICF: ICF buffer filled because of special suffixes
    Collective corrections: Logon 2/2007
    SU01: Password change dialog box and 'Logon data' tab page
    SU01: Password change dialog box and 'Logon data' tab page
    Downports: CUA change docs, archiving, 12 hour time format
    'Group' Titles are not being displayed.
    ALV form : TOP-OF-LIST on TOP-OF-PAGE with page numbers
    ALV mean value: mean value calculated incorrectly
    ALV Grid: Selection column is no longer displayed
    Message logs displayed after sorting
    Minor performance improvement in PDF generation
    Object pool: Persistent objects are not saved
    OutputDevice name is getting chopped in oac0
    Files not being deleted from the filesystem after archiving
    MS Word as Editor in SAPscript and Smart Forms
    MS Word as Editor in SAPscript and Smart Forms
    MS Word as Editor in SAPscript and Smart Forms
    MS Word as Editor in SAPscript and Smart Forms
    RTF download from Unicode systems
    RTF download from Unicode systems
    Tax amount ignored in transaction total sales
    BW 0RENTOBJECT_ATTR, occupancy cost center missing
    BW master data, time-independent characteristics are deleted
    BW master data, time-independent characteristics are deleted
    Termination CELL_FUELLEN_FEMZ-02 during query generation
    Field symbol not assigned in CL_RSDD_STATOLAP
    BIA: Master data reorganization for Y tables is not adjusted
    BIA: Master data reorganization for Y tables is not adjusted
    BIA shadow index: Enhancement of analysis option
    Inaccuracies in OLAP cache
    Inaccuracies in OLAP cache
    Dump TYPELOAD_LOS with insert in /BI0/06* tables
    Displaying SQL and EXPLAIN in query statistics
    BIA index incorrect after cancelation request
    F4 Hierarchy variable ignores version and date restrictions
    i_objvers: RSD_IOBJNM_GET_FROM_INFOSET
    MDX: Too many values for NON EMPTY and WITH SET
    Termination RTIME_APPEND-02- in program SAPLRRS2
    X299 Brain in CL_RSDRC_MULTIPROV; form GET_PART_IOBJNM-01-
    Buffering the MultiProvider runtime object
    Buffering the MultiProvider runtime object
    Buffering the MultiProvider runtime object
    Buffering the MultiProvider runtime object
    Dynamic DATA table during reading of data
    Compounding and text variable, dynamic filter
    READMODE initial leads to READMODE = A for MultiProviders
    Releasing memory OLAP_CACHE
    Termination SIDS_DIVIDE in SAPLRRSI and hierarchies
    Performance improvement during analysis authorizations
    Text variable with replacement path and exception cells
    Formula variable not replaced (hierarchy deactivated)
    IP: Optimizations for writable InfoProviders
    Termination DMMAN 13; reading of delta buffer improved
    Termination DMMAN 13; reading of delta buffer improved
    The OLAP tunnel
    Planning functions: Distribution with keys
    DB6: Filling the aggregate in blocks with MDC
    DB6: Filling the aggregate in blocks with MDC
    DB6: Improve performance of data load
    RSD_IOBJ_CMP_GET: Compounded navigation attributes
    RSD_IOBJ_CMP_GET: Compounded navigation attributes
    P18:DSO:Dump if you activate too many requests together
    P17:DSO:Postprocessing ODS - activating and updating
    Connection of MultiProvider validation in RSDMPROM
    Post office bank current acct number not checked correctly
    Unclear message for creation of bank details
    Runtime batch selection
    DYNPRO_MSG_IN_HELP runtime error with F1 help for a char
    Change documents for AccessControlList
    Documentation changes for FiMa
    Incorrect read access for immediate repayment settlement
    Loading the runtime repositories with inactive plug-ins
    Loading the runtime repositories with inactive plug-ins
    Loading the runtime repositories with inactive plug-ins
    Variant: Changing sequence of selected fields
    Correction of Note 1099260
    table_illegal_statement in base_api_object_syn
    BP: TaxNumber: Duplicate check for VAT Registration Number
    Dump error when opening a corrupted email from Inbox
    &quot;required&quot; attribute(input field) does not work for HE Lang.
    Closing of popup(duplicate person) not handled properly.
    PCUI : Improving performance for relations fetch.
    R3AD_* stop entry in SMQ1 ERP after start initial/req loads
    error in displaying adobe forms in portal through preview
    BP_XDT: No creation possible of BP who is customer
    MS_WORD_OLE_FORMLETTER: Wrong spec. chrctrs in file download
    RHBEGDA0: No longer possible to shorten objects
    PPPM: Termination on Individual Dev tab page when saving
    Technical preparations for enhancement package
    Document Flow - Object Pool usage control
    Regards
    Gattu

  • Summation functionality in WD Table

    Hi,
    I have a requirement.
    I would like to add the values of  the entries of some of my columns in WebDynPro ABAP.
    Can anyone let me know how can we achieve this.
    Best Regards
    Sid

    Hi,
    see the <a href="http://help.sap.com/saphelp_nw70/helpdata/en/b5/ac884118aa1709e10000000a155106/frameset.htm">documentation</a> for UI element Table (heading Totaling). The use of the ALV is recommended, see <a href="http://help.sap.com/saphelp_nw70/helpdata/en/5c/cf9e94c2054990a87b1ed409415f23/frameset.htm">Calculation in ALV</a>
    Regards, Heidi

Maybe you are looking for

  • Render Dependencies Issue in JSF Remote Portlet

    Hi All, Am facing one issue while Rendering Dependencies (JS and CSS) from a Remote Page (in Consumer) which contains a JSF Portlet in Producer. I created a JSF Portlet and added the "home.dependencies" in Render Dependencies Path in producer. Then i

  • Documentation for Formula Key Figure

    Hi BW Gurus, I have a Formula Key Figure which has been defined in a local key figure structure. This key figure is based on a two standard Key figures which exist in the Cube. How can I create Documentation for this formula key figure, so that user

  • IMac, 10.9.4, 'drive cannot be read by this computer' message

    Just installed Mavericks. 10.9.4. Older WD FW drives--no problems. New WD USB drives-- messages at startup: 'this drive cannot be read by this computer' i can click either Eject or Ignore. If I hit Ignore, the drives mount and appear to be normal and

  • How to parse jsp file

    What is the way to prase a JSP file which is in the local drive using a parser inorder to extract some information?. For example : <%@ page info=" hello world " %> <html> <head><title>Hello, World</title></head> <body bgcolor="blue" > <%@ include fil

  • Whare are the Classes?

    Where are the Classes situated which we import while writing a JAVA code. Import Java.Math My question is where in JDK folder the class MATH is situated?