Using 'REUSE_ALV_FIELDCATALOG_MERGE'

Hi,
I am facing problem with 'REUSE_ALV_FIELDCATALOG_MERGE'. when i execute the following code, IO get the message ' Field Catalog Not Found'. What could be the problem?
*& Report  Y_NORMAL_ALV2
REPORT  y_normal_alv2.
TABLES : equi.
TYPE-POOLS : slis.
SELECT-OPTIONS : opt1 FOR equi-equnr,
                 opt2 FOR equi-ernam.
TYPES : BEGIN OF t_equi ,
        equnr LIKE equi-equnr,
        ernam LIKE equi-ernam,
        erdat LIKE equi-erdat,
        brgew LIKE equi-brgew,
        END OF t_equi.
DATA : i_equi TYPE standard table of t_equi ,
      wa_equi TYPE t_equi,
       lt_fieldcat TYPE slis_t_fieldcat_alv,
       ls_layout TYPE slis_layout_alv,
       i_repid LIKE sy-repid.
START-OF-SELECTION.
  PERFORM get_data.
  PERFORM build_layout.
  PERFORM build_fieldcat.
  PERFORM display_data.
END-OF-SELECTION.
*&      Form  get-data
      text
FORM get_data.
  SELECT * FROM  equi INTO  corresponding fields of TABLE i_equi WHERE equnr IN opt1 OR ernam IN opt2.
ENDFORM.                    "get-data
*&      Form  build_layout
      text
FORM build_layout.
  ls_layout-colwidth_optimize = 'X'.
  ls_layout-window_titlebar = 'WOW'.
ENDFORM.                    "build_layout
*&      Form  build_fieldcat
      text
FORM build_fieldcat.
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
   EXPORTING
     i_program_name               = i_repid
     i_internal_tabname           = 'I_EQUI'
  I_STRUCTURE_NAME             = 'EQUI'
  I_CLIENT_NEVER_DISPLAY       = 'X'
     i_inclname                   = i_repid
  I_BYPASSING_BUFFER           =
  I_BUFFER_ACTIVE              =
    CHANGING
     ct_fieldcat                  = lt_fieldcat
   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.
DATA : ls_fieldcat TYPE slis_fieldcat_alv.
CONSTANTS: cons_l_tab     TYPE char8 VALUE  'I_EQUI',
            cons_l_1       TYPE char1 VALUE  '1',
            cons_l_2       TYPE char1 VALUE  '2',
            cons_l_3       TYPE char1 VALUE  '3',
            cons_l_4       TYPE char1 VALUE  '4',
            cons_l_equnr   TYPE char5 VALUE  'EQUNR',
            cons_l_ernam   TYPE char5 VALUE  'ERNAM',
            cons_l_erdat   TYPE char5 VALUE  'ERDAT',
            cons_l_brgew   TYPE char5 VALUE  'BRGEW'.
REFRESH: lt_fieldcat1.
ls_fieldcat-tabname = cons_l_tab.
ls_fieldcat-col_pos = cons_l_1.
ls_fieldcat-fieldname = cons_l_equnr.
ls_fieldcat-ref_tabname = 'EQUI'.
ls_fieldcat-ref_fieldname = 'EQUNR'.
ls_fieldcat-seltext_m = 'Equipment Number'.
APPEND ls_fieldcat TO lt_fieldcat1.
CLEAR ls_fieldcat.
ls_fieldcat-tabname = cons_l_tab.
ls_fieldcat-col_pos = cons_l_2.
ls_fieldcat-fieldname = cons_l_ernam.
ls_fieldcat-ref_tabname = 'EQUI'.
ls_fieldcat-ref_fieldname = 'ERNAM'.
ls_fieldcat-seltext_m = 'Created By'.
APPEND ls_fieldcat TO lt_fieldcat1.
CLEAR ls_fieldcat.
ls_fieldcat-tabname = cons_l_tab.
ls_fieldcat-col_pos = cons_l_3.
ls_fieldcat-fieldname = cons_l_erdat.
ls_fieldcat-ref_tabname = 'EQUI'.
ls_fieldcat-ref_fieldname = 'ERDAT'.
ls_fieldcat-seltext_m = 'Creation Date'.
APPEND ls_fieldcat TO lt_fieldcat1.
CLEAR ls_fieldcat.
ls_fieldcat-tabname = cons_l_tab.
ls_fieldcat-col_pos = cons_l_4.
ls_fieldcat-fieldname = cons_l_brgew.
ls_fieldcat-ref_tabname = 'EQUI'.
ls_fieldcat-ref_fieldname = 'BRGEW'.
ls_fieldcat-seltext_m = 'Wazan'.
APPEND ls_fieldcat TO lt_fieldcat1.
CLEAR ls_fieldcat.
ENDFORM.                    "build_fieldcat
*&      Form  display_data
      text
FORM display_data.
  CHECK NOT i_equi IS INITIAL.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
   EXPORTING
  I_INTERFACE_CHECK                 = ' '
  I_BYPASSING_BUFFER                = ' '
  I_BUFFER_ACTIVE                   = ' '
   i_callback_program                = 'i_repid'
  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                  =
  I_BACKGROUND_ID                   = ' '
  I_GRID_TITLE                      =
  I_GRID_SETTINGS                   =
    is_layout                         = ls_layout
     it_fieldcat                       = lt_fieldcat
  IT_EXCLUDING                      =
  IT_SPECIAL_GROUPS                 =
  IT_SORT                           =
  IT_FILTER                         =
  IS_SEL_HIDE                       =
  I_DEFAULT                         = 'X'
   I_SAVE                            = 'A'
  IS_VARIANT                        =
  IT_EVENTS                         =
  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                          = i_equi
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_data

Hi Sachin,
There are certainly some isues in the report, but I am not getting any error as 'Field catalog not found'
I could get the alv grid displayed:
This is my code: compare and check if  you have missed out somethg.
TABLES : equi.
TYPE-POOLS : slis.
SELECT-OPTIONS : opt1 FOR equi-equnr,
                 opt2 FOR equi-ernam.
TYPES : BEGIN OF t_equi ,
        equnr LIKE equi-equnr,
        ernam LIKE equi-ernam,
        erdat LIKE equi-erdat,
        brgew LIKE equi-brgew,
        END OF t_equi.
DATA : i_equi TYPE STANDARD TABLE OF t_equi ,
       wa_equi TYPE t_equi,
       lt_fieldcat TYPE slis_t_fieldcat_alv,
       lt_fieldcat1 TYPE slis_t_fieldcat_alv,
       ls_layout TYPE slis_layout_alv,
       i_repid LIKE sy-repid.
START-OF-SELECTION.
  PERFORM get_data.
  PERFORM build_layout.
  PERFORM build_fieldcat.
  PERFORM display_data.
END-OF-SELECTION.
*&      Form  get_data
      text
-->  p1        text
<--  p2        text
FORM get_data .
  SELECT * FROM equi INTO CORRESPONDING FIELDS OF TABLE i_equi WHERE equnr IN opt1 OR ernam IN opt2.
ENDFORM.                    " get_data
*&      Form  build_layout
      text
-->  p1        text
<--  p2        text
FORM build_layout .
  ls_layout-colwidth_optimize = 'X'.
  ls_layout-window_titlebar = 'WOW'.
ENDFORM.                    " build_layout
*&      Form  build_fieldcat
      text
-->  p1        text
<--  p2        text
FORM build_fieldcat .
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
  EXPORTING
  i_program_name = i_repid
  i_internal_tabname = 'I_EQUI'
  i_structure_name = 'EQUI'
  i_client_never_display = 'X'
  i_inclname = i_repid
*I_BYPASSING_BUFFER =
*I_BUFFER_ACTIVE =
  CHANGING
  ct_fieldcat = lt_fieldcat
  EXCEPTIONS
  inconsistent_interface = 1
  program_error = 2
  OTHERS = 3
  IF sy-subrc EQ 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
  ENDIF.
  DATA : ls_fieldcat TYPE slis_fieldcat_alv.
  CONSTANTS: cons_l_tab TYPE char8 VALUE 'I_EQUI',
  cons_l_1 TYPE char1 VALUE '1',
  cons_l_2 TYPE char1 VALUE '2',
  cons_l_3 TYPE char1 VALUE '3',
  cons_l_4 TYPE char1 VALUE '4',
  cons_l_equnr TYPE char5 VALUE 'EQUNR',
  cons_l_ernam TYPE char5 VALUE 'ERNAM',
  cons_l_erdat TYPE char5 VALUE 'ERDAT',
  cons_l_brgew TYPE char5 VALUE 'BRGEW'.
  REFRESH: lt_fieldcat1.
  ls_fieldcat-tabname = cons_l_tab.
  ls_fieldcat-col_pos = cons_l_1.
  ls_fieldcat-fieldname = cons_l_equnr.
  ls_fieldcat-ref_tabname = 'EQUI'.
  ls_fieldcat-ref_fieldname = 'EQUNR'.
  ls_fieldcat-seltext_m = 'Equipment Number'.
  APPEND ls_fieldcat TO lt_fieldcat1.
  CLEAR ls_fieldcat.
  ls_fieldcat-tabname = cons_l_tab.
  ls_fieldcat-col_pos = cons_l_2.
  ls_fieldcat-fieldname = cons_l_ernam.
  ls_fieldcat-ref_tabname = 'EQUI'.
  ls_fieldcat-ref_fieldname = 'ERNAM'.
  ls_fieldcat-seltext_m = 'Created By'.
  APPEND ls_fieldcat TO lt_fieldcat1.
  CLEAR ls_fieldcat.
  ls_fieldcat-tabname = cons_l_tab.
  ls_fieldcat-col_pos = cons_l_3.
  ls_fieldcat-fieldname = cons_l_erdat.
  ls_fieldcat-ref_tabname = 'EQUI'.
  ls_fieldcat-ref_fieldname = 'ERDAT'.
  ls_fieldcat-seltext_m = 'Creation Date'.
  APPEND ls_fieldcat TO lt_fieldcat1.
  CLEAR ls_fieldcat.
  ls_fieldcat-tabname = cons_l_tab.
  ls_fieldcat-col_pos = cons_l_4.
  ls_fieldcat-fieldname = cons_l_brgew.
  ls_fieldcat-ref_tabname = 'EQUI'.
  ls_fieldcat-ref_fieldname = 'BRGEW'.
  ls_fieldcat-seltext_m = 'Wazan'.
  APPEND ls_fieldcat TO lt_fieldcat1.
  CLEAR ls_fieldcat.
ENDFORM.                    " build_fieldcat
*&      Form  display_data
      text
-->  p1        text
<--  p2        text
FORM display_data.
  CHECK NOT i_equi IS INITIAL.
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
  i_interface_check = ' '
  i_bypassing_buffer = ' '
  i_buffer_active = ' '
  i_callback_program = 'i_repid'
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 =
**I_BACKGROUND_ID = ' '
i_grid_title =
*I_GRID_SETTINGS =
  is_layout = ls_layout
  it_fieldcat = lt_fieldcat
it_excluding =
it_special_groups =
it_sort =
it_filter =
is_sel_hide =
  i_default = 'X'
  i_save = 'A'
is_variant =
it_events =
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 = i_equi
  EXCEPTIONS
  program_error = 1
  OTHERS = 2
IF sy-subrc eq 0.
   MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
ENDFORM.                    " display_data

