ALV LIST/GRID DISPLAY

Hi,
My program output is in ALV format either LIST or GRID based on Sy-batch.
In that program they are using table Z1021.
They are retreiving data from Z1021 table based on selection screen parameters like werks, bukrs, vkorg,
auart and date and passing that data to one internal table.
SELECT * FROM Z1021 INTO TABLE i_z1021
WHERE werks in s_werks
AND       bukrs in s_bukrs
AND       vkorg in s_vkorg
AND       auart in s_auart
AND       pgi_date in s_date.
SORT i_z1021 BY werks bukrs vkorg auart pgi_date.
For fieldcatlog they used function module REUSE_ALV_FIELDCATALOG_MERGE'.
passing only i_structure_name  = c_struct_name in Exporting parameters
retreive to i_fieldcat from Changing parameters.
from above both they are passing i_z1021 table data and i_fieldcat to function module
'REUSE_ALV_GRID_DISPLAY' OR 'REUSE_ALV_LIST_DISPLAY' based on sy-batch.
That is my current program.
My new requirement is given below.
Additional and change to fields:
1) Add Intercompany purchase order number
    From the document flow table VBFA.
    The field name is VBFA-VBELN when Subs.doc.categ (VBFA-VBTYP_N) equal to "V" after sales order line item.
2) Change field name u2018Customeru2019 to u2018Ship-tou2019
From VBFA table need to retrieve VBELN value based on VBELN_VA and POSNR_VA from Z1021 table
where VBFA-VBELV = Z1021-VBELN_VA and VBFA-POSNV = Z1021-POSNR_VA.
This is the condition to fetch that data.
And I want to change the description of Field 'CUSTOMER'( Z1021-KUNNR) to' Ship-to'.
Is it possible to do without changing the original logic.
IF it is possible what is the solution ?
If it is not possible without changing the original code then what is the solution for that also.
Current Code:
Some code i am giving here.
TABLES: Z1021.
DATA: i_z1021 LIKE z1021 OCCURS 0.
CONSTANTS: c_struct_name LIKE dd02l-tabname VALUE 'Z1021'.
START-OF-SELECTION.
PERFORM get_data.
END-OF-SELECTION.
PERFORM list_display.
FORM get_data.
SELECT * FROM Z1021 INTO TABLE i_z1021
WHERE werks in s_werks
AND       bukrs in s_bukrs
AND       vkorg in s_vkorg
AND       auart in s_auart
AND       pgi_date in s_date.
SORT i_z1021 BY werks bukrs vkorg auart pgi_date.
ENDFORM.
FORM list_display.
PERFORM create_fieldcatalog.
< another performs>
PERFORM display_list.
ENDOFRM.
FORM create_fieldcatalog.
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
       i_structure_name    = c_struct_name
    CHANGING    
       ct_fieldcat               = i_fieldcat.
ENDFORM.
FORM display_list.
CASE sy-batch.
  WHEN 'X'.
CALL FUNCTION ;REUSE_ALV_LIST_DISPLAY'
  WHEN ' '.
CALL FUNCTION ;REUSE_ALV_GRID_DISPLAY'
ENDCASE
ENDFORM.
Could you please suggest on this.
Thanks & Regards.
VSR

Hi
After fill the field catalog table by function module MERGE, u can modify the value before moving it to ALV LIST/GRID display fm:
FORM create_fieldcatalog.
  DATA: LS_FIELDCAT TYPE SLIS_FIELDCAT_ALV
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
   EXPORTING
      i_structure_name = c_struct_name
   CHANGING
     ct_fieldcat = i_fieldcat.
LOOP AT I_FIELDCAT INTO LS_FIELDCAT.
    CASE LS_FIELDCAT-FIELDNAME.
       WHEN 'KUNNR'.
        LS_FIELDCAT-SELTEXT_L = <new descrip.>.
        LS_FIELDCAT-SELTEXT_M = <new descrip.>.
        LS_FIELDCAT-SELTEXT_S = <new descrip.>.
        MODIFY I_FIELDCAT FROM LS_FIELDCAT.
    ENDCASE.
ENDLOOP.
ENDFORM.
Max
Edited by: max bianchi on Jan 29, 2009 8:15 PM

