Regular ALV Vs OO ALV Vs SALV

Which is better, from performance point of view.
Thanks,
Kiran

Hi ,
We are currently using ALV (using FM 'REUSE_ALV_GRID_DISPLAY') . Would switching to SALV make any difference in performance ?
if so , as i understand , in GRID alv we just pass our final internal table in that FM and we get the ALV display .
What / Where would be the changes to switch from an ALV to SALV ?
I know it would be a very vague question without looking at the code . Pls email me at [email protected] .
Thanks in advance,
Ethan

Similar Messages

  • Report with ALV tree and ALV list?

    I need to create a report with layout as same as this one
    [http://trangiegie.com/MyFile/output.JPG]
    It looks like a report with combination of ALV tree and list. The tree works like a navigation bar. Wonder if there are any demo programs like this. Will appreciate any help.

    For Tree alone - You can check program : BCALV_TREE_02
    Program Name                   Report title
    BCALV_GRID_DND_TREE            ALV Grid: Drag and Drop with ALV Tree
    BCALV_GRID_DND_TREE_SIMPLE     ALV GRID: Drag and drop with ALV tree (simple)
    BCALV_TEST_COLUMN_TREE         Program BCALV_TEST_COLUMN_TREE
    BCALV_TEST_SIMPLE_TREE         Program BCALV_TEST_SIMPLE_TREE
    BCALV_TREE_01                  ALV Tree Control: Build Up the Hierarchy Tree
    BCALV_TREE_02                  ALV Tree Control: Event Handling
    BCALV_TREE_03                  ALV Tree Control: Use an Own Context Menu
    BCALV_TREE_04                  ALV Tree Control: Add a Button to the Toolbar
    BCALV_TREE_05                  ALV Tree Control: Add a Menu to the Toolbar
    BCALV_TREE_06                  ALV tree control: Icon column and icon for nodes/items
    BCALV_TREE_DEMO                Demo for ALV tree control
    BCALV_TREE_DND                 ALV tree control: Drag & Drop within a hierarchy tree
    BCALV_TREE_DND_MULTIPLE        ALV tree control: Drag & Drop within a hierarchy tree
    BCALV_TREE_EVENT_RECEIVER      Include BCALV_TREE_EVENT_RECEIVER
    BCALV_TREE_EVENT_RECEIVER01
    BCALV_TREE_ITEMLAYOUT          ALV Tree: Change Item Layouts at Runtime
    BCALV_TREE_MOVE_NODE_TEST      Demo for ALV tree control
    BCALV_TREE_SIMPLE_DEMO         Program BCALV_TREE_SIMPLE_DEMO
    BCALV_TREE_VERIFY              Verifier for ALV Tree and Simple ALV Tree

  • Problem with same layout (variant) for two ALV Grid and ALV Tree

    Hello!
    I have two docking containers on the screen. On the left i have cl_gui_alv_tree, on the right cl_salv_table.
    When a user set a default layout for ALV Grid (or ALV Tree), raport starts and sets this layout in both objects (tree and grid).
    How to avoid this?

    Hi,
    Take Two radio buttons.
    First radion button display the two containers in grid format,
    second radio button display the two containers in tree format base on user selection.
    CREATE OBJECT G_DOCING_CONTAINER
        EXPORTING PARENT = G_CUSTOM_CONTAINER."G_CONTAINER.
    DISPLAY THE DATA IN GRID FORMATA
    CREATE OBJECT r_grid
        EXPORTING
          i_parent          = G_DOCING_CONTAINER
    CALL METHOD g_docing_container->set_width
          EXPORTING
            width      = 1300.
    DISPLAY THE GRID DATA IN SECOND CONTAINER
    CREATE OBJECT r_grid1
        EXPORTING
          i_parent          = G_DOCING_CONTAINER
    CALL METHOD g_docing_container->set_width
          EXPORTING
            width      = 1300.
    OTHERWISE WE CAN DISPLAY THE TWO CONTAINERS DATA IN A GRID FORMAT
    CREATE OBJECT g_tree
        EXPORTING
          parent                = g_docing_container"g_custom_container
    IF R1 = 'X'.  "FOR GRID DISPLAY
    CALL METHOD r_grid1->set_table_for_first_display
    CALL METHOD r_grid2->set_table_for_first_display
    ELSE.
    ************TREE DISPLAY
    ENDIF.
    regards,
    muralii

  • Differences between the alv's and alv grid dispaly

    hi guys
    .........please send the  differences between the alv's and alv grid display.
                    thanks....

    Hi Midathala,
    Plz go through the links might be useful to you.
    Simple ALV report
    http://www.sapgenie.com/abap/controls/alvgrid.htm
    http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
    ALV
    1. Please give me general info on ALV.
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
    2. How do I program double click in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=11601
    http://www.sapfans.com/forums/viewtopic.php?t=23010
    Check the program in the following link:
    http://sap-img.com/abap/display-secondary-list-using-alv-grid.htm
    3. How do I add subtotals (I have problem to add them)...
    http://www.sapfans.com/forums/viewtopic.php?t=20386
    http://www.sapfans.com/forums/viewtopic.php?t=85191
    http://www.sapfans.com/forums/viewtopic.php?t=88401
    http://www.sapfans.com/forums/viewtopic.php?t=17335
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_basic.htm
    4. How to add list heading like top-of-page in ABAP lists?
    http://www.sapfans.com/forums/viewtopic.php?t=58775
    http://www.sapfans.com/forums/viewtopic.php?t=60550
    http://www.sapfans.com/forums/viewtopic.php?t=16629
    5. How to print page number / total number of pages X/XX in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
    6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
    http://www.sapfans.com/forums/viewtopic.php?t=64320
    http://www.sapfans.com/forums/viewtopic.php?t=44477
    7. How can I set the cell color in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=52107
    8. How do I print a logo/graphics in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=81149
    http://www.sapfans.com/forums/viewtopic.php?t=35498
    http://www.sapfans.com/forums/viewtopic.php?t=5013
    9. How do I create and use input-enabled fields in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=84933
    http://www.sapfans.com/forums/viewtopic.php?t=69878
    10. How can I use ALV for reports that are going to be run in background?
    http://www.sapfans.com/forums/viewtopic.php?t=83243
    http://www.sapfans.com/forums/viewtopic.php?t=19224
    11. How can I display an icon in ALV? (Common requirement is traffic light icon).
    http://www.sapfans.com/forums/viewtopic.php?t=79424
    http://www.sapfans.com/forums/viewtopic.php?t=24512
    12. How can I display a checkbox in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=88376
    http://www.sapfans.com/forums/viewtopic.php?t=40968
    http://www.sapfans.com/forums/viewtopic.php?t=6919
    13. Top-of-page in ALV
    selection-screen and top-of-page in ALV
    14. ALV Group Heading
    http://www.sap-img.com/fu037.htm
    How to add list heading like top-of-page in ABAP lists?
    http://www.sapfans.com/forums/viewtopic.php?t=58775
    http://www.sapfans.com/forums/viewtopic.php?t=60550
    http://www.sapfans.com/forums/viewtopic.php?t=16629
    15. ALV output to PDF conversion
    It has an example code for PDF Conversion.
    http://www.erpgenie.com/abap/code/abap51.htm
    converting the output of alv in pdf
    Thanks
    Mohinder Singh Chauhan

  • ALV Grid and ALV List difference?

    Hello,
    Can you help me differentiate ALV List and ALV grid and the low-level definition or context of each?
    Also, can you give me a transaction code that outputs an ALV list as well as a tcode for ALV grid?
    Thanks,
    Jennah

    Hi Kirtish,
    Thanks but I  havent done any function module stuff as I am not an ABAPer but anyway can you guide me through thios?
    "I hope this might slove your query. For more please refer to documentation on ALV and also implement the ALV LIST and GRID reports. By using class Class CL_GUI_ALV_GRID, Function module REUSE_ALV_LIST_DISPLAY , REUSE_ALV_GRID_DISPLAY and some more functions like that only."
    I will give you some tcode can you please try tcode FBL1n? then execute the report. What is the output is it an ALV list?
    I wish to see an ALV list also an ALV grid to see difference.
    Tjhakns,
    Jennah

  • Subtotal text in ALV using OO ALV

    HI All,
    How to display subtotal text in ALV using OO ALV?
    My output of ALV should be as follows
    COL1    COL2   COL3
    ABC      900       M1
    PQR      100       M1
    M1 Subtotal 1000
    XYZ      2100    M2    
    M2 Subtotal 2100
    I could put the subtotal, but couldnu2019t add subtotal text.
    My code
      TRY.
          CALL METHOD cl_salv_table=>factory
            IMPORTING
              r_salv_table   = g_alv
            CHANGING
              t_table        = gt_report
        CATCH cx_salv_msg .
      ENDTRY.
    u2026u2026
    *Display the table.
      g_alv->display( ).

    Hi
    REPORT  z_alv_demo_total_text.
    Type declaration for final table to display the output
    TYPES: BEGIN OF ty_mara,
            srno TYPE char40, " Storing the total text
            matnr TYPE matnr, " Material
            ersda TYPE ersda, " Creation date
            ernam TYPE ernam, " Created by
            laeda TYPE laeda, " Last change date
            aenam TYPE aenam, " Last change by
            vpsta TYPE vpsta, " Maintenance status
            brgew TYPE brgew, " Gross weight
            ntgew TYPE ntgew, " Net weight
            gewei TYPE gewei, " Weight Unit
           END OF ty_mara.
    Type declaration for table storing temp. data
    TYPES: BEGIN OF ty_mara_tmp,
            matnr TYPE matnr, " Material
            ersda TYPE ersda, " Creation date
            ernam TYPE ernam, " Created by
            laeda TYPE laeda, " Last change date
            aenam TYPE aenam, " Last change by
            vpsta TYPE vpsta, " Maintenance status
            brgew TYPE brgew, " Gross weight
            ntgew TYPE ntgew, " Net weight
            gewei TYPE gewei, " Weight Unit
          END OF ty_mara_tmp.
    Internal table for storing final data
    DATA: i_mara TYPE STANDARD TABLE OF ty_mara INITIAL SIZE 0.
    Work area for final table
    DATA: w_mara TYPE ty_mara.
    Internal table for storing temp. data
    DATA: i_mara_tmp TYPE STANDARD TABLE OF ty_mara_tmp INITIAL SIZE 0.
    Work area for temp. table
    DATA: w_mara_tmp TYPE ty_mara_tmp.
    Object variable for ALV grid
    DATA: oref1 TYPE REF TO cl_gui_alv_grid.
    Field catalog table for ALV grid
    DATA: fieldcat TYPE  lvc_t_fcat.
    Workarea for field catalog table
    DATA: w_field TYPE lvc_s_fcat.
    Internal table for storing info. for ALV grid
    data: i_sort2 TYPE STANDARD TABLE OF lvc_s_sort INITIAL SIZE 0.
    Workarea for sort table
    DATA: wa_sort2      TYPE  lvc_s_sort.
    Workarea for ALV layout
    data: wa_layout     TYPE  lvc_s_layo.
    START-OF-SELECTION.
    Fetch data
    SELECT  matnr   " Material
            ersda   " Creation date
            ernam   " Created by
            laeda   " Last change date
            aenam   " Last change by
            vpsta   " Maintenance status
            brgew   " Gross weight
            ntgew   " Net weight
            gewei   " Weight Unit
      FROM mara
      INTO TABLE i_mara_tmp
      UP TO 100 ROWS.
      CHECK sy-subrc = 0.
    Populate final table
      LOOP AT i_mara_tmp INTO w_mara_tmp.
      Storing the Total text need to be displayed in
      ALV
        w_mara-srno = 'Total weight (Gross & Net)'.
        w_mara-matnr = w_mara_tmp-matnr.
        w_mara-ersda = w_mara_tmp-ersda.
        w_mara-ernam  = w_mara_tmp-ernam .
        w_mara-laeda = w_mara_tmp-laeda.
        w_mara-aenam = w_mara_tmp-aenam.
        w_mara-vpsta = w_mara_tmp-vpsta.
        w_mara-brgew = w_mara_tmp-brgew.
        w_mara-ntgew = w_mara_tmp-ntgew.
        w_mara-gewei = w_mara_tmp-gewei.
        APPEND w_mara TO i_mara.
      ENDLOOP.
    Calling the screen to display ALV
      CALL SCREEN 100.
    *&      Module  STATUS_0100  OUTPUT
          Display ALV report
    MODULE status_0100 OUTPUT.
      IF oref1 IS INITIAL.
      Create ALV grid object
      In this case we have not created any custom container in the screen,
      Instead of that dummy container name is passed
      ADVANTAGE: we can run this report in background without any problem
        CREATE OBJECT oref1
          EXPORTING
            i_parent          = cl_gui_custom_container=>screen0
          EXCEPTIONS
            error_cntl_create = 1
            error_cntl_init   = 2
            error_cntl_link   = 3
            error_dp_create   = 4
            OTHERS            = 5
        CHECK sy-subrc = 0.
      Preparing the field catalog
      ZDEMO: Defined in DDIC, it's structure is same as TYPE ty_mara
      defined in the program
        CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
          EXPORTING
            i_structure_name       = 'ZDEMO'
          CHANGING
            ct_fieldcat            = fieldcat
          EXCEPTIONS
            inconsistent_interface = 1
            program_error          = 2
            OTHERS                 = 3.
        IF sy-subrc = 0.
          LOOP AT fieldcat INTO w_field.
            IF w_field-fieldname = 'BRGEW' OR
              w_field-fieldname = 'NTGEW'.
            Summation for Gross & Net weight
              w_field-do_sum = 'X'.
              MODIFY fieldcat FROM w_field TRANSPORTING do_sum.
            ENDIF.
            IF w_field-fieldname = 'SRNO'.
            Hide this field so that it can display it's content i.e.
            Total text in Subtotal level
              w_field-tech = 'X'.
              w_field-no_out = 'X'.
              MODIFY fieldcat FROM w_field TRANSPORTING tech no_out.
            ENDIF.
            CLEAR w_field.
          ENDLOOP.
        ENDIF.
      Populate Sort table with SRNO field so that we can display the total
      text in it's subtotal level
        wa_sort2-spos = 1.
        wa_sort2-fieldname = 'SRNO'.
        wa_sort2-up = 'X'.
        wa_sort2-subtot = 'X'.
        APPEND wa_sort2 TO i_sort2.
      Hide the total line
        wa_layout-no_totline = 'X'.
      Display the ALV grid
        CALL METHOD oref1->set_table_for_first_display
          EXPORTING
            is_layout                     = wa_layout
          CHANGING
            it_outtab                     = i_mara[]
            it_fieldcatalog               = fieldcat
            it_sort                       = i_sort2
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error                 = 2
            too_many_lines                = 3
            OTHERS                        = 4.
        IF sy-subrc <> 0.
        ENDIF.
      Set the focus on the grid
        CALL METHOD cl_gui_alv_grid=>set_focus
          EXPORTING
            control           = oref1
          EXCEPTIONS
            cntl_error        = 1
            cntl_system_error = 2
            OTHERS            = 3.
        IF sy-subrc <> 0.
        ENDIF.
      ENDIF.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    These will defintely help  in u displaying subtotal text check it
    thanks

  • Display totals on the first line in ALV grid and ALV LIST

    Generally we wll display totals at the end..
    bu the requirement is to display it in the first line of the column.
    how to display the totals in the first line?
    I have used ALV GRID and ALV LIST (choice) using function modules.
    Plz help me
    .for example : Po qty : Should display total po qty on the first line of the Po line item.

    IN LAYOUT
    ILAYOUT-totals_before_items = 'X'.
    REGARDS
    SHIBA DUTTA

  • Editable alv using OO ALV(newly edited row values are not updating )

    Hi friends,
    i am facing a problem. i am displaying an output alv  using OO ALV.
    i am creating a new row and validating the newly created row values and changing if it is not according to the criteria. but the newly edited values are not capturing in method
    pr_data_changed->mt_inserted_rows as it contains values only entries entered for the first time .
    i am not getting the newly edited values in it.
    please do the needful.
    Thanks and Regards,
    srinivas

    Hi!
    to rectify the problem in the Code.....
    You can Go through this program....for changed values....
    https://wiki.sdn.sap.com/wiki/x/AwBIBQ
    Regards.

  • What is the difference b/w slis_t_fieldcat_ alv and slis_fieldcat_ alv ,wha

    hai this is Shilpa Priya
    i have few doubts to clarify
    1) what is the difference b/w slis_t_fieldcat_ alv and slis_fieldcat_ alv ,what they are meant for
    1)what is the difference b/w slis_t_events and slis_alv_events ,what they meant for
    1) this is question asked in wipro interview whats the name of the company CARITOR before 2002 yr.
    Plz help me in getting correct explanation.
    Thankq

    slis_t_fieldcat_ alv is used to create a fielcatlogue table while slis_fieldcat_ alv is used to create a work area which can be used to append data to the table.
    DATA: i_fieldcat TYPE slis_t_fieldcat_alv.
    DATA: line_fieldcat TYPE slis_fieldcat_alv.
      CLEAR line_fieldcat.
      line_fieldcat-fieldname = 'QMNUM'.    
      line_fieldcat-tabname   = 'I_DATA'.    .
      line_fieldcat-key       = 'X'. 
      line_fieldcat-seltext_m = 'Notification No.'.
    <b>  APPEND line_fieldcat TO i_fieldcat.</b>
    Similarly slis_t_events is used to create the table and slis_alv_events is used for work area.
    I hope it helps.
    Best Regards,
    Vibha
    *Please mark all the helpful answers

  • Doubt in ALV grid (OO ALV) download to Excel

    Hi All,
    I done Report using OOALV when down loading to Excel one row got automatically inserted to the ALV Excel downloaded sheet at the top and the row contains Sy datum , Dynamic list display , page no
    my requirement is to delete that row. Is that possible. If so please suggest me how to handle that
    Thanks
    Kiran

    Hi,
    Check this link:
    Re: Digit missing in the alv export
    Hope this helps.
    Regards,
    Satish Kanteti

  • Is it possible to display list alv and grid alv in the same screen

    Hi
    There are methods to display more than 1 alv grid in the same screen by using block append grid . In the same manner its available for more than 1 list alv report display by REUSE_ALV_BLOCK_LIST_APPEND.
    My question is I want to display 1 alv list and 1 alv grid report in the same output screen .
    Please let me know how to do it ?  I will definetly appreciate the answers.
    Thanks!!

    Hi Anindita,
                                      Previously i ad told v cant display two lists together in same screen. But u can use Block ALV for this. Use FM "REUSE_ALV_BLOCK_LIST_APPEND.
    In OO u can use Cl_GUI_EAST_SPLITTER_CONTAINER for displayin more than two lists in same screen.
    If useful giv points
    Regards
    Vanitha P

  • ALV + HOTSPOT + DOWNLOAD ALV O/P to a file  Querry ??

    Hi All
    I have the following requirement in my SAP-ABAP prog which is as under:
    <b>>></b>Hotspot click to be provided on EBELN field then call ME23 tcode skipping the first screen.
    <b>>></b>Hotspot click to be provided on VBELN field then call VF03 tcode skipping the first screen.
    <b>>></b>If check box marked save the data displayed on the report as a file to a presentation server
    <b>>></b> and please let me the Field catalogue table name which exists in dic
    As such ther's no inconsistency in my prog. But when i execute my prog , the ALV  O/p shows no data .
    And regarding the Hotspot click , if you are telling me to use SET parameter Id statement , thn plz specify how to use it.
    i mean in the statement
    e.g
      SET PARAMETER ID 'EBE' FIELD ACC_TAB-EBELN.
    when i double click on EBE , it does not allows me to specify EBE as parameter for field EBELN.
    I can provide you with the prog which i have made , if needed.
    So do help. Helpful entries will be rewarded.
    Thanks
    Gaurav
    Message was edited by:
            Gaurav Verma

    Hi
    <b>please go through this Program it was handled by Hot spot only .</b>
    report zbnstest.
    * TABLES AND DATA DECLARATION.
    *TABLES: mara,makt.",marc.
    data syrepid like sy-repid.
    data sydatum(10). " LIKE sy-datum.
    data sypagno(3) type n.
    * WHEN USING MORE THAN ONE TABLE IN ALV WE NEEED TO DECLARE THE TYPE
    * GROUP (TYPE-POOLS--------->SLIS)
    type-pools : slis.
    * INTERNAL TABLE DECLARATION.
    * INTERNAL TABLE TO HOLD THE VALUES FROM THE MARA TABLE
    data: begin of t_mara occurs 0,
    matnr like mara-matnr,
    meins like mara-meins,
    mtart like mara-mtart,
    matkl like mara-matkl,
    end of t_mara.
    * INTERNAL TABLE TO HOLD THE CONTENTS FROM THE EKKO TABLE
    data : begin of t_marc occurs 0,
    matnr like mara-matnr,
    werks like marc-werks,
    minbe like marc-minbe.
    data: end of t_marc.
    * INTERNAL TABLE TO HOLD THE VALUES FROM MAKT TABLE.
    data : begin of t_makt occurs 0,
    matnr like mara-matnr,
    maktx like makt-maktx,
    spras like makt-spras,
    end of t_makt.
    * INTERNAL TABLE WHICH ACTUALLY MERGES ALL THE OTHER INTERNAL TABLES.
    data: begin of itab1 occurs 0,
    matnr like mara-matnr,
    meins like mara-meins,
    maktx like makt-maktx,
    spras like makt-spras,
    werks like marc-werks,
    minbe like marc-minbe,
    end of itab1.
    * THE FOLLOWING DECLARATION IS USED FOR DEFINING THE FIELDCAT
    * AND THE LAYOUT FOR THE ALV.
    * HERE AS slis_t_fieldcat_alv IS A INTERNAL TABLE WITHOUT A HEADER LINE
    * WE EXPLICITELY DEFINE AN INTERNAL TABLE OF THE SAME STRUCTURE AS THAT
    * OF slis_t_fieldcat_alv BUT WITH A HEADER LINE IN THE DEFINITION.
    * THIS IS DONE TO MAKE THE CODE SIMPLER.
    * OTHERWISE WE MAY HAVE TO DEFINE THE STRUCTURE AS IN THE NORMAL SAP
    * PROGRAMS.
    * IN THE FIELDCATALOG TABLE WE ACTUALLY PASS THE FIELDS FROM ONE OR
    * MORE TABLES AND CREATE A STRUCTURE
    * IN THE LAYOUT STRUCTURE WE BASICALLY DEFINE THE FORMATTING OPTIONS
    * LIKE DISPLAY IN THE ZEBRA PATTERN ,THE HOTSPOT OPTIONS ETC.
    data: fieldcatalog type slis_t_fieldcat_alv with header line,
    fieldlayout type slis_layout_alv.
    * DECLARING THE EVENTTABLE INTERNL TABLE FOR USING EVENTS LIKE
    * TOP-OF-PAGE ETC.
    data : eventstab type slis_t_event with header line.
    * DECLARING AN INTERNAL TABLE TO HOLD THE DATA FOR THE TOP-OF-PAGE
    data : heading type slis_t_listheader with header line.
    data : heading1 type slis_t_listheader with header line.
    data : heading2 type slis_t_listheader with header line.
    data : heading3 type slis_t_listheader with header line.
    data : heading4 type slis_t_listheader with header line.
    data : heading5 type slis_t_listheader with header line.
    data : heading6 type slis_t_listheader with header line.
    data : heading7 type slis_t_listheader with header line.
    data : heading8 type slis_t_listheader with header line.
    * STRUCTURE TO PASS THE COLOR ATTRIBUTES FOR DISPLAY.
    data : colorstruct type slis_coltypes.
    * INITIALIZATION. *
    initialization.
    syrepid = sy-repid.
    sypagno = sy-pagno.
    clear fieldcatalog.
    * START-OF-SELECTION. *
    start-of-selection.
    * SUBROUTINE TO POPULATE THE COLORSTRUCT
    perform fill_colorstruct using colorstruct.
    * SUBROUTINE TO POPULATE THE FIELDS OF THE FIELD CATALOGUE
    perform populate_fieldcatalog.
    * SUBROUTINE TO SELECT DATA FROM VARIOUS TABLES AND POPULATE IT IN THE
    * INTERNAL TABLE.
    perform selectdata_and_sort.
    * SUBROUTINE TO POPULATE THE LAYOUT STRUCTURE.
    perform populate_layout using fieldlayout.
    * SUBROUTINE TO CALL THE FUNCTION MERGE TO ENSURE PROPER DISPLAY.
    perform merge_fieldcatalog.
    * SUBROUTINE TO POPULATE THE EVENTSTAB.
    perform fill_eventstab tables eventstab.
    * SUBROUTINE TO POPULATE THE HEADING TABLES.
    perform fill_headingtable tables heading using 'HEADING'.
    perform fill_headingtable tables heading1 using 'HEADING1'.
    perform fill_headingtable tables heading2 using 'HEADING2'.
    perform fill_headingtable tables heading3 using 'HEADING3'.
    perform fill_headingtable tables heading4 using 'HEADING4'.
    perform fill_headingtable tables heading5 using 'HEADING5'.
    perform fill_headingtable tables heading6 using 'HEADING6'.
    perform fill_headingtable tables heading7 using 'HEADING7'.
    perform fill_headingtable tables heading8 using 'HEADING8'.
    * SUBROUTINE TO DISPLAY THE LIST.
    perform display_alv_list.
    * FORMS
    * IN THIS SUBROUTINE WE POPULATE THE FIELDCATALOG TABLE WITH THE NAMES
    * OF THE TABLE,FIELDNAME,WHETHER IT IS KEY FIELD OR NOT,HEADING AND
    * COLUMN JUSTIFICATION.
    form populate_fieldcatalog.
    perform fill_fields_of_fieldcatalog tables fieldcatalog
    using 'ITAB1' 'MATNR' 'X' .
    perform fill_fields_of_fieldcatalog tables fieldcatalog
    using 'ITAB1' 'MEINS' ' '.
    perform fill_fields_of_fieldcatalog tables fieldcatalog
    using 'ITAB1' 'MAKTX' ' ' .
    perform fill_fields_of_fieldcatalog tables fieldcatalog
    using 'ITAB1' 'MTART' ' ' .
    perform fill_fields_of_fieldcatalog tables fieldcatalog
    using 'ITAB1' 'MATKL' ' ' .
    perform fill_fields_of_fieldcatalog tables fieldcatalog
    using 'ITAB1' 'SPRAS' ' ' .
    perform fill_fields_of_fieldcatalog tables fieldcatalog
    using 'ITAB1' 'WERKS' ' ' .
    perform fill_fields_of_fieldcatalog tables fieldcatalog
    using 'ITAB1' 'MINBE' ' ' .
    endform. " POPULATE_FIELDCATALOG
    * FORM FILL_FIELDS_OF_FIELDCATALOG *
    * --> FIELDCATALOG *
    * --> P_TABNAME *
    * --> P_FIELDNAME *
    * --> P_KEY *
    * --> P_KEY *
    form fill_fields_of_fieldcatalog tables fieldcatalog
    structure fieldcatalog
    using p_tabname
    p_fieldname
    p_key.
    * p_no_out.
    fieldcatalog-tabname = p_tabname.
    fieldcatalog-fieldname = p_fieldname.
    fieldcatalog-key = p_key.
    fieldcatalog-emphasize = '1234'.
    *fieldcatalog-no_out = p_no_out.
    append fieldcatalog.
    endform. " FILL_FIELDSOFFIELDCATALOG
    * FORM POPULATE_LAYOUT *
    * --> FIELDLAYOUT *
    form populate_layout using fieldlayout type slis_layout_alv.
    fieldlayout-f2code = '&ETA' .
    fieldlayout-zebra = 'X'.
    * FOR THE WINDOW TITLE.
    fieldlayout-window_titlebar = 'ALV with Events'.
    fieldlayout-colwidth_optimize = 'X'.
    fieldlayout-no_vline = ' '.
    *fieldlayout-no_input = 'X'.
    fieldlayout-confirmation_prompt = ''.
    fieldlayout-key_hotspot = 'X'.
    * This removes the column headings if the flag is set to 'X'
    fieldlayout-no_colhead = ' '.
    *fieldlayout-hotspot_fieldname = 'MAKTX'.
    fieldlayout-detail_popup = 'X'.
    * fieldlayout-coltab_fieldname = 'X'.
    endform. " POPULATE_LAYOUT
    * FORM SELECTDATA_AND_SORT *
    form selectdata_and_sort.
    select matnr meins mtart matkl from mara
    into corresponding fields of t_mara
    up to 500 rows .
    select matnr maktx spras from makt
    into corresponding fields of t_makt
    where matnr = t_mara-matnr and
    spras = sy-langu.
    select matnr werks minbe from marc
    into corresponding fields of t_marc
    where matnr = t_mara-matnr.
    append t_marc.
    endselect.
    append t_makt.
    endselect.
    append t_mara.
    endselect.
    perform populate_itab1.
    sort itab1 by matnr.
    endform. " SELECTDATA_AND_SORT
    * FORM MERGE_FIELDCATALOG *
    form merge_fieldcatalog.
    call function 'REUSE_ALV_FIELDCATALOG_MERGE'
    exporting
    i_program_name = syrepid
    i_internal_tabname = 'ITAB1'
    * i_structure_name = 'COLORSTRUCT'
    * I_CLIENT_NEVER_DISPLAY = 'X'
    i_inclname = syrepid
    changing
    ct_fieldcat = fieldcatalog[]
    exceptions
    inconsistent_interface = 1
    program_error = 2
    others = 3.
    endform. " MERGE_FIELDCATALOG
    * IN THIS FUNCTION THE MINIMUM PARAMETERS THAT WE NEED TO PASS IS AS
    * FOLLOWS:-
    * i_callback_program --> CALLING PROGRAM NAME
    * i_structure_name --> STRUCTURE NAME.
    * is_layout --> LAYOUT NAME.
    * it_fieldcat ---> BODY OF THE FIELD CATALOGUE INTERNAL TABLE
    form display_alv_list.
    call function 'REUSE_ALV_LIST_DISPLAY'
    exporting
    * I_INTERFACE_CHECK = ' '
    i_callback_program = syrepid
    * I_CALLBACK_PF_STATUS_SET = ' '
    * I_CALLBACK_USER_COMMAND = ' '
    i_structure_name = 'ITAB1'
    is_layout = fieldlayout
    it_fieldcat = fieldcatalog[]
    * IT_EXCLUDING =
    * IT_SPECIAL_GROUPS =
    * IT_SORT =
    * IT_FILTER =
    * IS_SEL_HIDE =
    * I_DEFAULT = 'X'
    * THE FOLLOWING PARAMETER IS SET AS 'A' INORDER TO DISPLAY THE STANDARD
    * TOOL BAR
    i_save = 'A'
    * IS_VARIANT = ' '
    it_events = eventstab[]
    * IT_EVENT_EXIT =
    * 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 =
    tables
    t_outtab = itab1
    exceptions
    program_error = 1
    others = 2.
    endform. " DISPLAY_ALV_LIST
    *& Form POPULATE_ITAB1
    * text
    * --> p1 text
    * <-- p2 text
    form populate_itab1.
    loop at t_mara.
    loop at t_makt where matnr = t_mara-matnr.
    loop at t_marc where matnr = t_mara-matnr.
    move-corresponding t_mara to itab1.
    move-corresponding t_makt to itab1.
    move-corresponding t_marc to itab1.
    append itab1.
    endloop.
    endloop.
    endloop.
    endform. " POPULATE_ITAB1
    *& Form FILL_EVENTSTAB
    * text
    * -->P_EVENTSTAB text *
    form fill_eventstab tables p_eventstab structure eventstab.
    * WHEN THE FOLLOWING FUNCTION IS CALLED THE SYSTEM POPULATES THE
    * INTERNAL TABLE EVENTSTAB WITH A LIST OF EVENTS NAME.
    * AS SHOWN BELOW WHEN USING I_LIST_TYPE = 0 THE FUNCTION RETURNS 14
    * EVENTS NAME.
    call function 'REUSE_ALV_EVENTS_GET'
    exporting
    i_list_type = 0
    importing
    et_events = p_eventstab[]
    exceptions
    list_type_wrong = 1
    others = 2.
    * BY CALLING THE ABOVE FUNCTION WE FIRST POPULATE THE EVENTSTAB WITH
    * THE PREDEFINED EVENTS AND THEN WE MOVE THE FORM NAME AS SHOWN BELOW.
    * WE ASSIGN A FORM NAME TO THE EVENT AS REQUIRED BY THE USER.
    * FORM NAME CAN BE ANYTHING.THE PERFORM STATEMENT FOR THIS FORM
    * IS DYNAMICALY CALLED.
    read table p_eventstab with key name = slis_ev_top_of_page.
    if sy-subrc = 0 .
    move 'TOP_OF_PAGE' to p_eventstab-form.
    append p_eventstab.
    endif.
    read table p_eventstab with key name = slis_ev_top_of_coverpage.
    if sy-subrc = 0 .
    move 'TOP_OF_COVERPAGE' to p_eventstab-form.
    append p_eventstab.
    endif.
    read table p_eventstab with key name = slis_ev_end_of_coverpage .
    if sy-subrc = 0 .
    move 'END_OF_COVERPAGE' to p_eventstab-form.
    append p_eventstab.
    endif.
    read table p_eventstab with key name = slis_ev_foreign_top_of_page.
    if sy-subrc = 0 .
    move 'FOREIGN_TOP_OF_PAGE' to p_eventstab-form.
    append p_eventstab.
    endif.
    read table p_eventstab with key name = slis_ev_foreign_end_of_page.
    if sy-subrc = 0 .
    move 'FOREIGN_END_OF_PAGE' to p_eventstab-form.
    append p_eventstab.
    endif.
    read table p_eventstab with key name = slis_ev_list_modify.
    if sy-subrc = 0 .
    move 'LIST_MODIFY' to p_eventstab-form.
    append p_eventstab.
    endif.
    read table p_eventstab with key name = slis_ev_top_of_list.
    if sy-subrc = 0 .
    move 'TOP_OF_LIST' to p_eventstab-form.
    append p_eventstab.
    endif.
    read table p_eventstab with key name = slis_ev_end_of_page.
    if sy-subrc = 0 .
    move 'END_OF_PAGE' to p_eventstab-form.
    append p_eventstab.
    endif.
    read table p_eventstab with key name = slis_ev_end_of_list .
    if sy-subrc = 0 .
    move 'END_OF_LIST' to p_eventstab-form.
    append p_eventstab.
    endif.
    endform. " FILL_EVENTSTAB
    *& Form FILL_HEADINGTABLE
    * text
    * -->P_HEADING text *
    form fill_headingtable tables p_heading structure heading
    using tablename.
    case tablename.
    when 'HEADING'.
    p_heading-typ = 'H'.
    concatenate
    ' REPORT NAME:-' syrepid
    ' ABB Industry Pte Ltd' into p_heading-info.
    append p_heading.
    write sy-datum using edit mask '__/__/____' to sydatum.
    concatenate
    ' DATE:-' sydatum ' USER: ' sy-uname 'PAGE NO:' sypagno
    into p_heading-info.
    append p_heading.
    when 'HEADING1'.
    p_heading-typ = 'H'.
    p_heading-info = 'TOP-OF-COVER-PAGE'.
    append p_heading.
    when 'HEADING2'.
    p_heading-typ = 'H'.
    p_heading-info = 'END-OF-COVER-PAGE'.
    append p_heading.
    when 'HEADING3'.
    p_heading-typ = 'H'.
    p_heading-info = 'FOREIGN-TOP-OF-PAGE'.
    append p_heading.
    when 'HEADING4'.
    p_heading-typ = 'H'.
    p_heading-info = 'FOREIGN-END-OF-PAGE'.
    append p_heading.
    * WHEN 'HEADING5'.
    * P_HEADING-TYP = 'H'.
    * P_HEADING-INFO = 'LIST-MODIFY'.
    * APPEND P_HEADING.
    when 'HEADING6'.
    p_heading-typ = 'H'.
    p_heading-info = 'END-OF-PAGE'.
    append p_heading.
    when 'HEADING7'.
    p_heading-typ = 'H'.
    p_heading-info = 'END-OF-LIST'.
    append p_heading.
    when 'HEADING8'.
    p_heading-typ = 'H'.
    p_heading-info = 'TOP-OF-LIST'.
    append p_heading.
    endcase.
    endform. " FILL_HEADINGTABLE
    * FORM TOP_OF_PAGE *
    form top_of_page.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = heading[]
    exceptions
    others = 1.
    endform.
    *& Form FILL_COLORSTRUCT
    * text
    * -->P_COLORSTRUCT text *
    form fill_colorstruct using p_colorstruct type slis_coltypes .
    p_colorstruct-heacolfir-col = 6.
    p_colorstruct-heacolfir-int = 1.
    p_colorstruct-heacolfir-inv = 1.
    endform. " FILL_COLORSTRUCT
    * FORM TOP_OF_COVERPAGE *
    form top_of_coverpage.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = heading1[]
    exceptions
    others = 1.
    endform.
    * FORM END_OF_COVERPAGE *
    form end_of_coverpage.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = heading2[]
    exceptions
    others = 1.
    endform.
    * FORM FOREIGN_TOP_OF_PAGE *
    form foreign_top_of_page.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = heading3[]
    exceptions
    others = 1.
    endform.
    * FORM FOREIGN_END_OF_PAGE *
    form foreign_end_of_page.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = heading4[]
    exceptions
    others = 1.
    endform.
    * FORM LIST_MODIFY *
    *FORM LIST_MODIFY.
    * CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
    * EXPORTING
    * IT_LIST_COMMENTARY = HEADING5[]
    * EXCEPTIONS
    * OTHERS = 1.
    *ENDFORM.
    * FORM END_OF_PAGE *
    form end_of_page.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = heading6[]
    exceptions
    others = 1.
    endform.
    * FORM END_OF_LIST *
    form end_of_list.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = heading7[]
    exceptions
    others = 1.
    endform.
    * FORM TOP_OF_LIST *
    form top_of_list.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = heading8[]
    exceptions
    others = 1.
    endform.
    *--- End of Program
    make use of there FMs
    SAP_CONVERT_TO_XLS_FORMAT
    -> MS_EXCEL_OLE_STANDARD_DAT
    -> RSPO_DOWNLOAD_SPOOLJOB
    RH_START_EXCEL_WITH_DATA
    but , Header Description length will be based on the Field length.
    <b>Reward if usefull</b>

  • Difference between blocked ALV and Hierarchical ALV

    Hi All,
    Can some body tell me what's the difference between hierarchical and blocked ALV Report Please telle me some body what's the type of ALV it's displaying for the standard Report V/LD this is pricing report I want to develop custom report exactly looks as V/LD but the problem is I am not able to identify what's the ALV format it's displaying either Hierarchical or blocked?
    Thanks&Regards
    Mahesh

    Hi Mahesh,
    Blocked ALV displays the data in blocks together in output. e.g. suppose you want to dsplay the data of header & item level. Then you candisplay the data of header records in first block & Item level data in another block on same output screen.
    For hierarchical ALV  check the below link
    http://help.sap.com/saphelp_nw2004s/helpdata/en/6e/4e2941fa918739e10000000a1550b0/frameset.htm
    & check this link also:
    /people/sap.user72/blog/2005/09/14/a-new-approach-to-alv-programming
    Reward points if helpful answer.
    Ashvender

  • Whi is the winner? ALV LIst or ALV Grid OO?

    Hi Guys,
    Hope you are all well.
    My company is still mostly using the ALV List Function Modules when creating reports. Yes, they are using the SLIS pools.
    I have written a template program for them to start doing things the OO way. That is to say, using ALV Grid Objects.
    We are now thinking of COMPLETELY going over into ALV Grid Objects, but some of us are still arguing which one is best?
    The biggest argument is :
    Is ALV too "expensive" with regards to using system recources?
    Please give me your thoughts as Im all for going for OO, but I would understand if it would make things slower.
    Points will be awarded for useful arguments.
    tks
    Christiaan

    SLIS is OLD,  OBSOLETE DINOSAUR technology.
    With the new classes you can create new reports really quickly and easily and add all sorts of functionality to them.
    There's a small learning curve -- but what ought to appeal to management is that once you get the hang of it you can produce a report in hours (or even minutes) which done in the old way could take a week or more.
    These days Human development time is far far more expensive than machine time so there's NO CONTEST. 
    The advantages in general of OO are too numerous to list here but if you look at the sample code I've listed here you can see how easy and quicklly you can get an application up and running even if you haven't got my Z_class definition listed in the program (it's a global class now defined with SE24).
    With either cl_gui_alv_grid or even easier (if you don't need  edit capability)  the salv_table type class it only takes a few lines to code your program and display the grid.
    All you ever now need to do in an alv program is the following.
    1) define your data structures
    2) use RTTI to generate dynamic field catalog from your data structures
    3) create dynamic table
    4) populate it
    5) display grid.
    You should have all the events etc you need such as cell selection etc etc.
    Your whole code could be quite small.
    For example I've got a generalized Z_cLass for my alv grid.
    Now here's a sample program to display program names in the system. When I double click a program SE38 is entered and on exit unlike the standard sap transaction my list is re-displayed where I can choose another program.
    Note how small the code is.
    You won't be able to copy and run this  program directly as you'll need the Z_class definitions.
    In this Z_class there's also functionality for ON  data change, multiple cell selection , toolbar additions etc.
    These methods are available to EVERY program calling the class.
    If you need the extra functionality using SLIS you have to program it in every time for each individual program.
    You can therefore concentrate in your application program on just getting the data and displaying it. All the complicated functionality is in the Z_class.
    Incidently using ALV classes can also render the whole idea of classical dynpros with Table controls as also obsolete.
    program  zzjimboprogs.
    tables : trdirt.
    include my_zdata.  "data references to my Z_Class etc.
    * Front end to call SE38 Program list
    * When you use the search Program facility in SE38
    * the system loses the LIST after you choose a program and enter
    * transaction SE38
    * double click on the Program module you want SE38 to use.
    * After exiting SE38 you will return to the list .
    types:  begin of s_elements,
      name  type trdirt-name,
      text   type trdirt-text,
    end of  s_elements.
    data: progname type trdirt-name.
    data: wa_elements type s_elements.
    selection-screen begin of block one with frame title text-t01.
    select-options:  s_prog for trdirt-name obligatory.
    selection-screen end of block one.
    at selection-screen.
    initialization.
       invoker = sy-repid. "Name of calling program for alv class.
    start-of-selection.
      create data dref type s_elements.
      assign dref->* to <fs>.
      i_gridtitle = 'Program List'.
      invoker = sy-repid.
      i_zebra = ' '.
      i_edit = 'X'.
      create object z_object
           exporting
                      z_object = z_object
                      cfname = 'CCONTAINER1'.
         assign z_object to <fs1>.
      i_object = <fs1>.
      call method i_object->build_dynamic_structures
      exporting
        my_line = <fs>
        calling_program = invoker
      importing
        dy_table = dy_table
      changing
        it_fldcat = it_fldcat.
    perform populate_dynamic_itab
    changing dy_table.
    perform modify_fldcat.
    i_screen = '100'.
    i_text = 'Prog List'.
    perform display_grid
           using
             i_screen
             i_text
             it_fldcat
             <dyn_table>.
    end-of-selection.
    form populate_dynamic_itab changing dy_table.
      assign dy_table->* to <dyn_table>.
      create data dy_line like line of <dyn_table>.
      assign dy_line->* to <dyn_wa>.
      select *
            from trdirt
             into  corresponding fields of table <dyn_table>
             where name in s_prog
             and sprsl eq sy-langu.
    endform.
    form display_grid
    using i_screen
         i_text
         field_catalog
         dynamic_table.
    call method i_object->display_data
             exporting
               i_gridtitle = i_gridtitle
               i_edit = ' '
               i_zebra = ' '
               i_opt  = ' '
               title_text    = i_text
               program       = invoker
               screen_number = i_screen
               z_object = i_object
                changing
               it_fldcat = field_catalog
               gt_outtab = dynamic_table
               e_ucomm = e_ucomm.
             if e_ucomm  = 'BACK'.
               leave to screen 0.
          else.
            leave program.
          endif.
    endform.
    form verwerk.
    endform.
    form refresh.
      call method i_object->refresh_grid.
    endform.
    form dubbelklik using
            e_row   type lvc_s_row
            e_column type lvc_s_col
            es_row_no type lvc_s_roid.
      read table <dyn_table> index e_row into wa_elements.
    progname = wa_elements-name.
        set parameter id 'RID'  field progname.
         call transaction  'SE38'.
      perform refresh.
      row_number-row_id = e_row.
      call method z_object->set_cell
        exporting
                e_column = e_column
                es_row_no = row_number.
    endform.
    form modify_fldcat.
      col_name it_fldcat 1 'Programe' 25.
      col_name it_fldcat 2 'description' 50.
    endform.

  • Problems converting ALV LIST to ALV GRID

    Hey guys
    when i changed the name of the function REUSE_ALV_LIST_DISPLAY to REUSE_ALV_GRID_DISPLAY..in a report..I get the GRID in next page..
    whys is it so??
    like the rpeort has the the ALV to be displayed in END_OF_LIST event...(the report has oen HIERARCHIAL ALV as the main ALV LIST and in the END OF LIST it has another ALV)
    when i change LIST to GRID ...
    the GRID gets itno 2nd page while the rest of the report gets into page 1...
    i want both these in 1st page only

    you can do it with blocks, but the whole thing will be in list mode
    REUSE_ALV_BLOCK_LIST_INIT
    REUSE_ALV_BLOCK_LIST_HS_APPEND (for hierarchical list)
    REUSE_ALV_BLOCK_LIST_APPEND (for simple grid list)
    REUSE_ALV_BLOCK_LIST_DISPLAY

Maybe you are looking for

  • If you can, simply go to Apple or your carrier

    I preordered a 32 GB black 4S for Sprint as well.  I did it a few days after the initial opening.  I too had a 31 Oct expected date on my receipt (not noticed until after I paid and left the store, no heads up or anything from the salesperson).  I di

  • SOAP Header in java

    Hi, Here is my scenario - NWCE 7.1, EJB as a WebService and I want to access the SOAP Header,  what would be the best way. I'm thinking of using handler-chains, appreciate any suggestions. Rajiv.

  • Initial charge question

    Just bought a 3G tonight...I intended to use it completely with the charge that it came with out of the box and then charge it fully and deplete it fully. Without thinking, though, I ended up plugging it into my macbook to sync. So did I mess up the

  • Punchout Catalog Items are not transfering to Consumer Portal (SRM 7.0)

    Dear Experts, We are able to add a punch out calatog after check out items are not tranfered to Consumer Portal ( Not able to see selected items in shop screen). Same thing is working fine with Producer Portal. 1. Tried with RDL and RRA. 2. Internal

  • Painting

    Question: The game I am making in Swing involves objects moving around a grid. The way I create the animation is as follows... I have all my characters in JLabels as images. If I want a character to move left I simply call the setBounds method on the