ALV display column in print only

Hi,
My program uses 'alv_grid_display' and there is a column that i dont want to display on the output (i use gs_fieldcat-no_out = 'X' in the fieldcatalogue), but i do need to display it when its printed and im not sure how to do it as all of that happens after the 'alv_grid_display' statement.
Any ideas??
Thanks

hi ,
this there is no need to write the command it_fieldcat-no_out = 'X'.
use this method..
use the varients for this ....
if u click the button change layout or ctrl+f8 in the menu bar of the alv then it will ask for the sort fields ..there u can sort the fields and u can choose the required ..then u can print the values or u can change the layout if u want...
regards,
venkat.

Similar Messages

  • ALV display column and row wise

    hi experts,
    Is it possible to display in ALV display as 6 fields in column and some ranges in row display so how to display that using alv grid any sample report please do send me.
    e.g.display format.
                   PO Type          Shipping Date          Invoice Num          PCS  #        Po No.          Cust Name          Terms          Open Balance
    Current                                                                           
    Total Current                                                                           
    1 - 15                                                                           
    Total 1 - 15                                                                           
    16-30                                                                           
    Total 16-30                                                                           
    31 - 60                                                                           
    Total 31 - 60                                                                           
    61 - 90                                                                           
    Total 61 - 90                                                                           
    > 90                                                                           
    Total > 90                                                                           
    TOTAL

    hi Lakshman,
    i want report for customer open invoices that is aging report,
    so depens on due days as per ranges shown in my question like 1--15 days,
    15-16 days these are due days ranges , and i have display these related ranges records horizontally , just understand my display format u will get what i mean to say,
    please send me any proper solution.
    Thanks and Regards,
    Yogesh

  • ALV display column

    Dear All,
    Can I get two sub column under one cloumn in ALV report display?
    like '30 days' is first column and under that I need 'USD' and 'EUR'
    Thanks,
    Fed

    Hi Fed,
         I do't think so its possible with FM of ALV's, this can be done using Write statements.
    Regards,
    Suneel Kumar G

  • How To avoid column heading for only total line in ALV list Display

    Hi,
    How To avoid column heading for only total line in ALV list Display.

    Hi,
    to change colunm header field catlog is built
    look at the example below
    Changing column text headers
    use this to change, hide, or alter the ALV columns
    CLEAR: gt_fcat.
    READ TABLE gt_fcat WITH KEY fieldname = 'TEXT1' " ***
    *TEXT1 is your field name
       ASSIGNING <gtfcat>.
    IF sy-subrc = 0.
       <gtfcat>-coltext   = 'Date Type'.
       <gtfcat>-no_out    = ' '.
       <gtfcat>-tooltip   = 'Date Type Text from IT0019'.
       <gtfcat>-seltext   = 'IT0019'.
    keep seltext to '' if u want to hide
    ENDIF.
    regards
    austin

  • ALV  display for  row  s   and columns in this format.have ur full points..

    Hi ALL
      I have to dispalay data in the ALV format as :
    Basic
    DA
    HRA
    PF
    VPF
    20000
    500
    5000
    | 1500     | 600  |          |
    Details :  Basic   HRA in one Row and   PF , VPF in  second Row.
    The Amount  regarding htese fields are also displayed in the next rows for all  emp. numbers.
    its urgent for me and need helpful answers...
    Regards
    Lakhan

    see the attached code it will display the hierarchial display as per your need
    change the internal tables with dat of your own orgn structure and pass it to the fun module.
    Description : Pick Status Report
    This is an ALV report using the heirarchical ALV list display. The
    report selects all deliveries that fulfil the selection criteria
    and displays a summary of all items in that delivery with reference
    to certain statuses: overall status, goods issue status, transfer
    order status, load to pallet status, pallet count status, loaded to
    van status, van manifest printed status and end of day manifest
    printed status. These statuses have been defined by the business.
    There is extra functionality required to trigger printing of the van
    and end of day manifests from this report, and to set the loading
    end status of a shipment if the last handling unit of a particular
    shipment has been loaded onto a van for which the van manifest has
    been triggered.
    REPORT zwmr_pick_status_report NO STANDARD PAGE HEADING
    MESSAGE-ID zw.
    Type Pools
    TYPE-POOLS: icon, slis.
    Tables
    TABLES: tvst,
    likp,
    t30b,
    vekp,
    *{ INSERT UKMK900355 4
    zhu_to_link, "AS03
    *} INSERT
    zpallettr,
    vttk, "MB01
    zvantr.
    Types
    TYPES:
    BEGIN OF ty_data,
    lgtor LIKE likp-lgtor, " door
    vbeln LIKE likp-vbeln, " delivery
    wbstk LIKE vbuk-wbstk, " Goods movement status
    kostk LIKE vbuk-kostk, " Picking status
    posnr LIKE lips-posnr, " item
    route LIKE likp-route, " route
    wadat LIKE likp-wadat, " goods issue date
    lvsta LIKE vbup-lvsta, " warehouse status
    packvorschr LIKE vekp-packvorschr, " pack mnemonic
    exidv LIKE vekp-exidv, " handling unit
    zpallet_no(10), "like zpallettr-zpallet_no, " pallet no
    zdep_point LIKE zpallettr-zdep_point, "Departur Point "Jvdm01
    zcount_check LIKE zpallettr-zcount_check," count check flag
    zvan_no(10), "like zvantr-zvan_no, " van no
    zvan_print LIKE zvantr-zvan_print, " van manifest print
    tknum LIKE vttk-tknum, " Shipment No "ANV 11523
    zeod_print LIKE zvantr-zeod_print, " eod manifest print
    zzpackclass LIKE vekp-zzpackclass, " package class
    zzti LIKE vekp-zzti, " T.I. value
    vstel LIKE likp-vstel, "Shipping point RM050906
    anzpk TYPE znopack, "No of packages in dlv MB01+
    END OF ty_data.
    TYPES:BEGIN OF x_likp ,
    vbeln LIKE likp-vbeln,
    vstel LIKE likp-vstel, "RM050906
    lgtor LIKE likp-lgtor,
    zzroute2lgtor LIKE likp-zzroute2lgtor, "MB01
    route LIKE likp-route,
    wadat LIKE likp-wadat,
    zz2route LIKE likp-zz2route, "MB01+
    zzexproute LIKE likp-zzexproute, "MB01+
    zzroute2 LIKE likp-zzroute2, "MB01+
    anzpk LIKE likp-anzpk,
    END OF x_likp.
    TYPES: BEGIN OF x_vbuk,
    vbeln TYPE vbuk-vbeln,
    wbstk TYPE vbuk-wbstk, " Goods movement status
    kostk TYPE vbuk-kostk, " Picking status
    END OF x_vbuk.
    TYPES: BEGIN OF x_lips,
    vbeln TYPE lips-vbeln, " delivery
    posnr TYPE lips-posnr, " item
    pstyv TYPE lips-pstyv,
    matnr TYPE lips-matnr,
    charg TYPE lips-charg,
    END OF x_lips.
    TYPES: BEGIN OF x_vbup,
    vbeln TYPE vbup-vbeln, " delivery
    posnr TYPE vbup-posnr, " item
    lvsta TYPE vbup-lvsta, " warehouse status
    END OF x_vbup.
    TYPES: BEGIN OF x_vepo,
    venum TYPE vepo-venum, "Internal Handling Unit
    Number
    vepos TYPE vepo-vepos, "Handling Unit Item
    vbeln TYPE vepo-vbeln, " delivery
    posnr TYPE vepo-posnr, " item
    exidv TYPE vekp-exidv,
    END OF x_vepo.
    TYPES: BEGIN OF x_vepo1,
    venum TYPE vekp-venum, "Internal Handling Unit
    Number
    exidv TYPE vekp-exidv,
    END OF x_vepo1.
    Start of changes by ANV SR#11523
    TYPES: BEGIN OF x_vttp,
    tknum TYPE tknum, " Shipment No
    tpnum TYPE tpnum, " Item No
    vbeln TYPE vbup-vbeln, " delivery
    laufk LIKE vttk-laufk, " leg indicator MB01+
    END OF x_vttp.
    End of changes by ANV SR#11523
    Data
    RANGES: r_del FOR likp-vbeln,
    r_lgtor FOR likp-lgtor.
    RANGES: r_vanno FOR zvantr-zvan_no,
    r_palno FOR zpallettr-zpallet_no.
    DATA: BEGIN OF number_range OCCURS 0,
    mark(1),
    id(3),
    num(10) TYPE n,
    desc LIKE zpalletmd-zdesc,
    END OF number_range.
    DATA: t_disp_tab TYPE STANDARD TABLE OF zpickdisp,
    t_data_tab TYPE ty_data OCCURS 0 WITH HEADER LINE,
    it_likp TYPE x_likp OCCURS 0 WITH HEADER LINE, "SUM
    it_vbuk TYPE x_vbuk OCCURS 0 WITH HEADER LINE, "SUM
    it_lips TYPE x_lips OCCURS 0 WITH HEADER LINE, "SUM
    it_vbup TYPE x_vbup OCCURS 0 WITH HEADER LINE, "SUM
    it_vepo TYPE x_vepo OCCURS 0 WITH HEADER LINE, "SUM
    it_vepo2 TYPE x_vepo OCCURS 0 WITH HEADER LINE, "SUM
    *{ INSERT UKMK900355 3
    t_vepo_low TYPE x_vepo OCCURS 0 WITH HEADER LINE, " AS01
    *} INSERT
    it_vepo1 TYPE x_vepo1 OCCURS 0 WITH HEADER LINE, "SUM
    it_vttp TYPE x_vttp OCCURS 0 WITH HEADER LINE, "ANV SR#11523
    t_disp_head TYPE STANDARD TABLE OF zpickhead.
    DATA wa_item_tab TYPE zpickdisp OCCURS 0 WITH HEADER LINE.
    "ANV SR#11113
    DATA: w_numrnge LIKE number_range,
    w_number(10) TYPE n.
    DATA: t_likp LIKE likp OCCURS 0 WITH HEADER LINE,
    t_lips LIKE lips OCCURS 0 WITH HEADER LINE,
    t_vbuk LIKE vbuk OCCURS 0 WITH HEADER LINE,
    t_vbup LIKE vbup OCCURS 0 WITH HEADER LINE,
    t_vepo LIKE vepo OCCURS 0 WITH HEADER LINE,
    t_vekp LIKE vekp OCCURS 0 WITH HEADER LINE,
    t_vantr LIKE zvantr OCCURS 0 WITH HEADER LINE,
    t_pallettr LIKE zpallettr OCCURS 0 WITH HEADER LINE,
    w_likp like likp,
    w_lips LIKE lips,
    w_vbuk LIKE vbuk,
    w_vbup LIKE vbup,
    w_vepo LIKE vepo,
    w_vekp LIKE vekp,
    w_vepo TYPE x_vepo1,
    w_vbup TYPE x_vbup,
    w_vttp TYPE x_vttp, " ANV SR#11523
    w_lips TYPE x_lips,
    w_vbuk TYPE x_vbuk,
    w_likp TYPE x_likp, "MB01-+
    w_tplst LIKE vttk-tplst. "MB01+
    DATA: s_variant LIKE disvariant, "MB01+
    def_variant LIKE disvariant.
    ALV DATA *****
    DATA:
    g_grid TYPE REF TO cl_gui_alv_grid,
    g_sort TYPE slis_t_sortinfo_alv,
    g_custom_container TYPE REF TO cl_gui_custom_container,
    g_layout TYPE slis_layout_alv,
    gt_fieldcat TYPE slis_t_fieldcat_alv,
    t_fldcat LIKE LINE OF gt_fieldcat,
    g_keyinfo TYPE slis_keyinfo_alv,
    gt_events TYPE slis_t_event,
    gs_event TYPE slis_alv_event,
    w_sy_repid LIKE sy-repid.
    DATA: BEGIN OF seltab OCCURS 0.
    INCLUDE STRUCTURE rsparams.
    DATA: END OF seltab.
    SYSTEM GENERATED TABLE CONTROL DATA ********
    DECLARATION OF TABLECONTROL 'TC_TABCON' ITSELF
    CONTROLS: tc_tabcon TYPE TABLEVIEW USING SCREEN 0100.
    LINES OF TABLECONTROL 'TC_TABCON'
    DATA: g_tc_tabcon_lines LIKE sy-loopc.
    DATA: ok_code LIKE sy-ucomm.
    Constants
    CONSTANTS: c_data_class LIKE klah-class VALUE 'DG_DATA',
    c_mat_class LIKE rmclf-klart VALUE '001',
    c_pack LIKE lips-mtart VALUE 'VERP',
    c_a(1) VALUE 'A',
    c_b(1) VALUE 'B',
    c_c(1) VALUE 'C',
    c_yes(1) VALUE 'X',
    c_no(1) VALUE ' '.
    Selection screen
    standard report select options block
    SELECTION-SCREEN BEGIN OF BLOCK a WITH FRAME TITLE text-002.
    SELECT-OPTIONS:
    s_wadat FOR likp-wadat NO-EXTENSION OBLIGATORY. " Goods Issue Date
    *parameters: "TR01-
    p_vstel like tvst-vstel obligatory. " Shipping Point "TR01-
    SELECT-OPTIONS: "TR01+
    p_vstel FOR tvst-vstel. " Shipping Point "TR01+
    SELECT-OPTIONS:
    s_lfart FOR likp-lfart, " Delivery type
    s_lgtor FOR t30b-lgtor, " Door selection
    s_exidv FOR vekp-exidv, " Handling Unit
    s_vbeln FOR likp-vbeln, " Delivery "MB01-+
    s_lfdat FOR likp-lfdat. " Delivery date
    PARAMETERS:
    p_exdata AS CHECKBOX. " Show extra columns flag
    SELECTION-SCREEN END OF BLOCK a.
    van/pallet specific select options block
    SELECTION-SCREEN BEGIN OF BLOCK b WITH FRAME TITLE text-001.
    SELECT-OPTIONS:
    s_palno FOR zpallettr-zpallet_no, " no-extension,
    s_vanno FOR zvantr-zvan_no. " no-extension.
    SELECT-OPTIONS:
    s_deppnt FOR zpallettr-zdep_point, "Jvdm01
    s_tplst FOR vttk-tplst. "MB01
    SELECTION-SCREEN END OF BLOCK b.
    MB01 - START - Display variant
    SELECTION-SCREEN BEGIN OF BLOCK c WITH FRAME TITLE text-019.
    PARAMETERS: p_vari LIKE disvariant-variant.
    SELECTION-SCREEN END OF BLOCK c.
    MB01 - END
    Value Request Events
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_palno-low.
    CLEAR: number_range, w_number .
    REFRESH number_range.
    select numbers and display pop up screen for selection
    PERFORM select_pal_nos.
    s_palno-low = w_number.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_palno-high.
    CLEAR: number_range, w_number .
    REFRESH number_range.
    select numbers and display pop up screen for selection
    PERFORM select_pal_nos.
    s_palno-high = w_number.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_vanno-low.
    CLEAR: number_range, w_number .
    REFRESH number_range.
    select numbers and display pop up screen for selection
    PERFORM select_van_nos.
    s_vanno-low = w_number.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR s_vanno-high.
    CLEAR: number_range, w_number .
    REFRESH number_range.
    select numbers and display pop up screen for selection
    PERFORM select_van_nos.
    s_vanno-high = w_number.
    MB01 - START - display variant
    F4-Help for variant
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_vari.
    PERFORM f4_for_variant.
    MB01 - END
    At Selection Screen
    AT SELECTION-SCREEN.
    PERFORM validate_selections.
    Initialization
    INITIALIZATION.
    MB01 - START INSERT
    1. Transportation planning point
    Import transportation planning point from user parameters and
    populate
    select option.
    GET PARAMETER ID 'TDP' FIELD w_tplst.
    MOVE: 'I' TO s_tplst-sign,
    'EQ' TO s_tplst-option,
    w_tplst TO s_tplst-low.
    APPEND s_tplst.
    2. Display variant
    CLEAR s_variant.
    s_variant-report = sy-repid.
    Get default variant
    s_def_variante = s_variant.
    CALL FUNCTION 'REUSE_ALV_VARIANT_DEFAULT_GET'
    EXPORTING
    i_save = 'A'
    CHANGING
    cs_variant = s_variant
    EXCEPTIONS
    not_found = 2.
    IF sy-subrc = 0.
    p_vari = s_variant-variant.
    ENDIF.
    MB01 - END INSERT
    Start of selection
    START-OF-SELECTION.
    clear all data tables
    CLEAR: t_likp,
    it_likp,
    t_lips,
    t_vbuk,
    t_vbup,
    t_vepo,
    t_vantr,
    t_pallettr,
    w_likp,
    w_lips,
    w_vbuk,
    w_vbup,
    w_vepo,
    w_vekp.
    REFRESH: t_likp,
    it_likp,
    t_lips,
    t_vbuk,
    t_vbup,
    t_vepo,
    t_vantr,
    t_pallettr.
    select data for ALV
    due to different input parameters being used, to streamline the data
    selection process, different selection methods are required
    IF NOT s_vanno IS INITIAL
    OR NOT s_palno IS INITIAL
    OR NOT s_deppnt IS INITIAL. "Jvdm01
    if selecting by van/pallet number, need to select the data from the
    handling unit upwards to delivery
    PERFORM select_data_up.
    ELSE.
    otherwise the data can be selected from the delivery downwards
    PERFORM select_data_down.
    ENDIF.
    End of selection
    END-OF-SELECTION.
    call hierarchical ALV display function module
    CALL FUNCTION 'REUSE_ALV_HIERSEQ_LIST_DISPLAY'
    EXPORTING
    i_callback_program = 'ZWMR_PICK_STATUS_REPORT'
    i_callback_pf_status_set = 'SET_STATUS'
    i_callback_user_command =
    'USER_COMMAND' "custom gui status form
    is_layout = g_layout "user command form
    it_fieldcat = gt_fieldcat
    it_sort = g_sort
    i_save = 'X' "MB01+
    is_variant = s_variant
    it_events = gt_events
    i_tabname_header = 't_disp_head'
    i_tabname_item = 't_disp_tab'
    i_structure_name_header = 'ZPICKHEAD'
    i_structure_name_item = 'ZPICKDISP'
    is_keyinfo = g_keyinfo
    TABLES
    t_outtab_header = t_disp_head
    t_outtab_item = t_disp_tab.
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    FORMS
    Includes inserted by Screen Painter Wizard. DO NOT CHANGE THIS LINE!
    INCLUDE zwmr_pick_o01.
    INCLUDE zwmr_pick_status_reporto01 .
    INCLUDE zwmr_pick_i01.
    INCLUDE zwmr_pick_status_reporti01 .
    INCLUDE zwmr_pick_f01.
    INCLUDE zwmr_pick_status_reportf01 .
    *& Form select_pal_nos
    select pallet numbers for search help
    FORM select_pal_nos.
    DATA: BEGIN OF t_palno OCCURS 0,
    zpallet_no LIKE zpallettr-zpallet_no,
    END OF t_palno.
    select all available pallet numbers
    SELECT DISTINCT zpallet_no FROM zpallettr
    INTO CORRESPONDING FIELDS OF TABLE t_palno.
    LOOP AT t_palno.
    get pallet id
    SELECT SINGLE zpallet_id FROM zpallettr
    INTO number_range-id
    WHERE zpallet_no = t_palno-zpallet_no.
    get pallet description
    SELECT SINGLE zdesc FROM zpalletmd
    INTO number_range-desc
    WHERE zpallet_id = number_range-id.
    number_range-num = t_palno-zpallet_no.
    append to search help table
    APPEND number_range.
    ENDLOOP.
    call pop up dialog box
    CALL SCREEN 0100 STARTING AT 5 5.
    ENDFORM. " select_pal_nos
    *& Form select_van_nos
    select van numbers for search help
    FORM select_van_nos.
    DATA: BEGIN OF t_vanno OCCURS 0,
    zvan_no LIKE zvantr-zvan_no,
    END OF t_vanno.
    select available van numbers
    SELECT DISTINCT zvan_no FROM zvantr
    INTO CORRESPONDING FIELDS OF TABLE t_vanno.
    LOOP AT t_vanno.
    select van id
    SELECT SINGLE zvan_id FROM zvantr
    INTO number_range-id
    WHERE zvan_no = t_vanno-zvan_no.
    select van description (maintained in pallet tables)
    SELECT SINGLE zdesc FROM zpalletmd
    INTO number_range-desc
    WHERE zpallet_id = number_range-id.
    number_range-num = t_vanno-zvan_no.
    append to search help table
    APPEND number_range.
    ENDLOOP.
    call pop up dialog box
    CALL SCREEN 0100 STARTING AT 5 5.
    ENDFORM. " select_van_nos
    *& Form select_data_down
    select data if selecting from delivery down
    FORM select_data_down.
    select all deliveries from LIKP that fulfill selection criteria
    Start SU01 optmization changes
    SELECT vbeln vstel lgtor route wadat "RM050906
    SELECT vbeln vstel lgtor route wadat
    zzroute2lgtor zz2route zzexproute zzroute2 anzpk "MB01-+
    FROM likp INTO CORRESPONDING FIELDS OF TABLE it_likp"MB01-+
    WHERE vbeln IN s_vbeln
    AND vstel IN p_vstel
    AND lfart IN s_lfart
    AND wadat IN s_wadat
    AND lfdat IN s_lfdat "MB01+
    AND
    ( lgtor IN s_lgtor OR zzroute2lgtor IN s_lgtor ) ."MB01+
    IF sy-subrc NE 0.
    no data found
    MESSAGE i007.
    EXIT.
    ENDIF.
    IF NOT t_likp[] IS INITIAL. "SUM
    IF NOT it_likp[] IS INITIAL.
    SORT it_likp BY vbeln. "SUM
    select sales document headers from VBUK
    SELECT vbeln wbstk kostk
    FROM vbuk INTO TABLE it_vbuk
    FOR ALL ENTRIES IN it_likp "SUM
    WHERE vbeln EQ it_likp-vbeln. "SUM
    SORT it_vbuk BY vbeln.
    select all relevant delivery items from LIPS
    SELECT vbeln posnr pstyv matnr charg
    FROM lips INTO TABLE it_lips
    FOR ALL ENTRIES IN it_likp
    WHERE vbeln EQ it_likp-vbeln
    AND pckpf NE 'B' "cannot be packed "AS05
    AND pstyv NE 'ZPAC' "AS05
    AND pstyv NE 'ZGDP' "TR02+ "AS05
    AND lfimg GT 0. "TR01+
    ENDIF.
    IF NOT it_lips[] IS INITIAL.
    select all sales document line items from VBUP
    SORT it_lips BY vbeln posnr. "SUM
    SELECT vbeln posnr lvsta
    FROM vbup INTO TABLE it_vbup
    FOR ALL ENTRIES IN it_lips
    WHERE vbeln EQ it_lips-vbeln
    AND posnr = it_lips-posnr.
    SORT it_vbup BY vbeln posnr.
    select corresponding handling unit ID's (venum)
    TR03 Replace
    start
    select * from vepo appending corresponding fields of table t_vepo
    for all entries in t_lips
    where vbeln = t_lips-vbeln
    and posnr = t_lips-posnr
    and matnr = t_lips-matnr
    and charg = t_lips-charg.
    SELECT vepoVENUM vepoVEPOS vepovbeln vepoposnr
    FROM vepo as vepo
    INNER JOIN vekp as vekp ON vepovenum = vekpvenum
    APPENDING corresponding fields of table it_vepo
    FOR ALL ENTRIES IN it_lips
    WHERE vepo~vbeln = it_lips-vbeln
    AND vepo~posnr = it_lips-posnr
    AND vepo~matnr = it_lips-matnr
    AND vepo~charg = it_lips-charg
    AND vekp~exidv IN s_exidv.
    SELECT venum vepos vbeln posnr
    FROM vepo INTO TABLE it_vepo2
    FOR ALL ENTRIES IN it_lips
    WHERE vbeln = it_lips-vbeln
    AND posnr = it_lips-posnr
    AND matnr = it_lips-matnr
    AND charg = it_lips-charg.
    SORT it_vepo2 BY venum vepos.
    *{ INSERT UKMK900355 1
    Ice-multis: replace lower-level HUs with highest level " AS01
    PERFORM replace_highest_hu. " AS01
    *} INSERT
    Start of changes by ANV SR#11523
    MB01 - extract shipment header as well to populate leg indicator
    Therefore, join vttp with vttk
    Limit as well by transportation planning point
    SELECT vttptknum vttptpnum vttpvbeln vttklaufk
    FROM vttp INNER JOIN vttk
    ON vttptknum = vttktknum
    INTO TABLE it_vttp
    FOR ALL ENTRIES IN it_lips
    WHERE vttp~vbeln = it_lips-vbeln
    AND vttk~tplst IN s_tplst.
    MB01 - END
    End of changes by ANV SR#11523
    IF NOT it_vepo2[] IS INITIAL.
    SELECT venum exidv
    FROM vekp INTO TABLE it_vepo1
    FOR ALL ENTRIES IN it_vepo2
    WHERE venum = it_vepo2-venum
    AND exidv IN s_exidv.
    ENDIF.
    SORT it_vepo1 BY venum.
    CLEAR: w_vepo, it_vepo.
    LOOP AT it_vepo1.
    READ TABLE it_vepo2 WITH KEY venum = it_vepo1-venum.
    IF sy-subrc = 0.
    it_vepo2-exidv = it_vepo1-exidv.
    MODIFY it_vepo2 TRANSPORTING exidv
    WHERE venum = it_vepo1-venum .
    ENDIF.
    ENDLOOP.
    DELETE it_vepo2 WHERE exidv IS initial.
    it_vepo[] = it_vepo2[].
    TR03 Replace end
    ENDIF.
    build process table
    PERFORM move_to_table.
    ENDFORM. "select_data_down
    *& Form select_data_up
    select data if selecting from van/pallet up
    FORM select_data_up.
    IF NOT s_vanno IS INITIAL.
    if van then select van numbers and hence pallet numbers
    SELECT * FROM zvantr INTO TABLE t_vantr
    WHERE zvan_no IN s_vanno.
    and vstel eq p_vstel."TR01-
    IF NOT t_vantr[] IS INITIAL.
    SORT t_vantr BY zvan_id zvan_no vstel zpallet_no. "SUM
    SELECT * FROM zpallettr INTO TABLE t_pallettr
    FOR ALL ENTRIES IN t_vantr
    WHERE zpallet_no EQ t_vantr-zpallet_no
    AND zdep_point IN s_deppnt. "Jvdm01
    and vstel eq p_vstel."TR01-
    ENDIF.
    ELSE.
    otherwise can get pallet numbers directly
    SELECT * FROM zpallettr INTO TABLE t_pallettr
    WHERE zpallet_no IN s_palno
    AND zdep_point IN s_deppnt. "Jvdm01
    and vstel eq p_vstel."TR01-
    ENDIF.
    IF NOT t_pallettr[] IS INITIAL.
    from the pallet nos. we can select the handling units
    SORT t_pallettr BY zpallet_id zpallet_no vstel exidv. "SUM
    SELECT * FROM vekp INTO TABLE t_vekp
    FOR ALL ENTRIES IN t_pallettr
    WHERE exidv EQ t_pallettr-exidv
    AND exidv NE space
    AND exidv IN s_exidv "TR03+
    AND ( exida = 'E' "TR01+
    OR exida = 'F' ). "TR01+
    ENDIF.
    SORT t_vekp BY venum. "SUM
    IF NOT t_vekp[] IS INITIAL.
    build vbeln range from t_vekp.
    LOOP AT t_vekp.
    r_del-sign = 'I'.
    r_del-option = 'EQ'.
    r_del-low = t_vekp-vpobjkey.
    APPEND r_del.
    ENDLOOP.
    select all deliveries from LIKP that correspond to HU's
    SELECT * FROM likp INTO TABLE t_likp
    WHERE vbeln IN r_del
    AND wadat IN s_wadat
    AND lfart IN s_lfart.
    ENDIF.
    MB01- START
    SELECT vbeln lgtor route wadat
    FROM likp INTO TABLE it_likp
    WHERE vbeln IN r_del
    AND wadat IN s_wadat
    AND lfart IN s_lfart.
    SELECT vbeln vstel lgtor route wadat
    zzroute2lgtor zz2route zzexproute zzroute2 anzpk "MB01-+
    FROM likp INTO CORRESPONDING FIELDS OF TABLE it_likp
    WHERE vbeln IN r_del
    AND lfart IN s_lfart
    AND wadat IN s_wadat "MB01-+
    AND lfdat IN s_lfdat. "MB01+
    MB01- END
    ENDIF.
    IF NOT it_likp[] IS INITIAL.
    SORT it_likp BY vbeln . "SUM
    select sales document headers from VBUK
    SELECT * FROM vbuk INTO TABLE t_vbuk
    FOR ALL ENTRIES IN t_likp
    WHERE vbeln EQ t_likp-vbeln.
    SELECT vbeln wbstk kostk
    FROM vbuk INTO TABLE it_vbuk
    FOR ALL ENTRIES IN it_likp
    WHERE vbeln EQ it_likp-vbeln.
    SORT it_vbuk BY vbeln. "SUM
    select all relevant delivery items from LIPS
    SELECT * FROM lips INTO TABLE t_lips
    FOR ALL ENTRIES IN t_likp
    WHERE vbeln EQ t_likp-vbeln
    AND pstyv NE 'ZPAC'
    AND pstyv NE 'ZGDP' "TR02+
    AND lfimg GT 0. "TR01+
    SELECT vbeln posnr pstyv matnr charg
    FROM lips INTO TABLE it_lips
    FOR ALL ENTRIES IN it_likp
    WHERE vbeln EQ it_likp-vbeln
    AND pckpf NE 'B' "cannot be packed "AS05
    AND pstyv NE 'ZPAC' "AS05
    AND pstyv NE 'ZGDP' "TR02+ "AS05
    AND lfimg GT 0. "TR01+
    ENDIF.
    IF NOT it_lips[] IS INITIAL.
    SORT it_lips BY vbeln posnr. "SUM
    select all sales document line items from VBUP
    SELECT * FROM vbup INTO TABLE t_vbup
    FOR ALL ENTRIES IN t_lips
    WHERE vbeln EQ t_lips-vbeln
    AND posnr = t_lips-posnr.
    Start of changes by ANV SR#11523
    MB01 - START
    join vttp with vttk to obtain leg indicator
    SELECT tknum tpnum vbeln
    FROM vttp INTO TABLE it_vttp
    FOR ALL ENTRIES IN it_lips
    WHERE vbeln = it_lips-vbeln.
    SELECT vttptknum vttptpnum vttpvbeln vttklaufk
    FROM vttp INNER JOIN vttk
    ON vttptknum = vttktknum
    INTO TABLE it_vttp
    FOR ALL ENTRIES IN it_lips
    WHERE vttp~vbeln = it_lips-vbeln
    AND vttk~tplst IN s_tplst.
    MB01 - END
    End of changes by ANV SR#11523
    SELECT vbeln posnr lvsta
    FROM vbup INTO TABLE it_vbup
    FOR ALL ENTRIES IN it_lips
    WHERE vbeln EQ it_lips-vbeln
    AND posnr = it_lips-posnr.
    SORT t_vbup BY vbeln posnr. "SUM
    select corresponding handling unit ID's (venum)
    SELECT * FROM vepo APPENDING CORRESPONDING FIELDS OF TABLE t_vepo
    FOR ALL ENTRIES IN t_lips
    WHERE vbeln = t_lips-vbeln
    AND posnr = t_lips-posnr
    AND matnr = t_lips-matnr
    AND charg = t_lips-charg.
    SELECT venum vepos vbeln posnr
    FROM vepo APPENDING CORRESPONDING FIELDS OF TABLE it_vepo
    FOR ALL ENTRIES IN it_lips
    WHERE vbeln = it_lips-vbeln
    AND posnr = it_lips-posnr
    AND matnr = it_lips-matnr
    AND charg = it_lips-charg.
    *{ INSERT UKMK900355 1
    it_vepo2[] = it_vepo[]. " DS01
    PERFORM replace_highest_hu. " DS01
    it_vepo[] = it_vepo2[]. " DS01
    *} INSERT
    ENDIF.
    build process table
    PERFORM move_to_table.
    ENDFORM. "select_data_up
    *& Form move_to_table
    move data to processing table
    FORM move_to_table.
    LOOP AT it_vepo.
    CLEAR t_data_tab.
    delivery lines.
    CLEAR w_lips.
    READ TABLE it_lips WITH KEY vbeln = it_vepo-vbeln
    posnr = it_vepo-posnr
    INTO w_lips BINARY SEARCH. "SUM
    MOVE-CORRESPONDING w_lips TO t_data_tab.
    sales document line items
    CLEAR w_vbup.
    READ TABLE it_vbup WITH KEY vbeln = it_vepo-vbeln
    posnr = it_vepo-posnr
    INTO w_vbup BINARY SEARCH. "SUM
    if w_vbup-kosta = space. "TR01-
    not relevant for picking
    delete t_vepo. "TR01-
    continue. "TR01-
    else. "TR01-
    MOVE-CORRESPONDING w_vbup TO t_data_tab.
    endif. "TR01-
    sales doc header
    CLEAR w_vbuk.
    READ TABLE it_vbuk WITH KEY vbeln = it_vepo-vbeln
    INTO w_vbuk BINARY SEARCH. "SUM
    MOVE-CORRESPONDING w_vbuk TO t_data_tab.
    delivery header
    CLEAR w_likp.
    READ TABLE it_likp WITH KEY vbeln = it_vepo-vbeln
    INTO w_likp BINARY SEARCH. "SUM
    MOVE-CORRESPONDING w_likp TO t_data_tab.
    MB01 - START
    DATA: w_routetype TYPE i. "0=non-global,1=1st route,2=2nd
    route,3=both
    At this point move DOOR2 if it falls within the global route scenario
    and the door2 is satisfies the selection criteria for door
    1. Does delivery fall within global route scenario
    CLEAR w_routetype.
    IF w_likp-zz2route = 'Y' .
    1.a. First route - does door1 satisfy the selection criteria
    IF w_likp-lgtor IN s_lgtor.
    w_routetype = 1.
    MOVE w_likp-zzexproute TO t_data_tab-route.
    1.b. Second route - does door2 satisfy the selection criteria
    ELSEIF w_likp-zzroute2lgtor IN s_lgtor.
    here we need to move door2 to lgtor
    w_routetype = 2.
    MOVE w_likp-zzroute2lgtor TO t_data_tab-lgtor.
    MOVE w_likp-zzroute2 TO t_data_tab-route.
    ENDIF.
    If both routes satsify the criteria, append for 2nd leg ***REVISIT!
    IF w_likp-lgtor IN s_lgtor AND w_likp-zzroute2lgtor IN s_lgtor.
    w_routetype = 3.
    ENDIF.
    ENDIF.
    MB01 - END
    Start of changes by ANV SR#11523
    MB01 - If the delivery falls within the global route scenario... need
    to select either preliminary shipment leg OR subsequent leg
    when laufk= 1 (prelim) and linked to route1, if laufk = 2 (subseq) &
    linked to route2
    Shipment Number
    SORT it_vttp BY vbeln laufk.
    CLEAR w_vttp.
    CASE w_routetype.
    WHEN 0.
    READ TABLE it_vttp WITH KEY vbeln = it_vepo-vbeln
    INTO w_vttp BINARY SEARCH.
    WHEN 1.
    READ TABLE it_vttp WITH KEY vbeln = it_vepo-vbeln
    laufk = '1'
    INTO w_vttp BINARY SEARCH.
    WHEN 2.
    READ TABLE it_vttp WITH KEY vbeln = it_vepo-vbeln
    laufk = '3'
    INTO w_vttp BINARY SEARCH.
    WHEN 3. "REVISIT
    ENDCASE.
    MOVE w_vttp-tknum TO t_data_tab-tknum.
    MB01 - END
    End of changes by ANV SR#11523
    select handling unit info using vepo entry
    CLEAR w_vekp.
    IF t_vekp[] IS INITIAL.
    SELECT SINGLE * FROM vekp INTO w_vekp
    WHERE venum = it_vepo-venum.
    ELSE.
    READ TABLE t_vekp WITH KEY venum = it_vepo-venum
    INTO w_vekp BINARY SEARCH. "SUM
    IF sy-subrc NE 0.
    SELECT SINGLE * FROM vekp INTO w_vekp
    WHERE venum = t_vepo-venum.
    ENDIF.
    ENDIF.
    MOVE-CORRESPONDING w_vekp TO t_data_tab.
    *{ INSERT UKMK900355 2
    WM status for HU "AS03
    SELECT SINGLE * FROM zhu_to_link WHERE lgnum EQ w_vekp-lgnum"AS03
    AND exidv EQ w_vekp-exidv."AS03
    IF sy-subrc EQ 0. "AS03
    IF zhu_to_link-zpick_comp EQ space. "AS03
    t_data_tab-lvsta = 'B'. "AS03
    ELSE. "AS03
    t_data_tab-lvsta = 'C'. "AS03
    ENDIF. "AS03
    ENDIF. "AS03
    *} INSERT
    select pallet / van load information "Jvdm01-
    SELECT SINGLE zpallet_no zcount_check FROM zpallettr "Jvdm01-
    INTO (t_data_tab-zpallet_no, "Jvdm01-
    t_data_tab-zcount_check) "Jvdm01-
    WHERE exidv EQ w_vekp-exidv. "Jvdm01-
    PERFORM read_pallet. "MB01+
    SELECT SINGLE zpallet_no zcount_check zdep_point "Jvdm01+
    FROM zpallettr "Jvdm01+
    INTO (t_data_tab-zpallet_no, "Jvdm01+
    t_data_tab-zcount_check, "Jvdm01+
    t_data_tab-zdep_point) "Jvdm01+
    WHERE exidv EQ w_vekp-exidv. "Jvdm01+
    WHERE exidv EQ w_vekp-exidv "MB01-+
    AND zpallet_id = t_data_tab-lgtor."MB01+
    MB01 - INSERT START
    If pallet number specified and
    we are in the global route scenario & both doors fall within the
    selection criteria, we need to copy the one that is currently in a
    specified pallet
    IF NOT s_palno IS INITIAL AND not t_data_tab-zpallet_no in s_palno
    AND w_routetype = '3' .
    Switch doors & get 2nd shipment
    MOVE w_likp-zzroute2lgtor TO t_data_tab-lgtor.
    MOVE w_likp-zzroute2 TO t_data_tab-route.
    Read subsequent leg shipment
    READ TABLE it_vttp WITH KEY vbeln = it_vepo-vbeln
    laufk = '3'
    INTO w_vttp BINARY SEARCH.
    IF sy-subrc = 0.
    MOVE w_vttp-tknum TO t_data_tab-tknum.
    ENDIF.
    PERFORM read_pallet. "MB01+
    ENDIF.
    MB01 - INSERT END
    IF NOT t_data_tab-zpallet_no IN s_palno. "TR01+
    CONTINUE. "TR01+
    ENDIF. "TR01+
    IF sy-subrc = 0. "mb01+
    perform read_van. "MB01+
    SELECT SINGLE zvan_no zvan_print zeod_print FROM zvantr
    INTO (t_data_tab-zvan_no,
    t_data_tab-zvan_print,
    t_data_tab-zeod_print)
    WHERE zpallet_no EQ t_data_tab-zpallet_no.
    MB01 - INSERT START
    If van number specified and
    we are in the global route scenario & both doors fall within the
    selection criteria, we need to copy the one that is currently on a
    specified van
    IF NOT s_vanno IS INITIAL AND not t_data_tab-zvan_no in s_vanno AND
    w_routetype = '3' .
    Switch doors & get 2nd shipment
    MOVE w_likp-zzroute2lgtor TO t_data_tab-lgtor.
    MOVE w_likp-zzroute2 TO t_data_tab-route.
    Read subsequent leg shipment
    READ TABLE it_vttp WITH KEY vbeln = it_vepo-vbeln
    laufk = '3'
    INTO w_vttp BINARY SEARCH.
    IF sy-subrc = 0.
    MOVE w_vttp-tknum TO t_data_tab-tknum.
    ENDIF.
    PERFORM read_pallet. "MB01+
    perform read_van.
    ENDIF. "mb01-
    MB01 - INSERT END
    IF NOT t_data_tab-zvan_no IN s_vanno. "TR01+
    CONTINUE. "TR01+
    ENDIF. "TR01+
    ENDIF.
    APPEND t_data_tab.
    ENDLOOP.
    *-----> TR01+ start
    If the delivery has yet to be packed, then need to include in report
    Thus delete t_lips here and if any entries left after looping through
    t_vepo, these will also need to be added to t_data_tab
    if the selection is by handling unit though we do not want
    these"TR03+
    IF s_exidv IS INITIAL. "TR03+
    *{ REPLACE UKMK900355 1
    *\ LOOP AT it_vepo.
    *\ READ TABLE it_lips WITH KEY vbeln = it_vepo-vbeln
    *\ posnr = it_vepo-posnr
    *\ BINARY SEARCH. "SUM
    *\ IF sy-subrc = 0.
    *\ DELETE it_lips INDEX sy-tabix.
    *\ ENDIF.
    *\ ENDLOOP.
    Higher-level HUs can contain more than one delivery item " AS01
    LOOP AT it_lips. " AS01
    READ TABLE t_vepo_low WITH KEY vbeln = it_lips-vbeln " AS01
    posnr = it_lips-posnr. " AS01
    CHECK sy-subrc EQ 0. " AS01
    DELETE it_lips. " AS01
    ENDLOOP. " AS01
    *} REPLACE
    IF NOT it_lips[] IS INITIAL.
    move any unpacked items to the data table
    PERFORM move_lips_to_table.
    ENDIF.
    ENDIF. "TR03+
    *<---- TR01+ End
    get relevant status icons
    PERFORM select_icons.
    prepare ALV data
    PERFORM prepare_alv.
    ENDFORM. " select_data
    *& Form select_icons
    select icons for display and move data to display table
    FORM select_icons.
    DATA: w_disp_tab LIKE zpickdisp,
    w_disp_head LIKE zpickhead,
    w_color LIKE zpickdisp-color,
    ov_icon LIKE zpickdisp-ov_icon,
    gi_icon LIKE zpickdisp-gi_icon,
    to_icon LIKE zpickdisp-to_icon,
    lp_icon LIKE zpickdisp-lp_icon,
    pc_icon LIKE zpickdisp-pc_icon,
    lv_icon LIKE zpickdisp-lv_icon,
    vm_icon LIKE zpickdisp-vm_icon,
    em_icon LIKE zpickdisp-em_icon,
    sp_icon LIKE zpickdisp-sp_icon, " ANV SR#11523
    t_ovst_tab LIKE t_disp_tab WITH HEADER LINE.
    CONSTANTS: c_col1(3) VALUE 'C10',
    c_col2(3) VALUE 'C20'.
    SORT t_data_tab BY lgtor vbeln.
    w_color = c_col2.
    LOOP AT t_data_tab.
    AT NEW lgtor.
    fill ALV header table
    CLEAR w_disp_head.
    w_disp_head-lgtor = t_data_tab-lgtor.
    APPEND w_disp_head TO t_disp_head.
    ENDAT.
    goods issue status & overall amber/green only
    CASE t_data_tab-wbstk.
    WHEN c_c.
    MOVE icon_green_light TO gi_icon.
    MOVE icon_green_light TO ov_icon.
    WHEN OTHERS.
    MOVE icon_red_light TO gi_icon.
    MOVE icon_yellow_light TO ov_icon.
    ENDCASE.
    transfer order status
    CASE t_data_tab-lvsta.
    WHEN c_a.
    MOVE icon_red_light TO to_icon.
    WHEN c_b.
    MOVE icon_yellow_light TO to_icon.
    WHEN c_c.
    MOVE icon_green_light TO to_icon.
    WHEN space.
    write N/A
    to_icon = 'N/A'.
    ENDCASE.
    loaded to pallet status
    IF NOT t_data_tab-zpallet_no IS INITIAL.
    MOVE icon_green_light TO lp_icon.
    ELSE.
    MOVE icon_red_light TO lp_icon.
    ENDIF.
    pallet count status
    IF NOT t_data_tab-zcount_check IS INITIAL.
    MOVE icon_green_light TO pc_icon.
    ELSE.
    MOVE icon_red_light TO pc_icon.
    ENDIF.
    loaded to van status
    IF NOT t_data_tab-zvan_no IS INITIAL.
    MOVE icon_green_light TO lv_icon.
    ELSE.
    MOVE icon_red_light TO lv_icon.
    ENDIF.
    van manifest status
    IF NOT t_data_tab-zvan_print IS INITIAL.
    MOVE icon_green_light TO vm_icon.
    ELSE.
    MOVE icon_red_light TO vm_icon.
    ENDIF.
    Start of changes by ANV SR#11523
    Shipment status
    IF NOT t_data_tab-tknum IS INITIAL.
    MOVE icon_green_light TO sp_icon.
    ELSE.
    MOVE icon_red_light TO sp_icon.
    ENDIF.
    End of changes by ANV SR#11523
    end of day manifest status
    IF NOT t_data_tab-zeod_print IS INITIAL.
    MOVE icon_green_light TO em_icon.
    ELSE.
    MOVE icon_red_light TO em_icon.
    ENDIF.
    move working data table to display table
    MOVE-CORRESPONDING t_data_tab TO w_disp_tab.
    w_disp_tab-ov_icon = ov_icon.
    w_disp_tab-gi_icon = gi_icon.
    w_disp_tab-to_icon = to_icon.
    w_disp_tab-lp_icon = lp_icon.
    w_disp_tab-pc_icon = pc_icon.
    w_disp_tab-lv_icon = lv_icon.
    w_disp_tab-vm_icon = vm_icon.
    w_disp_tab-em_icon = em_icon.
    w_disp_tab-sp_icon = sp_icon. "ANV SR#11523
    w_disp_tab-color = w_color.
    fill N/A values for initial fields for display
    IF w_disp_tab-packvorschr IS INITIAL.
    w_disp_tab-packvorschr = 'N/A'.
    ENDIF.
    IF w_disp_tab-exidv IS INITIAL.
    w_disp_tab-exidv = 'N/A'.
    ENDIF.
    IF w_disp_tab-zpallet_no IS INITIAL.
    WRITE 'N/A' TO w_disp_tab-zpallet_no.
    ENDIF.
    IF w_disp_tab-zvan_no IS INITIAL.
    WRITE 'N/A' TO w_disp_tab-zvan_no.
    ENDIF.
    display different color for new doc number
    AT END OF vbeln.
    IF w_color = c_col1.
    w_color = c_col2.
    ELSEIF w_color = c_col2.
    w_color = c_col1.
    ENDIF.
    ENDAT.
    APPEND w_disp_tab TO t_disp_tab.
    CLEAR w_disp_tab.
    ENDLOOP.
    we have all the icons in display but need to check the overall status
    as this refers to the line items
    green and amber statuses already set and use the same criteria as the
    goods issue status unless detected as red here
    DATA: ov_stat_red(1).
    CLEAR w_disp_tab.
    SORT t_disp_tab BY vbeln.
    LOOP AT t_disp_tab INTO w_disp_tab.
    AT NEW vbeln.
    check all line items for delivery
    LOOP AT t_data_tab WHERE vbeln = w_disp_tab-vbeln.
    IF t_data_tab-lvsta = c_a.
    set overall status to red
    ov_stat_red = c_yes.
    EXIT.
    ELSE.
    leave green/amber status icon as previosly determined
    ENDIF.
    ENDLOOP.
    IF ov_stat_red = c_yes.
    set overall status to red for all items in that delivery
    CLEAR ov_stat_red.
    MOVE icon_red_light TO w_disp_tab-ov_icon.
    MODIFY t_disp_tab FROM w_disp_tab TRANSPORTING ov_icon
    WHERE vbeln = w_disp_tab-vbeln.
    ENDIF.
    ENDAT.
    ENDLOOP.
    ENDFORM. " select_icons
    *& Form fill_layout
    fill ALV layout parameters
    FORM fill_layout.
    CLEAR g_layout.
    g_layout-colwidth_optimize = c_yes. " column width optimisation
    g_layout-zebra = space. " alternate line colors
    g_layout-box_fieldname = 'MARK'. " checkbox fieldname
    g_layout-info_fieldname = 'COLOR'. " highlight row indicator
    g_layout-no_vline = space. " vertical line
    g_layout-key_hotspot = space. " hotspot field
    g_layout-f2code = 'PICK'. " F2 ok_code
    g_layout-numc_sum = c_yes. " sum numc fields
    g_layout-box_tabname = 't_disp_head'. " checkbox table name
    g_layout-expand_fieldname = 'EXPAND'. " expand field name
    ENDFORM. " fill_layout
    *& Form fill_sort
    fill ALV sort table
    FORM fill_sort.
    DATA: w_g_sort TYPE slis_sortinfo_alv.
    w_g_sort-spos = 1.
    w_g_sort-fieldname = 'LGTOR'.
    w_g_sort-tabname = 't_disp_tab'.
    w_g_sort-up = c_yes.
    APPEND w_g_sort TO g_sort.
    w_g_sort-spos = 2.
    w_g_sort-fieldname = 'VBELN'.
    w_g_sort-tabname = 't_disp_tab'.
    w_g_sort-up = c_yes.
    APPEND w_g_sort TO g_sort.
    w_g_sort-spos = 3.
    w_g_sort-fieldname = 'POSNR'.
    w_g_sort-tabname = 't_disp_tab'.
    w_g_sort-up = c_yes.
    APPEND w_g_sort TO g_sort.

  • Printing only one line record with total of all items through alv

    hi experts,
    i am facing a problem while printing a list through alv.
    requirement is, suppose i have 3 line items under one document no.
    i have to print only one record with total amount of all items.more clearly...
    1001  10  1000/-
    1001  20    234/-
    1001  30   540/- these records in internal table then i am passing it to reuse_alv_grid_display.
    i need to display only 1001  1774/-(means sum of all the items)
    please tell me how to do this.
    thanks in advance,
    manasi

    hi ansari,
    contains in itab
         3000000004     02.11.2000     5550     27.95     27.95     0
         3000000004     02.11.2000     5550     10.95     10.95     0
         3000000005     02.11.2000     5550     27.95     27.95     0
         3000000005     02.11.2000     5550     10.95     10.95     0
         3000000006     02.11.2000     3020     52.99     52.99     0
         3000000006     02.11.2000     3020     64.99     64.99     0
         3000000006     02.11.2000     3020     49.5     49.5     0
         3000000007     02.11.2000     3730     2,228.00     2,228.00     0
         3000000007     02.11.2000     3730     1,698.00     1,698.00     0
         3000000007     02.11.2000     3730     532     532     0
    now please tell me how to print the data
    output will be
    3000000004     02.11.2000     5550     38.90     38.90       0
    3000000005     02.11.2000     5550     38.90     38.90       0
    3000000006     02.11.2000     3020     117.19     117.19     0
    like that
    please help me out
    manasi

  • Missing columns in print preview of ALV Grid

    In a report using ALV grid the output is ok in ALV grid when press print preview the 1st column is always missing and the 1st row shift by 1 character. Why is it happening. The same is happening in print out or when list saved in excel also.
    the coding is like
      call function 'REUSE_ALV_GRID_DISPLAY'
        exporting
          i_interface_check        = ' '
          i_buffer_active          = ' '
          i_callback_program       = i_repname
          i_callback_html_top_of_page = 'HTML_TOP_OF_PAGE'
          i_callback_pf_status_set = ' '
          i_callback_user_command = 'FRM_ALV_USER_COMMAND'
          i_structure_name         = 'IT_REPORT'
          i_background_id          = ' '
          is_layout                = i_layout
          it_fieldcat              = i_fieldtab[]
          it_sort                  = i_sort[]
          i_default                = 'X'
          i_save                   = 'A'
          is_variant               = i_variant
          it_events                = i_events[]
          is_print                 = i_print
        tables
          t_outtab                 = it_report.
    Kindly resolve.
    thanks
    anya

    Sample code:
    REPORT ZALV_DISPLAY_CHANGE.
    TABLES :T247.
    TYPE-POOLS SLIS. "Type definitions for alv report
    DATA: IT_FIELDCAT TYPE LVC_T_FCAT,
    WA_FIELDCAT TYPE LVC_S_FCAT.
    DATA: WA_LAYOUT TYPE LVC_S_LAYO.
    DATA : BEGIN OF IT_FINAL OCCURS 0,
    CHECK(1),
    CELLTAB TYPE LVC_T_STYL, " Switch between display/change
    MNR LIKE T247-MNR,
    LTX LIKE T247-LTX,
    END OF IT_FINAL.
    DATA : WA_FINAL LIKE IT_FINAL.
    DATA : W_REPID LIKE SY-REPID.
    W_REPID = SY-REPID.
    REFRESH IT_FINAL.
    SELECT MNR LTX
    FROM T247
    INTO CORRESPONDING FIELDS OF TABLE IT_FINAL
    WHERE SPRAS EQ 'E'.
    WA_FIELDCAT-FIELDNAME = 'CHECK'.
    WA_FIELDCAT-TABNAME = 'IT_FINAL'.
    WA_FIELDCAT-CHECKBOX = 'X'.
    WA_FIELDCAT-EDIT = 'X'..
    WA_FIELDCAT-OUTPUTLEN = '3'.
    WA_FIELDCAT-COL_POS = '1'.
    APPEND WA_FIELDCAT TO IT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'MNR'.
    WA_FIELDCAT-TABNAME = 'IT_FINAL'.
    WA_FIELDCAT-OUTPUTLEN = '8'.
    WA_FIELDCAT-COL_POS = '2'.
    WA_FIELDCAT-REPTEXT = 'Month'.
    APPEND WA_FIELDCAT TO IT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    WA_FIELDCAT-FIELDNAME = 'LTX'.
    WA_FIELDCAT-TABNAME = 'IT_FINAL'.
    WA_FIELDCAT-OUTPUTLEN = '20'.
    WA_FIELDCAT-COL_POS = '3'.
    WA_FIELDCAT-REPTEXT = 'Month Desc'.
    APPEND WA_FIELDCAT TO IT_FIELDCAT.
    CLEAR WA_FIELDCAT.
    DATA: WA_CELLTAB TYPE LVC_S_STYL,
    IT_CELLTAB TYPE LVC_T_STYL,
    L_INDEX TYPE I.
    CLEAR : WA_CELLTAB,WA_FINAL,IT_CELLTAB.
    REFRESH IT_CELLTAB.
    *Initialize the celltab table
    LOOP AT IT_FINAL INTO WA_FINAL.
    L_INDEX = SY-TABIX.
    WA_CELLTAB-FIELDNAME = 'CHECK'.
    WA_CELLTAB-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_ENABLED.
    INSERT WA_CELLTAB INTO TABLE IT_CELLTAB.
    INSERT LINES OF IT_CELLTAB INTO TABLE WA_FINAL-CELLTAB.
    MODIFY IT_FINAL FROM WA_FINAL INDEX L_INDEX.
    ENDLOOP.
    *Make the first five 5 rows as disabled
    CLEAR L_INDEX.
    LOOP AT IT_FINAL INTO WA_FINAL.
    L_INDEX = SY-TABIX.
    IF SY-TABIX LE 5.
    LOOP AT WA_FINAL-CELLTAB INTO WA_CELLTAB.
    IF WA_CELLTAB-FIELDNAME EQ 'CHECK' .
    WA_CELLTAB-STYLE = CL_GUI_ALV_GRID=>MC_STYLE_DISABLED.
    MODIFY WA_FINAL-CELLTAB FROM WA_CELLTAB.
    MODIFY IT_FINAL INDEX L_INDEX FROM WA_FINAL TRANSPORTING CELLTAB.
    ENDIF.
    ENDLOOP.
    ENDIF.
    ENDLOOP.
    WA_LAYOUT-BOX_FNAME = 'CHECK'.
    WA_LAYOUT-NO_ROWMARK = 'X'.
    WA_LAYOUT-STYLEFNAME = 'CELLTAB'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
    EXPORTING
    I_CALLBACK_PROGRAM = W_REPID
    I_GRID_TITLE = 'GRID DISPLAY'
    IS_LAYOUT_LVC = WA_LAYOUT
    IT_FIELDCAT_LVC = IT_FIELDCAT
    TABLES
    T_OUTTAB = IT_FINAL
    EXCEPTIONS
    PROGRAM_ERROR = 1
    OTHERS = 2.
    Please give me reward point If it is useful
    Thanks
    Murali Poli

  • How to get ALV Display with First column alone in sort

    How to get ALV Display with First column alone in sort

    HI,
    You can build Internal Table and send this to the parameter "IT_SORT".
    eg:
    "the sorting Internal Table structure is as whown below.
    DATA:  t_sort_info type slis_t_sortinfo_alv.
    "Build the Sort Internal Table
      t_sort_info-fieldname = 'CARRID'.
      t_sort_info-subtot = 'X'.
      append t_sort_info.
      t_sort_info-fieldname = 'FLDATE'.
      t_sort_info-subtot = 'X'.
      append t_sort_info.
    Then pass this "IT_SORT_INFO" table to the Function module "Reuse_alv_*". (Note send the body of the Internal table only like "<b>IT_SORT = IT_SORT_INFO[]</b>".
    Here i am making ALV output sorted on CARRID & FLDATE.
    You can specify only the First Column name for sorting.
    Regards,
    Manju
    Message was edited by:
            MANJUNATHA KS

  • Display 80 characters of PO text in ALV grid column?

    Hi Guys,
                 I just want to display only 80 characters of PO Header text in the ALV grid column and  the rest should appear when we move the Mouse on to the each ALV grid'd POtext column. So how is it possible 1st tell me how to display 80 characters of PO text.?
      in ME23n u can see the PO  header text.
    Thanks ,
    Gopi.

    Hi Gopi,
    Are you displaying ALV in your custom report and you want to show just 80 char in output?
    If this is yes:
    You can set ALV column width as 80 CHAR while building field catalog.
    Column cell will have complete text but when ALV appears it will first show first 80 char.
    thnx,
    ags.

  • ALV Display dynamic column with multiline header

    Hi All.
    I need to create alv display with dynamic number of columns. Also, it contains two header line. Kindly help me in coding.
    The required format is this format.
    Product | Week1 | Week2 |.......| WeekN
    |--||---|--
                | Sales   | Sales   |.......| Sales
    |--| |---|--
    PRD1   | value    | Value    |.......| Value
    PRD2   | value    | Value    |.......| Value
    PRD3   | value    | Value    |.......| Value
    Thanks.
    Sadhna

    Hi Sadhana,
    You mean to say that your internal Table contains
    ABCDEF are the fields in your Internal table.
    A--BCD---E-----F
    1--12---13---a11----1
    2--11---01---b9-----0
    3--01---00---c32----0
    4--14---01---d21----0
    Now using Dynamic Internal Table it should display the output as follow :
    A--BCF---a---b-c----d
    1--12---13---111-9-32--21
    Here you want to display the the fields of D as header and E as its corresponding values...?
    Please let me knwo if you mean the same..
    Regards,
    Kittu

  • Alv grid column name display

    alv grid column name could not be displayed fully.we manually want to drag the column,to see the column name fully.  for ex. if column name is 'COMPANYNAME'.it shows 'COMPA' alone.
    how could i solve this problem....?

    hI,
        Check the below code...
    *& Report  ZALV_PROGRAAM
    REPORT  ZALV_PROGRAAM.
    TYPE-POOLS SLIS.
    DATA : BEGIN OF WA_KNA1,
    KUNNR TYPE KUNNR,
    NAME1 TYPE NAME1,
    END OF WA_KNA1,
    IT_KNA1 LIKE TABLE OF WA_KNA1.
    DATA : IT_FCAT TYPE SLIS_T_FIELDCAT_ALV,
    WA_FCAT LIKE LINE OF IT_FCAT.
    SELECT KUNNR NAME1 INTO TABLE IT_KNA1 FROM KNA1 UP TO 5 ROWS.
    PERFORM FCAT USING '1' 'KUNNR' 'CUSTOMERNUMBER' '40'.
    PERFORM FCAT USING '2' 'NAME1' 'CUSTOMERNAME' '40'.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
       I_CALLBACK_PROGRAM                = SY-CPROG
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
       IT_FIELDCAT                       = IT_FCAT
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      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                          = IT_KNA1
    EXCEPTIONS
       PROGRAM_ERROR                     = 1
       OTHERS                            = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
             WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    *&      Form  FCAT
          text
         -->P_0052   text
         -->P_0053   text
         -->P_0054   text
         -->P_0055   text
    form FCAT  using    FP_COL_POS
                        FP_FIELDNAME
                        FP_SELTEXT_M
                        FP_OUTPUTLEN.
    WA_FCAT-COL_POS = FP_COL_POS.
    WA_FCAT-FIELDNAME = FP_FIELDNAME.
    WA_FCAT-SELTEXT_M = FP_SELTEXT_M.
    WA_FCAT-OUTPUTLEN = FP_OUTPUTLEN.
    APPEND WA_FCAT TO IT_FCAT.
    CLEAR WA_FCAT.
    endform.                    " FCAT
    thanks,
    Thiru. R

  • ALV output to be printed in smartform

    Dear Experts,
    There is a report which uses ALV using webdynpro ABAP. Say the report has 5 columns A, B, C, D, and E.
    There is also a custom button on ALV 'Print' which calls the smartform to display the output of the ALV( All columns ).
    Now the requirement is, user may hide any of the columns in ALV, say, user chosen to hide B, and D columns. So ALV displays A, C, and E columns respectively.
    When the user presses the 'Print' button smartform should display only the columns selected by the end user on the webdynpro screen. In this case it is A, C and E columns.
    Now is there any way to cpature the list of columns selected by the user or hidden by the user before we process the smartform.
    If there is any please let me know.
    Thanks in advance!
    Regards,
    Shashi

    Dear Experts,
    Awaiting for any replies on this.. Please help in case of any information on this.
    Thanks in advance!
    Regards,
    Shashi

  • F4 for Editable field in ALV, display Name but capture ID

    Hi Friends,
    I have a ALV for which i have defined a Structure, which is passed to Fieldcatlog.
    I have defined a Search help - ZUSER_NAME which has following fields to display.
    USERID - USR02-BNAME
    FNAME
    LNAME
    FULLNAME
    So my structure for fieldcatalog has User-id which is linked to this search help with Domain XUBNAME.
    So in my report i made this User-Id as editable and F4 available, everything is working fine.
    when user does a F4, its displaying Userid,Fname,Lname and complete name.upon selection and save i am capturing the id and storing in the ztable.
    But now i have a requirement that when user selects a value from this search help on F4, i need to display Fullname but capture the User Id. How can i do that?
    This is something similar to the one we have in BSP- key-value pair.
    how to do this in ALV.
    Appreciate if someone can guide me thru.
    Thanks,
    Simha
    Edited by: Simha on Sep 6, 2008 2:24 PM

    hai ,  this is example code for editing the F4 display .. check out this
    REPORT zalv_editf4display.
    *Type pools for alv
    TYPE-POOLS : slis.
    *structure for t582a tbale
    TYPES : BEGIN OF ty_table,
            infty TYPE infty,
            pnnnn TYPE pnnnn_d,
            zrmkz TYPE dzrmkz,
            zeitb TYPE dzeitb,
            dname TYPE dianm,
             davo TYPE davo,
            davoe TYPE davoe,
            END OF ty_table.
    *Structure for infotype text
    TYPES : BEGIN OF ty_itext,
            infty TYPE infty,
            itext TYPE intxt,
            sprsl TYPE sprsl,
            END OF ty_itext.
    *Structure for output display
    TYPES : BEGIN OF ty_output,
            infty TYPE infty,
            itext TYPE intxt,
            pnnnn TYPE pnnnn_d,
            zrmkz TYPE dzrmkz,
            zeitb TYPE dzeitb,
            dname TYPE dianm,
            davo TYPE davo,
            davoe TYPE davoe,
           END OF ty_output.
    *internal table and work area declarations
    DATA : it_table TYPE STANDARD TABLE OF ty_table INITIAL SIZE 0,
           it_output TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
           it_pbo TYPE STANDARD TABLE OF ty_output INITIAL SIZE 0,
           it_ittext TYPE STANDARD TABLE OF ty_itext INITIAL SIZE 0,
           wa_table TYPE ty_table,
           wa_output TYPE ty_output,
           wa_ittext TYPE ty_itext.
    *Data declarations for dropdown lists for f4
    DATA: it_dropdown TYPE lvc_t_drop,
          ty_dropdown TYPE lvc_s_drop,
    *data declaration for refreshing of alv
          stable TYPE lvc_s_stbl.
    *Global variable declaration
    DATA: gstring TYPE c.
    *Data declarations for ALV
    DATA: c_ccont TYPE REF TO cl_gui_custom_container,         "Custom container object
          c_alvgd         TYPE REF TO cl_gui_alv_grid,         "ALV grid object
          it_fcat            TYPE lvc_t_fcat,                  "Field catalogue
          it_layout          TYPE lvc_s_layo.                  "Layout
    *ok code declaration
    DATA:
      ok_code       TYPE ui_func.
    *initialization event
    INITIALIZATION.
    *start of selection event
    START-OF-SELECTION.
    *select the infotypes maintained
      SELECT infty
              pnnnn
              zrmkz
              zeitb
              dname
              davo
              davoe
              FROM t582a UP TO 10 ROWS
              INTO CORRESPONDING FIELDS OF TABLE it_table.
    *Select the infotype texts
      IF it_table[] IS NOT INITIAL.
        SELECT itext
                 infty
                 sprsl
                 FROM t582s
                 INTO CORRESPONDING FIELDS OF TABLE it_ittext
                 FOR ALL ENTRIES IN it_table
                 WHERE infty = it_table-infty
                 AND sprsl = 'E'.
      ENDIF.
    *Apppending the data to the internal table of ALV output
      LOOP AT it_table INTO wa_table.
        wa_output-infty = wa_table-infty.
        wa_output-pnnnn = wa_table-pnnnn.
        wa_output-zrmkz = wa_table-zrmkz.
        wa_output-zeitb = wa_table-zeitb.
        wa_output-dname = wa_table-dname.
        wa_output-davo = wa_table-davo.
        wa_output-davoe = wa_table-davoe.
    For texts
        READ TABLE it_ittext INTO wa_ittext WITH KEY infty = wa_table-infty.
        wa_output-itext = wa_ittext-itext.
        APPEND wa_output TO it_output.
        CLEAR wa_output.
      ENDLOOP.
    Calling the ALV screen with custom container
      CALL SCREEN 0600.
    *On this statement double click  it takes you to the screen painter SE51.
    *Enter the attributes
    *Create a Custom container and name it CCONT and OK code as OK_CODE.
    *Save check and Activate the screen painter.
    *Now a normal screen with number 600 is created which holds the ALV grid.
    PBO of the actual screen ,
    Here we can give a title and customized menus
    *create 2 buttons with function code 'SAVE' and 'EXIT'.
    GIVE A SUITABLE TITLE
    *&      Module  STATUS_0600  OUTPUT
          text
    MODULE status_0600 OUTPUT.
      SET PF-STATUS 'DISP'.
      SET TITLEBAR 'ALVF4'.
    ENDMODULE.                 " STATUS_0600  OUTPUT
    calling the PBO module ALV_GRID.
    *&      Module  PBO  OUTPUT
          text
    MODULE pbo OUTPUT.
    *Creating objects of the container
      CREATE OBJECT c_ccont
           EXPORTING
              container_name = 'CCONT'.
    create object for alv grid
      create object c_alvgd
      exporting
      i_parent = c_ccont.
    SET field for ALV
      PERFORM alv_build_fieldcat.
    Set ALV attributes FOR LAYOUT
      PERFORM alv_report_layout.
      CHECK NOT c_alvgd IS INITIAL.
    Call ALV GRID
      CALL METHOD c_alvgd->set_table_for_first_display
        EXPORTING
          is_layout                     = it_layout
          i_save                        = 'A'
        CHANGING
          it_outtab                     = it_output
          it_fieldcatalog               = it_fcat
        EXCEPTIONS
          invalid_parameter_combination = 1
          program_error                 = 2
          too_many_lines                = 3
          OTHERS                        = 4.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                   WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDMODULE.                 " PBO  OUTPUT
    *&      Form  alv_build_fieldcat
          text
         <--P_IT_FCAT  text
    *subroutine to build fieldcat
    FORM alv_build_fieldcat.
      DATA lv_fldcat TYPE lvc_s_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '1'.
      lv_fldcat-fieldname = 'INFTY'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 8.
      lv_fldcat-scrtext_m = 'Infotype'.
      lv_fldcat-icon = 'X'.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '2'.
      lv_fldcat-fieldname = 'PNNNN'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 15.
      lv_fldcat-scrtext_m = 'Structure'.
      lv_fldcat-icon = ''.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '3'.
      lv_fldcat-fieldname = 'ITEXT'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 60.
      lv_fldcat-scrtext_m = 'Description'.
      lv_fldcat-icon = ''.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '5'.
      lv_fldcat-fieldname = 'ZRMKZ'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 1.
      lv_fldcat-scrtext_m = 'PERIOD'.
      lv_fldcat-icon = ''.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '6'.
      lv_fldcat-fieldname = 'ZEITB'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 5.
      lv_fldcat-scrtext_m = 'Time constraint'.
      lv_fldcat-edit = 'X'.
    *To avail the existing F4 help these are to
    *be given in the field catalogue
      lv_fldcat-f4availabl = 'X'.
      lv_fldcat-ref_table = 'T582A'.
      lv_fldcat-ref_field = 'ZEITB'.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '7'.
      lv_fldcat-fieldname = 'DNAME'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 15.
      lv_fldcat-scrtext_m = 'Dialogmodule'.
      lv_fldcat-icon = ''.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '8'.
      lv_fldcat-fieldname = 'DAVO'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 15.
      lv_fldcat-scrtext_m = 'Start'.
      lv_fldcat-edit = 'X'.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
      lv_fldcat-row_pos   = '1'.
      lv_fldcat-col_pos   = '9'.
      lv_fldcat-fieldname = 'DAVOE'.
      lv_fldcat-tabname   = 'IT_OUTPUT'.
      lv_fldcat-outputlen = 15.
      lv_fldcat-scrtext_m = 'End'.
      lv_fldcat-icon = ''.
      APPEND lv_fldcat TO it_fcat.
      CLEAR lv_fldcat.
    *To create drop down for the field 'DAVO'
    with our own f4 help
      ty_dropdown-handle = '1'.
      ty_dropdown-value = ' '.
      APPEND ty_dropdown TO it_dropdown.
      ty_dropdown-handle = '1'.
      ty_dropdown-value = '1'.
      APPEND ty_dropdown TO it_dropdown.
      ty_dropdown-handle = '1'.
      ty_dropdown-value = '2'.
      APPEND ty_dropdown TO it_dropdown.
      ty_dropdown-handle = '1'.
      ty_dropdown-value = '3'.
      APPEND ty_dropdown TO it_dropdown.
      CALL METHOD c_alvgd->set_drop_down_table
        EXPORTING
          it_drop_down = it_dropdown.
      LOOP AT it_fcat INTO lv_fldcat.
        CASE lv_fldcat-fieldname.
    To assign dropdown in the fieldcataogue
          WHEN 'DAVO'.
            lv_fldcat-drdn_hndl = '1'.
            lv_fldcat-outputlen = 15.
            MODIFY it_fcat FROM lv_fldcat.
        ENDCASE.
      ENDLOOP.
    ENDFORM.                    " alv_build_fieldcat
    *&      Form  alv_report_layout
          text
         <--P_IT_LAYOUT  text
    *Subroutine for setting alv layout
    FORM alv_report_layout.
      it_layout-cwidth_opt = 'X'.
      it_layout-col_opt = 'X'.
      it_layout-zebra = 'X'.
    ENDFORM.                    " alv_report_layout
    PAI module of the screen created. In case we use an interactive ALV or
    *for additional functionalities we can create OK codes
    *and based on the user command we can do the coding.
    *&      Module  PAI  INPUT
          text
    MODULE pai INPUT.
    *To change the existing values and refresh the grid
    *And only values in the dropdown or in the default
    *F4 can be given , else no action takes place for the dropdown
    *and error is thrown for the default F4 help and font changes to red
    *and on still saving, value is not changed
      c_alvgd->check_changed_data( ).
    *Based on the user input
    *When user clicks 'SAVE;
      CASE ok_code.
        WHEN 'SAVE'.
    *A pop up is called to confirm the saving of changed data
          CALL FUNCTION 'POPUP_TO_CONFIRM'
            EXPORTING
              titlebar       = 'SAVING DATA'
              text_question  = 'Continue?'
              icon_button_1  = 'icon_booking_ok'
            IMPORTING
              answer         = gstring
            EXCEPTIONS
              text_not_found = 1
              OTHERS         = 2.
          IF sy-subrc NE 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
    *When the User clicks 'YES'
          IF ( gstring = '1' ).
            MESSAGE 'Saved' TYPE 'S'.
    *Now the changed data is stored in the it_pbo internal table
            it_pbo = it_output.
    *Subroutine to display the ALV with changed data.
            PERFORM redisplay.
          ELSE.
    *When user clicks NO or Cancel
            MESSAGE 'Not Saved'  TYPE 'S'.
          ENDIF.
    **When the user clicks the 'EXIT; he is out
        WHEN 'EXIT'.
          LEAVE PROGRAM.
      ENDCASE.
      CLEAR: ok_code.
    ENDMODULE.                 " PAI  INPUT
    *&      Form  REDISPLAY
          text
    -->  p1        text
    <--  p2        text
    FORM redisplay .
    *Cells of the alv are made non editable after entering OK to save
      CALL METHOD c_alvgd->set_ready_for_input
        EXPORTING
          i_ready_for_input = 0.
    *Row and column of the alv are refreshed after changing values
      stable-row = 'X'.
      stable-col = 'X'.
    *REfreshed ALV display with the changed values
    *This ALV is non editable and contains new values
      CALL METHOD c_alvgd->refresh_table_display
        EXPORTING
          is_stable = stable
        EXCEPTIONS
          finished  = 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.                    " REDISPLAY

  • Download to excel from alv display

    Hi,
    How to download to excel from alv display.I am using object oriented abap for using alv.If i click export->spreadsheet i am getting fatal error and if i export->local file->spreadsheet i am getting only the column names and heading but no contents.Can anyone tell me how to overcome this problem.
    Regards,
    Sowmya.

    Hi Sowmya,
    Just put break point near FM reuse_alv_grid_display and check if internal table which is used to display output is popullated or not.
    Regards Sachin.

  • ALV display: Default setting field in grey mode

    Hi
    In SE16 or SE11 when we are checking the table (any table, say MARA, RESB etc) with ALV option, we are getting the "save layout" with default setting field in grey mode. So whatever layout is created it is not a default layout, the user has to select the layout. However when I check with another friend in another project there the ALV setting is coming with editable option.
    So how shall I get that the field in change mode. Pls suggest.
    Regds

    Hi BNR,
    for reasons that may be discussed elsewhere, the layout saved in SE16 is applied to all tables displayed using SE16. Thus a default layout does not make too much sense. In the layout the columns displayed are stored. If you have a default layout you will see only the columns that have all displayed columns in common.
    By the way, in my system I can store a default layout but only user-specific. I can not save standard (non-user-specific) layouts in SE16/SE11.
    In SE16N I can store both general (non-user-specific) and Default layouts. Here the layout is table-specific.
    If you users want a special layout (and they are allowed to use SE16!!!) , you should switch to SE16N.
    Regards,
    Clemens

Maybe you are looking for

  • How to reuse a 9iAS Portal database connection in a BC4J application?

    Hi, I have a 9iAS Portal 9.0.2 application, and I want to call a BC4J/UIX application from the Portal application. Ideally I would like to reuse the database connection already established within Portal, because it has authenticated the user with the

  • My iPhone 3gs is lagging and searching for signal all the time. Help!!

    Well, my phones like 3 years old...and latley it's been lagging, turning it's self off, not sending my messages, when I call other people it doesn't go through, and if it does they can barly hear me. I thought it was my sim card so I got a new one an

  • Data Migration from CRM 5.0 to CRM 7.0

    Hi Friends, We are into a re-implementation on CRM 7.0. The old system was on CRM 5.0. Since this is not an upgrade, the data will not copied over from the old system into the new system. So, now I would like to know how to migrate data (master/trans

  • ORA-01114: IO error writing block

    What is the best way to recover from error : Wed Nov 22 21:44:01 2006 Errors in file c:\oracle\admin\orcl\bdump\orcl_dbw0_3932.trc: ORA-01242: data file suffered media failure: database in NOARCHIVELOG mode ORA-01114: IO error writing block to file 6

  • Need help regarding implementing SSAS solution using microsoft decision trees algorithm

    Hi All, I am new to SSAS and Data Mining techniques. I dnt have a good knowledge about data mining in SSAS.  I have a requirement regarding predictive analysis and want to check whether i can implement SSAS for it.  I have two tables namely Tree and