Similar Messages

  • How can i use reuse_alv_fieldcatalog_merge function module

    I am using below steps for populating the final internal table.How can I use reuse_alv_fieldcatalog_merge function module in the place of declaring all these fields.How canI put title of the report in reuse_alv_fieldcatalog_merge function module.
    FORM BUILD_FIELDCATALOG .
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'KUNNR'.
      FIELDCAT-SELTEXT_M = 'Customer Name'.
      FIELDCAT-JUST      = 'L'.
      FIELDCAT-KEY       = 'X'.
      FIELDCAT-DATATYPE  = 'C'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'VBELN'.
      FIELDCAT-SELTEXT_M = 'Invoice Reference'.
      FIELDCAT-JUST      = 'L'.
      FIELDCAT-KEY       = 'X'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'VKBUR'.
      FIELDCAT-SELTEXT_M = 'Sales Office'.
      FIELDCAT-JUST      = 'L'.
    FIELDCAT-KEY       = 'X'.
      FIELDCAT-DATATYPE  = 'C'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'VKGRP'.
      FIELDCAT-SELTEXT_M = 'Sales Person'.
      FIELDCAT-JUST      = 'L'.
    FIELDCAT-KEY       = 'X'.
      FIELDCAT-DATATYPE  = 'C'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FINAL'.
      FIELDCAT-FIELDNAME = 'POSNR'.
      FIELDCAT-SELTEXT_M = 'Item No'.
      FIELDCAT-JUST      = 'L'.
      FIELDCAT-KEY       = 'X'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.
      FIELDCAT-TABNAME   = 'IT_FIANL'.
      FIELDCAT-FIELDNAME = 'ARKTX'.
      FIELDCAT-SELTEXT_M = 'Item Description'.
      FIELDCAT-JUST      = 'L'.
      FIELDCAT-DATATYPE  = 'C'.
      APPEND FIELDCAT TO I_FIELDCAT.
      CLEAR FIELDCAT.

    Hello,
    It is very easy to use reuse_alv_fieldcatalog_merge.
    You try this it will work.
    example
    data:
    DATA : gv_repid        TYPE syrepid VALUE sy-repid .  " Report id
      PERFORM set_field_catalog USING gst_struct CHANGING lst_fieldcat.
    FORM set_field_catalog  USING uv_tab TYPE slis_tabname
                         CHANGING  xt_fieldcatalog TYPE slis_t_fieldcat_alv.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = gv_repid
          i_internal_tabname     = uv_tab
          i_inclname             = gv_repid
        CHANGING
          ct_fieldcat            = xt_fieldcatalog
        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.
    ENDFORM.                    " set_field_catalog_spec

  • Dump when using REUSE_ALV_FIELDCATALOG_MERGE

    Hello friends,
    I am getting the following dump when using REUSE_ALV_FIELDCATALOG_MERGE.
    The occupied line length in the program text must not exceed the width of the internal table.
    The internal table "\FUNCTION=K_KKB_FIELDCAT_MERGE\DATA=L_ABAP_SOURCE[]" is 72
      characters wide. The program line is 75 characters wide.
    Regards,
    K.Sibi

    Hello Ajay ,
    THanks for the reply .
    DATA : BEGIN OF it_data OCCURS 0,
       matnr like RMMG1-MATNR , " Material number
       mbrsh like RMMG1-MBRSH, " Industry sector
       mtart like RMMG1-MTART, " Material type
       meins like MARA-MEINS, " Base unit of measure
       maktx like MAKT-MAKTX, " Material description
       spras like makt-spras , " Language key
       END OF it_data.
    my fm
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
       I_PROGRAM_NAME               = ge_repid
       I_INTERNAL_TABNAME           = 'it_data'
    *   I_STRUCTURE_NAME             = 'it_data'
    *   I_CLIENT_NEVER_DISPLAY       = 'X'
       I_INCLNAME                   = ge_repid
    *   I_BYPASSING_BUFFER           = 'X'
    *   I_BUFFER_ACTIVE              =
      CHANGING
        ct_fieldcat                  = alv_fieldcat
    EXCEPTIONS
       INCONSISTENT_INTERFACE       = 1
       PROGRAM_ERROR                = 2
       OTHERS                       = 3
    Regards,
    K.Sibi
    Edited by: sibi k  kanagaraj on Apr 27, 2009 9:21 PM

  • Field catalog issue using REUSE_ALV_FIELDCATALOG_MERGE

    Hello experts,
    I am using FM REUSE_ALV_FIELDCATALOG_MERGE and the field catalog is created fron the program.
    The field catalog finds the date field from the program but my internal table has been changed to make the date output YYYY/MM/DD.
    When I input the internal table in FM REUSE_ALV_GRID_DISPLAY the output displays the date as DD/MM/YYYY which is not what I want.
    How can I get FM REAUSE_ALV_GRID_DISPLAY to output the date in the format YYYY/MM/DD which is in my input table.
    I have spent a lot of time researching SDN on this but cannot find a similar solution however I did find some examples of changing the field catalogue. Can anybody suggest this is the way to go and if I would use the edit mask field in the field catalog or is there a better way.
    Thanks for any suggestions

    I think you can use a field exit for this.
    This means creating a field element and a domain in the data dictionary, the domain will need to have a conversion exit set by putting an entry in the 'Convers. Routine' field, eg MYDAT.
    You will need to create two function mdules as below:
    eg, CONVERSION_EXIT_MYDAT_OUTPUT
    and CONVERSION_EXIT_MYDAT_INPUT
    Your internal table will now need to refer to the data element you have created instead of the one you are currently using. ALV should automatically pick up the conversion exits and show the ouitput as you desire.
    FUNCTION CONVERSION_EXIT_MYDAT_OUTPUT.
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(INPUT) TYPE  DATS
    *"  EXPORTING
    *"     REFERENCE(OUTPUT)
    concatenate input(4) '/' input4(2) '/' input6
    into output.
    ENDFUNCTION.
    FUNCTION CONVERSION_EXIT_MYDAT_INPUT.
    ""Local Interface:
    *"  IMPORTING
    *"     REFERENCE(INPUT)
    *"  EXPORTING
    *"     REFERENCE(OUTPUT) TYPE  DATS
    data l_string type string.
    l_string = input.
    replace all occurrences of '/' in l_string with ' '.
    output = l_string.
    ENDFUNCTION.

  • Dont work 'REUSE_ALV_FIELDCATALOG_MERGE' with table type

    Hi Experts ;
    My problem about   'REUSE_ALV_FIELDCATALOG_MERGE' .
    I use intarnal table with Table Type ( with header line ). And 'REUSE_ALV_FIELDCATALOG_MERGE'  is not working . Field catalog is employ. I dont use 'REUSE_ALV_FIELDCATALOG_MERGE' have any problem.

    'REUSE_ALV_FIELDCATALOG_MERGE' expects a flat structure.
    Give the reference of the line type of the table type if you wish to have fieldcatalog as per that..
    Even if you dont use 'REUSE_ALV_FIELDCATALOG_MERGE' you can create your own Fieldcatalog..

  • Sum in ALV grid display using objects

    Hi Experts,
    I have created a Report with ALV using objects and also am able to get SUM for some fields using do_sum = 'X'.
    My problem is i want to do some calculation using the total amount which i have got, how can i do that (or can it be done??).
    Thanks in Advance...
    Santosh

    Hi this may be of some help.
    ABAP List Viewer
    The common features of report are column alignment, sorting, filtering, subtotals, totals etc. To implement these, a lot of coding and logic is to be put. To avoid that we can use a concept called ABAP List Viewer (ALV).
    This helps us to implement all the features mentioned very effectively.
    Using ALV, We can have three types of reports:
    1. Simple Report
    2. Block Report
    3. Hierarchical Sequential Report
    There are some function modules which will enable to produce the above reports without much effort.
    All the definitions of internal tables, structures and constants are declared in a type-pool called SLIS.
    1. SIMPLE REPORT.
    The important function modules are
    a. Reuse_alv_list_display
    b. Reuse_alv_fieldcatalog_merge
    c. Reuse_alv_events_get
    d. Reuse_alv_commentary_write
    e. Reuse_alv_grid_display
    A. REUSE_ALV_LIST_DISPLAY : This is the function module which prints the data.
    The important parameters are :
    I. Export :
    i. I_callback_program : report id
    ii. I_callback_pf_status_set : routine where a user can set his own pf status or change the functionality of the existing pf status
    iii. I_callback_user_command : routine where the function codes are handled
    iv. I_structure name : name of the dictionary table
    v. Is_layout : structure to set the layout of the report
    vi. It_fieldcat : internal table with the list of all fields and their attributes which are to be printed (this table can be populated automatically by the function module REUSE_ALV_FIELDCATALOG_MERGE
    vii. It_events : internal table with a list of all possible events of ALV and their corresponding form names.
    II. Tables :
    i. t_outtab : internal table with the data to be output
    B. REUSE_ALV_FIELDCATALOG_MERGE : This function module is used to populate a fieldcatalog which is essential to display the data in ALV. If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter(I_structure name) in the REUSE_ALV_LIST_DISPLAY. But in other cases we need to create it.
    The Important Parameters are :
    I. Export :
    i. I_program_name : report id
    ii. I_internal_tabname : the internal output table
    iii. I_inclname : include or the report name where all the dynamic forms are handled.
    II Changing
    ct_fieldcat : an internal table with the type SLIS_T_FIELDCAT_ALV which is
    declared in the type pool SLIS.
    C. REUSE_ALV_EVENTS_GET : Returns table of possible events for a list type
    Parameters :
    I. Import :
    Et_Events : The event table is returned with all possible CALLBACK events
    for the specified list type (column 'NAME'). For events to be processed by Callback, their 'FORM' field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field 'FORM' filled and the entry modified using constants from the type pool SALV.
    II. Export :
    I_List_type :
    0 = simple list REUSE_ALV_LIST_DISPLAY
    1 = hierarchcal-sequential list REUSE_ALV_HIERSEQ_LIST_DISPLAY
    2 = simple block list REUSE_ALV_BLOCK_LIST_APPEND
    3 = hierarchical-sequential block list
    REUSE_ALV_BLOCK_LIST_HS_APPEND
    D. REUSE_ALV_COMMENTARY_WRITE : This is used in the Top-of-page event to print the headings and other comments for the list.
    Parameters :
    I. it_list_commentary : internal table with the headings of the type slis_t_listheader.
    This internal table has three fields :
    Typ : ‘H’ – header, ‘S’ – selection , ‘A’ - action
    Key : only when typ is ‘S’.
    Info : the text to be printed
    E. REUSE_ALV_GRID_DISPLAY : A new function in 4.6 version, to display the results in grid rather than as a preview.
    Parameters : same as reuse_alv_list_display
    This is an example for simple list.
    2. BLOCK REPORT
    This is used to have multiple lists continuously.
    The important functions used in this report are:
    A. REUSE_ALV_BLOCK_LIST_INIT
    B. REUSE_ALV_BLOCK_LIST_APPEND
    C. REUSE_ALV_BLOCK_LIST_HS_APPEND
    D. REUSE_ALV_BLOCK_LIST_DISPLAY
    A. REUSE_ALV_BLOCK_LIST_INIT
    Parameters:
    I. I_CALLBACK_PROGRAM
    II. I_CALLBACK_PF_STATUS_SET
    III. I_CALLBACK_USER_COMMAND
    This function module is used to set the default gui status etc.
    B. REUSE_ALV_BLOCK_LIST_APPEND
    Parameters :
    Export :
    I. is_layout : layout settings for block
    II. it_fieldcat : field catalog
    III. i_tabname : internal table name with output data
    IV. it_events : internal table with all possible events
    Tables :
    i. t_outtab : internal table with output data.
    This function module adds the data to the block.
    Repeat this function for all the different blocks to be displayed one after the other.
    C. REUSE_ALV_BLOCK_LIST_HS_APPEND
    This function module is used for hierarchical sequential blocks.
    D. REUSE_ALV_BLOCK_LIST_DISPLAY
    Parameters : All the parameters are optional.
    This function module display the list with data appended by the above function.
    Here the functions REUSE_ALV_FIELDCATALOG_MERGE, REUSE_ALV_EVENTS_GET, REUSE_ALV_COMMENTARY_WRITE can be used.
    3. Hierarchical reports :
    Hierarchical sequential list output.
    The function module is
    A. REUSE_ALV_HIERSEQ_LIST_DISPLAY
    Parameters:
    I. Export:
    i. I_CALLBACK_PROGRAM
    ii. I_CALLBACK_PF_STATUS_SET
    iii. I_CALLBACK_USER_COMMAND
    iv. IS_LAYOUT
    v. IT_FIELDCAT
    vi. IT_EVENTS
    vii. i_tabname_header : Name of the internal table in the program containing the
    output data of the highest hierarchy level.
    viii. i_tabname_item : Name of the internal table in the program containing the
    output data of the lowest hierarchy level.
    ix. is_keyinfo : This structure contains the header and item table field
    names which link the two tables (shared key).
    II. Tables
    i. t_outtab_header : Header table with data to be output
    ii. t_outtab_item : Name of the internal table in the program containing the
    output data of the lowest hierarchy level.
    slis_t_fieldcat_alv : This internal table contains the field attributes. This internal table can be populated automatically by using ‘REUSE_ALV_FIELDCATALOG_MERGE’.
    Important Attributes :
    A. col_pos : position of the column
    B. fieldname : internal fieldname
    C. tabname : internal table name
    D. ref_fieldname : fieldname (dictionary)
    E. ref_tabname : table (dictionary)
    F. key(1) : column with key-color
    G. icon(1) : icon
    H. symbol(1) : symbol
    I. checkbox(1) : checkbox
    J. just(1) : (R)ight (L)eft (C)ent.
    K. do_sum(1) : sum up
    L. no_out(1) : (O)blig.(X)no out
    M. outputlen : output length
    N. seltext_l : long key word
    O. seltext_m : middle key word
    P. seltext_s : short key word
    Q. reptext_ddic : heading (ddic)
    R. ddictxt(1) : (S)hort (M)iddle (L)ong
    S. datatype : datatype
    T. hotspot(1) : hotspot
    with regards,
    Hema Sundara.
    pls reward if u find it helpful.

  • Function module used for formatting alv

    hi gurus,
    which function module is uesd to format alv?

    Hi
    see the following
    ABAP List Viewer
    The common features of report are column alignment, sorting, filtering, subtotals, totals etc. To implement these, a lot of coding and logic is to be put. To avoid that we can use a concept called ABAP List Viewer (ALV).
    This helps us to implement all the features mentioned very effectively.
    Using ALV, We can have three types of reports:
    1. Simple Report
    2. Block Report
    3. Hierarchical Sequential Report
    There are some function modules which will enable to produce the above reports without much effort.
    All the definitions of internal tables, structures and constants are declared in a type-pool called SLIS.
    1. SIMPLE REPORT.
    The important function modules are
    a. Reuse_alv_list_display
    b. Reuse_alv_fieldcatalog_merge
    c. Reuse_alv_events_get
    d. Reuse_alv_commentary_write
    e. Reuse_alv_grid_display
    A. REUSE_ALV_LIST_DISPLAY : This is the function module which prints the data.
    The important parameters are :
    I. Export :
    i. I_callback_program : report id
    ii. I_callback_pf_status_set : routine where a user can set his own pf status or change the functionality of the existing pf status
    iii. I_callback_user_command : routine where the function codes are handled
    iv. I_structure name : name of the dictionary table
    v. Is_layout : structure to set the layout of the report
    vi. It_fieldcat : internal table with the list of all fields and their attributes which are to be printed (this table can be populated automatically by the function module REUSE_ALV_FIELDCATALOG_MERGE
    vii. It_events : internal table with a list of all possible events of ALV and their corresponding form names.
    II. Tables :
    i. t_outtab : internal table with the data to be output
    B. REUSE_ALV_FIELDCATALOG_MERGE : This function module is used to populate a fieldcatalog which is essential to display the data in ALV. If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter(I_structure name) in the REUSE_ALV_LIST_DISPLAY. But in other cases we need to create it.
    The Important Parameters are :
    I. Export :
    i. I_program_name : report id
    ii. I_internal_tabname : the internal output table
    iii. I_inclname : include or the report name where all the dynamic forms are handled.
    II Changing
    ct_fieldcat : an internal table with the type SLIS_T_FIELDCAT_ALV which is
    declared in the type pool SLIS.
    C. REUSE_ALV_EVENTS_GET : Returns table of possible events for a list type
    Parameters :
    I. Import :
    Et_Events : The event table is returned with all possible CALLBACK events
    for the specified list type (column 'NAME'). For events to be processed by Callback, their 'FORM' field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field 'FORM' filled and the entry modified using constants from the type pool SALV.
    II. Export :
    I_List_type :
    0 = simple list REUSE_ALV_LIST_DISPLAY
    1 = hierarchcal-sequential list REUSE_ALV_HIERSEQ_LIST_DISPLAY
    2 = simple block list REUSE_ALV_BLOCK_LIST_APPEND
    3 = hierarchical-sequential block list
    REUSE_ALV_BLOCK_LIST_HS_APPEND
    D. REUSE_ALV_COMMENTARY_WRITE : This is used in the Top-of-page event to print the headings and other comments for the list.
    Parameters :
    I. it_list_commentary : internal table with the headings of the type slis_t_listheader.
    This internal table has three fields :
    Typ : ‘H’ – header, ‘S’ – selection , ‘A’ - action
    Key : only when typ is ‘S’.
    Info : the text to be printed
    E. REUSE_ALV_GRID_DISPLAY : A new function in 4.6 version, to display the results in grid rather than as a preview.
    Parameters : same as reuse_alv_list_display
    This is an example for simple list.
    2. BLOCK REPORT
    This is used to have multiple lists continuously.
    The important functions used in this report are:
    A. REUSE_ALV_BLOCK_LIST_INIT
    B. REUSE_ALV_BLOCK_LIST_APPEND
    C. REUSE_ALV_BLOCK_LIST_HS_APPEND
    D. REUSE_ALV_BLOCK_LIST_DISPLAY
    A. REUSE_ALV_BLOCK_LIST_INIT
    Parameters:
    I. I_CALLBACK_PROGRAM
    II. I_CALLBACK_PF_STATUS_SET
    III. I_CALLBACK_USER_COMMAND
    This function module is used to set the default gui status etc.
    B. REUSE_ALV_BLOCK_LIST_APPEND
    Parameters :
    Export :
    I. is_layout : layout settings for block
    II. it_fieldcat : field catalog
    III. i_tabname : internal table name with output data
    IV. it_events : internal table with all possible events
    Tables :
    i. t_outtab : internal table with output data.
    This function module adds the data to the block.
    Repeat this function for all the different blocks to be displayed one after the other.
    C. REUSE_ALV_BLOCK_LIST_HS_APPEND
    This function module is used for hierarchical sequential blocks.
    D. REUSE_ALV_BLOCK_LIST_DISPLAY
    Parameters : All the parameters are optional.
    This function module display the list with data appended by the above function.
    Here the functions REUSE_ALV_FIELDCATALOG_MERGE, REUSE_ALV_EVENTS_GET, REUSE_ALV_COMMENTARY_WRITE can be used.
    3. Hierarchical reports :
    Hierarchical sequential list output.
    The function module is
    A. REUSE_ALV_HIERSEQ_LIST_DISPLAY
    Parameters:
    I. Export:
    i. I_CALLBACK_PROGRAM
    ii. I_CALLBACK_PF_STATUS_SET
    iii. I_CALLBACK_USER_COMMAND
    iv. IS_LAYOUT
    v. IT_FIELDCAT
    vi. IT_EVENTS
    vii. i_tabname_header : Name of the internal table in the program containing the
    output data of the highest hierarchy level.
    viii. i_tabname_item : Name of the internal table in the program containing the
    output data of the lowest hierarchy level.
    ix. is_keyinfo : This structure contains the header and item table field
    names which link the two tables (shared key).
    II. Tables
    i. t_outtab_header : Header table with data to be output
    ii. t_outtab_item : Name of the internal table in the program containing the
    output data of the lowest hierarchy level.
    slis_t_fieldcat_alv : This internal table contains the field attributes. This internal table can be populated automatically by using ‘REUSE_ALV_FIELDCATALOG_MERGE’.
    Important Attributes :
    A. col_pos : position of the column
    B. fieldname : internal fieldname
    C. tabname : internal table name
    D. ref_fieldname : fieldname (dictionary)
    E. ref_tabname : table (dictionary)
    F. key(1) : column with key-color
    G. icon(1) : icon
    H. symbol(1) : symbol
    I. checkbox(1) : checkbox
    J. just(1) : (R)ight (L)eft (C)ent.
    K. do_sum(1) : sum up
    L. no_out(1) : (O)blig.(X)no out
    M. outputlen : output length
    N. seltext_l : long key word
    O. seltext_m : middle key word
    P. seltext_s : short key word
    Q. reptext_ddic : heading (ddic)
    R. ddictxt(1) : (S)hort (M)iddle (L)ong
    S. datatype : datatype
    T. hotspot(1) : hotspot
    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
    Go thru these programs they may help u to try on some hands on
    ALV Demo program
    BCALV_DEMO_HTML
    BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode
    BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode
    BCALV_GRID_DEMO Simple ALV Control Call Demo Program
    BCALV_TREE_DEMO Demo for ALV tree control
    BCALV_TREE_SIMPLE_DEMO
    BC_ALV_DEMO_HTML_D0100
    Regards
    Anji

  • Hi guru's what are the function modules are used in ALV

    hi guru's what are the function modules are used in ALV

    Hi vasu,
    There are some function modules which will enable to produce the  reports without much effort.
    All the definitions of internal tables, structures and constants are declared in a type-pool called SLIS.
    1. SIMPLE REPORT.
    The important function modules are
    a. Reuse_alv_list_display
    b. Reuse_alv_fieldcatalog_merge
    c. Reuse_alv_events_get
    d. Reuse_alv_commentary_write
    e. Reuse_alv_grid_display
    A. REUSE_ALV_LIST_DISPLAY : This is the function module which prints the data.
    The important parameters are :
    I. Export :
    i. I_callback_program : report id
    ii. I_callback_pf_status_set : routine where a user can set his own pf status or change the functionality of the existing pf status
    iii. I_callback_user_command : routine where the function codes are handled
    iv. I_structure name : name of the dictionary table
    v. Is_layout : structure to set the layout of the report
    vi. It_fieldcat : internal table with the list of all fields and their attributes which are to be printed (this table can be populated automatically by the function module REUSE_ALV_FIELDCATALOG_MERGE
    vii. It_events : internal table with a list of all possible events of ALV and their corresponding form names.
    II. Tables :
    i. t_outtab : internal table with the data to be output
    B. REUSE_ALV_FIELDCATALOG_MERGE : This function module is used to populate a fieldcatalog which is essential to display the data in ALV. If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter(I_structure name) in the REUSE_ALV_LIST_DISPLAY. But in other cases we need to create it.
    The Important Parameters are :
    I. Export :
    i. I_program_name : report id
    ii. I_internal_tabname : the internal output table
    iii. I_inclname : include or the report name where all the dynamic forms are handled.
    II Changing
    ct_fieldcat : an internal table with the type SLIS_T_FIELDCAT_ALV which is
    declared in the type pool SLIS.
    C. REUSE_ALV_EVENTS_GET : Returns table of possible events for a list type
    Parameters :
    I. Import :
    Et_Events : The event table is returned with all possible CALLBACK events
    for the specified list type (column 'NAME'). For events to be processed by Callback, their 'FORM' field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field 'FORM' filled and the entry modified using constants from the type pool SALV.
    II. Export :
    I_List_type :
    0 = simple list REUSE_ALV_LIST_DISPLAY
    1 = hierarchcal-sequential list REUSE_ALV_HIERSEQ_LIST_DISPLAY
    2 = simple block list REUSE_ALV_BLOCK_LIST_APPEND
    3 = hierarchical-sequential block list
    REUSE_ALV_BLOCK_LIST_HS_APPEND
    D. REUSE_ALV_COMMENTARY_WRITE : This is used in the Top-of-page event to print the headings and other comments for the list.
    Parameters :
    I. it_list_commentary : internal table with the headings of the type slis_t_listheader.
    This internal table has three fields :
    Typ : ‘H’ – header, ‘S’ – selection , ‘A’ - action
    Key : only when typ is ‘S’.
    Info : the text to be printed
    E. REUSE_ALV_GRID_DISPLAY : A new function in 4.6 version, to display the results in grid rather than as a preview.
    Parameters : same as reuse_alv_list_display
    This is an example for simple list.
    2. BLOCK REPORT
    This is used to have multiple lists continuously.
    The important functions used in this report are:
    A. REUSE_ALV_BLOCK_LIST_INIT
    B. REUSE_ALV_BLOCK_LIST_APPEND
    C. REUSE_ALV_BLOCK_LIST_HS_APPEND
    D. REUSE_ALV_BLOCK_LIST_DISPLAY
    A. REUSE_ALV_BLOCK_LIST_INIT
    Parameters:
    I. I_CALLBACK_PROGRAM
    II. I_CALLBACK_PF_STATUS_SET
    III. I_CALLBACK_USER_COMMAND
    This function module is used to set the default gui status etc.
    B. REUSE_ALV_BLOCK_LIST_APPEND
    Parameters :
    Export :
    I. is_layout : layout settings for block
    II. it_fieldcat : field catalog
    III. i_tabname : internal table name with output data
    IV. it_events : internal table with all possible events
    Tables :
    i. t_outtab : internal table with output data.
    This function module adds the data to the block.
    Repeat this function for all the different blocks to be displayed one after the other.
    C. REUSE_ALV_BLOCK_LIST_HS_APPEND
    This function module is used for hierarchical sequential blocks.
    D. REUSE_ALV_BLOCK_LIST_DISPLAY
    Parameters : All the parameters are optional.
    This function module display the list with data appended by the above function.
    Here the functions REUSE_ALV_FIELDCATALOG_MERGE, REUSE_ALV_EVENTS_GET, REUSE_ALV_COMMENTARY_WRITE can be used.
    3. Hierarchical reports :
    Hierarchical sequential list output.
    The function module is
    A. REUSE_ALV_HIERSEQ_LIST_DISPLAY
    Parameters:
    I. Export:
    i. I_CALLBACK_PROGRAM
    ii. I_CALLBACK_PF_STATUS_SET
    iii. I_CALLBACK_USER_COMMAND
    iv. IS_LAYOUT
    v. IT_FIELDCAT
    vi. IT_EVENTS
    vii. i_tabname_header : Name of the internal table in the program containing the
    output data of the highest hierarchy level.
    viii. i_tabname_item : Name of the internal table in the program containing the
    output data of the lowest hierarchy level.
    ix. is_keyinfo : This structure contains the header and item table field
    names which link the two tables (shared key).
    II. Tables
    i. t_outtab_header : Header table with data to be output
    ii. t_outtab_item : Name of the internal table in the program containing the
    output data of the lowest hierarchy level.
    slis_t_fieldcat_alv : This internal table contains the field attributes. This internal table can be populated automatically by using ‘REUSE_ALV_FIELDCATALOG_MERGE’.
    Important Attributes :
    A. col_pos : position of the column
    B. fieldname : internal fieldname
    C. tabname : internal table name
    D. ref_fieldname : fieldname (dictionary)
    E. ref_tabname : table (dictionary)
    F. key(1) : column with key-color
    G. icon(1) : icon
    H. symbol(1) : symbol
    I. checkbox(1) : checkbox
    J. just(1) : (R)ight (L)eft (C)ent.
    K. do_sum(1) : sum up
    L. no_out(1) : (O)blig.(X)no out
    M. outputlen : output length
    N. seltext_l : long key word
    O. seltext_m : middle key word
    P. seltext_s : short key word
    Q. reptext_ddic : heading (ddic)
    R. ddictxt(1) : (S)hort (M)iddle (L)ong
    S. datatype : datatype
    T. hotspot(1) : hotspot
    some theory regarding alv:
    This table tells ALV which events are processed by the caller by CALLBACK.
    The table of possible events per list type can be initialized using the module REUSE_ALV_EVENTS_GET.
    You can display the names of the constants in the type pools SLIS which represent the individual events using the individual test function in the function module
    REUSE_ALV_EVENT_NAMES_GET. Only events with a form routine name are processed.
    The table structure contains the fields:
    • IT_EVENTS-NAME
    Name of the Callback event.
    Possible Callback events:
    • Action
    USER_COMMAND USING R_UCOMM LIKE SY-UCOMM RS_SELFIELD TYPE SLIS_SELFIELD
    Process actions on the list
    As this is a frequently-used Callback event, the form routine can also be passed directly in the interface in the IMPORTING parameter I_CALLBACK_USER_COMMAND.
    PF_STATUS_SET USING RT_EXTAB TYPE SLIS_T_EXTAB
    If a user list status is to be set, it must be done in the form routine assigned to this event. The ALV function codes, which must not be active, are in the Parameter RT_EXTAB. This table must be passed with the SET PF-STATUS command (with inactive user function codes as well, if necessary).
    The STANDARD status of the function group SALV should be used as a template for a user-specific status.
    As this is a frequently-used Callback event, its form routine can also be passed directly in the interface in the IMPORTING parameter I_CALLBACK_PF_STATUS_SET.
    ITEM_DATA_EXPAND USING RS_SELFIELD TYPE SLIS_SELFIELD RFLG_ALL TYPE C
    Only relevant for hierarchical-sequential lists using the layout parameter IS_LAYOUT-EXPAND_FIELDNAME of the structure IS_LAYOUT.
    Exit for passing item entries (ITEM table) for a header record which was expanded interactively by the user.
    RS_SELFIELD-TABINDEX contains the header table index for which the item entries are to be put in the global item output table (T_OUTTAB_SLAVE). The Callback is only called if ALV has no items for a header which is to be expanded.
    RFLG_ALL is passed with 'X' if the user shows all items. The application must ensure that entries are not repeated in the item table. RS_SELFIELD is initial in this case.
    CALLER_EXIT USING RS_DATA Is called at the beginning of the function module to make special settings. It is not usually used.
    • List processing events
    IMPORTANT: The application Callback routine must not manipulate the internal output table and/or its header record. This restriction applies to all Callbacks which are called in the list output and run under the 'List processing events'.
    TOP_OF_LIST no USING parameter. Information output at the start of the list
    END_OF_LIST no USING parameter. Information output at the end of the list
    TOP_OF_PAGE no USING parameter
    Equivalent to the list processing TOP-OF-PAGE event
    END_OF_PAGE no USING parameter. Not available for hierarchical-sequential lists.
    Information output at the end of a page. This is only called for printing.
    TOP_OF_COVERPAGE no USING parameter
    The selection information and list status are output together (if they exist) on a separate page by default. See also the documentation of the parameters:
    IS_PRINT-NO_COVERPAGE
    IS_PRINT-NO_PRINT_SELINFOS
    IS_PRINT-NO_PRINT_LISTINFOS
    IS_LAYOUT-GET_SELINFOS
    The user can format the header area of the 'cover page' himself or herself by specifying a Callback routine for this event.
    END_OF_COVERPAGE no USING parameter
    Analogously to TOP_OF_COVERPAGE the user can add other information to the information output by ALV (selection information, list status) at this event.
    FOREIGN_TOP_OF_PAGE no USING parameter
    The Top-of-page event is always processed in ALV and is only passed to the caller via the Callback mechanism. This is still the case if the caller, e.g. by a user action, processes a branch list which was not formatted by ALV (e.g. a popup with additional information about the list record selected and displayed by ALV).
    In this case, top-of-page cannot be formatted by ALV analogously to the basic list, it must be handled completely by the caller. The event top-of-page still occurs in ALV. When ALV notices a top-of-page which was not caused by an ALV output, the form routine in FOREIGN_TOP_OF_PAGE is called.
    FOREIGN_END_OF_PAGE no USING parameter
    The event end-of-page is always processed in ALV and only passed to the caller via callback. This is still the case, e.g. when the caller processes a details list which was not formatted by ALV (e.g. a popup with further information about selected list records which were displayed by ALV).
    In this case, end-of-page cannot be formatted by ALV analogously to the basic list, it must be handled completely by the caller. The event end-of-page still occurs in ALV. When ALV notices an end-of-page that was not caused by an ALV output, the form routine in FOREIGN_END_OF_PAGE is called.
    BEFORE_LINE_OUTPUT USING RS_LINEINFO TYPE SLIS_LINEINFO
    Output information before each output line. Should only be used in justified cases because it costs a lot of performance.
    AFTER_LINE_OUTPUT USING RS_LINEINFO TYPE SLIS_LINEINFO
    Output information after each output line. Should only be used in justified cases because it costs a lot of performance.
    • Internal use only
    LIST_MODIFY USING R_TABNAME TYPE SLIS_TABNAME
    R_INDEX LIKE SY-TABIX
    R_INDEX_ITEM LIKE SY-TABIX
    R_INDEX_SUM LIKE SY-TABIX
    • IT_EVENTS-FORM
    Name of the form routine which should be called in the calling program at the event.
    Field_catalog:
    Field catalog with field descriptions
    2.7.1. Description
    Field catalog containing descriptions of the list output fields (usually a subset of the internal output table fields). A field catalog is required for every ALV list output.
    The field catalog for the output table is built-up in the caller's coding. The build-up can be completely or partially automated by calling the REUSE_ALV_FIELDCATALOG_MERGE module
    See also the documentation of the function module REUSE_ALV_FIELDCATALOG_MERGE.
    The minimal field catalog is documented under 'default'. The caller can use the other optional parameters to assign output attributes to a field which differ from the default.
    A field catalog need not be built-up and passed explicitly only under the following conditions:
    • The internal table to be output has the same structure as a Data Dictionary structure which is referred to in the internal table declaration using LIKE or INCLUDE STRUCTURE.
    • all fields in this structure are to be output
    • the structure name is passed to ALV in the parameter I_STRUCTURE_NAME.
    See also the documentation of the IMPORTING paramter I_STRUCTURE_NAME.
    Positioning
    • row_pos (row position)
    value set: 0, 1 - 3
    Only relevant if the list output is to be multi-line (two or three lines) by default.
    A multi-line list can also be defined by the user interactively if the default list is one-line.
    The parameter specifies the relative output line of the column in a multi-line list.
    • col_pos (column position)
    value set: 0, 1 - 60
    only relevant when the default relative column positions differ from the field catalog field sequence. The parameter specifies the relative column position of the field in the list output. The column order can be changed interactively by the user. If this parameter is initial for all field catalog entries, columns appear in the field catalog field sequence.
    Identification
    • fieldname (field name)
    value set: internal output table field name (required parameter)
    Name of the internal output table field which is described by this field catalog entry
    • tabname (internal output table)
    value set: SPACE, internal output table name
    This parameter is used in 'manual' field catalog build-up only for hierarchical-sequential lists.
    Name of the internal output table which contains the field FIELDCAT-FIELDNAME.
    Data Dictionary reference
    • ref_fieldname (reference field name)
    value set: SPACE, Data Dictionary field name
    Name of the Data Dictionary field referred to.
    This parameter is only used when the internal output table field described by the current field catalog entry has a reference to the Data Dictionary (not a program field), and the field name in the internal output table is different from the name of the field in the Data Dictionary. If the field names are identical, naming the Data Dictionary structure or table in the FIELDCAT-REF_TABNAME parameter is sufficient.
    • ref_tabname (reference table/structure field name)
    value set: SPACE, name of a Data Dictionary structure or table
    Structure or table name of the referred Data Dictionary field.
    This parameter is only used when the internal output table field described by the current field catalog entry has a Data Dictionary reference (not a program field).
    Reference to fields with currency/measurement unit
    Each internal output table sum or quantity field whose decimal places are to be formatted appropriately for the unit in the list must follow the convention:
    • the field is of data type QUAN or CURR (internal type P) (the field must really have this physical data type. Overwriting the physical data type with the parameter FIELDCAT-DATATYPE has no effect)
    • There is a field in the internal output table which contains the associated unit.
    • There is also an entry in the field catalog for the unit field.
    (If the unit is not to appear as a column in the list, and cannot be interactively displayed as a column, e.g. because it is always unambiguous and is therefore explicitly output by the caller in the list header, the field catalog units field entry can take the parameter FIELDCAT-TECH = 'X'.
    The association of a value field to a unit affects the output as follows:
    • appropriate decimal places display for the unit
    • an initialized field with a link to a non-initial unit is output as '0' for the unit (if FIELDCAT-NO_ZERO is initial). When this field is summed, this unit affects whether the units are homogeneous.
    • an initialized field with a link to an initial unit is output as SPACE. When this field is summed, the unit SPACE does not affect the homogeneity of the units.
    • When non-initial fields with an initial unit are summed, the unit SPACE is considered to be a unit.
    Link to currency unit
    • cfieldname (currency unit field name)
    value set: SPACE, output table field name
    Only relevant for amount columns with associated unit.
    Name of the internal output table field containing the currency unit associated with the amount field FIELDCAT-FIELDNAME. The field in FIELDCAT-CFIELDNAME must have its own field catalog entry.
    • ctabname (internal currency unit field output table)
    value set: SPACE, output table field name
    only relevant for hierarchical-sequential lists
    Name of the internal output table containing the FIELDCAT-CFIELDNAME field.
    Link to measurement unit
    • qfieldname (measurement unit field name)
    value set: SPACE, output table field name
    only relevant for quantity columns with unit link.
    Name of the internal output table field containing the measurement unit associated with the quantity field FIELDCAT-FIELDNAME.
    The field in FIELDCAT-QFIELDNAME must have its own field catalog entry.
    • qtabname (internal measurement unit field output table)
    value set: SPACE, output table field name
    only relevant for hierarchical-sequential lists
    Name of the internal output table containing the FIELDCAT-QFIELDNAME field.
    Column output options
    • outputlen (column width)
    value set: 0 (initial), n
    For fields with a Data Dictionary link this parameter can be left initial.
    For fields without a Data Dictionary link (program field) the parameter must be given the value of the desired field list output length (column width).
    initial = column width is the output length of the referred Data Dictionary field (domain).
    n = column width is n characters
    • key (key column)
    value set: SPACE, 'X' 'X' = kex field (key field output in color)
    Key fields can not be interactively hidden. Parameter FIELDCAT-NO_OUT must be left initial.
    For exceptions see the documentation of the FIELDCAT-KEY_SEL parameter.
    • key_sel (hideable key column)
    value set: SPACE, 'X'
    only relevant when FIELDCAT-KEY = 'X'
    Key field which can be hidden interactively.
    The key column sequence cannot be changed interactively by the user.
    The output is controlled by the FIELDCAT-NO_OUT parameter analogously to non-key fields.
    • no_out (field in field list)
    value set: SPACE, 'X' 'X' = field is not displayed in the current list.
    The user can interactively choose the field for output from the field list.
    The user can display the contents of these fields at line level using the 'Detail' function.
    See also the 'Detail screen' documentation of the parameter IS_LAYOUT.
    • tech (technical field)
    value set: SPACE, 'X' 'X' = technical field
    Field cannot be output in the list and cannot be displayed interactively.
    Field can only be used in the field catalog (not in IT_SORT, ...).
    • emphasize (highlight columns in color)
    value set: SPACE, 'X' or 'Cxyz' (x:'1'-'9'; y,z: '0'=off '1'=on)
    'X' = column is colored with the default column highlight color.
    'Cxyz' = column is colored with a coded color:
    • C: Color (coding must begin with C)
    • x: color number
    • y: bold
    • z: inverse
    • hotspot (column as hotspot)
    value set: SPACE, 'X'
    'X' = column cells are output as hotspots
    • fix_column (fix column)
    value set: SPACE, 'X'
    Not relevant for block lists (output of several lists consecutively)
    'X' = column fixed (does not scroll horizontally)
    All columns to be fixed must have this flag, starting from the left. If a column without this flag is output, only the columns to the left of this column are fixed. The user can change the column fixing interactively. See also the documentation of the Layout parameter
    IS_LAYOUT-NO_KEYFIX of the IMPORTING paramter IS_LAYOUT.
    • do_sum (sum over column)
    value set: SPACE, 'X' 'X' = a sum is to be calculated over this internal output table field.
    This function can also be called by the user interactively.
    • no_sum (sums forbidden)
    value set: SPACE, 'X' 'X' = no sum can be calculated over this field, although the data type of the field would allow summing.
    • input (column ready for input)
    Function not available
    Format column contents
    • icon
    value set: SPACE, 'X' 'X' = column contents to be output as an icon.
    The caller must consider the printability of icons.
    • symbol
    value set: SPACE, 'X' 'X' = column contents are to be output as a symbol.
    The internal output table column must be a valid symbol character.
    The caller must consider the printability of symbols.
    Symbols can usually be printed, but may not always be output correctly, depending on the printer configuration.
    • just (justification)
    value set: SPACE, 'R', 'L', 'C'
    Only relevant for fields of data type CHAR or NUMC
    ' ' = default justification for this data type
    'R' = right-justified output
    'L' = left-justified output
    'C' = centered output
    The justification of the column header always follows the justification of the columns. Independent justification of the column neader is not possible.
    • lzero (leading zeros)
    value set: SPACE, 'X'
    Only relevant for fields of data type NUMC
    ALV outputs NUMC fields right-justified without leading zeros by default.
    'X' = output with leading zeros
    Note: If a NUMC field is output left-justified or centered by FIELDCAT-JUST, leading zeros are output. If the output of leading zeros is suppressed by a Data Dictionary reference ALPHA conversion exit, the output is always left-justified.
    • no_sign (no +/- sign) Only relevant for value fields
    value set: SPACE, 'X' 'X' = value output without +/ sign
    • no_zero (suppress zeros) Only relevant for value fields
    value set: SPACE, 'X' 'X' = suppress zeros
    • edit_mask (field formatting)
    value set: SPACE, template
    template = see documentation of WRITE formatting option USING EDIT MASK template
    The output conversion conv can be made by template = '== conv'.
    Texts
    The following text parameters should be specified for program fields without a Data Dictionary reference. The texts are taken from the Data Dictionary for fields with a Data Dictionary reference. If this is not desired, the text parameters can also be specified. The Data Dictionary texts are then ignored. If the user changes the column width interactively, the column header text with the appropriate length is always used. The interactive function 'Optimize column width' takes account of both the field contents and the column headers: if all field contents are shorter than the shortest column header, the column width depends on the column header.
    The 'long field label' is also used in display variant definition, sort, etc. popups.
    • seltext_l (long field label)
    • seltext_m (medium field label)
    • seltext_s (short field label)
    • reptext_ddic (header)
    analogous to the Data element maintenance 'Header'
    The specified text is not necessarily output in the list, an optimum among all texts is sought.
    • ddictxt (specify text)
    value set: SPACE, 'L', 'M', 'S'
    You can specify with values 'L', 'M', and 'S', the keyword that should always be used as column header. If the column width changes, no attempt is made in this case to find an appropriate header for the new output width.
    Parameters for program fields without Data Dictionary reference
    see also 'Text' parameters
    • datatype (data type)
    value set: SPACE, Data Dictionary data type (CHAR, NUMC,...)
    Only relevant for fields without Data Dictionary reference
    Program field data type
    • ddic_outputlen (external output length)
    value set: 0 (initial), n
    Only relevant for fields without Data Dictionary reference whose output is nevertheless to be modified by a conversion exit.
    Prerequisites:
    • FIELDCAT-EDIT_MASK = '==conv'
    see also the documentation of the parameter FIELDCAT-EDIT_MASK
    • FIELDCAT-INTLEN = n
    see also the documentation of the parameter FIELDCAT-INTLEN
    n = external format field output length
    The column width FIELDCAT-OUTPUTLEN need not be the same as the external format output length (FIELDCAT-DDIC_OUTPUTLEN).
    • intlen (internal output length)
    value set: 0 (initial), n
    Only relevant for fields without Data Dictionary reference whose output is nevertheless to be modified by a conversion exit.
    Prerequisites:
    • FIELDCAT-EDIT_MASK = '==conv'
    see also the documentation of the parameter FIELDCAT-EDIT_MASK
    • FIELDCAT-DDIC_OUTPUTLEN = n
    see also the documentation of the parameter FIELDCAT-DDIC_OUTPUTLEN
    n = internal format field output length
    • rollname (data element)
    value set: SPACE, Data Dictionary data element name
    F1 help can be provided for a program field without a Data Dictionary reference, or F1 help which differs from the Data Dictionary help can be provided for a field with a Data Dictionary reference, using this parameter.
    When F1 help is called for this field, the documentation of the specified data element is displayed.
    If the FIELDCAT-ROLLNAME is initial for fields with a Data Dictionary reference, the documentation of the data element of the referred Data Dictionary field is output.
    Others
    • sp_group (field group key)
    value set: SPACE, CHAR(1)
    Field group key.
    Keys are assigned to group names in the IT_SPECIAL_GROUPS parameter (see also the documentation of the parameter IT_SPECIAL_GROUPS).
    When such an assignment is made in the field catalog and in IT_SPECIAL_GROUPS, the fields are grouped correspondingly in the display variant popup.
    • reprep (Report/Report interface selection criterion)
    value set: SPACE, 'X'
    Prerequisites:
    • The system contains the Report/Report interface (function group RSTI, table TRSTI)
    • Parameter LAYOUT-REPREP = 'X'
    (see also the documentation of the parameter LAYOUT-REPREP of the IMPORTING parameter IS_LAYOUT )
    'X' = When the Report/Report interface is called, the value of this field is passed in the selected interface start record as a selection criterion.
    2.7.2. Default
    • The following entries are usually sufficient for internal table fields with a reference to a field defined in the Data Dictionary :
    • fieldname
    • ref_tabname
    Notes:
    ALV gets the remaining information from the Data Dictionary.
    If no relative column position (COL_POS) is specified, the fields are output in the list in the order in which they were added to the field catalog.
    REF_FIELDNAME need only be specifid when the name of the internal table field differs from the name of the referred Data Dictionary field.
    Information which is explicitly entered in the field catalog is not overwritten by information from the Data Dictionary.
    Priority rule:
    Entries in the field catalog have priority over differing entries in the Data Dictionary.
    • The following entries are usually sufficient for internal table fields without a reference to the Data Dictionary (program fields):
    • fieldname
    • outputlen
    • datatype
    • seltext_s
    • seltext_m
    • seltext_l
    Notes:
    F1 help can be provided for program fields by assigning a data element to the parameter ROLLNAME.
    If the parameters SELTEXT_S, SELTEXT_M, SELTEXT_L, and REPTEXT_DDIC contain appropriate field labels, the program field column headers are also adjusted appropriately when the column width changes
    sites :
    http://www.sapdevelopment.co.uk/reporting/alv/alv_variousfcat.htm
    <b>plese reward if useful </b>
    Message was edited by:
            sunil kairam

  • ALV USING FM(FIELDCATALOG_MERGE)

    What is the purpose of fm
    "REUSE_ALV_FIELDCATALOG_MERGE"
    explain briefly with sample code.

    Hi,
    Using REUSE_ALV_FIELDCATALOG_MERGE can automatically determine the fieldstructure from this source program, no need to maunally build fieldcatalog for the fields defined in the internal table.
    REPORT Z_ALV_SIMPLE_EXAMPLE_WITH_ITAB .
    *data definition
    tables:
    marav. "Table MARA and table MAKT
    * Data to be displayed in ALV
    * Using the following syntax, REUSE_ALV_FIELDCATALOG_MERGE can auto-
    * matically determine the fieldstructure from this source program
    Data:
    begin of imat occurs 100,
    matnr like marav-matnr, "Material number
    maktx like marav-maktx, "Material short text
    matkl like marav-matkl, "Material group (so you can test to make
                            " intermediate sums)
    ntgew like marav-ntgew, "Net weight, numeric field (so you can test to
                            "make sums)
    gewei like marav-gewei, "weight unit (just to be complete)
    end of imat.
    * Other data needed
    * field to store report name
    data i_repid like sy-repid.
    * field to check table length
    data i_lines like sy-tabix.
    * Data for ALV display
    TYPE-POOLS: SLIS.
    data int_fcat type SLIS_T_FIELDCAT_ALV.
    select-options:
    s_matnr for marav-matnr matchcode object MAT1.
    start-of-selection.
    * read data into table imat
      select * from marav
      into corresponding fields of table imat
      where
      matnr in s_matnr.
    * Check if material was found
      clear i_lines.
      describe table imat lines i_lines.
      if i_lines lt 1.
    *   Using hardcoded write here for easy upload
        write: /
        'No materials found.'.
        exit.
      endif.
    end-of-selection.
    * Now, we start with ALV
    * To use ALV, we need a DDIC-structure or a thing called Fieldcatalogue.
    * The fieldcatalouge can be generated by FUNCTION
    * 'REUSE_ALV_FIELDCATALOG_MERGE' from an internal table from any
    * report source, including this report.
    * The only problem one might have is that the report and table names
    * need to be in capital letters. (I had it :-( )
    * Store report name
      i_repid = sy-repid.
    * Create Fieldcatalogue from internal table
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                I_PROGRAM_NAME         = i_repid
                I_INTERNAL_TABNAME     = 'IMAT'  "capital letters!
                I_INCLNAME             = i_repid
           CHANGING
                CT_FIELDCAT            = int_fcat
           EXCEPTIONS
                INCONSISTENT_INTERFACE = 1
                PROGRAM_ERROR          = 2
                OTHERS                 = 3.
    *explanations:
    *    I_PROGRAM_NAME is the program which calls this function
    *    I_INTERNAL_TABNAME is the name of the internal table which you want
    *                       to display in ALV
    *    I_INCLNAME is the ABAP-source where the internal table is defined
    *               (DATA....)
    *      CT_FIELDCAT contains the Fieldcatalouge that we need later for
    *      ALV display
      IF SY-SUBRC <> 0.
        write: /
        'Returncode',
        sy-subrc,
        'from FUNCTION REUSE_ALV_FIELDCATALOG_MERGE'.
      ENDIF.
    *This was the fieldcatlogue
    * And now, we are ready to display our list
    * Call for ALV list display
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
           EXPORTING
    *            I_CALLBACK_PROGRAM = 'Z_ALV_SIMPLE_EXAMPLE_WITH_ITAB'
                I_CALLBACK_PROGRAM = i_repid
                IT_FIELDCAT        = int_fcat
                I_SAVE             = 'A'
           TABLES
                T_OUTTAB           = imat
           EXCEPTIONS
                PROGRAM_ERROR      = 1
                OTHERS             = 2.
    *explanations:
    *    I_CALLBACK_PROGRAM is the program which calls this function
    *    IT_FIELDCAT (just made by REUSE_ALV_FIELDCATALOG_MERGE) contains
    *                 now the data definition needed for display
    *    I_SAVE allows the user to save his own layouts
    *      T_OUTTAB contains the data to be displayed in ALV
      IF SY-SUBRC <> 0.
        write: /
        'Returncode',
        sy-subrc,
        'from FUNCTION REUSE_ALV_LIST_DISPLAY'.
      ENDIF.
    Thanks,
    Sriram Ponna.

  • Newly added field not getting displayed in ALV output

    Hi All,
       I'm adding one more field/column to be displayed in an old existing program that uses REUSE_ALV_FIELDCATALOG_MERGE to generate the ALV fieldcat.
    DATA: BEGIN OF it_salary OCCURS 0,
            pernr LIKE pa0000-pernr,
            ename LIKE pa0001-ename,
            rtext like lv_rtext, -
    added field
            waers LIKE pa0008-waers
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = driver
          i_internal_tabname     = 'IT_SALARY'
          i_client_never_display = 'X'
          i_inclname             = driver
        CHANGING
          ct_fieldcat            = lv_fieldcat[]
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
      CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
        EXPORTING
          i_callback_program      = driver
          it_fieldcat             = lv_fieldcat[]
          i_default               = 'X'
          i_save                  = 'A'
          is_variant              = lv_tmplt
          is_layout               = lv_ls_layout
         i_callback_user_command = 'USER_COMMAND'
        TABLES
          t_outtab                = it_salary
        EXCEPTIONS
          program_error           = 1
          OTHERS                  = 2.
    The newly added field is not getting populated in the lv_fieldcat table. Tried running programs BALVBUFDEL,
    BCALV_BUFFER_DEL_SHARED then logging off and logging in but of no help.
    Please provide suggestion for this issue.
    Regards,
    Sridevi S

    Hi,
    Fieldcat is buffered - so use
    I_BYPASSING_BUFFER = 'X'
    Since a while CL_GUI_ALV_GRID is available which does NOT need any fieldcat (is determined internally using RTTI). It is worth playing around whith this class if you have some time. This class is recommended for ALV Output by SAP (but no edit is possible - was never supported officially).
    A simple use would be:
    data: gt_output type standard table of (adjust!).
    *simple ALV output
    data go_alv type ref to cl_salv_table.
    data go_functions type ref to cl_salv_functions_list.
    data go_columns type ref to cl_salv_columns_table.
    data go_column type ref to cl_salv_column_table.
    *Exceprion handlig
    data: go_exception  type ref to cx_root,
          gv_errortext   type string.
    ** fill table gt_output ...
    ** ALV output
    if not gt_output is initial.
        try.
            call method cl_salv_table=>factory
              importing
                r_salv_table = go_alv
              changing
                t_table      = gt_output.
          catch cx_salv_msg into go_exception.
            gv_errortext = go_exception->get_text( ).
            message gv_errortext type 'A'.
        endtry.
    * enable all standard ALV functions
        go_functions =  go_alv->get_functions( ).
        go_functions->set_all( ).
    * hide MANDT
        go_columns = go_alv->get_columns( ).
        go_column ?=  go_columns->get_column( columnname = 'MANDT' ).
        go_column->set_technical( ).
        go_alv->display( ).
    Kind regards,
    Holger

  • Added new field to ALV but not  displaying the ouput

    Hi guys,
    I'm adding one more column to be displayed on an old existing program that uses REUSE_ALV_FIELDCATALOG_MERGE to generate the ALV fieldcat.
    DATA : BEGIN OF itab OCCURS 0,
      matnr LIKE eina-matnr,
      extwg LIKE mara-extw,
      matkl LIKE mara-matkl,
      mtart LIKE mara-mtart,
      maktx LIKE makt-maktx,
      lifnr LIKE eina-lifnr,
      wglif LIKE eina-wglif,
    <span style="color:red">idnlf like eina-idnlf,          " <----
    new field</span>
      name1 LIKE lfa1-name1,
      profl LIKE mara-profl,
    END OF itab.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
        EXPORTING
          i_program_name         = sy-cprog
          i_internal_tabname     = 'ITAB'
          i_client_never_display = ''
          i_inclname             = sy-cprog
         i_bypassing_buffer     = 'X'
        CHANGING
          ct_fieldcat            = t_cat
        EXCEPTIONS
          inconsistent_interface = 1
          program_error          = 2
          OTHERS                 = 3.
    I've added in a new field inside the ITAB internal table, but it wouldn't appear in the t_cat, only all the old fields will appear. What have i done wrong?

    Hi
      Facing similar kind of issue.. added one field to the existing internal table. This is not getting populted by the field catalog merge FM. Tried with the suggested solution also of running programs BALVBUFDEL,
    BCALV_BUFFER_DEL_SHARED then logging off  and logging in..
    But the newly added field is not getting populated. Any suggestions would be of great help.
    Regards,
    sridevi S

  • Need to be displayed in ALV grid

    Dear All,
    Below is my Program's code which is working accordingly. But in this code I am generating output as Basic list display.  But  I want my output to be displayed in ALV only. So from where I will start. Where to add code for Alv in my existing code. Can anybody help me out on the same.
    Regards,
    Abhay.
    REPORT  zfi_temp_rfkopr00
            MESSAGE-ID FR
           LINE-SIZE  132
           NO STANDARD PAGE HEADING.
    Report Name : Vendor Open Items Ageing Report
    Purpose : This report displays the Vendor Open Items based on
    different Ageing days (Calculated by taking the Base
    Line date and the days mentioned in Payment Terms)
    D A T A B A S E T A B L E S D E C L A R A T I O N
    TABLES: lfa1, " Vendor Master (General)
    t001, " Company Codes
    rfpdo.
    I N T E R N A L T A B L E S D E C L A R A T I O N S *
    Internal Table for Vendor Open Items Data
    DATA: BEGIN OF int_bsik OCCURS 0,
    lifnr LIKE bsik-lifnr, " Vendor Number
    name1 LIKE lfa1-name1, " Vendor Name
    shkzg LIKE bsik-shkzg, " Dr/Cr Indicator
    belnr LIKE bsik-belnr, " Document Number
    xblnr LIKE bsik-xblnr, " Ref Doc No
    blart LIKE bsik-blart, " Document Type
    zfbdt LIKE bsik-zfbdt, " Base Line Date
    zbd1t LIKE bsik-zbd1t,                                      " Due date1
    zbd2t LIKE bsik-zbd2t,                                      " Due Date2
    zbd3t LIKE bsik-zbd3t,                                      " Due Date3
    waers LIKE bsik-waers, " Currency
    dmbtr LIKE bsik-dmbtr, " Amount in Local Curr
    END OF int_bsik.
    Internal Table for Amounts Sum Up Data
    DATA: BEGIN OF int_final OCCURS 0,
    lifnr LIKE bsik-lifnr, " Vendor Number
    name1 LIKE lfa1-name1, " Vendor Name
    total1 LIKE bsik-dmbtr, " Amount in Local Curr
    total2 LIKE bsik-dmbtr, " Amount in Local Curr
    total3 LIKE bsik-dmbtr, " Amount in Local Curr
    total4 LIKE bsik-dmbtr, " Amount in Local Curr
    total5 LIKE bsik-dmbtr, " Amount in Local Curr
    total6 LIKE bsik-dmbtr, " Amount in Local Curr
    total LIKE bsik-dmbtr, " Amount in Local Curr
    END OF int_final.
    D A T A D E C L A R A T I O N S
    DATA : v_flag, " Flag
    v_gtotal1 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal2 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal3 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal4 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal5 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal6 LIKE bsik-dmbtr, " Amount Totals
    v_gtotal LIKE bsik-dmbtr, " Amount Totals
    v_subtotal1 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal2 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal3 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal4 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal5 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal6 LIKE bsik-dmbtr, " Amount Totals
    v_subtotal LIKE bsik-dmbtr, " Amount Totals
    v_date LIKE bsik-zfbdt, " Due Date
    v_tage1(4), " Age 30 days
    v_tage2(4), " Age 60 days
    v_tage3(4), " Age 90 days
    v_fir(15), " Column Text1
    v_sec(15), " Column Text2
    v_thir(15), " Column Text3
    v_four(17), " Column Text4
    v_fidd(4), " Days field1
    v_sedd(4), " Days field2
    v_thdd(4), " Days field3
    v_fodd(4), " Days field4
    v_str TYPE sy-lisel, " String
    v_str1(11), " String
    v_tage(3), " String
    v_date1(10). " Date field
    R A N G E D E C L A R A T I O N S
    RANGES: r_date1 FOR bsik-zfbdt, " Date Range 1
    r_date2 FOR bsik-zfbdt, " Date Range 2
    r_date3 FOR bsik-zfbdt, " Date Range 3
    r_date4 FOR bsik-zfbdt. " Date Range 4
    S E L E C T I O N S C R E E N *
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_lifnr FOR lfa1-lifnr. "Vendor account
    PARAMETERS: p_bukrs LIKE t001-bukrs. "Co. Code
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-002.
    PARAMETERS: p_allgst LIKE rfpdo-allgstid OBLIGATORY DEFAULT sy-datum.
    "Open items at key date
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-003.
    PARAMETERS: p_tage1 LIKE rfpdo1-allgfael DEFAULT '30',
    p_tage2 LIKE rfpdo1-allgfael DEFAULT '60',
    p_tage3 LIKE rfpdo1-allgfael DEFAULT '90',
    p_tage4 LIKE rfpdo1-allgfael DEFAULT '120'.
    SELECTION-SCREEN END OF BLOCK b3.
    A T S E L E C T I O N S C R E E N *
    AT SELECTION-SCREEN.
    Validate the screen fields
      PERFORM validate_flds.
    S T A R T O F S E L E C T I O N *
    START-OF-SELECTION.
    Fetch main data
      PERFORM fetch_data.
    T O P O F P A G E
    Header
    TOP-OF-PAGE.
      PERFORM header.
    E N D O F P A G E
    Footer
    END-OF-PAGE.
      ULINE.
    T O P O F P A G E D U R I N G L I N E S E L E C T I O N *
    Top of Page in Secondary List
    TOP-OF-PAGE DURING LINE-SELECTION.
      PERFORM header1.
    A T L I N E S E L E C T I O N *
    AT LINE-SELECTION.
    Perform Line Selections
      PERFORM line_selection.
    E N D O F S E L E C T I O N
    END-OF-SELECTION.
    List generation
      PERFORM basic_list.
    *& Form validate_flds
    Validation of Selection Screen fields
    FORM validate_flds .
    Validate Vendor Code
      CLEAR lfa1-lifnr.
      SELECT lifnr UP TO 1 ROWS
      INTO lfa1-lifnr
      FROM lfa1
      WHERE lifnr IN s_lifnr AND
      spras = sy-langu.
      ENDSELECT.
      IF sy-subrc <> 0.
        MESSAGE e000 WITH 'Invalid Vendor Code range'(023).
      ENDIF.
    Validate Company Code
      CLEAR t001-bukrs.
      SELECT bukrs UP TO 1 ROWS
      INTO t001-bukrs
      FROM t001
      WHERE bukrs = p_bukrs AND
      spras = sy-langu.
      ENDSELECT.
      IF sy-subrc <> 0.
        MESSAGE e021. " Invalid Company Code range
      ENDIF.
      IF ( p_tage1 > p_tage2 ) OR ( p_tage1 > p_tage3 ) OR
      ( p_tage1 > p_tage4 ).
        MESSAGE e999 WITH 'Column 1 greater'(004)
        'than Column# 2 or 3 or 4'(005).
      ENDIF.
    *column 2
      IF ( p_tage2 > p_tage3 ) OR ( p_tage1 > p_tage4 ).
        MESSAGE e999 WITH 'Column 2 greater'(006)
        'than Column# 3 or 4'(007).
      ENDIF.
    *column3
      IF ( p_tage3 > p_tage4 ).
        MESSAGE e999 WITH 'Column 3 greater'(008)
        'than Column#4'(009).
      ENDIF.
    ENDFORM. " validate_flds
    *& Form fetch_data
    Fetching Data from Database Tables
    FORM fetch_data .
    Date Range Population
      r_date1-sign = 'I'.
      r_date1-option = 'BT'.
      r_date1-low = p_allgst.
      r_date1-high = r_date1-low + p_tage1.
      APPEND r_date1.
      r_date2-sign = 'I'.
      r_date2-option = 'BT'.
      r_date2-low = r_date1-high + 1.
      r_date2-high = r_date1-low + p_tage2.
      APPEND r_date2.
      r_date3-sign = 'I'.
      r_date3-option = 'BT'.
      r_date3-low = r_date2-high + 1.
      r_date3-high = r_date1-low + p_tage3.
      APPEND r_date3.
      r_date4-sign = 'I'.
      r_date4-option = 'BT'.
      r_date4-low = r_date3-high + 1.
      r_date4-high = r_date1-low + p_tage4.
      APPEND r_date4.
    Select the Vendor Open Items data from BSIK
      SELECT l~lifnr
      l1~name1
      b~waers
      b~dmbtr
      b~zfbdt
      b~zbd1t
      b~zbd2t
      b~zbd3t
      b~belnr
      b~xblnr
      b~shkzg
      b~blart
      INTO CORRESPONDING FIELDS OF TABLE int_bsik
      FROM lfb1 AS l INNER JOIN lfa1 AS l1
      ON llifnr = l1lifnr
      INNER JOIN bsik AS b
      ON llifnr = blifnr AND
      lbukrs = bbukrs
      WHERE l~lifnr IN s_lifnr AND
      l~bukrs = p_bukrs AND
      b~zfbdt LE p_allgst.
      IF sy-subrc <> 0.
        MESSAGE i000 WITH 'No Data found'(027).
      ENDIF.
    Removing the date limit to get the due items in the past
      DELETE int_bsik WHERE
      ( blart NE 'RE' AND blart NE 'KR' ) OR
      shkzg NE 'H'.
      SORT int_bsik BY lifnr.
    ENDFORM. " fetch_data
    *& Form header
    Display the Report Columns
    FORM header .
      v_tage1 = p_tage1 + 1.
      v_tage2 = p_tage2 + 1.
      v_tage3 = p_tage3 + 1.
      v_fidd = p_tage1.
      v_sedd = p_tage2.
      v_thdd = p_tage3.
      v_fodd = p_tage4.
      MOVE v_fodd0(4) TO v_fodd1(3).
      v_fodd+0(1) = space.
      CONCATENATE '1 to'(010) v_fidd INTO v_fir.
      CONCATENATE v_tage1 ' to '(011) v_sedd INTO v_sec.
      CONCATENATE v_tage2 ' to '(011) v_thdd INTO v_thir.
      CONCATENATE v_tage3 ' to '(011) space v_fodd INTO v_four.
    Standard header
      CLEAR: v_date1, v_str, v_str1, v_tage.
      WRITE p_allgst TO v_date1.
      MOVE p_tage4 TO v_tage.
      CONCATENATE '>' v_tage text-025 INTO v_str1.
      CONCATENATE
      'Summary of Ageing Analysis for Vendor Open Invoices as on'(013)
      v_date1 INTO v_str SEPARATED BY space.
    CALL FUNCTION 'Z_STANDARD_HEADER'
       EXPORTING
         title1 = 'Saudi International Petrochemical Company'(012)
         title2 = v_str.
      FORMAT COLOR OFF.
      WRITE : /1(168) sy-uline.
      FORMAT COLOR 1 INTENSIFIED.
      WRITE :/1 sy-vline, 13 sy-vline, 49 sy-vline,
      50(101) 'Invoices Due For(In Days)'(014) CENTERED,
      151 sy-vline, 168 sy-vline .
      WRITE :/1 sy-vline, 2(11) 'Vendor#'(015) CENTERED,
      13 sy-vline ,14(35) 'Vendor Name'(016) CENTERED,
      49 sy-vline,
      50(101) sy-uline,151 sy-vline,
      152(16) 'Total'(017) CENTERED,
      168 sy-vline.
      WRITE : /1 sy-vline,13 sy-vline, 49 sy-vline,
      50(16) v_fir CENTERED, 66 sy-vline,
      67(16) v_sec CENTERED, 83 sy-vline,
      84(16) v_thir CENTERED, 100 sy-vline,
      101(16) v_four CENTERED, 117 sy-vline,
      118(16) v_str1 CENTERED, 134 sy-vline,
      135(16) 'Already Overdue'(018) CENTERED,151 sy-vline,
      168 sy-vline.
      FORMAT COLOR OFF.
      WRITE : /1(168) sy-uline.
    ENDFORM. " header
    *& Form basic_list
    Display the Basic List
    FORM basic_list .
      NEW-PAGE LINE-SIZE 168.
      LOOP AT int_bsik.
        CLEAR v_date.
        IF int_bsik-zbd3t <> ' '.
          v_date = int_bsik-zfbdt + int_bsik-zbd3t.
        ELSE.
          IF int_bsik-zbd2t <> ' '.
            v_date = int_bsik-zfbdt + int_bsik-zbd2t.
          ELSE.
            v_date = int_bsik-zfbdt + int_bsik-zbd1t.
          ENDIF.
        ENDIF.
        IF int_bsik-zbd1t = ' '.
          v_date = int_bsik-zfbdt.
        ENDIF.
        IF v_date IN r_date1.
          int_final-total1 = int_final-total1 + int_bsik-dmbtr.
        ELSEIF v_date IN r_date2.
          int_final-total2 = int_final-total2 + int_bsik-dmbtr.
        ELSEIF v_date IN r_date3.
          int_final-total3 = int_final-total3 + int_bsik-dmbtr.
        ELSEIF v_date IN r_date4.
          int_final-total4 = int_final-total4 + int_bsik-dmbtr.
        ELSEIF v_date > r_date4-high.
          int_final-total5 = int_final-total5 + int_bsik-dmbtr.
        ELSEIF v_date < p_allgst.
          int_final-total6 = int_final-total6 + int_bsik-dmbtr.
        ENDIF.
        AT END OF lifnr.
          v_flag = 1.
        ENDAT.
        IF v_flag = 1.
          int_final-lifnr = int_bsik-lifnr.
          int_final-name1 = int_bsik-name1.
          int_final-total = int_final-total1 + int_final-total2 +
          int_final-total3 + int_final-total4 + int_final-total5 +
          int_final-total6.
          APPEND int_final.
          v_gtotal1 = v_gtotal1 + int_final-total1.
          v_gtotal2 = v_gtotal2 + int_final-total2.
          v_gtotal3 = v_gtotal3 + int_final-total3.
          v_gtotal4 = v_gtotal4 + int_final-total4.
          v_gtotal5 = v_gtotal5 + int_final-total5.
          v_gtotal6 = v_gtotal6 + int_final-total6.
          v_gtotal = v_gtotal + int_final-total.
          WRITE: /1 sy-vline,
          2 int_final-lifnr COLOR 4 INTENSIFIED ON,
          13 sy-vline,
          14 int_final-name1 COLOR 4 INTENSIFIED ON,
          49 sy-vline.
          DATA : v_rem.
          v_rem = sy-tabix MOD 2.
          IF v_rem NE 0.
            FORMAT COLOR 2 INTENSIFIED.
            WRITE : 50 int_final-total1 CURRENCY int_bsik-waers,
            66 sy-vline,
            67 int_final-total2 CURRENCY int_bsik-waers,
            83 sy-vline,
            84 int_final-total3 CURRENCY int_bsik-waers,
            100 sy-vline,
            101 int_final-total4 CURRENCY int_bsik-waers,
            117 sy-vline,
            118 int_final-total5 CURRENCY int_bsik-waers,
            134 sy-vline,
            135 int_final-total6 CURRENCY int_bsik-waers,
            151 sy-vline,
            152 int_final-total CURRENCY int_bsik-waers,
            168 sy-vline.
          ELSE.
            WRITE : 50 int_final-total1 CURRENCY int_bsik-waers,
            66 sy-vline,
            67 int_final-total2 CURRENCY int_bsik-waers,
            83 sy-vline,
            84 int_final-total3 CURRENCY int_bsik-waers,
            100 sy-vline,
            101 int_final-total4 CURRENCY int_bsik-waers,
            117 sy-vline,
            118 int_final-total5 CURRENCY int_bsik-waers,
            134 sy-vline,
            135 int_final-total6 CURRENCY int_bsik-waers,
            151 sy-vline,
            152 int_final-total CURRENCY int_bsik-waers,
            168 sy-vline.
          ENDIF.
          FORMAT COLOR OFF.
          HIDE int_final.
          CLEAR int_final.
          v_flag = 0.
        ENDIF.
        AT LAST.
          WRITE : /1(168) sy-uline.
          FORMAT COLOR 3 INTENSIFIED.
          WRITE : /1 sy-vline, 2(47) 'GRAND TOTAL'(022) CENTERED,
          49 sy-vline, 50 v_gtotal1 CURRENCY int_bsik-waers,
          66 sy-vline, 67 v_gtotal2 CURRENCY int_bsik-waers,
          83 sy-vline, 84 v_gtotal3 CURRENCY int_bsik-waers,
          100 sy-vline,101 v_gtotal4 CURRENCY int_bsik-waers,
          117 sy-vline,118 v_gtotal5 CURRENCY int_bsik-waers,
          134 sy-vline,135 v_gtotal6 CURRENCY int_bsik-waers,
          151 sy-vline,152 v_gtotal CURRENCY int_bsik-waers,
          168 sy-vline.
          HIDE : v_gtotal1,
          v_gtotal2,
          v_gtotal3,
          v_gtotal4,
          v_gtotal5,
          v_gtotal6,
          v_gtotal.
        ENDAT.
        FORMAT COLOR OFF.
      ENDLOOP.
      WRITE : /1(168) sy-uline.
    ENDFORM. " basic_list
    *& Form line_selection
    When double clicked on the line display the seconday list
    FORM line_selection .
      NEW-PAGE LINE-SIZE 206.
    Sy-lsind = 1.
      DATA : v_rem,v_cnt LIKE sy-tabix.
      v_cnt = 0.
      SORT int_bsik BY belnr zfbdt.
      LOOP AT int_bsik WHERE lifnr EQ int_final-lifnr.
        v_rem = v_cnt MOD 2.
        CLEAR v_date.
        IF int_bsik-zbd3t <> ' '.
          v_date = int_bsik-zfbdt + int_bsik-zbd3t.
        ELSE.
          IF int_bsik-zbd2t <> ' '.
            v_date = int_bsik-zfbdt + int_bsik-zbd2t.
          ELSE.
            v_date = int_bsik-zfbdt + int_bsik-zbd1t.
          ENDIF.
        ENDIF.
        IF int_bsik-zbd1t = ' '.
          v_date = int_bsik-zfbdt.
        ENDIF.
        IF v_rem NE 0.
          FORMAT COLOR 2 INTENSIFIED.
          WRITE :/1 sy-vline, 2 int_bsik-belnr,
          12 sy-vline,13 int_bsik-lifnr,
          23 sy-vline,24 int_bsik-name1,
          59 sy-vline,60 int_bsik-xblnr,
          76 sy-vline,77 int_bsik-zfbdt,
          87 sy-vline.
          WRITE : 104 sy-vline,121 sy-vline,
          138 sy-vline,155 sy-vline,
          172 sy-vline, 189 sy-vline,
          190 int_bsik-dmbtr CURRENCY int_bsik-waers,
          206 sy-vline.
          IF v_date IN r_date1.
            v_subtotal1 = v_subtotal1 + int_bsik-dmbtr.
            WRITE : 88 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date IN r_date2.
            v_subtotal2 = v_subtotal2 + int_bsik-dmbtr.
            WRITE : 105 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date IN r_date3.
            v_subtotal3 = v_subtotal3 + int_bsik-dmbtr.
            WRITE : 122 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date IN r_date4.
            v_subtotal4 = v_subtotal4 + int_bsik-dmbtr.
            WRITE : 139 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date > r_date4-high.
            v_subtotal5 = v_subtotal5 + int_bsik-dmbtr.
            WRITE : 156 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date < p_allgst.
            v_subtotal6 = v_subtotal6 + int_bsik-dmbtr.
            WRITE : 173 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ENDIF.
          FORMAT COLOR OFF.
        ELSE.
          WRITE :/1 sy-vline, 2 int_bsik-belnr,
          12 sy-vline,13 int_bsik-lifnr,
          23 sy-vline,24 int_bsik-name1,
          59 sy-vline,60 int_bsik-xblnr,
          76 sy-vline,77 int_bsik-zfbdt,
          87 sy-vline.
          WRITE : 104 sy-vline,121 sy-vline,
          138 sy-vline,155 sy-vline,
          172 sy-vline,189 sy-vline,
          190 int_bsik-dmbtr CURRENCY int_bsik-waers,
          206 sy-vline.
          IF v_date IN r_date1.
            v_subtotal1 = v_subtotal1 + int_bsik-dmbtr.
            WRITE : 88 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date IN r_date2.
            v_subtotal2 = v_subtotal2 + int_bsik-dmbtr.
            WRITE : 105 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date IN r_date3.
            v_subtotal3 = v_subtotal3 + int_bsik-dmbtr.
            WRITE : 122 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date IN r_date4.
            v_subtotal4 = v_subtotal4 + int_bsik-dmbtr.
            WRITE : 139 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date > r_date4-high.
            v_subtotal5 = v_subtotal5 + int_bsik-dmbtr.
            WRITE : 156 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ELSEIF v_date < p_allgst.
            v_subtotal6 = v_subtotal6 + int_bsik-dmbtr.
            WRITE : 173 int_bsik-dmbtr CURRENCY int_bsik-waers.
          ENDIF.
        ENDIF.
        FORMAT COLOR OFF.
        v_cnt = v_cnt + 1.
      ENDLOOP.
      WRITE : /1(206) sy-uline.
      v_subtotal = v_subtotal1 + v_subtotal2 + v_subtotal3
      + v_subtotal4 + v_subtotal5 + v_subtotal6.
      FORMAT COLOR 3 INTENSIFIED.
      WRITE : /1 sy-vline,
      2(85) 'Total'(017) CENTERED CURRENCY int_bsik-waers ,
      87 sy-vline,
      88 v_subtotal1 CURRENCY int_bsik-waers,
      104 sy-vline,
      105 v_subtotal2 CURRENCY int_bsik-waers,
      121 sy-vline,
      122 v_subtotal3 CURRENCY int_bsik-waers,
      138 sy-vline,
      139 v_subtotal4 CURRENCY int_bsik-waers,
      155 sy-vline,
      156 v_subtotal5 CURRENCY int_bsik-waers,
      172 sy-vline,
      173 v_subtotal6 CURRENCY int_bsik-waers,
      189 sy-vline,
      190 v_subtotal CURRENCY int_bsik-waers,
      206 sy-vline.
      FORMAT COLOR OFF.
      WRITE : /1(206) sy-uline.
      CLEAR : v_subtotal,v_subtotal1,v_subtotal2,v_subtotal3,
      v_subtotal4,v_subtotal5,v_gtotal1,v_gtotal2,v_gtotal3,
      v_gtotal4, v_gtotal5,v_gtotal,v_subtotal6,v_gtotal6.
    ENDFORM. " line_selection
    *& Form header1
    Secondary List Header
    FORM header1 .
    Standard header
      CLEAR: v_date1, v_str, v_str1, v_tage.
      WRITE p_allgst TO v_date1.
      MOVE p_tage4 TO v_tage.
      CONCATENATE '>' v_tage text-025 INTO v_str1.
      CONCATENATE
      'Details of Ageing Analysis for Vendor Open Invoices as on'(024)
      v_date1 INTO v_str SEPARATED BY space.
    CALL FUNCTION 'Z_STANDARD_HEADER'
       EXPORTING
         title1 = 'Saudi International Petrochemical Company'(012)
         title2 = v_str.
      FORMAT COLOR 1 INTENSIFIED.
      WRITE :/1(206) sy-uline.
      WRITE :/1 sy-vline,12 sy-vline ,
      23 sy-vline,59 sy-vline,76 sy-vline,87 sy-vline,
      88(101) 'Invoices Due For(In Days)'(014) CENTERED,
      189 sy-vline,206 sy-vline.
      WRITE : /1 sy-vline, 2(10) 'Doc Number'(021) CENTERED,
      12 sy-vline, 13(10) 'Vendor#'(015) CENTERED,
      23 sy-vline, 24(35) 'Vendor Name'(016) CENTERED,
      59 sy-vline, 60(16) 'Ref invoice#'(019) CENTERED,
      76 sy-vline, 77(10) 'Inv dt'(020) CENTERED,
      87 sy-vline, 88(101) sy-uline,
      189 sy-vline,190(16) 'Total'(017) CENTERED,
      206 sy-vline.
      WRITE : /1 sy-vline, 12 sy-vline,
      23 sy-vline,59 sy-vline,
      76 sy-vline,87 sy-vline,
      88(16) v_fir CENTERED, 104 sy-vline,
      105(16) v_sec CENTERED, 121 sy-vline,
      122(16) v_thir CENTERED, 138 sy-vline,
      139(16) v_four CENTERED, 155 sy-vline,
      156(16) v_str1 CENTERED,
      172 sy-vline,
      173(16) 'Already Overdue'(018) CENTERED,
      189 sy-vline,
      206 sy-vline.
      FORMAT COLOR OFF.
      WRITE : /1(206) sy-uline.
    ENDFORM.                                                    " header1

    Hi Abhay,
    After moving the whole data into final internal table, pass that internal table to function module REUSE_ALV_GRID_DISPLAY.
    before that you need to build field catalog and have to build layout with all the required columns.
    Go through the below links for your reference.
    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
    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
    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
    Check this for basic concepts of OOPS
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/abap%20objects/abap%20code%20sample%20to%20learn%20basic%20concept%20of%20object-oriented%20programming.doc
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20display%20data%20in%20alv%20grid%20using%20object%20oriented%20programming.doc
    Tabstrip
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20for%20tab%20strip%20in%20alv.pdf
    Editable ALV
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/abap%20code%20samples/alv%20grid/abap%20code%20sample%20to%20edit%20alv%20grid.doc
    Tree
    http://www.sapdevelopment.co.uk/reporting/alv/alvtree/alvtree_usrint.htm
    General Tutorial for OOPS
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an%20easy%20reference%20for%20alv%20grid%20control.pdf
    http://www.sapdevelopment.co.uk/reporting/alvhome.htm
    http://www.sap-img.com/abap/what-is-alv-programming.htm
    http://www.sap-img.com/abap-function.htm
    http://www.geocities.com/mpioud/Abap_programs.html
    http://www.sapdevelopment.co.uk/reporting/alv/alvtree%5Calvtree_basic.htm
    http://esnips.com/doc/ad20dca9-6182-4903-8d8f-96a66dc8590c/ALV.pdf
    http://www.sap-img.com/abap-function.htm
    Go thru these programs they may help u to try on some hands on
    ALV Demo program
    BCALV_DEMO_HTML
    BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode
    BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode
    BCALV_GRID_DEMO Simple ALV Control Call Demo Program
    BCALV_TREE_DEMO Demo for ALV tree control
    BCALV_TREE_SIMPLE_DEMO
    BC_ALV_DEMO_HTML_D0100
    The common features of report are column alignment, sorting, filtering, subtotals, totals etc. To implement these, a lot of coding and logic is to be put. To avoid that we can use a concept called ABAP List Viewer (ALV).
    This helps us to implement all the features mentioned very effectively.
    Using ALV, We can have three types of reports:
    1. Simple Report
    2. Block Report
    3. Hierarchical Sequential Report
    There are some function modules which will enable to produce the above reports without much effort.
    All the definitions of internal tables, structures and constants are declared in a type-pool called SLIS.
    1. SIMPLE REPORT.
    The important function modules are
    a. Reuse_alv_list_display
    b. Reuse_alv_fieldcatalog_merge
    c. Reuse_alv_events_get
    d. Reuse_alv_commentary_write
    e. Reuse_alv_grid_display
    A. REUSE_ALV_LIST_DISPLAY : This is the function module which prints the data.
    The important parameters are :
    I. Export :
    i. I_callback_program : report id
    ii. I_callback_pf_status_set : routine where a user can set his own pf status or change the functionality of the existing pf status
    iii. I_callback_user_command : routine where the function codes are handled
    iv. I_structure name : name of the dictionary table
    v. Is_layout : structure to set the layout of the report
    vi. It_fieldcat : internal table with the list of all fields and their attributes which are to be printed (this table can be populated automatically by the function module REUSE_ALV_FIELDCATALOG_MERGE
    vii. It_events : internal table with a list of all possible events of ALV and their corresponding form names.
    II. Tables :
    i. t_outtab : internal table with the data to be output
    B. REUSE_ALV_FIELDCATALOG_MERGE : This function module is used to populate a fieldcatalog which is essential to display the data in ALV. If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter(I_structure name) in the REUSE_ALV_LIST_DISPLAY. But in other cases we need to create it.
    The Important Parameters are :
    I. Export :
    i. I_program_name : report id
    ii. I_internal_tabname : the internal output table
    iii. I_inclname : include or the report name where all the dynamic forms are handled.
    II Changing
    ct_fieldcat : an internal table with the type SLIS_T_FIELDCAT_ALV which is
    declared in the type pool SLIS.
    C. REUSE_ALV_EVENTS_GET : Returns table of possible events for a list type
    Parameters :
    I. Import :
    Et_Events : The event table is returned with all possible CALLBACK events
    for the specified list type (column 'NAME'). For events to be processed by Callback, their 'FORM' field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field 'FORM' filled and the entry modified using constants from the type pool SALV.
    II. Export :
    I_List_type :
    0 = simple list REUSE_ALV_LIST_DISPLAY
    1 = hierarchcal-sequential list REUSE_ALV_HIERSEQ_LIST_DISPLAY
    2 = simple block list REUSE_ALV_BLOCK_LIST_APPEND
    3 = hierarchical-sequential block list
    REUSE_ALV_BLOCK_LIST_HS_APPEND
    D. REUSE_ALV_COMMENTARY_WRITE : This is used in the Top-of-page event to print the headings and other comments for the list.
    Parameters :
    I. it_list_commentary : internal table with the headings of the type slis_t_listheader.
    This internal table has three fields :
    Typ : ‘H’ – header, ‘S’ – selection , ‘A’ - action
    Key : only when typ is ‘S’.
    Info : the text to be printed
    E. REUSE_ALV_GRID_DISPLAY : A new function in 4.6 version, to display the results in grid rather than as a preview.
    Parameters : same as reuse_alv_list_display
    This is an example for simple list.
    2. BLOCK REPORT
    This is used to have multiple lists continuously.
    The important functions used in this report are:
    A. REUSE_ALV_BLOCK_LIST_INIT
    B. REUSE_ALV_BLOCK_LIST_APPEND
    C. REUSE_ALV_BLOCK_LIST_HS_APPEND
    D. REUSE_ALV_BLOCK_LIST_DISPLAY
    A. REUSE_ALV_BLOCK_LIST_INIT
    Parameters:
    I. I_CALLBACK_PROGRAM
    II. I_CALLBACK_PF_STATUS_SET
    III. I_CALLBACK_USER_COMMAND
    This function module is used to set the default gui status etc.
    B. REUSE_ALV_BLOCK_LIST_APPEND
    Parameters :
    Export :
    I. is_layout : layout settings for block
    II. it_fieldcat : field catalog
    III. i_tabname : internal table name with output data
    IV. it_events : internal table with all possible events
    Tables :
    i. t_outtab : internal table with output data.
    This function module adds the data to the block.
    Repeat this function for all the different blocks to be displayed one after the other.
    C. REUSE_ALV_BLOCK_LIST_HS_APPEND
    This function module is used for hierarchical sequential blocks.
    D. REUSE_ALV_BLOCK_LIST_DISPLAY
    Parameters : All the parameters are optional.
    This function module display the list with data appended by the above function.
    Here the functions REUSE_ALV_FIELDCATALOG_MERGE, REUSE_ALV_EVENTS_GET, REUSE_ALV_COMMENTARY_WRITE can be used.
    3. Hierarchical reports :
    Hierarchical sequential list output.
    The function module is
    A. REUSE_ALV_HIERSEQ_LIST_DISPLAY
    Parameters:
    I. Export:
    i. I_CALLBACK_PROGRAM
    ii. I_CALLBACK_PF_STATUS_SET
    iii. I_CALLBACK_USER_COMMAND
    iv. IS_LAYOUT
    v. IT_FIELDCAT
    vi. IT_EVENTS
    vii. i_tabname_header : Name of the internal table in the program containing the
    output data of the highest hierarchy level.
    viii. i_tabname_item : Name of the internal table in the program containing the
    output data of the lowest hierarchy level.
    ix. is_keyinfo : This structure contains the header and item table field
    names which link the two tables (shared key).
    II. Tables
    i. t_outtab_header : Header table with data to be output
    ii. t_outtab_item : Name of the internal table in the program containing the
    output data of the lowest hierarchy level.
    slis_t_fieldcat_alv : This internal table contains the field attributes. This internal table can be populated automatically by using ‘REUSE_ALV_FIELDCATALOG_MERGE’.
    Important Attributes :
    A. col_pos : position of the column
    B. fieldname : internal fieldname
    C. tabname : internal table name
    D. ref_fieldname : fieldname (dictionary)
    E. ref_tabname : table (dictionary)
    F. key(1) : column with key-color
    G. icon(1) : icon
    H. symbol(1) : symbol
    I. checkbox(1) : checkbox
    J. just(1) : (R)ight (L)eft (C)ent.
    K. do_sum(1) : sum up
    L. no_out(1) : (O)blig.(X)no out
    M. outputlen : output length
    N. seltext_l : long key word
    O. seltext_m : middle key word
    P. seltext_s : short key word
    Q. reptext_ddic : heading (ddic)
    R. ddictxt(1) : (S)hort (M)iddle (L)ong
    S. datatype : datatype
    T. hotspot(1) : hotspot
    <b>Reward points for helpful answers,</b>
    Satish

  • Printing from ALV Grid

    Hi Friends,
    I am facing a problem while printing a report from ALV grid .. The report display is coming perfectly based on the SORT criteria .. but while trying  to print or print preview or Download to  Excel  the sorting is not working .. If any one know how to print the report as it look like the  screen display ..Please let me know..
    Thanks in advance..
    Regards.
    Elango

    Hi Vinni,
    Thanks for your repaly , I am using 4.7.
    Function module used to display grid is  REUSE_ALV_GRID_DISPLAY and for  
    build the field catlog  I am using REUSE_ALV_FIELDCATALOG_MERGE 
    function module .
    Regards,
    Elango

  • ALV Report doubt

    Hi All
    I am creating a ALV report and had realized that we can use REUSE_ALV_FIELDCATALOG_MERGE to create a fieldcatalog.
    However in I_STRUCTURE_NAME parameters I have to pass only structure that are defined in DDIC. I can"t pass my internal table defined for output.
    So this option maynot be much useful. instead I can build fieldcatalog manually.
    Am I right ? also at this time I am only concentrating on ALV using Functional Modules. Please let me know.
    Regards
    Madhu.

    Hi ERIC and others,
    Thanks you once again.
    Can you please let me know where I am doing mistake, i am not getting totals on price but I getting sort on carrid and they are grouping.
    Please help me.
    REPORT  ZALV_REPORT_SFLIGHT.
    TABLES : SFLIGHT.
    TYPE-POOLS : SLIS.
    DATA :   IT_SFLIGHT TYPE TABLE OF SFLIGHT.
    **DATA DECLARTION
    DATA: FIELDCATALOG TYPE SLIS_T_FIELDCAT_ALV WITH HEADER LINE,
          GD_sort type STANDARD TABLE OF slis_sortinfo_alv WITH HEADER LINE,
          I_REPID      LIKE SY-REPID.
    i_repid = sy-repid.
    perform get_data.
    perform build_fieldcat.
    perform display.
    *&      Form  get_data
    form get_data .
    select * from sflight into table it_sflight.
    endform.                    " get_data
    *&      Form  build_fieldcat
    form build_fieldcat .
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
       I_PROGRAM_NAME               = i_repid
       I_INTERNAL_TABNAME           = 'IT_SFLIGHT'
       I_STRUCTURE_NAME             = 'SFLIGHT'
      I_CLIENT_NEVER_DISPLAY       = 'X'
      I_INCLNAME                   =
      I_BYPASSING_BUFFER           =
      I_BUFFER_ACTIVE              =
      CHANGING
        ct_fieldcat                  = FIELDCATALOG[]
    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.
    GD_sort-fieldname = 'CARRID'.
    GD_sort-tabname = 'SFLIGHT'.
    *GD_sort-up  =
    *GD_sort-down =
    *GD_sort-group = 'X'.
    GD_sort-subtot = 'X'.
    append gd_sort TO GD_SORT.
    endform.                    " build_fieldcat
    *&      Form  display
    form display .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = I_REPID
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
       IT_FIELDCAT                       = FIELDCATALOG[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
        IT_SORT                           = GD_sort[]
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        t_outtab                          = IT_SFLIGHT
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    endform.                    " display
    Thank you

  • Need to display two ALV GRIDs in a single screen

    Hi,
    I have a question, i'm using version 4.6. I want to display 2 ALVs in a single screen or by calling.
    Step 1 : The internal table (which holds the data for the ALVs has to be populated before calling ALV1 or ALV2) 
    Step 2 : Display In a single report
    ALV1 report (Editable ,Has to be a GRID)
    ALV2 report (Non Editable, Has to be a GRID)
                             (or)
    Step 1 : The internal table (which holds the data for the ALVs has to be populated before calling ALV1 or ALV2)
    Step 2 :
    ALV1 report (Editable ,Has to be a GRID, with a custom button to call ALV2 hiding the ALV1 ie not visible to user)
    ALV2 report (Non Editable ,Has to be a GRID, with a custom button to call ALV1 hiding the ALV2 ie not visible to user)
    Please help me <b><REMOVED BY MODERATOR></b>
    Message was edited by:
            Alvaro Tejada Galindo

    Hi
    ABAP List Viewer
    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
    Go thru these programs they may help u to try on some hands on
    ALV Demo program
    BCALV_DEMO_HTML
    BCALV_FULLSCREEN_DEMO ALV Demo: Fullscreen Mode
    BCALV_FULLSCREEN_DEMO_CLASSIC ALV demo: Fullscreen mode
    BCALV_GRID_DEMO Simple ALV Control Call Demo Program
    BCALV_TREE_DEMO Demo for ALV tree control
    BCALV_TREE_SIMPLE_DEMO
    BC_ALV_DEMO_HTML_D0100
    The common features of report are column alignment, sorting, filtering, subtotals, totals etc. To implement these, a lot of coding and logic is to be put. To avoid that we can use a concept called ABAP List Viewer (ALV).
    This helps us to implement all the features mentioned very effectively.
    Using ALV, We can have three types of reports:
    1. Simple Report
    2. Block Report
    3. Hierarchical Sequential Report
    There are some function modules which will enable to produce the above reports without much effort.
    All the definitions of internal tables, structures and constants are declared in a type-pool called SLIS.
    1. SIMPLE REPORT.
    The important function modules are
    a. Reuse_alv_list_display
    b. Reuse_alv_fieldcatalog_merge
    c. Reuse_alv_events_get
    d. Reuse_alv_commentary_write
    e. Reuse_alv_grid_display
    A. REUSE_ALV_LIST_DISPLAY : This is the function module which prints the data.
    The important parameters are :
    I. Export :
    i. I_callback_program : report id
    ii. I_callback_pf_status_set : routine where a user can set his own pf status or change the functionality of the existing pf status
    iii. I_callback_user_command : routine where the function codes are handled
    iv. I_structure name : name of the dictionary table
    v. Is_layout : structure to set the layout of the report
    vi. It_fieldcat : internal table with the list of all fields and their attributes which are to be printed (this table can be populated automatically by the function module REUSE_ALV_FIELDCATALOG_MERGE
    vii. It_events : internal table with a list of all possible events of ALV and their corresponding form names.
    II. Tables :
    i. t_outtab : internal table with the data to be output
    B. REUSE_ALV_FIELDCATALOG_MERGE : This function module is used to populate a fieldcatalog which is essential to display the data in ALV. If the output data is from a single dictionary table and all the columns are selected, then we need not exclusively create the field catalog. Its enough to mention the table name as a parameter(I_structure name) in the REUSE_ALV_LIST_DISPLAY. But in other cases we need to create it.
    The Important Parameters are :
    I. Export :
    i. I_program_name : report id
    ii. I_internal_tabname : the internal output table
    iii. I_inclname : include or the report name where all the dynamic forms are handled.
    II Changing
    ct_fieldcat : an internal table with the type SLIS_T_FIELDCAT_ALV which is
    declared in the type pool SLIS.
    C. REUSE_ALV_EVENTS_GET : Returns table of possible events for a list type
    Parameters :
    I. Import :
    Et_Events : The event table is returned with all possible CALLBACK events
    for the specified list type (column 'NAME'). For events to be processed by Callback, their 'FORM' field must be filled. If the field is initialized, the event is ignored. The entry can be read from the event table, the field 'FORM' filled and the entry modified using constants from the type pool SALV.
    II. Export :
    I_List_type :
    0 = simple list REUSE_ALV_LIST_DISPLAY
    1 = hierarchcal-sequential list REUSE_ALV_HIERSEQ_LIST_DISPLAY
    2 = simple block list REUSE_ALV_BLOCK_LIST_APPEND
    3 = hierarchical-sequential block list
    REUSE_ALV_BLOCK_LIST_HS_APPEND
    D. REUSE_ALV_COMMENTARY_WRITE : This is used in the Top-of-page event to print the headings and other comments for the list.
    Parameters :
    I. it_list_commentary : internal table with the headings of the type slis_t_listheader.
    This internal table has three fields :
    Typ : ‘H’ – header, ‘S’ – selection , ‘A’ - action
    Key : only when typ is ‘S’.
    Info : the text to be printed
    E. REUSE_ALV_GRID_DISPLAY : A new function in 4.6 version, to display the results in grid rather than as a preview.
    Parameters : same as reuse_alv_list_display
    This is an example for simple list.
    2. BLOCK REPORT
    This is used to have multiple lists continuously.
    The important functions used in this report are:
    A. REUSE_ALV_BLOCK_LIST_INIT
    B. REUSE_ALV_BLOCK_LIST_APPEND
    C. REUSE_ALV_BLOCK_LIST_HS_APPEND
    D. REUSE_ALV_BLOCK_LIST_DISPLAY
    A. REUSE_ALV_BLOCK_LIST_INIT
    Parameters:
    I. I_CALLBACK_PROGRAM
    II. I_CALLBACK_PF_STATUS_SET
    III. I_CALLBACK_USER_COMMAND
    This function module is used to set the default gui status etc.
    B. REUSE_ALV_BLOCK_LIST_APPEND
    Parameters :
    Export :
    I. is_layout : layout settings for block
    II. it_fieldcat : field catalog
    III. i_tabname : internal table name with output data
    IV. it_events : internal table with all possible events
    Tables :
    i. t_outtab : internal table with output data.
    This function module adds the data to the block.
    Repeat this function for all the different blocks to be displayed one after the other.
    C. REUSE_ALV_BLOCK_LIST_HS_APPEND
    This function module is used for hierarchical sequential blocks.
    D. REUSE_ALV_BLOCK_LIST_DISPLAY
    Parameters : All the parameters are optional.
    This function module display the list with data appended by the above function.
    Here the functions REUSE_ALV_FIELDCATALOG_MERGE, REUSE_ALV_EVENTS_GET, REUSE_ALV_COMMENTARY_WRITE can be used.
    3. Hierarchical reports :
    Hierarchical sequential list output.
    The function module is
    A. REUSE_ALV_HIERSEQ_LIST_DISPLAY
    Parameters:
    I. Export:
    i. I_CALLBACK_PROGRAM
    ii. I_CALLBACK_PF_STATUS_SET
    iii. I_CALLBACK_USER_COMMAND
    iv. IS_LAYOUT
    v. IT_FIELDCAT
    vi. IT_EVENTS
    vii. i_tabname_header : Name of the internal table in the program containing the
    output data of the highest hierarchy level.
    viii. i_tabname_item : Name of the internal table in the program containing the
    output data of the lowest hierarchy level.
    ix. is_keyinfo : This structure contains the header and item table field
    names which link the two tables (shared key).
    II. Tables
    i. t_outtab_header : Header table with data to be output
    ii. t_outtab_item : Name of the internal table in the program containing the
    output data of the lowest hierarchy level.
    slis_t_fieldcat_alv : This internal table contains the field attributes. This internal table can be populated automatically by using ‘REUSE_ALV_FIELDCATALOG_MERGE’.
    Important Attributes :
    A. col_pos : position of the column
    B. fieldname : internal fieldname
    C. tabname : internal table name
    D. ref_fieldname : fieldname (dictionary)
    E. ref_tabname : table (dictionary)
    F. key(1) : column with key-color
    G. icon(1) : icon
    H. symbol(1) : symbol
    I. checkbox(1) : checkbox
    J. just(1) : (R)ight (L)eft (C)ent.
    K. do_sum(1) : sum up
    L. no_out(1) : (O)blig.(X)no out
    M. outputlen : output length
    N. seltext_l : long key word
    O. seltext_m : middle key word
    P. seltext_s : short key word
    Q. reptext_ddic : heading (ddic)
    R. ddictxt(1) : (S)hort (M)iddle (L)ong
    S. datatype : datatype
    T. hotspot(1) : hotspot
    Regards
    Anji

Maybe you are looking for

  • Why does my Macbook freeze when I try to transfer my Powerbook files

    Hello out there I have been having trouble with my PB and could not retrieve any of my files... the bash shell appeared. I thought my files were gone forever. I was able to find my HD through utility disk, great! The problem is that I am trying to re

  • Printing through Windows on Mac with printers set up on Time Capsule?

    I have my printer hooked up to Time Capsule and can print from my Macbook to it no problem. I would like to print from Windows (on my Macbook through Fusion) to the same printer. How do I install that printer in Windows? Do I need to use Bonjour sinc

  • Nokia C7 "Unable to install OVI Store"

    Hi All, Here is my experience from NOKIA C-7 Problem Description: “Unable to install OVI Store" Installed Version: ----------START------------- Phone Model: Nokia C-7 Nokia Ovi Suite 3.0.0.284 PC Connectivity Solution 10.50.2.0 Connectivity Cable Dri

  • Preview mode is blank

    After spending most of the day designing pages and successfully previewing them, the preview mode now just shows a blank page. I have closed and re-opend the project to no avail. I can only see my site.page via design, exported or previewed via brows

  • Brush Opacity Less Than 100%

    I am using Photoshop CC 2014.   On application of a Brush stroke, the color laid down is less, far less, than the 100% that is set for Opacity and Flow.  This problem does not exist with the installed Photoshop CC.  Probably, if I were to guess, the