Multiple headings on ALV

Hi there
Our development requires that we have a main heading with multiple subheadings on a report.  Is it possible to display multiple headings on an ALV grid report?
Kind Regards
Gustav Coleske

Hi Vijay
This example does not do what we need.  I attach a better description of what we need:
Heading line 1 - Appointments
Heading line 2 (all under heading line 1) - ACI, WF, WM, Total, ACI %, WF %, WM%
Please let me know if you need more clarity.
Kind Regards
Gustav Coleske

Similar Messages

  • Multiple headings in alv

    Hi All,
    can any one help in acheving
    the below shown functionality in the url
    URLhttp://img689.imageshack.us/img689/894/forum14f35511154572086.jpg[/url]
    i have searched the SCN  but i cant find the solution
    and some them mentioned it is not possible.
    Regards,
    R K

    Dear RK
    Please find the below Code
    TYPE-POOLS: SLIS, ICON.
    DATA: LD_FIELDCAT  TYPE  SLIS_FIELDCAT_ALV.
    DATA: T_ALV_FIELDCAT      TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
    ALV_LAYOUT TYPE SLIS_LAYOUT_ALV .
    DATA : IT_FLD TYPE SLIS_T_FIELDCAT_ALV ,
           IT_EVT TYPE SLIS_T_EVENT     ,
           WA_FLD TYPE SLIS_FIELDCAT_ALV   ,
           WA_EVT TYPE SLIS_ALV_EVENT      ,
           WA_LAY TYPE SLIS_LAYOUT_ALV     .
    DATA:BEGIN OF ITAB OCCURS 0,
    CARRID LIKE SFLIGHT-CARRID,
    CONNID LIKE SFLIGHT-CONNID,
    PLANETYPE LIKE SFLIGHT-PLANETYPE,
    SEATSMAX LIKE SFLIGHT-SEATSMAX,
    END OF ITAB.
    START-OF-SELECTION. {color:red}"We are using table sflight to populate the internaltable{color}
      SELECT CARRID CONNID PLANETYPE SEATSMAX  FROM SFLIGHT  INTO TABLE ITAB.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        IMPORTING
          ET_EVENTS = IT_EVT.
      READ TABLE IT_EVT INTO WA_EVT  WITH KEY NAME = SLIS_EV_AFTER_LINE_OUTPUT .
      WA_EVT-FORM = SLIS_EV_AFTER_LINE_OUTPUT .
      MODIFY IT_EVT FROM WA_EVT INDEX SY-TABIX .
      READ TABLE IT_EVT INTO WA_EVT  WITH KEY NAME = SLIS_EV_TOP_OF_PAGE .
      WA_EVT-FORM = SLIS_EV_TOP_OF_PAGE .
      MODIFY IT_EVT FROM WA_EVT INDEX SY-TABIX .
    CLEAR: LD_FIELDCAT.
      LD_FIELDCAT-TABNAME       = 'ITAB'.
      LD_FIELDCAT-FIELDNAME     = 'CARRID'.
      LD_FIELDCAT-REF_TABNAME   = 'SFLIGHT'.
      LD_FIELDCAT-OUTPUTLEN     = '10'.
      APPEND LD_FIELDCAT TO T_ALV_FIELDCAT.
      CLEAR LD_FIELDCAT.
      CLEAR: LD_FIELDCAT.
      LD_FIELDCAT-TABNAME       = 'ITAB'.
      LD_FIELDCAT-FIELDNAME     = 'CONNID'.
      LD_FIELDCAT-REF_TABNAME   = 'SFLIGHT'.
      LD_FIELDCAT-OUTPUTLEN     = '10'.
      APPEND LD_FIELDCAT TO T_ALV_FIELDCAT.
      CLEAR LD_FIELDCAT.
      CLEAR: LD_FIELDCAT.
      LD_FIELDCAT-TABNAME       = 'ITAB'.
      LD_FIELDCAT-FIELDNAME     = 'PLANETYPE'.
      LD_FIELDCAT-REF_TABNAME   = 'SFLIGHT'.
      LD_FIELDCAT-OUTPUTLEN     = '10'.
      APPEND LD_FIELDCAT TO T_ALV_FIELDCAT.
      CLEAR LD_FIELDCAT.
      CLEAR: LD_FIELDCAT.
      LD_FIELDCAT-TABNAME       = 'ITAB'.
      LD_FIELDCAT-FIELDNAME     = 'SEATSMAX'.
      LD_FIELDCAT-REF_TABNAME   = 'SFLIGHT'.
      LD_FIELDCAT-OUTPUTLEN     = '10'.
      APPEND LD_FIELDCAT TO T_ALV_FIELDCAT.
      CLEAR LD_FIELDCAT.  {color:red}"This is where we exclude the standard ALV columns {color}
      ALV_LAYOUT-NO_COLHEAD = 'X' .

  • Sub headings in ALV Grid

    Hi,
    How to display sub headings in alv grid
    output format should be:
    <COL_HEADING1>                      <COL_HEADING2>
    <SUB_HEADING1> <SUB_HEADING2> <SUB_HEADING1><SUB_HEADING2>
    and i want separate templet with side headings?
    could you tell me grid supports this?
    thanks in advance
    cheers
    srini

    Hi Srinivas,
    Look ALV grid Multiple Header ... ? which has got a slightly more comprehensive information
    Regards,
    Anand Mandalika.

  • Multiple Headings in a Report with Optional Sections

    I’m trying to create a BI publisher document that has a main section and two optional sections. The report is for an Oracle Apex 4.1 application so user responses regarding the sections they require is via an apex page. Apex allows session state variables to be included in the report data xml so the user responses are stored in the data xml. I’m using an RTF template. The problem is that the optional sections need to have different headings from the main report (and each other) and start on a new page. I just cannot get this report to work. I either end up with headings on blank pages or just blank pages when the user chooses not to have the optional sections.
    The queries for the optional sections have been structured in such way that they will only return rows if the user has selected the optional sections.
    This is what I’ve tried so far:
    Section breaks before the optional sections: The headers for the optional sections appear regardless of whether there’s any data to show. I have to use a section break that will produce a page break because we want the optional sections to start on their own page. Even if I surround the section break and the rowset for the optional section with an if statement I still get a heading on a blank page.
    Taking this a stage further if I try to suppress the header by completely surrounding it with an if statement with the appropriate report variable ie
    <?if:optional_section_1 = ‘Y’?>
    Heading text
    <?end if?>
    I just get a blank page instead.
    If I use the same header and footer throughout the document and use normal page breaks with the optional sections the report works fine.
    Templates: I’ve tried splitting the optional parts of the report into sub templates that have their own headings but these headings don’t show up at all in the final report.
    Start body/end body tags: That is placing the headers actually in the document text (rather than the actual headers and footers) but outside of these tags. I end up with both headers for the optional parts in my output document. The Oracle documentation “Creating Multiple or Complex Header and Footers” is rather sparse and the example doesn’t really cover what it purports to cover i.e. a document with multiple headings. I’ve done plenty of Google searches regarding this and cannot find any good examples.

    can you send me your template and xml to my email . I can try at my side : [email protected]

  • FIeld headings in ALV Grid by label

    Hi
    I want disply the headings in alv grid display like this format.
    I want write my own label in the output. (not in Normal LIST DISPLAY)
    Sno |      Sname |    Marks
        |           |     M1 |  M2  | M3
    How it is possible?
    Edited by: Krishna Bommisetty on Sep 11, 2008 10:55 AM

    Hi,
      Check the below code.
    WA_FCAT-SELTEXT_M   = TEXT-073.
      WA_FCAT-DDICTXT      = 'M'.
    We can define the name of the field label as mentioned above, where texto073 is nothing but the field label you want to give to the particular field.
      DDICTXT you have to mention the length as small 'S', medium 'M' and large as 'L'.

  • How to select multiple row in ALV report

    Hi friends,
    1. How to select multiple row in ALV report
                   ( How to set tab in ALV report and want to select multiple line.)
    Thanking you.
    Subash

    Hi Sahoo,
    If you are using the class CL_GUI_ALV_GRID. In methods SET_TABLE_FOR_FIRST_DISPLAY.
    in layout structure you will find field SEL_MODE
    pass :
    LS_LAYOUT-SEL_MODE = 'A'.
    In PAI.
      CALL METHOD GRID->GET_SELECTED_ROWS
        IMPORTING
          ET_INDEX_ROWS = T_ROWS
          ET_ROW_NO     = T_ROWID.
    Hope these will solve your problem.
    Regards,
    Kumar M.

  • How to add the double headings in Alv Report.

    Hi All,
    Plz suggest me how to add the double headings in ALv Report.
    Ram

    Hi,
    Try out this program....
    REPORT  ypm_historycard_rep.
    TYPE-POOLS : slis.
    DATA : it_cbm TYPE STANDARD TABLE OF mara.
    DATA : it_layout TYPE STANDARD TABLE OF slis_layout_alv WITH HEADER LINE,
           wa_fcat TYPE slis_fieldcat_alv,
           it_fcat TYPE slis_t_fieldcat_alv.
    START-OF-SELECTION.
      SELECT  *
      FROM  mara
      INTO CORRESPONDING FIELDS OF TABLE  it_cbm
      where matnr = 'D80K7'.
    END-OF-SELECTION.
      it_layout-zebra = 'X'.
      it_layout-colwidth_optimize = 'X'.
      it_layout-f2code = '&ETA'.
      APPEND it_layout.
      DEFINE macro4fcat.
        wa_fcat-col_pos = &1.
        wa_fcat-fieldname = &2.
        wa_fcat-tabname = &3.
        wa_fcat-seltext_l = &4.
        append wa_fcat to it_fcat.
        clear wa_fcat.
      END-OF-DEFINITION.
      macro4fcat    '1'  'MATNR'         'IT_CBM'   'MATERIAL NO'    .
      DESCRIBE TABLE it_cbm.
      IF sy-ucomm = '&F03'.
        MESSAGE 'hi hello good morning "press enter button" this is quiz' TYPE 'S'.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
      i_callback_program                = sy-repid
    i_callback_html_top_of_page       = 'HTML_TOP_OF_PAGE'
      is_layout                         = it_layout
      it_fieldcat                       = it_fcat
       i_save                            = 'A'
      TABLES
      t_outtab                          = it_cbm
      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  html_top_of_page
    *       text
    *      -->TOP        text
    FORM html_top_of_page USING top TYPE REF TO cl_dd_document.
      DATA: l_text(255) TYPE c.
      DATA: text1(255)  TYPE c.
      DATA: t_header TYPE REF TO cl_dd_table_element ,
            wa_header TYPE REF TO cl_dd_table_area.
      CALL METHOD top->add_gap
        EXPORTING
          width = 10.
      CALL METHOD top->add_text
      EXPORTING
        text          = 'hello'
        sap_style     = 'HEADING'
    CALL METHOD top->add_gap
        EXPORTING
          width = 20.
      CALL METHOD top->add_text
      EXPORTING
        text          = 'HOW ARE YOU'
        sap_style     = 'HEADING'.
        CALL METHOD TOP->new_line
    *      EXPORTING
    *        repeat =
        CALL METHOD top->add_gap
        EXPORTING
          width = 50.
      CALL METHOD top->add_text
      EXPORTING
        text          = '____________________________________________________________'
        sap_style     = 'HEADING'.
        CALL METHOD TOP->new_line
    *      EXPORTING
    *        repeat =
        CALL METHOD top->add_gap
        EXPORTING
          width = 90.
      CALL METHOD top->add_text
      EXPORTING
        text          = 'YOU CAN TRY LIKE THIS'
        sap_style     = 'HEADING'.
    ENDFORM.                    "html_top_of_page
    Regards
    Debarshi

  • SAPGUI JAVA 7.10 (OSX 10.5.1): cannot select multiple columns in ALV

    Hi,
    in sapgui java 7.10 (on mac osx 10.5.1) I cannot select multiple columns in ALV reports.
    I can do it only in some transactions (like SE16). But on all our custom reports (REUSE_ALV_GRID_DISPLAY) in does not work.
    Any hint?
    Many thanks,
    Lorenzo

    Hi Lorenzo,
    did you double check if selecting multiple columns works with SAP GUI for Windows in the same report?
    If yes, I suggest to file a bug report so we can do a remote logon to run your custom report.
    If not it might be because of REUSE_ALV_GRID_DISPLAY itself or your parameters calling REUSE_ALV_GRID_DISPLAY.
    Best regards
    Rolf-Martin

  • REUSE_ALV_GRID_DISPLAY (column headings from ALV to EXCEL) Max please help

    Hi Max,
    If you remember in one of my last post I asked for changing the column headings in ALV display for example from 'Material' to 'Material used'.
    I am using
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
          I_CALLBACK_PROGRAM                = repid
          IT_FIELDCAT                       = field_body
          I_SAVE                            = g_save
          IS_VARIANT                        = g_variant
          IT_EVENTS                         = events
        TABLES
          T_OUTTAB                          = itab.
    And you suggested me the following way....
    loop at field_body into field_wa.
    case field_wa-fieldname.
      when 'Material'.
         field_wa-seltext_l = 'Material used'.
         field_wa-seltext_m = 'Material used'.
         field_wa-seltext_s = 'Material used'.
    endcase.
    modify field_body from field_wa.
    endloop.
    It is working well. In ALV display the column heading is changed to what I wanted. But the question is when I export the displayed ALV to Excel using ALV functionality, Export->Spreadsheet... I see that <b>I dont get the Column Heading into Excel as it was in the ALV display.</b>
    I get in the Excel as 'Material u' or 'Mat. Used'. But when I add this line in the code.....
    when 'Material'.
         field_wa-seltext_l = 'Material used'.
         field_wa-seltext_m = 'Material used'.
         field_wa-seltext_s = 'Material used'.
        <b> field_wa-outputlen = 20.</b>
    Then I see that I get the complete heading in the Excel. But this way the columns with outputlen 20 are taking much space in ALV display.
    Is there any fix for this. May be not mentioning the outputlen but still get the column headings into Excel as it was in ALV display.
    Anyone with ideas please respond. Waiting for replies. Thanks

    Hi
    The labels have a fixed size:
    seltext_l is long   text: 20 char
    seltext_m is medium text: 15 char
    seltext_s is short  text: 10 char
    The text 'Material used' is long 13 char so you should write:
    field_wa-seltext_l = 'Material used'.
    field_wa-seltext_m = 'Material used'.
    field_wa-seltext_s = 'Mat. used'.
    You can try to set the field colwidth_optimize of parameter IT_LAYOUT.
    This field should optimize the width of the colunm
    So
    data layout type SLIS_LAYOUT_ALV.
    layout-colwidth_optimize = 'X'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
    I_CALLBACK_PROGRAM = repid
    IT_LAYOUT   = layout       
    IT_FIELDCAT = field_body
    I_SAVE = g_save
    IS_VARIANT = g_variant
    IT_EVENTS = events
    TABLES
    T_OUTTAB = itab.
    and you can decide which label has to be used:
    field_wa-seltext_l = 'Material used'.
    field_wa-seltext_m = 'Material used'.
    field_wa-seltext_s = 'Mat. used'.
    If you want to set the short text
    field_wa-ddictxt   = 'S'.
    ...medium
    field_wa-ddictxt   = 'M'.
    ...long
    field_wa-ddictxt   = 'L'.
    Max

  • Multiple Heading in ALV Grid

    Hello ,
    I have a requirement to display Multiple heading in ALV Grid, I am using the Class 'cl_gui_alv_grid'. please let me know if you have Any suggestions.
    Ex:
    |                 Divison                     |     
    Sub D:1
    Sub D: 2
    Sub D: 3
        Like wise i have few more divisions to display and Under we need to display the Sub Division also .
    Thanks in Advance..  Waiting for your suggestions.
    With Best Regards
    Nags

    Hi,
    I had attempted to do it in the object oriented way, but found no ready solution, so I settled for the below solution.
    Please use the function REUSE_ALV_COMMENTARY_WRITE.
    This allows you to print multiple lines in the header.
    I had a requirement of showing 5 lines in the header.
    So i went on like:
    DATA: it_list_commentary TYPE slis_t_listheader,
               wa_list_commentary TYPE slis_listheader.
    wa_list_commentary-typ = 'H'.
    wa_list_commentary-info = <text>.
    APPEND wa_list_commentary TO it_list_commentary.
    wa_list_commentary-typ = 'S'.
    wa_list_commentary-info = <text>.
    APPEND wa_list_commentary TO it_list_commentary.
    I fed he internal table with all 5 lines like above.
    Finally I called the function.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = it_list_commentary.
    Regards,
    Prosenjit.
    Edited by: prosenjit chaudhuri on Jan 28, 2009 6:14 AM

  • How to select multiple records in ALV with out pressing ctrl

    Hi Experts,
    Is there a way to select multiple records in ALV with out pressing ctrl button on the key board?
    Selection and deselection should allow multiple records.
    any clue is highly appreciated.
    regards,
    Ajay

    The keyboard always plays a role, although with the Shift key you can select blocks of records.
    ○       CTRLclick, CTRLspacebar
    Toggles a selection.
    ○       SHIFTclick, CTRLshift
    Selects the area from the lead selection to the row selected. If no lead selection is set, the selection starts from the first row. In the multiNoLead mode, the selection starts from the row last selected

  • Multiple headers in alv

    Hi All,
    I have the following requirement, need to display multiple headers in ALV display(not multiple lines in alv header).
    Header1.
    Row1
    Row2
    Row3
    Footer 1.
    Header2.
    Row1
    Row2
    Row3
    Footer 2.
    Header3.
    Row1
    Row2
    Row3
    Footer 3.
    To display this in hierarchal ALV the above given tables does not have header item relationship. To use Blocked ALV the number of blocks are not constant, Sometimes there can be only 2 blocks sometimes there can be 10 blocks and some times even more, there is no cap on Maximum number of blocks.
    I have searched in SDN N google but couldnt found suitable answer. If anyone has solved this type of issue before, can please through some light.
    Thanks in Advance.

    Hi All,
    I'm able to solve the above issue somewhat by using split technique. I want to know how to trigger top of page event in split. I want to trigger top of page event in same container where data is being displayed.
    I have created container on screen and splitted that container into 3 parts, as I need to display data in each container. Now I want to display top of page for each container.
    I have searched over internet and SDN but I'm able to find examples like split the containers into 2 parts and use 1 part for top of page and second part for data display.
    My case is little different. I need to display data in each container with separate header for each container. If the header is only single line I could have used Layout-Title, but the header for each container is multiple lines. So I must use top of page.
    If any body handled such kind of scenario, please provided some inputs.
    Thanks in advance.

  • Multiple levels in ALV Hierarchy

    Hi All
    How to display Multiple levels in ALV Hierarchy.
    I have header and Item Tables but Under Header Expansions I have to display one more Expansion.
    Means Multiple levels.

    Hi,
      I think you can check standard program BCALV_TEST_HIERSEQ_LIST
    Regards,
    Himanshu

  • How to avoid multiple selection in ALV tree control?

    Hi,
    Experts,
    I want to avoid multiple selections on Alv tree control after pressing control keyboard button(Ctrl). Even by pressing Ctrl keyword button i want to select only one row of a Alv tree control.i have used cl_salv_tree class for it is there any method to achieve this please pass some code/idea on it.
    Thanks in advance,
    Shabeer ahmed.

    I haven't tried it before but it should help.
    [https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/cda3992d-0e01-0010-90b2-c4e1f899ac01|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/cda3992d-0e01-0010-90b2-c4e1f899ac01]

  • How to select multiple lines in ALV report

    hi gurus,
    I am working on an interactive ALV report where i have to select multiple lines from the basic list into an internal table, based on check box clicks. Using RS_SELFIELD i can select only 1 row. The coding has been done based on Call Function. Can u please suggest some way.
    Regards,
    Satyajit

    hi,
    try like this
    TABLES:     ekko.
    TYPE-POOLS: slis.                                 "ALV Declarations
    TYPES: BEGIN OF t_ekko,
      sel,                         "stores which row user has selected
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          fieldcatalog1 TYPE slis_t_fieldcat_alv WITH HEADER LINE,
          gd_tab_group TYPE slis_t_sp_group_alv,
          gd_layout    TYPE slis_layout_alv,
          gd_repid     LIKE sy-repid.
    DATA : BEGIN OF det_tab OCCURS 0,
            ebeln LIKE ekpo-ebeln,
           END OF det_tab.
    START-OF-SELECTION.
      PERFORM data_retrieval.
      PERFORM build_fieldcatalog.
      PERFORM build_layout.
      PERFORM display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
    *       Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
      fieldcatalog-fieldname   = 'EBELN'.
      fieldcatalog-seltext_m   = 'Purchase Order'.
      fieldcatalog-outputlen   = 10.
      fieldcatalog-emphasize   = 'X'.
      fieldcatalog-key         = 'X'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'EBELP'.
      fieldcatalog-seltext_m   = 'PO Item'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'STATU'.
      fieldcatalog-seltext_m   = 'Status'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'AEDAT'.
      fieldcatalog-seltext_m   = 'Item change date'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MATNR'.
      fieldcatalog-seltext_m   = 'Material Number'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MENGE'.
      fieldcatalog-seltext_m   = 'PO quantity'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'MEINS'.
      fieldcatalog-seltext_m   = 'Order Unit'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'NETPR'.
      fieldcatalog-seltext_m   = 'Net Price'.
      fieldcatalog-outputlen   = 15.
      fieldcatalog-do_sum      = 'X'.        "Display column total
      fieldcatalog-datatype     = 'CURR'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
      fieldcatalog-fieldname   = 'PEINH'.
      fieldcatalog-seltext_m   = 'Price Unit'.
      APPEND fieldcatalog TO fieldcatalog.
      CLEAR  fieldcatalog.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
    *       Build layout for ALV grid report
    FORM build_layout.
      gd_layout-box_fieldname     = 'SEL'.
      "set field name to store row selection
      gd_layout-edit              = 'X'. "makes whole ALV table editable
      gd_layout-zebra             = 'X'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
    *       Display report using ALV grid
    FORM display_alv_report.
      gd_repid = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program       = gd_repid
          i_callback_user_command  = 'USER_COMMAND'
          i_callback_pf_status_set = 'SET_STAT'
          is_layout                = gd_layout
          it_fieldcat              = fieldcatalog[]
          i_save                   = 'X'
        TABLES
          t_outtab                 = it_ekko
        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.
    ENDFORM.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
       UP TO 10 ROWS
        FROM ekpo
        INTO CORRESPONDING FIELDS OF TABLE it_ekko.
    ENDFORM.                    " DATA_RETRIEVAL
    *       FORM USER_COMMAND                                          *
    *       --> R_UCOMM                                                *
    *       --> RS_SELFIELD                                            *
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
    * Check function code
      CASE r_ucomm.
        WHEN '&IC1'.
          IF rs_selfield-fieldname = 'EBELN'.
            READ TABLE it_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
            SET PARAMETER ID 'BES' FIELD wa_ekko-ebeln.
            CALL TRANSACTION 'ME23N' AND SKIP FIRST SCREEN.
          ENDIF.
        WHEN 'DET'.  "button add by me
          CLEAR det_tab.
          REFRESH det_tab.
          LOOP AT it_ekko INTO wa_ekko WHERE sel = 'X'.
            MOVE-CORRESPONDING wa_ekko TO det_tab.
            APPEND det_tab.
          ENDLOOP.
          PERFORM build_cat.
          PERFORM dis_data.
      ENDCASE.
    ENDFORM.                    "user_command
    *&      Form  set_stat
    *       text
    *      -->RT_EXTAB   text
    FORM set_stat USING rt_extab TYPE slis_t_extab.
      SET PF-STATUS 'ZSTAT' EXCLUDING rt_extab.
    ENDFORM.                    "set_stat
    *&      Form  build_cat
    *       text
    FORM build_cat.
      CLEAR fieldcatalog1.
      REFRESH fieldcatalog1.
      fieldcatalog1-fieldname = 'EBELN'.
      fieldcatalog1-tabname = 'DET_TAB'.
      fieldcatalog1-seltext_m = 'Order No.'.
      fieldcatalog1-outputlen = 10.
      APPEND fieldcatalog1 TO fieldcatalog1.
      CLEAR fieldcatalog1.
    ENDFORM.                    "build_cat
    *&      Form  dis_data
    *       text
    FORM dis_data.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program = 'ZTEST_DS'
          it_fieldcat        = fieldcatalog1[]
          i_save             = 'X'
        TABLES
          t_outtab           = det_tab.
    ENDFORM.                    "dis_data
    here i have copied standard gui status of ALV into my z status ZSTAT and add one button DET......
    here u can select morethan one line using control(ctrl)
    reward if usefull...

Maybe you are looking for

  • Can not seem to print from 64 bit mac osx photoshop cs4 in landscape

    we have like 5 mac computers in the building and about 20 pcs. all the pcs and all the 32 bit macs work fine. the 2 64 bit macs will not print in landscape only from photoshop cs4 i can print from indesign in landscape and illustrator in landscape. s

  • I cant open my iTunes ("Restore Windows" error)

    I cant open my iTunes. When I open it, it says to press "Restore Windows" or "Don't Restore Windows", but before I have time to press anything, it then closes and says "iTunes quit unexpectedly". This is the details: Process:     iTunes [336] Path:  

  • Role Validity date

    Hi Guys, I have a role assigned to a user with a validity date (say 01/20/10 to 04/20/10). However after the expiry date the user is able to perform actions related to that role. I do have PFUD scheduled which runs every day. I understand that prgn_c

  • Inane problem (not a newbie) w/ my nano

    Okay, so I need help...I use RealPlayer with my nano, and it has worked great-it's much faster than iTunes for me. The only thing is, today I went to listen, and my nano doesn't have any songs listed. I plugged the thing back in, and, lo and behold,

  • I keep getting an error message when I try to do facebook sharing?why

    What is causing the error message I get when trying to share with facebook?