Similar Messages

  • Multi ALV lists/grid report in one output/screen

    Hi,
    I need to develop a ALV report, where in the output/ALV/List/Grid should look like below (all lists/grids should be fit in only one screen, if there are too many entires in the sub reports user will scroll down each), here am giving the details (MATNR, KUNNR, LIFNR) of the output just for example purpose
                                                 _My_Report_
    Sub_report_1
    MATNR-----Description
    Sub_report_2
    KUNNR-----Name
    Sub_report_3
    LIFNR-----Name
    Sub_report_4
    BANK-----Name
    Its okay to have any kind of ALV either grid or List, when user press F8 on the selection screen all should come in one screen, if there are too many entries then user will scroll down
    Thank you

    Hello,
    You can use blocked alv to achieve this.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_INIT'
        EXPORTING
          i_callback_program = l_repid.
    *Adding First Block to the List
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          is_layout                  = w_layo
          it_fieldcat                = it_fcat
          i_tabname                  = text-064
          it_events                  = it_events
          it_sort                    = it_sort
        TABLES
          t_outtab                   = it_mainalv
        EXCEPTIONS
          program_error              = 1
          maximum_of_appends_reached = 2
          OTHERS                     = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_APPEND'
        EXPORTING
          is_layout                  = w_layo
          it_fieldcat                = it_fcat1
          i_tabname                  = text-094
          it_events                  = it_events1
          it_sort                    = it_sort1
        TABLES
          t_outtab                   = it_field_change
        EXCEPTIONS
          program_error              = 1
          maximum_of_appends_reached = 2
          OTHERS                     = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    Displaying the list
      CALL FUNCTION 'REUSE_ALV_BLOCK_LIST_DISPLAY'
        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.
    Thanks.
    ramya.

  • Need ALV LIST for displaying Dynamic Internal Tables

    Hi Guys,
                     I have some thing like 2 Dynamic internal tables.
    Say 1st Internal table will be filled based on some condition.
    say 2nd table will be filled based on some condition.
    When appending the 1st Internal table, if that internal table is filled it creates another internal table of same kind and continues so on until some condition.
    In the same way when appending the 2nd Internal table, if that internal table is filled it creates another internal table of same kind and continues so on until some condition.
    My requirement is I need to display all these Internal tables in the output.
    The output should look something like
    1st Internal Table
    some gap
    2nd Internal Table
    some gap
    so on...................
    Is there any standard ALV List, to display all these Internal Tables in such a way.
    Thanks,
    Prasad.

    Hi.
    One thing more here is code which get 10 records from 2 tables and then show them in ALV.
    first when u execute it will show data from ist table.
    when u go back (F3) then it will sow data from 2nd table.
    But if u want to show both ALV on the same screen then u will have to use screen programin and using class u will have to create container and then have to do it.
    But as i above mentioned. that sample code is as below.
    REPORT ztn_test LINE-COUNT 100.
      data: itab_ref type ref to data.
      data: hstr type lvc_title.
    data: tabname like DD02T-TABNAME.
       tabname = 'MARA'. " First Table
      create data itab_ref type standard table of (tabname).
      field-symbols: <itab> type standard table.
      assign itab_ref->* to <itab>.
      select * UP TO 10 ROWS from (tabname) into corresponding fields of table <itab>.
      perform showalv.
       tabname = 'KNA1'. " 2nd Table
      create data itab_ref type standard table of (tabname).
      "field-symbols: <itab> type standard table.
      assign itab_ref->* to <itab>.
      select * UP TO 10 ROWS from (tabname) into corresponding fields of table <itab>.
      perform showalv.
    form showalv.
    " to show that data in alv
      type-pools: slis.
      data: myalv type ref to cl_gui_alv_grid,    "ALV Grid
            fieldcat type slis_t_fieldcat_alv,    "Field Catalog Table
            ls_fcat type slis_fieldcat_alv,       "Line of Field catalog.
            ls_heading type slis_listheader,      "Line of Heading.
            layout type slis_layout_alv,          "layout of ALV for Heading and Logo.
            event type slis_t_event,              "Event Raising to Display Heading.
            event_str type slis_alv_event.        "Event String.
    type-pools: slis.
    data: heading type slis_t_listheader.       "List Heading.
      if heading[] is initial.
        ls_heading-typ = 'H'.
        ls_heading-info = 'HR: Master Data Change History'.
        append ls_heading to heading.
      endif.
    *  ls_heading-typ = 'A'.
    *  ls_heading-info = ''.
    *  APPEND ls_heading TO heading.
    *                          ALV DISPLAY                        *
    *******Making Layout of ALV
      layout-zebra = 'X'.
      layout-colwidth_optimize = 'X'.
    *Calling function to raise event to display heading and icon above ALV
      call function 'REUSE_ALV_EVENTS_GET'
       exporting
         i_list_type           = 0
       importing
         et_events             = event[]
    * EXCEPTIONS
    *   LIST_TYPE_WRONG       = 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.
    ******calling TOP_OF_PAGE Event
      read table event with key name = 'TOP_OF_PAGE' into event_str.
      if sy-subrc = 0.
        move: 'TOP_OF_PAGE' to event_str-form.
        modify event from event_str index sy-tabix.
      endif.
    **** Now use this Fuction to display ALV without any Screen Programming.
      call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
    *   I_INTERFACE_CHECK                 = ' '
    *   I_BYPASSING_BUFFER                = ' '
    *   I_BUFFER_ACTIVE                   = ' '
         i_callback_program                = 'SAPLZFSL_HR_UTILS' "sy-cprog
    *   I_CALLBACK_PF_STATUS_SET          = ' '
    *   I_CALLBACK_USER_COMMAND           = ' '
    *   I_CALLBACK_TOP_OF_PAGE            = ' '
    *   I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *   I_CALLBACK_HTML_END_OF_LIST       = ' '
         i_structure_name                  = tabname
    *   I_BACKGROUND_ID                   = ' '
         i_grid_title                      = hstr   "Heading of ALV Grid.
    *   I_GRID_SETTINGS                   =
         is_layout                         = layout
    *   it_fieldcat                       = fieldcat[]
    *   IT_EXCLUDING                      =
    *   IT_SPECIAL_GROUPS                 =
    *   IT_SORT                           =
    *   IT_FILTER                         =
    *   IS_SEL_HIDE                       =
         i_default                         = 'X'
         i_save                            = 'X'
    *   IS_VARIANT                        =
         it_events                         = event[]
    *   IT_EVENT_EXIT                     =
    *   IS_PRINT                          =
    *   IS_REPREP_ID                      =
    *   I_SCREEN_START_COLUMN             = 0
    *   I_SCREEN_START_LINE               = 0
    *   I_SCREEN_END_COLUMN               = 0
    *   I_SCREEN_END_LINE                 = 0
    *   I_HTML_HEIGHT_TOP                 = 0
    *   I_HTML_HEIGHT_END                 = 0
    *   IT_ALV_GRAPHICS                   =
    *   IT_HYPERLINK                      =
    *   IT_ADD_FIELDCAT                   =
    *   IT_EXCEPT_QINFO                   =
    *   IR_SALV_FULLSCREEN_ADAPTER        =
    * IMPORTING
    *   E_EXIT_CAUSED_BY_CALLER           =
    *   ES_EXIT_CAUSED_BY_USER            =
        tables
          t_outtab                          = <itab>
    * 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.

  • Header Alv list/Grid

    Hi Guys,
    I need to display data in a ALV list and grid in the following format.
    GI----
        Delivery-
       Document   Year PostDate Item Plnt Stlc CoCd    Document Item 
    Could anyone please tell me how do i get the Header Part (GI and Delivery that spans the below columns). GI will be header for the Document Year PostDate Item..etc.....and Delivery should be the header for document and Item columns in alv.
    Please give me an idea......
    San

    hi San,
      You can write the GI----------------Delivery part in top of page
    chk this
    REPORT ztest.
    TABLES : mara.
    TYPE-POOLS: slis.
    DATA : w_repid LIKE sy-repid.
    w_repid = sy-repid.
    DATA : BEGIN OF it_mara OCCURS 0,
           matnr LIKE mara-matnr,
           END OF it_mara.
    *layout
    DATA: wa_layout           TYPE slis_layout_alv.
    *field catalog
    DATA: it_fieldcat_wrt_off TYPE slis_t_fieldcat_alv,
          wa_fieldcat_wrt_off TYPE slis_fieldcat_alv.
    START-OF-SELECTION.
      SELECT matnr FROM mara INTO CORRESPONDING FIELDS OF TABLE it_mara.
    END-OF-SELECTION.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
       EXPORTING
         i_program_name               = w_repid
       i_internal_tabname           = 'IT_MARA'
    *     i_structure_name             = 'IT_MARA'
    *   I_CLIENT_NEVER_DISPLAY       = 'X'
       i_inclname                   = w_repid
    *   I_BYPASSING_BUFFER           =
    *   I_BUFFER_ACTIVE              =
        CHANGING
          ct_fieldcat                  = it_fieldcat_wrt_off[]
       EXCEPTIONS
         inconsistent_interface       = 1
         program_error                = 2
         OTHERS                       = 3
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program     = w_repid
          i_callback_top_of_page = 'TOP-OF-PAGE'
          is_layout              = wa_layout
          it_fieldcat            = it_fieldcat_wrt_off
        TABLES
          t_outtab               = it_mara
        EXCEPTIONS
          program_error          = 1
          OTHERS                 = 2.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    * Form  TOP-OF-PAGE                                                 *
    * ALV Report Header                                                 *
    FORM top-of-page.
    *ALV Header declarations
      DATA: t_header TYPE slis_t_listheader,
            wa_header TYPE slis_listheader,
            t_line LIKE wa_header-info,
            ld_lines TYPE i,
            ld_linesc(10) TYPE c.
    * Title
      wa_header-typ  = 'H'.
      wa_header-info = ' REPORT'.
      APPEND wa_header TO t_header.
      CLEAR wa_header.
    * Date
    *  wa_header-typ  = 'S'.
    *  wa_header-key = 'Date: '.
    *  CONCATENATE  sy-datum+6(2) '.'
    *               sy-datum+4(2) '.'
    *               sy-datum(4) INTO wa_header-info.   "todays date
    *  APPEND wa_header TO t_header.
    *  CLEAR: wa_header.
      wa_header-typ  = 'S'.
      wa_header-key = '--'.
      CONCATENATE  '-----------GI--------------------------------------'
                   'delivery---------------------------------'
                   INTO wa_header-info.
      APPEND wa_header TO t_header.
      CLEAR: wa_header.
    * Total No. of Records Selected
    *  describe table it_ekko lines ld_lines.
    *  ld_linesc = ld_lines.
    *  concatenate 'Total No. of Records Selected: ' ld_linesc
    *                    into t_line separated by space.
    *  wa_header-typ  = 'A'.
    *  wa_header-info = t_line.
    *  append wa_header to t_header.
    *  clear: wa_header, t_line.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = t_header.
    *            i_logo             = 'Z_LOGO'.
    ENDFORM.                    "top-of-page

  • Is it possible to make certain rows mandatory in ALV custom Grid display?

    Hi experts,
                    Is it possible to make certain columns mandatory in the ALV custom grid control just as we give in a selection screen ?
    Thanks in advance
    regards,
    Ashwin

    fieldcat-key = 'X'.
    Regards,
    Amit

  • What is the difference between ALV list FM display and OO ALV Display?

    What is the difference between ALV Function Modules and Object Oriented ALV Display?

    Hi Sathish ,
      There is not much diffrence , it is only another way of implementing it.
    Regards
    Arun

  • What is the  difference between list display and grid display in alv report

    Hai genious
    i am a new of the abap, i dont know the alv report, i have a small doubt, can u please tell me  what is the main difference between list display and grid display in alv report
    thanks&regards
    chinnu

    Hi ,
    1. For all practical purposes, they are the same.
    2. Some differences:
    a) from abap coding point of view,
    alv list is done with Function modules,
    alv gris can also be done with FM,
    but can also be done using OO concepts.
    b) Alv grid (using oo concept) requires
    designing the screen layout .
    Hence, in one screen, we can show more
    then one alv grid
    (we cannot show more than
    one alv list on one screen)
    c) ALV grid uses ActiveX controls
    present on the Presentation Server.
    Hence, it consumes More Memory
    on the presentation server.
    d) ALV LIST is Display Only.
    Whereas
    ALV Grid Can Be made EDITABLE for entry purpose.
    e) In alv grid, these options are possible,
    but not in alv list.
    without horizontal lines
    without vertical lines
    without cell merging during sorts
    display total lines above the entries
    I hope it helps.
    Regards,
    Mamta
    Edited by: Mamta Verma on Nov 27, 2008 6:41 AM

  • ALV list display in a Background job - Spool output

    Hi,
    We are currently working on a report scheduled to be run in the background job, and the ALV list is displayed in the spool output.
    ALV list in the spool does not look the same as front run job, the column headers are all crowded together, and there is no grid in-between different columns or rows. It's hard to read.
    Is there a way to add grid for this kind of output?
    Thanks!

    Hi Deepak:
    I expanded your report into two rows display, and the grid in the spool display simply gone!
    report zzscratch line-size 120 no standard page heading.
    type-pools slis.
    tables pa0001.
    data : li_field type standard table of slis_fieldcat_alv,
    gi_events type standard table of slis_alv_event,
    gr_layout_bck type slis_layout_alv,
    gr_save like disvariant,
    gr_events type slis_alv_event.
    types : begin of gtt_emp,
    pernr type persno,
    ename  like pa0001-ename,
    uname  like pa0001-UNAME,
    end of gtt_emp.
    data : lr_field type slis_fieldcat_alv.
    data : lc_rep like syst-repid.
    data : li_emp type standard table of gtt_emp,
    lr_emp type gtt_emp.
    data : gv_ref_table type lvc_rtname.
    gv_ref_table = 'CATSDB'.
    lr_field-fieldname = 'PERNR'.
    lr_field-ref_tabname = gv_ref_table.
    lr_field-inttype = 'N'.
    lr_field-outputlen = 8.
    lr_field-seltext_l = 'EMPLOYEE Number'.
    append lr_field to li_field.
    lr_field-fieldname = 'ENAME'.
    lr_field-ref_tabname = 'PA0001'.
    lr_field-inttype = 'C'.
    lr_field-outputlen = 40.
    lr_field-seltext_l = 'EMPLOYEE Name'.
    append lr_field to li_field.
    lr_field-fieldname = 'UNAME'.
    lr_field-ref_tabname = 'PA0001'.
    lr_field-inttype = 'C'.
    lr_field-outputlen = 12.
    lr_field-seltext_l = 'User Name'.
    lr_field-row_pos = 2.
    lr_field-col_pos = 1.
    append lr_field to li_field.
    lc_rep = sy-repid.
    gr_layout_bck-edit_mode = 'D'.
    gr_save-report = sy-repid.
    lr_emp-pernr = '00000001'.
    lr_emp-ename = 'abc'.
    lr_emp-uname = 'testus'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000002'.
    lr_emp-ename = 'def'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000003'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000004'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000005'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000006'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000007'.
    append lr_emp to li_emp.
    lr_emp-pernr = '00000008'.
    append lr_emp to li_emp.
    end-of-selection.
    Function module for ALV grid display
      call function 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_buffer_active    = 'X'
                i_callback_program = lc_rep
                is_layout          = gr_layout_bck
                it_fieldcat        = li_field
                i_save             = 'A'
                is_variant         = gr_save
                it_events          = gi_events
           TABLES
                t_outtab           = li_emp[]
           EXCEPTIONS
                program_error      = 1
                others             = 2.
      if sy-subrc <> 0.
    clear gr_messages.
    message e023 into gr_messages.
    append gr_messages to gi_messages.
      endif.

  • List display and grid display

    hi SDNers,
    can any one help me on what are the differences between list diplay and grid display in r3 alv reports.
    quick reply is highly appreciated.

    Hi mahesh,
    1. For all practical purposes, they are the same.
    2. Some differences:
    a) from abap coding point of view,
    alv list is done with Function modules,
    alv gris can also be done with FM,
    but can also be done using OO concepts.
    b) Alv grid (using oo concept) requires
    designing the screen layout .
    Hence, in one screen, we can show more
    then one alv grid
    (we cannot show more than
    one alv list on one screen)
    c) ALV grid uses ActiveX controls
    present on the Presentation Server.
    Hence, it consumes More Memory
    on the presentation server.
    d) ALV LIST is Display Only.
    Whereas
    ALV Grid Can Be made EDITABLE for entry purpose.
    e) In alv grid, these options are possible,
    but not in alv list.
    without horizontal lines
    without vertical lines
    without cell merging during sorts
    display total lines above the entries
    I hope it helps.
    regards,
    amit m.

  • What is the difference between GRID DISPLAY AND LIST DISPLAY

    WHAT IS THE DIFFERENCE BETWEEN THE
                                                        REUSE_ALV_GRID_DISPLAY .
                                                                           AND
                                                       REUSE ALVLIST_DISPLAY.
    COULD U PLZ GIVE ME THE CLEAR DIFFERENCE.

    hi,
    1. For all practical purposes, they are the same.
    2. Some differences:
    a) from abap coding point of view,
    alv list is done with Function modules,
    alv gris can also be done with FM,
    but can also be done using OO concepts.
    b) Alv grid (using oo concept) requires
    designing the screen layout .
    Hence, in one screen, we can show more
    then one alv grid
    (we cannot show more than
    one alv list on one screen)
    c) ALV grid uses ActiveX controls
    present on the Presentation Server.
    Hence, it consumes More Memory
    on the presentation server.
    d) ALV LIST is Display Only.
    Whereas
    ALV Grid Can Be made EDITABLE for entry purpose.
    e) In alv grid, these options are possible,
    but not in alv list.
    without horizontal lines
    without vertical lines
    without cell merging during sorts
    display total lines above the entries
    ALV LIST Can be coded using only FMs
    ALV GRID Can be coded using FMs and object oriented concepts
    ALV LIST Can be displayed hieraicharlly
    ALV GRID cannot be displayed hierarichally
    I hope it helps.
    Regards
    anver

  • Multiple Lines Header and Records in ALV List

    Dear All,
    I am faced with a wierd user requirement to print multiple line header in ALV. Currently we have a classical report where we are displaying a huge text for example 400 characters in a single cell of a column of the report.
    Now we will have to convert this to ALV report where I need to show that data in a single cell. I am wondering how is it possible in ALV list/grid. Please let me know if you guys have any clue.
    Regards,
    Bikramjit

    Hi,
    Did you find a solution for this?, I am also having a similar requirement.
    If you have any work around please share.
    Thanks.

  • ALV List processing

    Hi
    I have created a transaction which when executed displays a selection screen and on entering proper search criteria, result data is displayed in the form of ALV list.  (for example name this screen 'A' ). Here, On the application toolbar, there is a button named 'POST', which is used to post the selected entries from the ALV list into the database. To know Whether the entries are posted or not a status is maintained and also the status is to be displayed. for this the ALV list is displayed again with modified status.From here when I press the BACK button from the standard toolbar, the control first goes from this screen to screen A, and then when I press the BACK button again, the control reaches the selection screen.
    My  requirement is that when I press the back button from the screen in which the modified ALV list is displayed(that is the last screen), it should directly come back to the selection screen of the transaction.
    Many thanks in advance.
    Regards
    Smriti

    Hi ,
    You can do one more thing.
    Open SE41,click the icon for copy status it will open one window.
    You have to give:
    Program--> SAPLKKBL
    Status--> STANDARD
    After that enter:
    Prg name--> Your program name
    Status-->Your Own Status Name
    And press copy.
    Then In your created status go to application toolbar and Add your Button.
    Then In the program Create a Form
    FORM pf_status "#EC *
    USING p_extab TYPE slis_t_extab.
    SET PF-STATUS 'STAT1' EXCLUDING p_extab.
    ENDFORM. "PF_STATUS
    Here 'STAT1 is your own Status Name
    Then in the FM -->CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    Pass i_callback_pf_status_set = 'PF_STATUS' this.
    For more info, kindly visit links:
    1. http://wiki.sdn.sap.com/wiki/display/ABAP/ProcesstocreateALVwith+OOPS
    2. Custom buttons in ALV grid display
    3. Re: How to add a pushbutton in ALV
    May it helps you.
    Regards.
    Deepak Sharma.

  • Double click in alv list

    Hi all,
    Here is the code:
    my aim is to double click the alv list and display the correspoonding data .can any one tell me how to solve this.
    regards,
    Lisa
    Message was edited by: Lisa Roy

    Hi Lisa,
    **-ALV list Display
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          I_CALLBACK_PROGRAM       = SY-REPID
       <b>   I_CALLBACK_PF_STATUS_SET = 'PF_STATUS_SET'</b>
        <b>  I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'</b>
          IS_LAYOUT                = X_LAYOUT
          IT_FIELDCAT              = IT_FIELDCAT
          IT_EVENTS                = IT_EVENTS
        TABLES
          T_OUTTAB                 = IT_FINAL
        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.
    you need to pass these two forms
    FORM PF_STATUS_SET USING    P_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS 'STANDARD' EXCLUDING P_EXTAB.
    ENDFORM.                    "PF_STATUS_SET
    FORM USER_COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE
                                                             SLIS_SELFIELD.
    case UCOMM.
    when '&IC1'.  "this is for double click.
    "do some thing..
      ENDCASE.
    ENDFORM.                    "USER_COMMAND

  • Need help in interactive alv list

    hi,
    i  need document and simple Example prog for interactive alv list.If anybody have it kindly help me..
    thanks in advance,
    Kavitha.

    hi,
    Jus copy and paste the following code in SE38.
    *& This is an Interactive ALV report, where on line slection we can see
    *&  the secondry list
    REPORT  ZZ_22038_22098_002 NO STANDARD PAGE HEADING LINE-SIZE 650
    MESSAGE-ID ZZ_9838                      .
    TYPE-POOLS: SLIS.
    *type declaration for values from ekko
    TYPES: BEGIN OF I_EKKO,
           EBELN LIKE EKKO-EBELN,
           AEDAT LIKE EKKO-AEDAT,
           BUKRS LIKE EKKO-BUKRS,
           BSART LIKE EKKO-BSART,
           LIFNR LIKE EKKO-LIFNR,
           END OF I_EKKO.
    DATA: IT_EKKO TYPE STANDARD TABLE OF I_EKKO INITIAL SIZE 0,
          WA_EKKO TYPE I_EKKO.
    *type declaration for values from ekpo
    TYPES: BEGIN OF I_EKPO,
           EBELN LIKE EKPO-EBELN,
           EBELP LIKE EKPO-EBELP,
           MATNR LIKE EKPO-MATNR,
           MENGE LIKE EKPO-MENGE,
           MEINS LIKE EKPO-MEINS,
           NETPR LIKE EKPO-NETPR,
           END OF I_EKPO.
    DATA: IT_EKPO TYPE STANDARD TABLE OF I_EKPO INITIAL SIZE 0,
          WA_EKPO TYPE I_EKPO .
    *variable for Report ID
    DATA: V_REPID LIKE SY-REPID .
    *declaration for fieldcatalog
    DATA: I_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV,
          WA_FIELDCAT TYPE SLIS_FIELDCAT_ALV.
    DATA: IT_LISTHEADER TYPE SLIS_T_LISTHEADER.
    declaration for events table where user comand or set PF status will
    be defined
    DATA: V_EVENTS TYPE SLIS_T_EVENT,
          WA_EVENT TYPE SLIS_ALV_EVENT.
    declartion for layout
    DATA: ALV_LAYOUT TYPE SLIS_LAYOUT_ALV.
    declaration for variant(type of display we want)
    DATA: I_VARIANT TYPE DISVARIANT,
          I_VARIANT1 TYPE DISVARIANT,
          I_SAVE(1) TYPE C.
    *PARAMETERS : p_var TYPE disvariant-variant.
    *Title displayed when the alv list is displayed
    DATA:  I_TITLE_EKKO TYPE LVC_TITLE VALUE 'FIRST LIST DISPLAYED'.
    DATA:  I_TITLE_EKPO TYPE LVC_TITLE VALUE 'SECONDRY LIST DISPLAYED'.
    INITIALIZATION.
      V_REPID = SY-REPID.
      PERFORM BUILD_FIELDCATLOG.
      PERFORM EVENT_CALL.
      PERFORM POPULATE_EVENT.
    START-OF-SELECTION.
      PERFORM DATA_RETRIEVAL.
      PERFORM BUILD_LISTHEADER USING IT_LISTHEADER.
      PERFORM DISPLAY_ALV_REPORT.
    *&      Form  BUILD_FIELDCATLOG
          Fieldcatalog has all the field details from ekko
    FORM BUILD_FIELDCATLOG.
      WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'EBELN'.
      WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'AEDAT'.
      WA_FIELDCAT-SELTEXT_M = 'DATE.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'BUKRS'.
      WA_FIELDCAT-SELTEXT_M = 'COMPANY CODE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'BUKRS'.
      WA_FIELDCAT-SELTEXT_M = 'DOCMENT TYPE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'IT_EKKO'.
      WA_FIELDCAT-FIELDNAME = 'LIFNR'.
      WA_FIELDCAT-NO_OUT    = 'X'.
      WA_FIELDCAT-SELTEXT_M = 'VENDOR CODE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    ENDFORM.                    "BUILD_FIELDCATLOG
    *&      Form  EVENT_CALL
      we get all events - TOP OF PAGE or USER COMMAND in table v_events
    FORM EVENT_CALL.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = V_EVENTS
      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.                    "EVENT_CALL
    *&      Form  POPULATE_EVENT
         Events populated for TOP OF PAGE & USER COMAND
    FORM POPULATE_EVENT.
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'TOP_OF_PAGE'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-FORM.
      ENDIF.
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'USER_COMMAND'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'USER_COMMAND'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-NAME.
      ENDIF.
    ENDFORM.                    "POPULATE_EVENT
    *&      Form  data_retrieval
      retreiving values from the database table ekko
    FORM DATA_RETRIEVAL.
      SELECT EBELN AEDAT BUKRS BSART LIFNR FROM EKKO INTO TABLE IT_EKKO.
    ENDFORM.                    "data_retrieval
    *&      Form  bUild_listheader
          text
         -->I_LISTHEADEtext
    FORM BUILD_LISTHEADER USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
      DATA HLINE TYPE SLIS_LISTHEADER.
      HLINE-INFO = 'this is my first alv pgm'.
      HLINE-TYP = 'H'.
    ENDFORM.                    "build_listheader
    *&      Form  display_alv_report
          text
    FORM DISPLAY_ALV_REPORT.
      V_REPID = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         I_CALLBACK_PROGRAM                = V_REPID
         I_CALLBACK_USER_COMMAND           = 'USER_COMMAND'
         I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
         I_GRID_TITLE                      = I_TITLE_EKKO
         IT_FIELDCAT                       = I_FIELDCAT[]
         I_SAVE                            = 'A'
         IT_EVENTS                         = V_EVENTS
        TABLES
          T_OUTTAB                          = IT_EKKO
      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  TOP_OF_PAGE
          text
    FORM TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = IT_LISTHEADER
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  USER_COMMAND
          text
         -->R_UCOMM    text
         -->,          text
         -->RS_SLEFIELDtext
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
    RS_SELFIELD TYPE SLIS_SELFIELD.
      CASE R_UCOMM.
        WHEN '&IC1'.
          READ TABLE IT_EKKO INTO WA_EKKO INDEX RS_SELFIELD-TABINDEX.
          PERFORM BUILD_FIELDCATLOG_EKPO.
          PERFORM EVENT_CALL_EKPO.
          PERFORM POPULATE_EVENT_EKPO.
          PERFORM DATA_RETRIEVAL_EKPO.
          PERFORM BUILD_LISTHEADER_EKPO USING IT_LISTHEADER.
          PERFORM DISPLAY_ALV_EKPO.
      ENDCASE.
    ENDFORM.                    "user_command
    *&      Form  BUILD_FIELDCATLOG_EKPO
          text
    FORM BUILD_FIELDCATLOG_EKPO.
      WA_FIELDCAT-TABNAME = 'IT_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'EBELN'.
      WA_FIELDCAT-SELTEXT_M = 'PO NO.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'IT_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'EBELP'.
      WA_FIELDCAT-SELTEXT_M = 'LINE NO'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
      WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'MATNR'.
      WA_FIELDCAT-SELTEXT_M = 'MATERIAL NO.'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'MENGE'.
      WA_FIELDCAT-SELTEXT_M = 'QUANTITY'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'MEINS'.
      WA_FIELDCAT-SELTEXT_M = 'UOM'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    WA_FIELDCAT-TABNAME = 'I_EKPO'.
      WA_FIELDCAT-FIELDNAME = 'NETPR'.
      WA_FIELDCAT-SELTEXT_M = 'PRICE'.
      APPEND WA_FIELDCAT TO I_FIELDCAT.
      CLEAR WA_FIELDCAT.
    ENDFORM.                    "BUILD_FIELDCATLOG_EKPO
    *&      Form  event_call_ekpo
      we get all events - TOP OF PAGE or USER COMMAND in table v_events
    FORM EVENT_CALL_EKPO.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
       EXPORTING
         I_LIST_TYPE           = 0
       IMPORTING
         ET_EVENTS             = V_EVENTS
      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.                    "event_call_ekpo
    *&      Form  POPULATE_EVENT
           Events populated for TOP OF PAGE & USER COMAND
    FORM POPULATE_EVENT_EKPO.
      READ TABLE V_EVENTS INTO WA_EVENT WITH KEY NAME = 'TOP_OF_PAGE'.
      IF SY-SUBRC EQ 0.
        WA_EVENT-FORM = 'TOP_OF_PAGE'.
        MODIFY V_EVENTS FROM WA_EVENT TRANSPORTING FORM WHERE NAME =
    WA_EVENT-FORM.
      ENDIF.
      ENDFORM.                    "POPULATE_EVENT
    *&      Form  TOP_OF_PAGE
          text
    FORM F_TOP_OF_PAGE.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY       = IT_LISTHEADER
    ENDFORM.                    "TOP_OF_PAGE
    *&      Form  USER_COMMAND
          text
         -->R_UCOMM    text
         -->,          text
         -->RS_SLEFIELDtext
    *retreiving values from the database table ekko
    FORM DATA_RETRIEVAL_EKPO.
    SELECT EBELN EBELP MATNR MENGE MEINS NETPR FROM EKPO INTO TABLE IT_EKPO.
    ENDFORM.
    FORM BUILD_LISTHEADER_EKPO USING I_LISTHEADER TYPE SLIS_T_LISTHEADER.
    DATA: HLINE1 TYPE SLIS_LISTHEADER.
    HLINE1-TYP = 'H'.
    HLINE1-INFO = 'CHECKING PGM'.
    ENDFORM.
    FORM DISPLAY_ALV_EKPO.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
       I_CALLBACK_PROGRAM                = V_REPID
       I_CALLBACK_TOP_OF_PAGE            = 'TOP_OF_PAGE'
       I_GRID_TITLE                      = I_TITLE_EKPO
       IT_FIELDCAT                       = I_FIELDCAT[]
       I_SAVE                            = 'A'
       IT_EVENTS                         = V_EVENTS
      TABLES
        T_OUTTAB                          = IT_EKPO
    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.
    Another program..............
    TABLES : LFA1,KNA1.
    DATA ITAB LIKE LFA1 OCCURS 0 WITH HEADER LINE.
    DATA ITAB1 LIKE KNA1 OCCURS 0 WITH HEADER LINE.
    SELECTION-SCREEN BEGIN OF BLOCK B WITH FRAME TITLE T.
    SELECT-OPTIONS LIFNR FOR LFA1-LIFNR.
    SELECTION-SCREEN END OF BLOCK B.
    INITIALIZATION .
    T = 'VENDOR DETAILS'.
    AT SELECTION-SCREEN OUTPUT.
    LIFNR-LOW = '1000'.
    LIFNR-HIGH = '4000'.
    APPEND LIFNR.
    START-OF-SELECTION.
    SELECT * FROM LFA1 INTO ITAB WHERE LIFNR IN LIFNR.
    APPEND ITAB.
    ENDSELECT.
    LOOP AT ITAB.
    FORMAT COLOR 6 INVERSE ON.
    WRITE : /2 SY-VLINE,4 ITAB-LAND1,7 SY-VLINE,9 ITAB-NAME1,44 SY-VLINE,46
    ITAB-ORT01,60 SY-VLINE.
    HIDE ITAB-ORT01.
    ENDLOOP.
    FORMAT COLOR OFF.
    TOP-OF-PAGE.
    WRITE : / 'VENDOR DETAILS'.
    ULINE AT /(70).
    SKIP.
    END-OF-PAGE.
    AT LINE-SELECTION.
    CASE SY-LSIND.
    WHEN 1.
    SELECT * FROM KNA1 INTO TABLE ITAB1 WHERE ORT01 = ITAB-ORT01.
    LOOP AT ITAB1.
    FORMAT COLOR 6 INVERSE ON.
    WRITE : /2 SY-VLINE,4 ITAB1-LAND1,7 SY-VLINE,9 ITAB1-NAME1,44 SY-VLINE,
    46 ITAB1-ORT01,60 SY-VLINE.
    FORMAT COLOR OFF.
    ENDLOOP.
    ENDCASE.
    TOP-OF-PAGE DURING LINE-SELECTION.
    CASE SY-LSIND.
    WHEN 1.
    WRITE : / 'VENDOR DETAILS'.
    ULINE AT /(70).
    SKIP.
    FORMAT COLOR 6 INVERSE ON.
    WRITE : /2 SY-VLINE,4 'LAND',7 SY-VLINE,9 'NAME',44 SY-VLINE,46
    'CITY',60 SY-VLINE.
    FORMAT COLOR OFF.
    WHEN 2.
    WRITE : / 'ANOTHER VENDOR DETAILS'.
    FORMAT COLOR 6 INVERSE ON.
    WRITE : /2 SY-VLINE,4 'LAND',7 SY-VLINE,9 'NAME',44 SY-VLINE,46
    'CITY',60 SY-VLINE.
    FORMAT COLOR OFF.
    endcase.
    END-OF-SELECTION.
    feel free to ask your clarifications.
    Senthil kumar

  • Run time error with ALV List

    Hi,
    I am Using ALV list to display data,In that when itry to display currency field it is giving run time error.
    Following is the code i am using
      lf_fcat-fieldname   = 'SALARYE'.
      lf_fcat-tabname     = 'IT_EMPLOYEE'.
      lf_fcat-col_pos     = l_cnt.
      lf_fcat-emphasize   = 'X'.
      lf_fcat-outputlen   = 15.
      lf_fcat-ref_tabname = 'PA0008'. "<--- Ref table
      lf_fcat-ref_fieldname = 'ANCUR'. "<-----ref field
      lf_fcat-decimals_out = 2.
      lf_fcat-seltext_l   = text-061.
      append lf_fcat to it_fcat.
      clear  lf_fcat.

    Hi,
    Please check in the internal table 'IT_EMPLOYEE' , the relevant currency field as it should type compatible with your reference table field.
    Thanks,
    Dhruv Kumar Malhotra

Maybe you are looking for

  • Windows tool to compile forms on unix server

    We have one client using Forms 6i on the web, so I need to test in this environment. Currently to compile the fmb on the unix platform, I use Hummingbird software (Connectivity, Exceed, Xstart) to run the compile using the command f60genm. I do not p

  • Firefox opens in offline mode and doesn't save my settings

    When I start the internet, it always starts in "work offline" mode. So I have to un-check the work offline button and refresh the pages. Also, my customized toolbar settings are not saved. I add the tab group button and it isn't on the toolbar when I

  • How to verify "security authentication failure rate" command

    i type "security authentication failure rate 2 log" in global configuration mode,then  login authentication failed many times but no the 15-second delay. why?Thanks.

  • JMS Listener Bug??

    I am implementing SIM 7.0 and have enabled a JMS Listener resource. The resource works well and we have no issues with it. The problem is when you try to edit the Synchronization policy for the JMS Listener and then cancel it without saving i.e. 1. S

  • Internal speakers won't play

    I can hear sounds and music when I have my headphones in, but whem I take them ut no sound comes. I have a 2nd generation and there should be an internal speaker. I also got mine refurbished. Do I have to reset it, or turn something on? Thanks!