Skip to Content
author's profile photo Former Member
Former Member

alv report

hello,

i want to know about daily alv flash report.

please give with one example.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

2 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2008 at 08:09 AM

    Hi

    Please daily sales alv report,

    report zcra0002.

    ----


    tables : vbak,vbap.

    ----


    • TYPE-POOLS *

    ----


    type-pools slis .

    *Sales Document: Header Data

    data : begin of wt_vbak occurs 0,

    vbeln like vbak-vbeln,

    erdat like vbak-erdat,

    kunnr like vbak-kunnr,

    end of wt_vbak.

    *Sales Document: Item Data

    data : begin of wt_vbap occurs 0,

    vbeln like vbap-vbeln,

    posnr like vbap-posnr,

    matnr like vbap-matnr,

    arktx like vbap-arktx,

    kwmeng like vbap-kwmeng,

    werks like vbap-werks,

    erdat like vbak-erdat,

    kunnr like vbak-kunnr,

    end of wt_vbap.

    *Sales Document Flow

    data : begin of wt_vbfa occurs 0,

    vbelv like vbfa-vbelv,

    posnv like vbfa-posnv,

    vbeln like vbfa-vbeln,

    posnn like vbfa-posnn,

    vbtyp_n like vbfa-vbtyp_n,

    end of wt_vbfa.

    • Sales Document Flow

    data : begin of wt_vbfa1 occurs 0,

    vbelv like vbfa-vbelv,

    posnv like vbfa-posnv,

    vbeln like vbfa-vbeln,

    posnn like vbfa-posnn,

    vbtyp_n like vbfa-vbtyp_n,

    end of wt_vbfa1.

    *SD Document: Delivery Header Data

    data : begin of wt_likp occurs 0,

    vbeln like likp-vbeln,

    lfdat like likp-lfdat,

    end of wt_likp.

    *SD document: Delivery: Item data

    data : begin of wt_lips occurs 0,

    vbeln like lips-vbeln,

    posnr like lips-posnr,

    lfimg like lips-lfimg,

    meins like lips-meins,

    end of wt_lips.

    *Delivery Note Additional Quantity (L20)

    data : begin of wt_lipso2 occurs 0,

    vbeln like lipso2-vbeln,

    posnr like lipso2-posnr,

    msehi like lipso2-msehi,

    adqntp like lipso2-adqntp,

    end of wt_lipso2.

    • Final Table for ALV Display

    data : begin of wt_final occurs 0,

    erdat like vbak-erdat,

    vbeln like vbap-vbeln,

    posnr like vbap-posnr,

    kunnr like vbak-kunnr,

    name1 like kna1-name1,

    matnr like vbap-matnr ,

    arktx like vbap-arktx,

    kwmeng like vbap-kwmeng,

    werks like vbap-werks,

    delno like likp-vbeln,

    delitem like lips-posnr,

    deldate like likp-lfdat,

    delquan like lips-lfimg,

    uom like lips-meins,

    altuom like lipso2-msehi,

    quanl20 like lips-lfimg,

    invoice like vbrk-vbeln,

    invitem like vbrp-posnr,

    end of wt_final.

    *Billing Document: Header Data

    data : begin of wt_vbrk occurs 0,

    vbeln like vbrk-vbeln,

    fksto like vbrk-fksto,

    end of wt_vbrk.

    • Customer Details

    data : begin of wt_kna1 occurs 0,

    kunnr like kna1-kunnr,

    name1 like kna1-name1,

    end of wt_kna1.

    ----


    • ALV DATA *

    ----


    data : ws_alvfield type slis_fieldcat_alv ,

    wt_fieldcat type slis_t_fieldcat_alv.

    ----


    • VARIABLES *

    ----


    • DATA : WV_

    ----


    • CONSTANTS *

    ----


    • CONSTANTS : WC_

    ----


    • PARAMETERS / SELECTION SCREEN *

    ----


    selection-screen begin of block b1 with frame

    title text-001.

    select-options s_werks for vbap-werks.

    parameters p_vkorg like vbak-vkorg obligatory.

    select-options : s_vtweg for vbak-vtweg,

    s_spart for vbak-spart,

    s_erdat for vbak-erdat obligatory.

    selection-screen end of block b1.

    ************************************************************************

    • AT SELECTION-SCREEN *

    ************************************************************************

    at selection-screen.

    ************************************************************************

    • INITIALIZATION *

    ************************************************************************

    initialization.

    ************************************************************************

    • START-OF-SELECTION *

    ************************************************************************

    start-of-selection.

    perform select_data.

    perform prepare_data.

    ************************************************************************

    • END-OF-SELECTION *

    ************************************************************************

    end-of-selection.

    perform display_data.

    ************************************************************************

    • SUB ROUTINES *

    ************************************************************************

    &----


    *& Form select_data

    &----


    form select_data .

    data wlt_vbak like wt_vbak occurs 0 with header line.

    data wlt_vbfa1 like wt_vbfa1 occurs 0 with header line.

    select vbeln erdat kunnr

    from vbak

    into table wt_vbak

    where erdat in s_erdat

    and vkorg = p_vkorg

    and vtweg in s_vtweg

    and spart in s_spart.

    if sy-subrc = 0.

    wlt_vbak[] = wt_vbak[].

    sort wlt_vbak by kunnr.

    delete adjacent duplicates from wlt_vbak

    comparing kunnr.

    select kunnr name1 from kna1

    into table wt_kna1

    for all entries in wlt_vbak

    where kunnr = wlt_vbak-kunnr.

    if sy-subrc = 0.

    sort wt_kna1 by kunnr.

    endif.

    sort wt_vbak by vbeln.

    select vbeln posnr matnr arktx kwmeng werks

    from vbap

    into table wt_vbap

    for all entries in wt_vbak

    where vbeln = wt_vbak-vbeln

    and werks in s_werks.

    if sy-subrc = 0.

    sort wt_vbap by vbeln posnr.

    select vbelv posnv vbeln posnn vbtyp_n

    into table wt_vbfa

    from vbfa

    for all entries in wt_vbap

    where vbelv = wt_vbap-vbeln

    and posnv = wt_vbap-posnr

    and vbtyp_n = 'J'.

    if sy-subrc = 0.

    sort wt_vbfa by vbeln posnn.

    delete adjacent duplicates from wt_vbfa

    comparing vbeln posnn.

    select vbelv posnv vbeln posnn vbtyp_n

    into table wt_vbfa1

    from vbfa

    for all entries in wt_vbfa

    where vbelv = wt_vbfa-vbeln

    and posnv = wt_vbfa-posnn

    and vbtyp_n = 'M'.

    if sy-subrc = 0.

    sort wt_vbfa1 by vbeln posnn.

    wlt_vbfa1[] = wt_vbfa1[].

    sort wlt_vbfa1 by vbeln.

    delete adjacent duplicates from wlt_vbfa1

    comparing vbeln.

    select vbeln fksto from vbrk

    into table wt_vbrk

    for all entries in wlt_vbfa1

    where vbeln = wlt_vbfa1-vbeln.

    endif.

    select vbeln lfdat

    from likp

    into table wt_likp

    for all entries in wt_vbfa

    where vbeln = wt_vbfa-vbeln.

    if sy-subrc = 0.

    sort wt_likp by vbeln.

    endif.

    select vbeln posnr lfimg meins

    from lips

    into table wt_lips

    for all entries in wt_vbfa

    where vbeln = wt_vbfa-vbeln

    and posnr = wt_vbfa-posnn.

    select vbeln posnr msehi adqntp

    from lipso2

    into table wt_lipso2

    for all entries in wt_vbfa

    where vbeln = wt_vbfa-vbeln

    and posnr = wt_vbfa-posnn

    and msehi in ('L','L20').

    endif.

    endif.

    endif.

    endform. " select_data

    &----


    *& Form prepare_data

    &----


    form prepare_data .

    • Local Data

    data wlt_vbfa like wt_vbfa occurs 0 with header line.

    data : begin of wls_struct1,

    vbeln like vbap-vbeln,

    posnr like vbap-posnr,

    end of wls_struct1.

    data : begin of wls_struct2,

    vbeln like vbfa-vbelv,

    posnr like vbfa-posnv,

    end of wls_struct2.

    data : begin of wlt_delivery occurs 0,

    vbeln like lips-vbeln,

    posnr like lips-posnr,

    order like vbap-vbeln,

    oitem like vbap-posnr,

    lfimg like lips-lfimg,

    meins like lips-meins,

    altuom like lips-meins,

    quanl20 like lips-lfimg,

    lfdat like likp-lfdat,

    invoice like vbrk-vbeln,

    invitem like vbrp-posnr,

    end of wlt_delivery.

    data wlv_index like sy-tabix.

    data wlv_index1 like sy-tabix.

    data : wlv_adqntpl like lipso2-adqntp,

    wlv_adqntpl20 like lipso2-adqntp,

    wlv_factor like lipso2-adqntp.

    *Local Data ///

    sort wt_vbrk by vbeln.

    sort wt_vbfa1 by vbeln posnn.

    • Delete the Cancelled Invoices

    wlv_index = 1.

    loop at wt_vbrk.

    loop at wt_vbfa1 from wlv_index.

    if wt_vbfa1-vbeln > wt_vbrk-vbeln.

    wlv_index = sy-tabix.

    exit.

    elseif wt_vbfa1-vbeln = wt_vbrk-vbeln.

    if wt_vbrk-fksto = 'X'.

    wt_vbfa1-vbeln = 'X'.

    modify wt_vbfa1 transporting vbeln.

    clear wt_vbfa1.

    endif.

    endif.

    endloop.

    endloop.

    delete wt_vbfa1 where vbeln = 'X'.

    • Merge Invoices and Deliveries

    sort wt_vbfa1 by vbelv posnv.

    loop at wt_vbfa1.

    wlt_delivery-invoice = wt_vbfa1-vbeln.

    wlt_delivery-invitem = wt_vbfa1-posnn.

    wlt_delivery-vbeln = wt_vbfa1-vbelv.

    wlt_delivery-posnr = wt_vbfa1-posnv.

    append wlt_delivery.

    clear wlt_delivery.

    endloop.

    • Merge Delivery Item details

    sort wlt_delivery by vbeln posnr.

    wlv_index = 1.

    loop at wt_lips.

    wls_struct1-vbeln = wt_lips-vbeln.

    wls_struct1-posnr = wt_lips-posnr.

    loop at wlt_delivery from wlv_index.

    wls_struct2-vbeln = wlt_delivery-vbeln.

    wls_struct2-posnr = wlt_delivery-posnr.

    if wls_struct2 > wls_struct1.

    wlv_index = sy-tabix.

    exit.

    elseif wls_struct2 = wls_struct1.

    wlt_delivery-lfimg = wt_lips-lfimg.

    wlt_delivery-meins = wt_lips-meins.

    modify wlt_delivery transporting lfimg meins.

    clear wlt_delivery.

    endif.

    endloop.

    endloop.

    • Merge Sales Order with Delivery and Invoice

    wlv_index = 1.

    loop at wt_vbfa.

    wls_struct1-vbeln = wt_vbfa-vbeln.

    wls_struct1-posnr = wt_vbfa-posnn.

    loop at wlt_delivery from wlv_index.

    wls_struct2-vbeln = wlt_delivery-vbeln.

    wls_struct2-posnr = wlt_delivery-posnr.

    if wls_struct2 > wls_struct1.

    wlv_index = sy-tabix.

    exit.

    elseif wls_struct2 = wls_struct1.

    wlt_delivery-order = wt_vbfa-vbelv.

    wlt_delivery-oitem = wt_vbfa-posnv.

    modify wlt_delivery transporting order oitem

    lfimg meins.

    clear wlt_delivery.

    endif.

    endloop.

    endloop.

    • Merge the Alternate UOM and Quantity in L20 with Delivery

    sort wlt_delivery by vbeln posnr.

    sort wt_lipso2 by vbeln.

    wlv_index = 1.

    loop at wlt_delivery.

    wlv_index1 = sy-tabix.

    wls_struct1-vbeln = wlt_delivery-vbeln.

    wls_struct1-posnr = wlt_delivery-posnr.

    loop at wt_lipso2 from wlv_index.

    wls_struct2-vbeln = wt_lipso2-vbeln.

    wls_struct2-posnr = wt_lipso2-posnr.

    if wls_struct2 > wls_struct1.

    wlv_index = sy-tabix.

    exit.

    elseif wls_struct2 = wls_struct1.

    if wt_lipso2-msehi = 'L'.

    wlv_adqntpl = wt_lipso2-adqntp.

    elseif wt_lipso2-msehi = 'L20'.

    wlv_adqntpl20 = wt_lipso2-adqntp.

    endif.

    endif.

    endloop.

    if not wlv_adqntpl20 is initial.

    wlt_delivery-altuom = 'L20'.

    wlt_delivery-quanl20 = ( wlv_adqntpl20 / wlv_adqntpl )

    • wlt_delivery-lfimg.

    modify wlt_delivery index wlv_index1

    transporting altuom quanl20.

    endif.

    endloop.

    sort wt_vbfa1 by vbelv posnv.

    sort wlt_delivery by vbeln posnr.

    • Merge the Delivery Date from Header into Items

    wlv_index = 1.

    loop at wt_likp.

    loop at wlt_delivery from wlv_index.

    if wlt_delivery-vbeln > wt_likp-vbeln.

    wlv_index = sy-tabix.

    exit.

    elseif wlt_delivery-vbeln = wt_likp-vbeln.

    wlt_delivery-lfdat = wt_likp-lfdat.

    modify wlt_delivery transporting lfdat.

    endif.

    endloop.

    endloop.

    • Final Table for Display

    sort wlt_delivery by order oitem.

    wlv_index = 1.

    loop at wlt_delivery.

    wt_final-vbeln = wlt_delivery-order.

    wt_final-posnr = wlt_delivery-oitem.

    wt_final-delno = wlt_delivery-vbeln.

    wt_final-delitem = wlt_delivery-posnr.

    wt_final-delquan = wlt_delivery-lfimg.

    wt_final-uom = wlt_delivery-meins.

    wt_final-altuom = wlt_delivery-altuom.

    wt_final-deldate = wlt_delivery-lfdat.

    wt_final-quanl20 = wlt_delivery-quanl20.

    wt_final-invoice = wlt_delivery-invoice.

    wt_final-invitem = wlt_delivery-invitem.

    append wt_final.

    clear wt_final.

    endloop.

    • Merge Sales Header and Sales Items

    sort wt_final by vbeln posnr.

    wlv_index = 1.

    loop at wt_vbak.

    loop at wt_vbap from wlv_index.

    if wt_vbap-vbeln > wt_vbak-vbeln.

    wlv_index = sy-tabix.

    exit.

    elseif wt_vbap-vbeln = wt_vbak-vbeln.

    wt_vbap-erdat = wt_vbak-erdat.

    wt_vbap-kunnr = wt_vbak-kunnr.

    modify wt_vbap transporting erdat kunnr.

    endif.

    endloop.

    endloop.

    • Merge Sales Order Details into Final Table

    wlv_index = 1.

    loop at wt_vbap.

    wls_struct1-vbeln = wt_vbap-vbeln.

    wls_struct1-posnr = wt_vbap-posnr.

    loop at wt_final from wlv_index.

    wls_struct2-vbeln = wt_final-vbeln.

    wls_struct2-posnr = wt_final-posnr.

    if wls_struct2 > wls_struct1.

    wlv_index = sy-tabix.

    exit.

    elseif wls_struct2 = wls_struct1.

    read table wt_kna1 with key kunnr = wt_vbap-kunnr

    binary search.

    if sy-subrc = 0.

    wt_final-name1 = wt_kna1-name1.

    endif.

    wt_final-erdat = wt_vbap-erdat.

    wt_final-matnr = wt_vbap-matnr.

    wt_final-arktx = wt_vbap-arktx.

    wt_final-werks = wt_vbap-werks.

    wt_final-kwmeng = wt_vbap-kwmeng.

    wt_final-kunnr = wt_vbap-kunnr.

    modify wt_final transporting erdat matnr

    arktx kwmeng werks kunnr name1.

    clear wt_final.

    clear : wt_vbap-matnr,wt_vbap-posnr,wt_vbap-arktx,

    wt_vbap-kwmeng,wt_vbap-werks.

    endif.

    endloop.

    endloop.

    endform. " prepare_data

    &----


    *& Form display_data

    &----


    form display_data .

    data wlv_column like sy-cucol.

    data wls_layout type slis_layout_alv.

    data wlv_repid like sy-repid.

    data wlt_sort type slis_t_sortinfo_alv.

    data wls_sort type slis_sortinfo_alv.

    wlv_column = wlv_column + 1.

    ws_alvfield-col_pos = wlv_column.

    ws_alvfield-fieldname = 'ERDAT'.

    ws_alvfield-seltext_l = text-011.

    append ws_alvfield to wt_fieldcat.

    clear ws_alvfield.

    wlv_column = wlv_column + 1.

    ws_alvfield-col_pos = wlv_column.

    ws_alvfield-fieldname = 'VBELN'.

    ws_alvfield-seltext_l = text-012.

    append ws_alvfield to wt_fieldcat.

    clear ws_alvfield.

    wlv_column = wlv_column + 1.

    ws_alvfield-col_pos = wlv_column.

    ws_alvfield-fieldname = 'POSNR'.

    ws_alvfield-seltext_l = text-013.

    append ws_alvfield to wt_fieldcat.

    clear ws_alvfield.

    wlv_column = wlv_column + 1.

    ws_alvfield-col_pos = wlv_column.

    ws_alvfield-fieldname = 'KUNNR'.

    ws_alvfield-seltext_l = text-014.

    append ws_alvfield to wt_fieldcat.

    clear ws_alvfield.

    wlv_column = wlv_column + 1.

    ws_alvfield-col_pos = wlv_column.

    ws_alvfield-fieldname = 'NAME1'.

    ws_alvfield-seltext_l = text-028.

    append ws_alvfield to wt_fieldcat.

    clear ws_alvfield.

    wlv_column = wlv_column + 1.

    ws_alvfield-col_pos = wlv_column.

    ws_alvfield-fieldname = 'MATNR' .

    ws_alvfield-seltext_l = text-015.

    append ws_alvfield to wt_fieldcat.

    clear ws_alvfield.

    wlv_column = wlv_column + 1.

    ws_alvfield-col_pos = wlv_column.

    ws_alvfield-fieldname = 'ARKTX' .

    ws_alvfield-seltext_l = text-016.

    ws_alvfield-do_sum = 'X'.

    append ws_alvfield to wt_fieldcat.

    clear ws_alvfield.

    wlv_column = wlv_column + 1.

    ws_alvfield-col_pos = wlv_column.

    ws_alvfield-fieldname = 'KWMENG' .

    ws_alvfield-seltext_l = text-017.

    append ws_alvfield to wt_fieldcat.

    clear ws_alvfield.

    wlv_column = wlv_column + 1.

    ws_alvfield-col_pos = wlv_column.

    ws_alvfield-fieldname = 'WERKS' .

    ws_alvfield-seltext_l = text-018.

    append ws_alvfield to wt_fieldcat.

    clear ws_alvfield.

    wlv_column = wlv_column + 1.

    ws_alvfield-col_pos = wlv_column.

    ws_alvfield-fieldname = 'DELNO' .

    ws_alvfield-seltext_l = text-019.

    append ws_alvfield to wt_fieldcat.

    clear ws_alvfield.

    wlv_column = wlv_column + 1.

    ws_alvfield-col_pos = wlv_column.

    ws_alvfield-fieldname = 'DELITEM' .

    ws_alvfield-seltext_l = text-020.

    append ws_alvfield to wt_fieldcat.

    clear ws_alvfield.

    wlv_column = wlv_column + 1.

    ws_alvfield-col_pos = wlv_column.

    ws_alvfield-fieldname = 'DELDATE' .

    ws_alvfield-seltext_l = text-021.

    append ws_alvfield to wt_fieldcat.

    clear ws_alvfield.

    wlv_column = wlv_column + 1.

    ws_alvfield-col_pos = wlv_column.

    ws_alvfield-fieldname = 'DELQUAN' .

    ws_alvfield-seltext_l = text-022.

    append ws_alvfield to wt_fieldcat.

    clear ws_alvfield.

    wlv_column = wlv_column + 1.

    ws_alvfield-col_pos = wlv_column.

    ws_alvfield-fieldname = 'UOM' .

    ws_alvfield-seltext_l = text-023.

    append ws_alvfield to wt_fieldcat.

    clear ws_alvfield.

    wlv_column = wlv_column + 1.

    ws_alvfield-col_pos = wlv_column.

    ws_alvfield-fieldname = 'QUANL20'.

    ws_alvfield-seltext_l = text-024.

    append ws_alvfield to wt_fieldcat.

    clear ws_alvfield.

    wlv_column = wlv_column + 1.

    ws_alvfield-col_pos = wlv_column.

    ws_alvfield-fieldname = 'ALTUOM' .

    ws_alvfield-seltext_l = text-025.

    append ws_alvfield to wt_fieldcat.

    clear ws_alvfield.

    wlv_column = wlv_column + 1.

    ws_alvfield-col_pos = wlv_column.

    ws_alvfield-fieldname = 'INVOICE' .

    ws_alvfield-seltext_l = text-026.

    append ws_alvfield to wt_fieldcat.

    clear ws_alvfield.

    wlv_column = wlv_column + 1.

    ws_alvfield-col_pos = wlv_column.

    ws_alvfield-fieldname = 'INVITEM' .

    ws_alvfield-seltext_l = text-027.

    append ws_alvfield to wt_fieldcat.

    clear ws_alvfield.

    wls_sort-fieldname = 'VBELN'.

    wls_sort-tabname = 'WT_FINAL'.

    wls_sort-subtot = 'X'.

    wls_sort-up = 'X'.

    append wls_sort to wlt_sort.

    • FILL THE LAYOUT***************************************

    wlv_repid = sy-repid.

    wls_layout-colwidth_optimize = 'X'.

    wls_layout-zebra = 'X'.

    wls_layout-detail_initial_lines = 'X'.

    wls_layout-detail_popup = 'X'.

    wls_layout-get_selinfos = 'X'.

    wls_layout-group_change_edit = 'X'.

    call function 'REUSE_ALV_GRID_DISPLAY'

    exporting

    i_callback_program = wlv_repid

    is_layout = wls_layout

    it_fieldcat = wt_fieldcat

    it_sort = wlt_sort

    i_default = 'X'

    i_save = 'X'

    tables

    t_outtab = wt_final

    exceptions

    program_error = 1

    others = 2.

    if sy-subrc <> 0.

    message e005(zc).

    endif.

    endform. " display_data

    If it is helpful rewards points

    Regards

    Pratap.M

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Feb 01, 2008 at 08:15 AM

    Hi this will help u.

    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

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.