Alv grid  dispaly in custom container....?

Hay friends i have shown ALV grid display in custom container .....in that some fields are input fields...
how can i modify my internal table (which is shown in ALV )...by knowing that this field is changed...i need to update in my internal  table...
need help...
reply soon...

Hello
All you need to know can be found in thread About events of class cl_gui_alv_grid and the links mentioned therein.
Regards
  Uwe

Similar Messages

  • Refresh Editable ALV Grid inside a custom Container

    Hello all,
    I am having a screen with custom container in which i am populating datas and a entry screen which is going to have my
    filtering condition for this custom container screen..
    The problem i am facing is whenever i come out of the custom container screen after displaying and again give the
    necessary filtering data in the previous screen...
    the custom container screen displays wrong values...
    But when i refresh the data with the refresh icon in the container right datas are coming...
    I even used CALL METHOD C_ALVGD->REFRESH_TABLE_DISPLAY
    EXPORTING
    IS_STABLE = STABLE
    EXCEPTIONS
    FINISHED = 1
    OTHERS = 2. after displaying the values using
    CALL METHOD C_ALVGD->SET_TABLE_FOR_FIRST_DISPLAY
    EXPORTING
    IT_TOOLBAR_EXCLUDING = T_FUNC
    IS_LAYOUT = IT_LAYOUT
    I_SAVE = 'A'
    CHANGING
    IT_OUTTAB = IT_ZCAWNT_V
    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.
    I have refreshed my internal table once when i display and again fetched from the DB according to the filtering conditions given
    in the first screen.
    I have tried clearing the Object created once when i display and again recreated it.But could not get the output.
    solution would be really helpful...

    Hey all,
    Thanks a lot for helping me...
    The problem is solved....
    i just used,
            CALL METHOD C_ALVGD->FREE. 'Grid inside the container
            CLEAR C_ALVGD.
            CALL METHOD C_CCONT->FREE. "Container
            CLEAR C_CCONT.
    when i click BACK Button from screen 2 to screen1.

  • Regarding PF Status In ALV Grid Dispaly

    Hi..
    Can you please tell me how to set PF status in ALV Grid Display.
    Regards
    Sandeep.

    hi,
    if u use REUSE_ALV_LIST_DISPLAY copy the standard GUI-Status named STANDARD from function group SALV in your program
    if u use REUSE_ALV_GRID_DISPLAY_LVC or REUSE_ALV_GRID_DISPLAY copy the standard GUI-Status named STANDARD_FULLSCREEN from function group SLVC_FULLSCREEN in your program
    after  that you cas set the pf-status in this way:
    >CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'                   
    > EXPORTING                                               
    >    i_callback_program                = sy-cprog         
    >    i_callback_pf_status_set          = 'STATUS'
    >    i_callback_user_command           = 'USERCOMMAND'    
    >   is_layout                           = st_layout         
    >   it_fieldcat                          = st_fieldcat      
    >  TABLES                                      
    >    t_outtab                          = outtab 
    or
    >CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'              
    > EXPORTING                                              
    >    i_callback_program                = sy-cprog         
    >    i_callback_pf_status_set          = 'STATUS'  
    >    i_callback_user_command           = 'USERCOMMAND'   
    >    is_layout_lvc                     = wa_slis_layout  
    >    it_fieldcat_lvc                   = tb_slis_fieldcat
    >  TABLES                                                
    >    t_outtab                          = tb_app          
    where USERCOMMAND and STATUS are 2 forms in your program.
    >FORM status USING pfstat TYPE slis_t_extab.
    > SET PF-STATUS 'STANDARD' EXCLUDING pfstat.
    >ENDFORM.
    >
    > ...
    >
    >FORM usercommand USING okcode LIKE sy-ucomm
    >                       wa_selfield TYPE slis_selfield.
    >  CASE okcode.
    >      .... 
    >  ENDCASE
    >ENDFORM.
    Bye.
    Marco

  • ALV grid total line customizing

    Dear Masters,
    I need a solution for my problem. I need to modify sorting of subtotal and grand total based on currency which criteria i create  myself. The standard alv output sort total by currency based on alpahabetical order, e.g: AUD,  EUR, IDR, USD. I need to change the sorting into IDR, USD, AUD, EUR. How can i do it in alv grid?
    I also like to add new line after grand total line, which is grand total in Local Currency, in this case, in IDR, which rate given. I can get the figure of subtotal, but i don't know how to append new line after grand total line output in alv standard.
    Need your suggestion.
    Many thanks,
    Tiara

    Hi,
    I have used object oriented ALV. You can remove final total line and have sub total lines. Code below can help you.
    1) Fieldcatalog you can do sum for currency values
    2) Sort Build you can have sub totals.
    3) layout_init you can remove final total line.
    4) CALL METHOD grid->set_table_for_first_display you can pass above structure for excepted Result.
    fieldcatalog_init
    FORM fieldcatalog_init USING lt_fieldcatalog TYPE lvc_t_fcat
                           value(field_name) value(field_type) value(field_text) value(field_key).
      DATA: ls_fieldcatalog TYPE lvc_s_fcat.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = field_name.
      ls_fieldcatalog-datatype  = field_type.
      ls_fieldcatalog-reptext   = field_text.
      ls_fieldcatalog-coltext   = field_text.
      ls_fieldcatalog-seltext   = field_text.
      ls_fieldcatalog-tooltip   = field_text.
      ls_fieldcatalog-key       = field_key.
      IF field_type = 'CURR'.
        ls_fieldcatalog-do_sum    = 'X'.
      ENDIF.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
    ENDFORM.                    "fieldcatalog_init
    sort_build
    FORM sort_build USING lt_sort TYPE lvc_t_sort.
      DATA: ls_sort TYPE lvc_s_sort.
      ls_sort-fieldname = 'BUKRS'. "Fieldname on which to sort
      ls_sort-subtot    = 'X'.
      ls_sort-up        = 'X'.     "Sort Ascending
      APPEND ls_sort TO lt_sort.
      IF p_comp <> 'X'.
        ls_sort-fieldname = 'LIFNR'. "Fieldname on which to sort
        ls_sort-subtot    = 'X'.
        ls_sort-up        = 'X'.     "Sort Ascending
        APPEND ls_sort TO lt_sort.
      ENDIF.
      ls_sort-fieldname = 'WAERS'. "Fieldname on which to sort
      ls_sort-subtot    = 'X'.
      ls_sort-up        = 'X'.     "Sort Ascending
      APPEND ls_sort TO lt_sort.
    ENDFORM.                    "sort_build
    layout_init
    FORM layout_init USING ls_layout TYPE lvc_s_layo.
      DATA lv_date(10) TYPE c.
      WRITE sy-datum TO lv_date.
      IF p_line = 'X'.
        CONCATENATE 'Line Item wise Report as on' lv_date INTO w_string2 SEPARATED BY space.
      ELSEIF p_vend = 'X'.
        CONCATENATE 'Vendor Summary Report as on' lv_date INTO w_string2 SEPARATED BY space.
      ELSEIF p_comp = 'X'.
        CONCATENATE 'Company Summary Report as on' lv_date INTO w_string2 SEPARATED BY space.
      ENDIF.
      ls_layout-zebra      = 'X'.
      ls_layout-grid_title =  w_string2.
      ls_layout-sel_mode   = 'A'.
    ls_layout-no_merging = 'X'.
      ls_layout-cwidth_opt = 'X'.
      ls_layout-no_totline = 'X'.
      IF p_line = 'X'.
        ls_layout-ctab_fname = 'COLINFO'.
      ENDIF.
    ENDFORM.                    "layout_init
          CALL METHOD grid->set_table_for_first_display
            EXPORTING
              is_layout       = gs_layout
              is_variant      = va_layout "&see below
              i_save          = 'A'     "&see below
              i_default       = ''
            CHANGING
              it_outtab       = it_apout[]
              it_fieldcatalog = gt_fieldcatalog
              it_sort         = gt_sort.
    Edited by: Himanshu Dave on May 11, 2009 2:33 PM

  • Events in alv grid dispaly

    Hi,
    I have a requirement to select a row in ALV output and perform some action after a button is pressed.
    (i.e) i have a release button and after i select a line item in alv output and press on the button ,that item should be released.
    so both the events (Selection of line item and pressing of button) should happen together
    how can this be achieved.
    moreover i should be able to select multiple line items in the alv grid display.how can this be achieved.is it in fieldcatalog level or layout level.
    Any pointers to this would be of great help.
    Regards,
    S.Subasree.

    Hi,
    Check the sample code which captures multipe selcted rows
    on clicking a button.
    FORM sub_user_command USING ucomm TYPE sy-ucomm
                                  sel TYPE slis_selfield.
      DATA: ref_grid TYPE REF TO cl_gui_alv_grid.
      DATA: count             TYPE i            ,
            i_rows            TYPE lvc_t_row    .
      DATA: lf_row_index      TYPE lvc_index    ,
            i_selected_line_s TYPE lvc_s_row    ,
            l_vbeln           TYPE vbeln        .
    *then insert the following code in your USER_COMMAND routine...
      IF ref_grid IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            e_grid = ref_grid.
      ENDIF.
      IF NOT ref_grid IS INITIAL.
        CALL METHOD ref_grid->check_changed_data.
      ENDIF.
      CASE ucomm.
        WHEN 'PDF'.
          CALL METHOD ref_grid->get_selected_rows
            IMPORTING
              et_index_rows = i_rows.
          LOOP AT i_rows
             INTO i_selected_line_s.
            lf_row_index = i_selected_line_s-index.
            CLEAR i_selected_line_s.
            READ TABLE it_itab
                  INTO wa_itab
                 INDEX lf_row_index.
            IF sy-subrc EQ 0.
              refresh:bdcmsgcoll,
                      bdcdata.
              clear:l_vbeln.
              MOVE wa_itab-vbeln TO l_vbeln.
    ENDFORM.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                i_callback_program       = sy-repid
                i_callback_pf_status_set = 'Z_PF_TEST'
                i_callback_user_command  = 'SUB_USER_COMMAND'
                is_layout                = ls_layout
                it_fieldcat              = lt_fieldcat
               it_sort     = lt_sort
           TABLES
                t_outtab    = it_itab.
    Regards,
    Raj.

  • ALV Grid dispaly

    I am using ECC 5 version.
    In the ALV grid display, if we assign a box as a first field, we get selection boxes for each row and also in the Fields' header, we will have one more button to select All fields and columns in the list.
    I do not require 'Select All' button in the list but I need individual selection buttons. Please help me.
    Thanks

    this should help u
    u want to select 2 or more boxes at a time , if i am right
    tables Mara.
    DATA: begin of lmara OCCURS 0,
    abc.
    include structure mara.
    data end of lmara.
    SELECT * FROM mara.
    move-corresponding mara to lmara.
    append lmara.
    endselect.
    call screen 100.
    *& Module STATUS_0100 OUTPUT
    * text
    module STATUS_0100 output.
    * SET PF-STATUS 'xxxxxxxx'.
    * SET TITLEBAR 'xxx'.
    data: gc_custom_container TYPE REF TO cl_gui_custom_container,
    ggrid_codes TYPE REF TO cl_gui_alv_grid,
    gs_layout TYPE lvc_s_layo,
    gt_fieldcat type lvc_t_fcat.
    IF gc_custom_container IS INITIAL.
    CREATE OBJECT gc_custom_container
    EXPORTING container_name = 'ALV_CONTAINER'.
    CREATE OBJECT ggrid_codes
    EXPORTING
    i_parent = gc_custom_container.
    data st_fieldcat type lvc_s_fcat.
    st_fieldcat-fieldname = 'ABC'.
    st_fieldcat-inttype = 'C'.
    st_fieldcat-outputlen = 3.
    st_fieldcat-CHECKBOX = 'X'.
    st_fieldcat-EDIT = 'X'.
    st_fieldcat-coltext = 'ABC'.
    st_fieldcat-seltext = 'ABC'.
    append st_fieldcat to gt_fieldcat.
    clear st_fieldcat.
    st_fieldcat-fieldname = 'MATNR'.
    st_fieldcat-inttype = 'C'.
    st_fieldcat-outputlen = 10.
    st_fieldcat-coltext = 'Material'.
    st_fieldcat-seltext = 'MATNR'.
    append st_fieldcat to gt_fieldcat.
    gs_layout-grid_title = 'WELCOME 2 NEW WORLD'.
    gs_layout-no_toolbar = 'X'.
    CALL METHOD ggrid_codes->set_table_for_first_display
    EXPORTING
    * i_structure_name = 'MARA'
    is_layout = gs_layout
    CHANGING
    it_outtab = lmara[]
    it_fieldcatalog = gt_fieldcat.
    ENDIF.

  • Differences between the alv's and alv grid dispaly

    hi guys
    .........please send the  differences between the alv's and alv grid display.
                    thanks....

    Hi Midathala,
    Plz go through the links might be useful to you.
    Simple ALV report
    http://www.sapgenie.com/abap/controls/alvgrid.htm
    http://wiki.ittoolbox.com/index.php/Code:Ultimate_ALV_table_toolbox
    ALV
    1. Please give me general info on ALV.
    http://www.sapfans.com/forums/viewtopic.php?t=58286
    http://www.sapfans.com/forums/viewtopic.php?t=76490
    http://www.sapfans.com/forums/viewtopic.php?t=20591
    http://www.sapfans.com/forums/viewtopic.php?t=66305 - this one discusses which way should you use - ABAP Objects calls or simple function modules.
    2. How do I program double click in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=11601
    http://www.sapfans.com/forums/viewtopic.php?t=23010
    Check the program in the following link:
    http://sap-img.com/abap/display-secondary-list-using-alv-grid.htm
    3. How do I add subtotals (I have problem to add them)...
    http://www.sapfans.com/forums/viewtopic.php?t=20386
    http://www.sapfans.com/forums/viewtopic.php?t=85191
    http://www.sapfans.com/forums/viewtopic.php?t=88401
    http://www.sapfans.com/forums/viewtopic.php?t=17335
    http://www.sapdevelopment.co.uk/reporting/alv/alvgrid_basic.htm
    4. How to add list heading like top-of-page in ABAP lists?
    http://www.sapfans.com/forums/viewtopic.php?t=58775
    http://www.sapfans.com/forums/viewtopic.php?t=60550
    http://www.sapfans.com/forums/viewtopic.php?t=16629
    5. How to print page number / total number of pages X/XX in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=29597 (no direct solution)
    6. ALV printing problems. The favourite is: The first page shows the number of records selected but I don't need this.
    http://www.sapfans.com/forums/viewtopic.php?t=64320
    http://www.sapfans.com/forums/viewtopic.php?t=44477
    7. How can I set the cell color in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=52107
    8. How do I print a logo/graphics in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=81149
    http://www.sapfans.com/forums/viewtopic.php?t=35498
    http://www.sapfans.com/forums/viewtopic.php?t=5013
    9. How do I create and use input-enabled fields in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=84933
    http://www.sapfans.com/forums/viewtopic.php?t=69878
    10. How can I use ALV for reports that are going to be run in background?
    http://www.sapfans.com/forums/viewtopic.php?t=83243
    http://www.sapfans.com/forums/viewtopic.php?t=19224
    11. How can I display an icon in ALV? (Common requirement is traffic light icon).
    http://www.sapfans.com/forums/viewtopic.php?t=79424
    http://www.sapfans.com/forums/viewtopic.php?t=24512
    12. How can I display a checkbox in ALV?
    http://www.sapfans.com/forums/viewtopic.php?t=88376
    http://www.sapfans.com/forums/viewtopic.php?t=40968
    http://www.sapfans.com/forums/viewtopic.php?t=6919
    13. Top-of-page in ALV
    selection-screen and top-of-page in ALV
    14. ALV Group Heading
    http://www.sap-img.com/fu037.htm
    How to add list heading like top-of-page in ABAP lists?
    http://www.sapfans.com/forums/viewtopic.php?t=58775
    http://www.sapfans.com/forums/viewtopic.php?t=60550
    http://www.sapfans.com/forums/viewtopic.php?t=16629
    15. ALV output to PDF conversion
    It has an example code for PDF Conversion.
    http://www.erpgenie.com/abap/code/abap51.htm
    converting the output of alv in pdf
    Thanks
    Mohinder Singh Chauhan

  • ME57 ALV Grid adding some custom fields (columns)

    Hi all,
    does anyone know if it is possible to add some custom col's to the ALV where i see  the Overview of PO Requests in ME57 ?
    seems to me that i have to find a possibilty to expand the structure MEREQ3214 .
    can i do this with the exit MEREQ001 ?  if yes, which component should i use ?
    Thanks for some ideas.
    Tony

    Hi Tony,
    I am facing the same issue. Did you ever get to any solution regarding it ?
    Thanks,
    Gaurav

  • Multiple ALV Grid Controls per report - problem with default displ.variant

    Hi,
    I have a report with few screens called sequentialy. Each one of the screens has implemented own instance of ALV Grid Control within custom container, means:
    - screen 100 has container Cont100 and grid control "grid100",
    - screen 110 has container Cont110 and grid control "grid110"
    - screen 120 has container Cont120 and grid control "grid120"
    and so on...
    Each one of the grid controls is initialized with own field catalog table, with own layout and variant structure definitions. My problem occurs when the user changes the display variant for some of the grid controls and save the layout variant using "default setting" checkbox. In this case next time the program is started all other grid controls behaves like they don't have their own variant definitions, but uses the default setting of the mentioned screen. This leads (usualy) to unsuable grid controls by default, because usualy different controls have no equal field-definition tables. I have the same behaviour even when there are more than 1 ALV grids on a single screen (for example - 2).
    For now I don't provide variant variables at selection screen, but it seems there is no way to provide such variables for each one of the grid-controls.
    Is anyone aware how to control this? Means no matter if there is default setting in use for some of the grid-controls, how to manipulate other grid-controls not to use this default setting?
    Many thanks in advance.
    Regards,
    Ivaylo Mutafchiev

    check this sample code which displays 4 grids in 4 different tabs and with 4 different handles
    PROGRAM  sapmzsdpp MESSAGE-ID z1.
    Table Declarations                                                   *
    TABLES:
      vbpa,                                " Sales Document: Partner
      kna1,                                " Customer Master
      vbap.                                " Sales Document: Item Data
    Tab Strip Declarations                                              *
    CONTROLS:
      tabstrip_sdpp TYPE TABSTRIP.         " Tabstrip
    Constants declarations                                               *
    CONSTANTS:
      c_rep_zm(2)   TYPE c VALUE 'ZM',     " Outside Sales Representative
      c_rep_ve(2)   TYPE c VALUE 'VE',     " Inside Sales Representative
      c_rep_zi(2)   TYPE c VALUE 'ZI',     " Sales Manager
      c_abgru_08(2) TYPE c VALUE '08',     " Reason for Rej: SO Not Closed
      c_stock_ind_e TYPE c VALUE 'E',      " Stock Idctr : Orders on hand
      c_gauge(5)    TYPE c VALUE 'GAUGE',  " Characteristic Name - GAUGE
      c_width(5)    TYPE c VALUE 'WIDTH',  " Characteristic Name - WIDTH
      c_gauge_metric(12)                   " Character Name - GAUGE_METRIC
                    TYPE c VALUE 'GAUGE_METRIC',
      c_width_metric(12)                   " Character Name - WIDTH_METRIC
                    TYPE c VALUE 'WIDTH_METRIC',
      c_eng_metric(14)                     " Charac Value - ENGLISH_METRIC
                    TYPE c VALUE 'ENGLISH_METRIC',
      c_coil(4)     TYPE c VALUE 'COIL',   " For Value COIL
      c_spec_bf(7)  TYPE c VALUE 'SPEC_BF'," Charac value SPEC_BF
      c_wadat_ist(8)                       " Actual Goods Movement Date
                    TYPE c VALUE '00000000',
      c_mcha(4)     TYPE c VALUE 'MCHA',   " Database Table 'MCHA'
      c_classtype_022(3)
                    TYPE c VALUE '022',    " Class Type : BATCH
      c_pipe(2)     TYPE c VALUE '06',     " Material Pricing Group: Pipes
      c_item_ctgry_ztam(4)
                    TYPE c VALUE 'ZTAM',   " Item Cat:Certificate Mnfctr
      c_lab_result(10)                     " Charac Value LAB_RESULT
                    TYPE n VALUE '0000001392',
      c_none_reqd(10)                      " For Value NONE REQD
                    TYPE c VALUE 'NONE REQD.',
      c_passed(6)   TYPE c VALUE 'PASSED', " For Value PASSED
      c_pending(12) TYPE c                 " For Value TEST PENDING
                    VALUE 'TEST PENDING',
      c_bundling(13)                       " For Value TEST BUNDLING
                    TYPE c VALUE 'TEST BUNDLING',
      c_normal(2)   TYPE c VALUE '01'.     " Priority: Normal
    Internal Table Declarations                                          *
    DATA :
    Internal table to hold common data for all reports
    BEGIN OF t_common_data OCCURS 0,
       kunnr        LIKE vbak-kunnr,       " Customer Number
       vbeln        LIKE vbap-vbeln,       " Sales Document Number
       posnr        LIKE vbap-posnr,       " Sales Document Item Number
       ihrez_e      LIKE vbkd-ihrez_e,     " Mill Order Number
       matnr        LIKE vbap-matnr,       " Material Number
       pstyv        LIKE vbap-pstyv,       " Sales Document Item Category
       kwmeng       LIKE vbap-kwmeng,      " Cumulative Order Quantity
       lprio        LIKE vbap-lprio,       " Delivery Priority
       werks        LIKE vbap-werks,       " Plant
       kondm        LIKE vbap-kondm,       " Material Pricing Group
       aedat        LIKE vbap-aedat,       " Date of Last Change
       cuobj        LIKE vbap-cuobj,       " Configuration
       saldata      LIKE vbap-zzcust_req_avail,
                                           " Required Availability Date
    END OF t_common_data,
    Internal table to hold Customer Number
      BEGIN OF t_cust_temp OCCURS 0,
        kunnr       LIKE vbak-kunnr,       " Customer Number
      END OF t_cust_temp,
    Internal table to hold stock details
      BEGIN OF t_stock OCCURS 0,
       vbeln        LIKE mska-vbeln,       " Sales Document Number
       posnr        LIKE mska-posnr,       " Sales Document Item Number
       matnr        LIKE mska-matnr,       " Material Number
       werks        LIKE mska-werks,       " Plant
       charg        LIKE mska-charg,       " Batch Number
       kalab        LIKE mska-kalab,       " Valuated Stock
       ersda        LIKE mska-ersda,
    END OF t_stock,
    Internal table to hold deliveries
    BEGIN OF t_delivery_data OCCURS 0,
      vbeln         LIKE lips-vbeln,       " Delivery Document Number
      vgbel         LIKE lips-vgbel,       " Document No of Ref Document
      vgpos         LIKE lips-vgpos,       " Item No of Ref Item
    END OF t_delivery_data,
    Internal table to hold released tons & released days
    BEGIN OF t_released_tons_days OCCURS 0,
      vbeln         LIKE likp-vbeln,       " Delivery Document Number
      btgew         LIKE likp-btgew,       " Total Weight
      bldat         LIKE likp-bldat,       " Document Date in Document
    END OF t_released_tons_days,
    Internal table to hold Pre-Production-Pending Orders (Report-1)
    BEGIN OF t_pre_prod_ord OCCURS 0,
       sortl1       LIKE zcustcode-sortl,  " Customer Search Term
       ihrez_e1     LIKE vbkd-ihrez_e,     " Mill Order Number
       salord1(17)  TYPE c,                " Sales Order Document & Item
       descri       TYPE char70,           " Specification of the Item
       speci        TYPE char30,           " Description of the Item
       days_entry   LIKE zlgcyinfo-days_since_entry,
                                           " Days Since Entry
       dept         LIKE zlgcyinfo-bklog,  " Department
       notes1       LIKE zcsimemo-text,    " CSI File Memo Text
    */ Request No. DV2K904687
       chng_date    LIKE vbap-aedat,       " Date of Last Change
    END OF t_pre_prod_ord,
    Internal table to hold Delinquent Orders (Report-2)
    BEGIN OF t_delinquent_ord OCCURS 0,
       sortl2       LIKE zcustcode-sortl,  " Customer Search Term
       ihrez_e2     LIKE vbkd-ihrez_e,     " Mill Order Number
       salord2(17)  TYPE c,                " Sales Order Document & Item
       descri       TYPE char70,           " Specification of the Item
       speci        TYPE char30,           " Description of the Item
       saldata      LIKE vbap-zzcust_req_avail,
       schdate      LIKE vbep-edatu,       " Schedule Line Date
       days_late    LIKE zlgcyinfo-dayslate,
                                           " Days Late
       unit         LIKE zlgcyinfo-unit,   " Status of Consolidation Units
       days_at_unit LIKE zlgcyinfo-daysatunit,
       notes2       LIKE zcsimemo-text,    " CSI File Memo Text
    END OF t_delinquent_ord,
    Internal table to hold Processed Material Orders (Report-3)
    BEGIN OF t_processed_ord OCCURS 0,
       sortl3       LIKE zcustcode-sortl,  " Customer Search Term
       ihrez_e3     LIKE vbkd-ihrez_e,     " Mill Order Number
       salord3(17)  TYPE c,                " Sales Order Document & Item
       descri       TYPE char70,           " Specification of the Item
       speci        TYPE char30,           " Description of the Item
       order_tons   LIKE vbap-kwmeng,      " Cumulative Order Quantity
       fin_tons     LIKE mska-kalab,       " Val.Stock With Unres Usage
       fin_days     TYPE i,                " Finished Days
       rel_tons     LIKE likp-btgew,       " Total Weight
       rel_days     TYPE i,                " No.of.Days Order is Released
       status(15)   TYPE c,                " Status Of Stock
       tb_tons      LIKE zlgcyinfo-tons,   " Tons
       notes3       LIKE zcsimemo-text,    " CSI File Memo Text
    END OF t_processed_ord,
    Internal table to hold Flagged Orders (Report-4)
    BEGIN OF t_flagged_ord OCCURS 0,
       sortl4       LIKE zcustcode-sortl,  " Customer Search Term
       ihrez_e4     LIKE vbkd-ihrez_e,     " Mill Order Number
       salord4(17)  TYPE c,                " Sales Order Document & Item
       descri       TYPE char70,           " Specification of the Item
       speci        TYPE char30,           " Description of the Item
       saldata      LIKE vbap-zzcust_req_avail,
       unit         LIKE zlgcyinfo-unit,   " Status of Consolidation Units
       tons         LIKE zlgcyinfo-tons,   " Tons
       priority     LIKE vbap-lprio,       " Delivery Priority
       notes4       LIKE zcsimemo-text,    " CSI File Memo Text
    END OF t_flagged_ord,
    Internal table to hold CSI memo file data
    BEGIN OF t_csi_memo_data OCCURS 0,
       vbeln        LIKE zcsimemo-vbeln,   " Sales Document Number
       posnr        LIKE zcsimemo-posnr,   " Sales Order line item
       text         LIKE zcsimemo-text,    " CSI File Memo Text
    END OF t_csi_memo_data,
    Internal table to hold Customer Codes
    BEGIN OF t_customer_code OCCURS 0,
       sortl        LIKE zcustcode-sortl,  " Sort Field
       kunnr        LIKE zcustcode-kunnr,  " Customer Number
    END OF t_customer_code,
    Internal table to hold schedule line dates
    BEGIN OF t_schedule_line_date OCCURS 0,
       vbeln        LIKE vbep-vbeln,       " Sales Document Number
       posnr        LIKE vbep-posnr,       " Sales Document Item Number
       edatu        LIKE vbep-edatu,       " Schedule line date
    END OF t_schedule_line_date,
    Internal table to hold Characteristic values
      t_configuration
                    TYPE TABLE OF conf_out
                    WITH HEADER LINE,
    Internal tables to hold legacy data
      t_lgcyinfo    TYPE TABLE OF zlgcyinfo
                    WITH HEADER LINE.
    Work variables declarations                                          *
    DATA:
      gv_parvw      LIKE kupav-parvw,      " Partner function
      gv_abgru      LIKE vbap-abgru,       " Reason to eject sales order
      gv_gauge      LIKE conf_out-atwtb,   " Charac Value Description
      gv_width      LIKE conf_out-atwtb,   " Charac Value Description
      gv_ok_code    LIKE sy-ucomm,         " Usercommand
      gv_okcode     LIKE sy-ucomm,         " User Command
      gv_number     LIKE sy-dynnr
                    VALUE '0101',          " Initial Sub Screen Number
      gv_vbeln      LIKE vbak-vbeln,       " Sales Order
      gv_posnr      LIKE vbup-posnr,       " Sales Item
    */ Request No. DV2K904687
      gv_del_prio   LIKE vbap-lprio,       " Delivery Priority
      gv_obj_key    LIKE inob-objek,       " Object Key
      gv_config     LIKE inob-cuobj,       " Configuration
      gv_lab_result LIKE ausp-atwrt,       " Lab Result Value
      gv_pass_stock LIKE mska-kalab,       " Finished Stock
      gv_fail_stock LIKE mska-kalab,       " Failed Stock
      gv_tp_tons    LIKE mska-kalab,       " Test Pending Tons
      gv_csi_stock  LIKE mbew-lbkum,       " CSI Stock On Hand
      gv_val_stock  LIKE mska-kalab,       " Valuated Stock
      gv_fin_tons   LIKE mska-kalab,       " Finished Tons
      gv_fin_days   TYPE i,                " Finished Days
      gv_rel_tons   LIKE likp-btgew,       " Released Tons
      gv_rel_days   TYPE i,                " Released Days
      gv_no_delivery                       " Number of Delivery Documents
                    TYPE i,
      gv_bund_tons  LIKE zlgcyinfo-tons,   " Bundling Tons
      gv_net_weight LIKE mara-ntgew,       " Net Weight
      gv_tb_tons    LIKE zlgcyinfo-tons,   " Test/Bundling Tons
      gv_date       LIKE mska-ersda,       " Date
      gv_tabix      LIKE sy-tabix,         " Table Index
      gv_flg        TYPE c,                " Flag Variable
      gv_exit       TYPE c.                " For Parameter Exit
    Constant declarations for ALV Grid                                   *
    CONSTANTS:
      c_cont_pre_prod_ord
                     TYPE scrfname VALUE 'CUST_PPP',
                                           " Custom Container for Report-1
      c_cont_delinquent_ord
                     TYPE scrfname VALUE 'CUST_DIP',
                                           " Custom Container for Report-2
      c_cont_processed_ord
                     TYPE scrfname VALUE 'CUST_PMS',
                                           " Custom Container for Report-3
      c_cont_flagged_ord
                     TYPE scrfname VALUE 'CUST_FLGORD',
                                           " Custom Container for Report-4
      c_handle1(3)   TYPE c VALUE 'G_1',   " Handle for PPP rpt Grid
      c_handle2(3)   TYPE c VALUE 'G_2',   " Handle for DIP rpt Grid
      c_handle3(3)   TYPE c VALUE 'G_3',   " Handle for PMS rpt Grid
      c_handle4(3)   TYPE c VALUE 'G_4',   " Handle for FLGORD rpt Grid
      c_true         TYPE c VALUE 'X',     " For value 'X'
      c_save         TYPE c VALUE 'A'.     " User-Defd & Global Variants
    Selection Screen                                                     *
    SELECTION-SCREEN BEGIN OF SCREEN 500 AS WINDOW.
    SELECTION-SCREEN BEGIN OF BLOCK b1 WITH FRAME TITLE text-014.
    PARAMETERS :
      p_osr       RADIOBUTTON GROUP g1
                  DEFAULT 'X',             " Outside Sales Representative
      p_isr       RADIOBUTTON GROUP g1,    " Inside Sales Representative
      p_s_mgr     RADIOBUTTON GROUP g1.    " Sales Manager
    SELECTION-SCREEN END OF BLOCK b1.
    SELECTION-SCREEN BEGIN OF BLOCK b2 WITH FRAME TITLE text-005.
    SELECT-OPTIONS:
      s_pernr     FOR vbpa-pernr
                  OBLIGATORY,              " Employee Number
      s_kunnr     FOR kna1-kunnr,          " Customer Number
      s_sortl     FOR kna1-sortl,          " Customer Search Term
      s_kondm     FOR vbap-kondm.          " Material Pricing Group
    SELECTION-SCREEN END OF BLOCK b2.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-006.
    PARAMETERS:
      p_open      RADIOBUTTON GROUP g2
                  DEFAULT 'X',             " Open Orders
      p_closed    RADIOBUTTON GROUP g2.    " Closed Orders
    SELECTION-SCREEN END OF BLOCK b3.
    SELECTION-SCREEN BEGIN OF BLOCK b4 WITH FRAME TITLE text-007.
    PARAMETERS:
      p_var1      LIKE disvariant-variant, " Variant For Report-1
      p_var2      LIKE disvariant-variant, " Variant For Report-2
      p_var3      LIKE disvariant-variant, " Variant For Report-3
      p_var4      LIKE disvariant-variant. " Varinat For Report-3
    SELECTION-SCREEN END OF BLOCK b4.
    SELECTION-SCREEN END OF SCREEN 500.
    */ Begin of Modification - Request No. DV2K904687
    Selection Screen for Changing Sales Order Priority
    SELECTION-SCREEN BEGIN OF SCREEN 1100 AS WINDOW.
    SELECTION-SCREEN BEGIN OF BLOCK b5 WITH FRAME TITLE text-044.
    PARAMETERS    p_sonum  LIKE vbap-vbeln." Sales Order Number
    SELECT-OPTIONS s_item  FOR  vbap-posnr." Sales Order Item
    PARAMETERS     p_delpr LIKE vbap-lprio." Delivery Priority
    SELECTION-SCREEN END OF BLOCK b5.
    SELECTION-SCREEN END OF SCREEN 1100.
    */ End of Modification - Request No. DV2K904687
    CLASS lcl_gv_event_receiveriver DEFINITION                           *
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    ALV Grid - Work Variables Declarations                               *
    DATA:
      gv_cont_pre_prod_ord   TYPE REF
                               TO cl_gui_custom_container,
                                           " Custom Cont For Report-1
      gv_cont_delinquent_ord TYPE REF
                               TO cl_gui_custom_container,
                                          " Custom Cont For Report-2
      gv_cont_processed_ord  TYPE REF
                               TO cl_gui_custom_container,
                                           " Custom Cont For Report-3
      gv_cont_flagged_ord    TYPE REF
                               TO cl_gui_custom_container,
                                           " Custom Cont For Report-4
      gv_grid_pre_prod_ord   TYPE REF
                               TO cl_gui_alv_grid,
                                           " Grid For Report-1
      gv_grid_delinquent_ord TYPE REF
                               TO cl_gui_alv_grid,
                                           " Grid For Report-2
      gv_grid_processed_ord  TYPE REF
                               TO cl_gui_alv_grid,
                                           " Grid For Report-3
      gv_grid_flagged_ord    TYPE REF
                               TO cl_gui_alv_grid,
                                           " Grid For Report-4
      gv_event_receiver      TYPE REF
                               TO lcl_event_receiver,
                                           " Object For Local Class
      gs_lay_pre_prod_ord    TYPE lvc_s_layo,
                                           " Work Area for Grid layout
      gs_lay_delinquent_ord  TYPE lvc_s_layo,
                                           " Work Area for Grid layout
      gs_lay_processed_ord   TYPE lvc_s_layo,
                                           " Work Area for Grid layout
      gs_lay_flagged_ord     TYPE lvc_s_layo,
                                           " Work Area for Grid Layout
      gs_var_pre_prod_ord    TYPE disvariant,
                                           " Layout Structure
      gs_var_delinquent_ord  TYPE disvariant,
                                           " Layout Structure
      gs_var_processed_ord   TYPE disvariant,
                                           " Layout Structure
      gs_var_flagged_ord     TYPE disvariant,
                                           " Layout Structure
      t_fcat_pre_prod_ord    TYPE lvc_t_fcat
                             WITH HEADER LINE,
                                           " Field Catalog For Report-1
      t_fcat_delinquent_ord  TYPE lvc_t_fcat
                             WITH HEADER LINE,
                                           " Field Catalog For Report-2
      t_fcat_processed_ord   TYPE lvc_t_fcat
                             WITH HEADER LINE,
                                           " Field Catalog For Report-3
      t_fcat_flagged_ord     TYPE lvc_t_fcat
                             WITH HEADER LINE,
                                           " Field Catalog For Report-4
      t_exclude              TYPE ui_functions,
                                           " Function Code Table
      gs_exclude             TYPE ui_func. " Function Code Structure
    CLASS lcl_gv_event_receiver DEFINITION                               *
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
          handle_hotspot
            FOR EVENT hotspot_click OF cl_gui_alv_grid
              IMPORTING e_row_id e_column_id es_row_no,
          handle_top_of_page
                          FOR EVENT print_top_of_page OF cl_gui_alv_grid,
    */ Begin of Modification - Request No. DV2K904687
        handle_toolbar
            FOR EVENT toolbar OF cl_gui_alv_grid
                IMPORTING e_object e_interactive,
        handle_user_command
            FOR EVENT user_command OF cl_gui_alv_grid
                IMPORTING e_ucomm.
    */ End of Modification - Request No. DV2K904687
    ENDCLASS.                              " LCL_EVENT_RECEIVER DEFINITION
    CLASS IMPLEMENTATION                                                 *
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_hotspot.
        CASE e_column_id-fieldname.
          WHEN 'SALORD1'.
            CLEAR t_pre_prod_ord.
            READ TABLE t_pre_prod_ord
                  INTO t_pre_prod_ord
                 INDEX e_row_id-index.
          Call VA03 To View Sales Order Line Item Details
            PERFORM call_va03 USING t_pre_prod_ord-salord1.
          WHEN 'SALORD2'.
            CLEAR t_delinquent_ord.
            READ TABLE t_delinquent_ord
                  INTO t_delinquent_ord
                 INDEX e_row_id-index.
          Call VA03 To View Sales Order Line Item Details
            PERFORM call_va03 USING t_delinquent_ord-salord2.
          WHEN 'SALORD3'.
            CLEAR t_processed_ord.
            READ TABLE t_processed_ord
                  INTO t_processed_ord
                 INDEX e_row_id-index.
          Call VA03 To View Sales Order Line Item Details
            PERFORM call_va03 USING t_processed_ord-salord3.
          WHEN 'SALORD4'.
            CLEAR t_flagged_ord.
            READ TABLE t_flagged_ord
                  INTO t_flagged_ord
                 INDEX e_row_id-index.
          Call VA03 To View Sales Order Line Item Details
            PERFORM call_va03 USING t_flagged_ord-salord4.
          WHEN 'SORTL1'.
            CLEAR t_pre_prod_ord.
            READ TABLE t_pre_prod_ord
                  INTO t_pre_prod_ord
                 INDEX e_row_id-index.
        Call ZSD11 for Customer Search Term
            PERFORM call_zsd11_cust_code USING t_pre_prod_ord-sortl1.
          WHEN 'SORTL2'.
            CLEAR t_delinquent_ord.
            READ TABLE t_delinquent_ord
                  INTO t_delinquent_ord
                 INDEX e_row_id-index.
          Call ZSD11 for Customer Search Term
            PERFORM call_zsd11_cust_code USING t_delinquent_ord-sortl2.
          WHEN 'SORTL3'.
            CLEAR t_processed_ord.
            READ TABLE t_processed_ord
                  INTO t_processed_ord
                 INDEX e_row_id-index.
          Call ZSD11 for Customer Search Term
            PERFORM call_zsd11_cust_code USING t_processed_ord-sortl3.
          WHEN 'SORTL4'.
            CLEAR t_flagged_ord.
            READ TABLE t_flagged_ord
                  INTO t_flagged_ord
                 INDEX e_row_id-index.
          Call ZSD11 for Customer Search Term
            PERFORM call_zsd11_cust_code USING t_flagged_ord-sortl4.
          WHEN 'IHREZ_E1'.
            CLEAR t_pre_prod_ord.
            READ TABLE t_pre_prod_ord
                  INTO t_pre_prod_ord
                 INDEX e_row_id-index.
          Call ZSD11 for Mill Order
            PERFORM call_zsd11_millorder USING t_pre_prod_ord-ihrez_e1.
          WHEN 'IHREZ_E2'.
            CLEAR t_delinquent_ord.
            READ TABLE t_delinquent_ord
                  INTO t_delinquent_ord
                 INDEX e_row_id-index.
          Call ZSD11 for Mill Order
            PERFORM call_zsd11_millorder USING t_delinquent_ord-ihrez_e2.
          WHEN 'IHREZ_E3'.
            CLEAR t_processed_ord.
            READ TABLE t_processed_ord
                  INTO t_processed_ord
                 INDEX e_row_id-index.
          Call ZSD11 for Mill Order
            PERFORM call_zsd11_millorder USING t_processed_ord-ihrez_e3.
          WHEN 'IHREZ_E4'.
            CLEAR t_flagged_ord.
            READ TABLE t_flagged_ord
                   INTO t_flagged_ord
                  INDEX e_row_id-index.
          Call ZSD11 for Mill Order
            PERFORM call_zsd11_millorder USING t_flagged_ord-ihrez_e4.
          WHEN 'NOTES1'.
            CLEAR t_pre_prod_ord.
            READ TABLE t_pre_prod_ord
                  INTO t_pre_prod_ord
                 INDEX e_row_id-index.
          Call zsd00087 program to edit CSI Memo Text
            PERFORM edit_notes USING t_pre_prod_ord-salord1.
          WHEN 'NOTES2'.
            CLEAR t_delinquent_ord.
            READ TABLE t_delinquent_ord
                  INTO t_delinquent_ord
                 INDEX e_row_id-index.
          Call zsd00087 program to edit CSI Memo Text
            PERFORM edit_notes USING t_delinquent_ord-salord2.
          WHEN 'NOTES3'.
            CLEAR t_processed_ord.
            READ TABLE t_processed_ord
                  INTO t_processed_ord
                 INDEX e_row_id-index.
          Call zsd00087 program to CSI Memo Text
            PERFORM edit_notes USING t_processed_ord-salord3.
          WHEN 'NOTES4'.
            CLEAR t_flagged_ord.
            READ TABLE t_flagged_ord
                  INTO t_flagged_ord
                 INDEX e_row_id-index.
          Call zsd00087 program to CSI Memo Text
            PERFORM edit_notes USING t_flagged_ord-salord4.
        ENDCASE.                           " CASE E_COLUMN_ID ...
      ENDMETHOD.                           " HANDLE_HOTSPOT
      METHOD handle_top_of_page.
        PERFORM write_report_header.
      ENDMETHOD.                           " METHOD HANDLE_TOP_OF_PAGE
    */ Begin of Modification - Request No. DV2K904687
      METHOD handle_toolbar.
        DATA: ls_toolbar  TYPE stb_button.
      append a separator to normal toolbar
        CLEAR ls_toolbar.
        MOVE 3 TO ls_toolbar-butn_type.
        APPEND ls_toolbar TO e_object->mt_toolbar.
        CLEAR ls_toolbar.
      append a button for Change Delivery Priority
        MOVE 'CHNG_PRIO' TO ls_toolbar-function.
        MOVE 'Change SO Delivery Priority'(048)
             TO ls_toolbar-quickinfo.
        MOVE 'Change SO Priority'(049) TO ls_toolbar-text.
        MOVE 0 TO ls_toolbar-butn_type.
        APPEND ls_toolbar TO e_object->mt_toolbar.
      ENDMETHOD.                           " handle_toolbar
      METHOD handle_user_command.
        DATA: t_sel_row  TYPE lvc_t_roid,
              gs_sel_row TYPE lvc_s_roid,
              gs_flagged_ord LIKE t_flagged_ord,
              lv_lines   TYPE i.
        CASE e_ucomm.
          WHEN 'CHNG_PRIO'.
            REFRESH t_sel_row.
            CLEAR e_ucomm.
            CALL METHOD gv_grid_flagged_ord->get_selected_rows
              IMPORTING
                et_row_no = t_sel_row.
            CLEAR: t_flagged_ord,
                   gv_vbeln,
                   gv_posnr,
                   gv_del_prio.
            DESCRIBE TABLE t_sel_row LINES lv_lines.
            IF lv_lines GT 1.
              MESSAGE i001 WITH 'Select only one row'(043).
            ELSEIF lv_lines EQ 1.
              READ TABLE t_sel_row INTO gs_sel_row INDEX 1.
              READ TABLE t_flagged_ord INTO gs_flagged_ord
                   INDEX gs_sel_row-row_id.
              IF sy-subrc EQ 0.
                SPLIT gs_flagged_ord-salord4 AT '-' INTO gv_vbeln gv_posnr.
                gv_del_prio = gs_flagged_ord-priority.
                CLEAR: s_item, s_item[].
                p_sonum    = gv_vbeln.
                p_delpr    = gv_del_prio.
                s_item-low = gv_posnr.
                APPEND s_item TO s_item.
                CLEAR  s_item.
              ENDIF.                       " IF sy-subrc EQ 0
            ENDIF.                         " IF lv_lines GT 1
            IF lv_lines LE 1.
              CALL SELECTION-SCREEN '1100' STARTING AT 30 2
                                           ENDING   AT 110 7.
              LEAVE TO SCREEN 100.
            ENDIF.
        ENDCASE.                           " CASE e_ucomm
      ENDMETHOD.                           " handle_user_command
    */ End of Modification - Request No. DV2K904687
    ENDCLASS.                              " LCL_EVENT_RECEIVER
    " IMPLEMENTATION
    Form  WRITE_REPORT_HEADER                                            *
    This subroutine displays Report Header which includes                *
    Report Name, Executed by, Execution date, Execution Time             *
    There are no parameters to be passed to this subroutine              *
    FORM write_report_header.
      DATA lv_rep_tit(72) TYPE c.
      FORMAT COLOR COL_KEY.
      MOVE sy-title TO lv_rep_tit.
      CONDENSE lv_rep_tit.
      SKIP 1.
      WRITE: /3  sy-repid,
              25 'California Steel Industries, Inc.'(040),
              75 'Page'(041),
              80(4) sy-pagno.
      WRITE: /3  sy-uzeit,
              25 lv_rep_tit,
              75 sy-datum.
      FORMAT RESET.
    ENDFORM.                               " WRITE_REPORT_HEADER
    At selection-output                                                  *
    AT SELECTION-SCREEN OUTPUT.
      CLEAR sy-ucomm.
      IF sy-dynnr EQ '0500'.
      Initialize layout variant for report-1
        CLEAR gs_var_pre_prod_ord.
        gs_var_pre_prod_ord-report = sy-cprog.
        gs_var_pre_prod_ord-handle = c_handle1.
        PERFORM initialize_layoutvariant CHANGING gs_var_pre_prod_ord.
        p_var1 = gs_var_pre_prod_ord-variant.
      Initialize layout variant for report-2
        CLEAR gs_var_delinquent_ord.
        gs_var_delinquent_ord-report = sy-cprog.
        gs_var_delinquent_ord-handle = c_handle2.
        PERFORM initialize_layoutvariant CHANGING gs_var_delinquent_ord.
        p_var2 = gs_var_delinquent_ord-variant.
      Initialize layout variant for report-3
        CLEAR gs_var_processed_ord.
        gs_var_processed_ord-report = sy-cprog.
        gs_var_processed_ord-handle = c_handle3.
        PERFORM initialize_layoutvariant CHANGING gs_var_processed_ord.
        p_var3 = gs_var_processed_ord-variant.
      Initialize layout variant for report-4
        CLEAR gs_var_flagged_ord.
        gs_var_flagged_ord-report = sy-cprog.
        gs_var_flagged_ord-handle = c_handle4.
        PERFORM initialize_layoutvariant CHANGING gs_var_flagged_ord.
        p_var4 = gs_var_flagged_ord-variant.
    */ Begin of Modification - Request No. DV2K904687
      ELSEIF sy-dynnr EQ '1100'.
        DATA t_exclude  TYPE TABLE OF sy-ucomm.
        SET PF-STATUS 'MENU_1100'.
      To use your own GUI status for a selection screen
        CALL FUNCTION 'RS_SET_SELSCREEN_STATUS'
          EXPORTING
            p_status  = 'MENU_1100'
          TABLES
            p_exclude = t_exclude.
      ENDIF.                               " IF sy-dynnr EQ '0500'
    */ End of Modification - Request No. DV2K904687
    At Selection Screen                                                  *
    AT SELECTION-SCREEN.
    */ Begin of Modification - Request No. DV2K904687
      CASE sy-dynnr.
        WHEN '1100'.
          IF sy-ucomm IS INITIAL.
            CLEAR sy-ucomm.
            LEAVE TO SCREEN 1100.
          ENDIF.                           " IF sy-ucomm IS INITIAL
          CASE sy-ucomm.
            WHEN 'SAVE'.
              CLEAR sy-ucomm.
            Change Delivery Priority using BAPI method
              PERFORM change_del_priority.
              CLEAR: sy-ucomm,
                     gv_vbeln,
                     gv_posnr,
                     gv_del_prio,
                     p_sonum,
                     s_item,
                     s_item[],
                     p_delpr.
              LEAVE TO SCREEN 0.
            WHEN 'CANCEL'.
              CLEAR: sy-ucomm,
                     gv_vbeln,
                     gv_posnr,
                     gv_del_prio,
                     p_sonum,
                     s_item,
                     s_item[],
                     p_delpr.
              LEAVE TO SCREEN 0.
          ENDCASE.                         " CASE sy-ucomm
        WHEN '0500'.
          IF sy-ucomm EQ 'CRET'.
            LEAVE TO SCREEN 100.
          ELSEIF sy-ucomm IS INITIAL.
            LEAVE TO SCREEN 500.
          ENDIF.                           " IF SY-UCOMM EQ 'CRET'
      ENDCASE.                             " CASE sy-dynnr
    */ End of Modification - Request No. DV2K904687
    Selection Screen: Validations                                        *
    AT SELECTION-SCREEN ON s_pernr.
    Validate Employee Number
      PERFORM validate_employee_number.
    AT SELECTION-SCREEN ON s_kunnr.
    Validate Customer Number
      IF NOT s_kunnr IS INITIAL.
        PERFORM validate_customer_number.
      ENDIF.                               " IF NOT S_KUNNR IS INITIAL
    AT SELECTION-SCREEN ON s_sortl.
    Validate Search Term
      IF NOT s_sortl IS INITIAL.
        PERFORM validate_search_term.
      ENDIF.                               " IF NOT S_SORTL IS INITIAL
    AT SELECTION-SCREEN ON s_kondm.
    Validate Product
      IF NOT s_kondm IS INITIAL.
        PERFORM validate_product.
      ENDIF.                               " IF NOT S_KONDM IS INITIAL
    Validate p_var1
    AT SELECTION-SCREEN ON p_var1.
      CLEAR gs_var_pre_prod_ord.
      gs_var_pre_prod_ord-report  = sy-cprog.
      gs_var_pre_prod_ord-handle  = c_handle1.
      gs_var_pre_prod_ord-variant = p_var1.
      IF p_var1 IS NOT INITIAL.
        PERFORM validate_variant CHANGING gs_var_pre_prod_ord.
      ENDIF.                               " IF P_VAR1 IS NOT INITIAL
    Validate p_var2
    AT SELECTION-SCREEN ON p_var2.
      CLEAR gs_var_delinquent_ord.
      gs_var_delinquent_ord-report  = sy-cprog.
      gs_var_delinquent_ord-handle  = c_handle2.
      gs_var_delinquent_ord-variant = p_var2.
      IF p_var2 IS NOT INITIAL.
        PERFORM validate_variant CHANGING gs_var_delinquent_ord.
      ENDIF.                               " IF P_VAR2 IS NOT INITIAL
    Validate p_var3
    AT SELECTION-SCREEN ON p_var3.
      CLEAR gs_var_processed_ord.
      gs_var_processed_ord-report  = sy-cprog.
      gs_var_processed_ord-handle  = c_handle3.
      gs_var_processed_ord-variant = p_var3.
      IF p_var3 IS NOT INITIAL.
        PERFORM validate_variant CHANGING gs_var_processed_ord.
      ENDIF.                               " IF P_VAR3 IS NOT INITIAL
    Validate p_var4
    AT SELECTION-SCREEN ON p_var4.
      CLEAR gs_var_flagged_ord.
      gs_var_flagged_ord-report  = sy-cprog.
      gs_var_flagged_ord-handle  = c_handle4.
      gs_var_flagged_ord-variant = p_var4.
      IF p_var4 IS NOT INITIAL.
        PERFORM validate_variant CHANGING gs_var_flagged_ord.
      ENDIF.                               " IF P_VAR4 IS NOT INITIAL
    Selection Screen: Value Request for ALV GRID Variants                *
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var1.
      CLEAR gs_var_pre_prod_ord.
      gs_var_pre_prod_ord-report = sy-cprog.
      gs_var_pre_prod_ord-handle = c_handle1.
      PERFORM f4_variant CHANGING gs_var_pre_prod_ord
                                  gv_exit.
      IF gv_exit NE c_true.
        p_var1 = gs_var_pre_prod_ord-variant.
      ENDIF.                               " IF GV_EXIT NE c_true
    F4 help for variant p_var2
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var2.
      CLEAR:
        gs_var_delinquent_ord,
        gv_exit.
      gs_var_delinquent_ord-report = sy-cprog.
      gs_var_delinquent_ord-handle = c_handle2.
      PERFORM f4_variant CHANGING gs_var_delinquent_ord
                                  gv_exit.
      IF gv_exit NE c_true.
        p_var2 = gs_var_delinquent_ord-variant.
      ENDIF.                               " IF GV_EXIT NE c_true
    F4 help for variant p_var3
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var3.
      CLEAR:
        gs_var_processed_ord,
        gv_exit.
      gs_var_processed_ord-report = sy-cprog.
      gs_var_processed_ord-handle = c_handle3.
      PERFORM f4_variant CHANGING gs_var_processed_ord
                                  gv_exit.
      IF gv_exit NE c_true.
        p_var3 = gs_var_processed_ord-variant.
      ENDIF.                               " IF GV_EXIT NE c_true
    F4 help for variant p_var4
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_var4.
      CLEAR:
        gs_var_flagged_ord,
        gv_exit.
      gs_var_flagged_ord-report = sy-cprog.
      gs_var_flagged_ord-handle = c_handle4.
      PERFORM f4_variant CHANGING gs_var_flagged_ord
                                  gv_exit.
      IF gv_exit NE c_true.
        p_var4 = gs_var_flagged_ord-variant.
      ENDIF.                               " IF GV_EXIT NE c_true
    Form  validate_employee_number                                       *
    This subroutine validates Employee Number                            *
    There are no parameters to need be passed to this subroutine         *
    FORM validate_employee_number.
      DATA lv_pernr LIKE vbpa-pernr.
      SELECT SINGLE pernr
        INTO lv_pernr
        FROM vbpa
       WHERE pernr IN s_pernr.
      IF sy-subrc NE 0.
        MESSAGE e001 WITH text-010.
      ENDIF.                               " IF SY-SUBRC NE 0
      CLEAR lv_pernr.
    ENDFORM.                               " VALIDATE_EMPLOYEE_NUMBER
    Form  validate_customer_number                                       *
    This subroutine validates Customer Number                            *
    There are no parameters need to be passed to this subroutine         *
    FORM validate_customer_number.
      SELECT SINGLE kunnr
        INTO t_common_data-kunnr
        FROM kna1
       WHERE kunnr IN s_kunnr.
      IF sy-subrc NE 0.
        MESSAGE e001 WITH text-011.
      ENDIF.                               " IF SY-SUBRC NE 0
      CLEAR t_common_data-kunnr.
    ENDFORM.                               " VALIDATE_CUSTOMER_NUMBER
    Form  validate_search_term                                           *
    This subroutine validates Search Term                                *
    There are no parameters need to be passed to this subroutine         *
    FORM validate_search_term.
      SELECT SINGLE sortl
        INTO t_customer_code-sortl
        FROM kna1
       WHERE sortl IN s_sortl.
      IF sy-subrc NE 0.
        MESSAGE e001 WITH text-012.
      ENDIF.                               " IF SY-SUBRC NE 0
      CLEAR t_customer_code-sortl.
    ENDFORM.                               " VALIDATE_SEARCH_TERM
    Form  validate_product                                               *
    This subroutine validates Product                                    *
    There are no parameters need to be passed to this subroutine         *
    FORM validate_product.
      SELECT SINGLE kondm
        INTO t_

  • SET parameter on ALV grid with container

    Hi,
    I need to SET PARAMETER ID to acess the transaction CJ40, in an ALV grid program with screen container for the ALV.
    I'm using a method handle_double_click to select a line and pass the value to the parameter ID like this:
      METHOD handle_double_click.
        DATA: l_project TYPE prps-pspnr.
        READ TABLE it_out INDEX e_row-index INTO wa_out.
        CHECK sy-subrc = 0.
        WRITE wa_out-pspnr TO l_project.
        SET PARAMETER ID 'PRD' FIELD l_project.
        CALL TRANSACTION 'CJ40' AND SKIP FIRST SCREEN.
        CLEAR wa_out-pspnr.
      ENDMETHOD.                           "handle_double_click
    But this doesn't work. No value at all is passed to the transaction.
    What is missing?
    Thanks in advance,
    Rui

    Parameter ID PSP is attached to the Project Definition field.
    SET PARAMETER ID 'PSP' FIELD l_project.
    CALL TRANSACTION 'CJ40' AND SKIP FIRST SCREEN.
    Regards,
    Naimesh Patel

  • Regarding Alv Grid Totals_text is not Printing

    Hi All,
    I am presently working in Alv Grid dispaly.
    I need to dispaly Totals_Text = 'Totals'. But this text is not displaying in my output dispaly.i am copying my code here.
    Code:
    REPORT  ZFTRSERV NO STANDARD PAGE HEADING
                     MESSAGE-ID YV
                     LINE-SIZE 255.
    TABLES: BSIS,           "Accounting: Secondary Index for G/L Accounts
            BSAS,           "Accounting: Secondary Index for G/L Accounts (Cleared Items)
            BSID,           "Accounting: Secondary Index for Customers
            BKPF,           "Accounting Document Header
            ITCPP.          "SAPscript output parameters
    TYPE-POOLS: SLIS.       "ALV Declarations
    $$********************************************************************
    $$    GLOBAL TYPES
    $$    NAMING CONVENTION: "Y_NAME"
    $$********************************************************************
    *eject
    $$********************************************************************
    $$    GLOBAL INTERNAL TABLES (WITH INCLUDE STRUCTURE)
    $$    NAMING CONVENTION: "I_NAME"
    $$********************************************************************
    $$********************************************************************
    $$    GLOBAL INTERNAL TABLES (CUSTOM STRUCTURE)
    $$    NAMING CONVENTION: "T_NAME"
    $$********************************************************************
    *eject
    $$********************************************************************
    $$    GLOBAL FIELD-SYMBOLS
    $$    NAMING CONVENTION: "<FS_NAME>"
    $$********************************************************************
    FIELD-SYMBOLS: <FS_BSIS>  TYPE Y_BSIS.
    $$********************************************************************
    $$    MACROS DECLARATION
    $$    NAMING CONVENTION: M_NAME
    $$********************************************************************
    $$********************************************************************
    $$    PARAMETERS & SELECT-OPTIONS
    $$    NAMING CONVENTION: "P_NAME" & "S_NAME"
    $$********************************************************************
    SELECTION-SCREEN BEGIN OF BLOCK SS01 WITH FRAME TITLE TEXT-B01.
    GENERAL SELECTIONS
    SELECT-OPTIONS:   S_BUKRS FOR BSIS-BUKRS OBLIGATORY,
                      S_HKONT FOR BSIS-HKONT OBLIGATORY,
                      S_BLART FOR BSIS-BLART,
                      S_BELNR FOR BSIS-BELNR.
    SELECTION-SCREEN END OF BLOCK SS01.
    SELECTION-SCREEN BEGIN OF BLOCK SS02 WITH FRAME TITLE TEXT-B02.
      OPEN ITEMS:
    SELECTION-SCREEN BEGIN OF LINE.
    PARAMETERS P_OPIT LIKE ITEMSET-XOPSEL RADIOBUTTON GROUP RAD1 DEFAULT 'X'.
    SELECTION-SCREEN COMMENT 3(20) TEXT-003 FOR FIELD P_OPIT.
    SELECTION-SCREEN END OF LINE.
    PARAMETERS P_STIDA LIKE RFPDO-ALLGSTID DEFAULT SY-DATLO.
    SELECTION-SCREEN SKIP.
    SELECTION-SCREEN: COMMENT (12) BLANK1,
                      COMMENT (20) TEXT-006 FOR FIELD P_OSST.
    PARAMETERS:  P_OSST  AS CHECKBOX DEFAULT SPACE.
    SELECTION-SCREEN: COMMENT (12) BLANK2,
                      COMMENT (20) TEXT-007 FOR FIELD P_OUTD.
    PARAMETERS:P_OUTD LIKE ITCPP-TDDEST.
    SELECTION-SCREEN END OF LINE.
    SELECTION-SCREEN END OF BLOCK SS03.
    *eject
    $$********************************************************************
    $$    INITIALIZATION
    $$********************************************************************
    INITIALIZATION.
      CLEAR: E_BSID,
             E_BSIS,
             E_BSAS,
             E_BKPF,
             E_TOTAL,
             E_SUMSHET_OPEN,
             E_SUMSHET_CLEAR,
             E_SUMSHET_TOTAL,
             E_CATLOG,
             E_ALV_LAYOUT.
      FREE:  T_BSID,
             T_BSIS,
             T_BSAS,
             T_BKPF,
             T_TOTAL,
             T_SUMSHET_OPEN,
             T_SUMSHET_CLEAR,
             T_SUMSHET_TOTAL.
    *eject
    $$********************************************************************
    $$    AT SELECTION-SCREEN
    $$********************************************************************
    AT SELECTION-SCREEN .
    *eject
    $$********************************************************************
    $$    START-OF-SELECTION
    $$********************************************************************
    START-OF-SELECTION.
    To Get data from tables
      PERFORM F_OUT_DATA_RETRIEVEL.
    *eject
    $$********************************************************************
    $$    END-OF-SELECTION
    $$********************************************************************
    END-OF-SELECTION.
    To Display ALV Grid Layout
      PERFORM F_ALV_DATA_RETRIVAL.
    *eject
    *&      Form  f_out_data_retrievel
        data retrival for Open,Clear and All items
    FORM F_OUT_DATA_RETRIEVEL.
      IF P_OPIT EQ C_X.
    *‘open items’ is selected data will be retrieved from BSIS table.
        PERFORM F_OPEN_ITEMS.
    TO GET DATA FOR SUMMARY SHEET OPEN ITEMS.
        PERFORM F_GET_OPEN_SUMSHET.
      ENDIF.
    ENDFORM.                    " f_out_data_retrievel
    *&      Form  F_OPEN_ITEMS
       getting data for Open items from BSIS Table
    FORM F_OPEN_ITEMS .
      SELECT BUKRS
             HKONT
             AUGDT
             AUGBL
             ZUONR
             GJAHR
             BELNR
             BUZEI
             BUDAT
             BLDAT
             BLART
             BSCHL
             MWSKZ
             DMBTR
             SGTXT
        FROM BSIS
        INTO  CORRESPONDING FIELDS OF TABLE T_BSIS
       WHERE BUKRS IN S_BUKRS
         AND HKONT IN S_HKONT
         AND BLART IN S_BLART
         AND BELNR IN S_BELNR
         AND AUGDT NE P_STIDA .
      IF SY-SUBRC NE C_0.
        MESSAGE S999 WITH text-030.
      ENDIF.
      PERFORM F_GET_DATA_BSIS.
    ENDFORM.                    " F_OPEN_ITEMS
    To get the Entry date and Reference Key2
      PERFORM F_GET_DATA_BSIS.
    *&      Form  F_GET_DATA_BSAS
          GETTING DATA FROM BSAS TABLE
    FORM F_GET_DATA_BSAS .
      DATA: W_TABIX TYPE SY-TABIX.
      UNASSIGN <FS_BSAS>.
    GETTING DATA FROM BKPF AND BSID TABLES
      LOOP AT T_BSAS ASSIGNING <FS_BSAS>.
        CLEAR: E_BKPF,
               E_BSID,
               W_TABIX.
        MOVE SY-TABIX TO W_TABIX.
        SELECT SINGLE BUKRS
                      BELNR
                      GJAHR
                      CPUDT
                      BUDAT
          FROM BKPF
          INTO CORRESPONDING FIELDS OF E_BKPF
         WHERE BUKRS EQ E_BSAS-BUKRS
           AND BLART EQ E_BSAS-BLART
           AND BELNR EQ E_BSAS-BELNR
           AND BUDAT EQ E_BSAS-BUDAT.
        IF SY-SUBRC EQ C_0.
          MOVE E_BKPF-CPUDT TO <FS_BSAS>-CPUDT.
          MODIFY T_BSAS INDEX W_TABIX FROM <FS_BSAS>
                 TRANSPORTING CPUDT.
        ENDIF.
        SELECT SINGLE BUKRS
                      KUNNR
                      UMSKS
                      UMSKZ
                      AUGDT
                      AUGBL
                      ZUONR
                      GJAHR
                      BELNR
                      BUZEI
                      XREF2
          FROM  BSID
          INTO CORRESPONDING FIELDS OF E_BSID
         WHERE BUKRS EQ E_BSAS-BUKRS
           AND BELNR EQ E_BSAS-BELNR
           AND BLART EQ E_BSAS-BLART
           AND BUDAT EQ E_BSAS-BUDAT.
        IF SY-SUBRC EQ C_0.
          MOVE E_BSID-XREF2 TO <FS_BSAS>-XREF2.
          FREE T_BSID.
          MODIFY T_BSAS INDEX W_TABIX FROM <FS_BSAS>
                 TRANSPORTING XREF2.
        ENDIF.
        <FS_BSAS>-IDATE = SY-DATUM.
        <FS_BSAS>-IEDAT = <FS_BSAS>-CPUDT - <FS_BSAS>-ZUONR.
        <FS_BSAS>-PTIME = SY-DATUM - <FS_BSAS>-CPUDT.
        MODIFY T_BSAS INDEX W_TABIX FROM <FS_BSAS>
               TRANSPORTING IEDAT
                            PTIME
                            IDATE.
      ENDLOOP.
      SORT T_BSAS BY HKONT XREF2 CPUDT.
    ENDFORM.                    " F_GET_DATA_BSAS
    *&      Form  F_GET_DATA_BSIS
        GETTING DATA FROM BSIS TABLE
    FORM F_GET_DATA_BSIS .
      DATA: W_TABIX  TYPE SY-TABIX,
            W_SGTXT  LIKE BSIS-SGTXT,
            W_SGTXT1 LIKE BSIS-SGTXT,
            W_SORTL LIKE KNA1-SORTL.
      CLEAR: E_BKPF,
             E_BSID,
             W_TABIX,
             W_SGTXT,
             W_SGTXT1,
             W_SORTL.
    GETTING DATA FROM BKPF AND BSID TABLES
      LOOP AT T_BSIS INTO E_BSIS.
        MOVE SY-TABIX TO W_TABIX.
        SELECT SINGLE BUKRS
                      BELNR
                      GJAHR
                      CPUDT
                      BUDAT
          FROM BKPF
          INTO CORRESPONDING FIELDS OF E_BKPF
         WHERE BUKRS EQ E_BSIS-BUKRS
           AND BLART EQ E_BSIS-BLART
           AND BELNR EQ E_BSIS-BELNR
           AND BUDAT EQ E_BSIS-BUDAT.
        IF SY-SUBRC EQ C_0.
          MOVE E_BKPF-CPUDT TO E_BSIS-CPUDT.
          FREE T_BKPF.
          MODIFY T_BSIS INDEX W_TABIX FROM E_BSIS
                 TRANSPORTING CPUDT.
        ENDIF.
        SELECT SINGLE BUKRS
                      KUNNR
                      UMSKS
                      UMSKZ
                      AUGDT
                      AUGBL
                      ZUONR
                      GJAHR
                      BELNR
                      BUZEI
                      XREF2
          FROM BSID
          INTO CORRESPONDING FIELDS OF E_BSID
         WHERE BUKRS EQ E_BSIS-BUKRS
           AND BLART EQ E_BSIS-BLART
           AND BELNR EQ E_BSIS-BELNR
           AND BUDAT EQ E_BSIS-BUDAT.
        IF sy-subrc EQ C_0.
         DUMMY CHECK
        ENDIF.
        SELECT SINGLE  KUNNR
          FROM BSID
          INTO CORRESPONDING FIELDS OF E_BSID
         WHERE BUKRS EQ E_BSIS-BUKRS
           AND BLART EQ E_BSIS-BLART
           AND BELNR EQ E_BSIS-BELNR
           AND BUDAT EQ E_BSIS-BUDAT.
        IF sy-subrc EQ C_0.
         DUMMY CHECK
        ENDIF.
        SELECT SINGLE SORTL
          FROM KNA1
          INTO W_SORTL
         WHERE KUNNR EQ E_BSID-KUNNR.
        IF SY-SUBRC EQ C_0.
          MOVE W_SORTL TO E_BSIS-XREF2.
          MODIFY T_BSIS INDEX W_TABIX FROM E_BSIS
                 TRANSPORTING XREF2.
        ENDIF.
        W_SGTXT = E_BSIS-SGTXT.
        SPLIT W_SGTXT AT C_SLASH INTO W_SGTXT W_SGTXT1.
        MOVE: W_SGTXT TO E_BSIS-SGTXT,
              SY-DATUM TO E_BSIS-IDATE.
        DATA : W_ZOUNR LIKE BSAS-ZUONR,
               W_DATE TYPE D,
               W_Z(10) TYPE C.
        CLEAR:  W_ZOUNR,
                W_DATE,
                W_Z.
        MOVE E_BSIS-ZUONR TO W_ZOUNR.
        MOVE : W_ZOUNR4(4) TO W_Z0(4),
               W_ZOUNR2(2) TO W_Z4(2),
               W_ZOUNR0(2) TO W_Z6(2).
        MOVE W_Z TO W_DATE.
        E_BSIS-IEDAT = E_BSIS-CPUDT - W_DATE.
        CONCATENATE W_ZOUNR+0(2)  C_DOT
                    W_ZOUNR+2(2)  C_DOT
                    W_ZOUNR+4(4)  INTO E_BSIS-ZUONR.
        E_BSIS-PTIME = SY-DATUM - E_BSIS-CPUDT.
        MODIFY T_BSIS INDEX W_TABIX FROM E_BSIS
               TRANSPORTING IEDAT
                            PTIME
                            IDATE
                            SGTXT
                            ZUONR.                              "30TH
      ENDLOOP.
      SORT T_BSIS BY HKONT XREF2 CPUDT.
    ENDFORM.                    " F_GET_DATA_BSIS
    *&      Form  f_build_fld_catlog1
          BUILDING FIELD CATALOG FOR OPEN ITEMS DATA
    FORM F_FLD_CATLOG_OPEN_ITEMS.
      ORM f_fld_catlog_open_items.
      REFRESH i_catlog1.
      CLEAR w_col_pos.
      w_col_pos = w_col_pos + c_1.
      PERFORM f_first_field_catalog USING C_HKONT
                                          C_BSIS
                                          w_col_pos
                                          text-010
                                          SPACE
                                          SPACE.
      w_col_pos = w_col_pos + c_1.
      PERFORM f_first_field_catalog USING C_XREF2
                                          C_BSIS
                                          w_col_pos
                                          text-011
                                          SPACE
                                          SPACE.
      w_col_pos = w_col_pos + c_1.
      PERFORM f_first_field_catalog USING C_BELNR
                                          C_BSIS
                                          w_col_pos
                                          text-012
                                          SPACE
                                          SPACE.
      w_col_pos = w_col_pos + c_1.
      PERFORM f_first_field_catalog USING C_BLART
                                          C_BSIS
                                          w_col_pos
                                          text-013
                                          SPACE
                                          SPACE.
      w_col_pos = w_col_pos + c_1.
      PERFORM f_first_field_catalog USING c_BLDAT
                                          C_BSIS
                                          W_col_pos
                                          text-014
                                          SPACE
                                          SPACE.
      w_col_pos = w_col_pos + c_1.
      PERFORM f_first_field_catalog USING c_BUDAT
                                          C_BSIS
                                          w_col_pos
                                          text-015
                                          SPACE
                                          SPACE.
      w_col_pos = w_col_pos + c_1.
      PERFORM f_first_field_catalog USING c_CPUDT
                                          C_BSIS
                                          w_col_pos
                                          text-016
                                          SPACE
                                          SPACE.
      w_col_pos = w_col_pos + c_1.
      PERFORM f_first_field_catalog USING c_ZUONR
                                          C_BSIS
                                          w_col_pos
                                          text-017
                                          SPACE
                                          SPACE.
      w_col_pos = w_col_pos + c_1.
      PERFORM f_first_field_catalog USING c_BSCHL
                                          C_BSIS
                                          w_col_pos
                                          text-018
                                          SPACE
                                          SPACE.
      w_col_pos = w_col_pos + c_1.
      PERFORM f_first_field_catalog USING C_DMBTR
                                          C_BSIS
                                          w_col_pos
                                          text-019
                                          C_X           "dispaly Sum Total
                                          '40'.
      w_col_pos = w_col_pos + c_1.
      PERFORM f_first_field_catalog USING c_MWSKZ
                                          C_BSIS
                                          w_col_pos
                                          text-020
                                          SPACE
                                          SPACE.
      w_col_pos = w_col_pos + c_1.
      PERFORM f_first_field_catalog USING c_SGTXT
                                          C_BSIS
                                          w_col_pos
                                          text-021
                                          SPACE
                                          SPACE.
      w_col_pos = w_col_pos + c_1.
      PERFORM f_first_field_catalog USING c_IEDAT
                                          C_BSIS
                                          w_col_pos
                                          text-022
                                          SPACE
                                          SPACE.
      w_col_pos = w_col_pos + c_1.
      PERFORM f_first_field_catalog USING C_PTIME
                                          C_BSIS
                                          w_col_pos
                                          text-023
                                          SPACE
                                          SPACE.
      CLEAR: W_COL_POS,
             I_ALV_EVENTS.
    ENDFORM.                    " f_fld_catlog_open_items
    *&      Form  f_first_report_dispaly
         ROUTINE FOR OPEN ITEMS  GRID LAYOUT DISPLAY
    FORM F_DISPALY_OPEN_ITEMS.
      CLEAR W_REPNAME.
      W_REPNAME = SY-REPID.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = W_REPNAME
       I_CALLBACK_PF_STATUS_SET          = C_FSTAT
       I_CALLBACK_USER_COMMAND           = C_FUCOM
         I_CALLBACK_TOP_OF_PAGE            = C_FTOPI
      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                         = E_ALV_LAYOUT
         IT_FIELDCAT                       = I_CATLOG1[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
         I_DEFAULT                         = C_A
      I_SAVE                            = ' '
      IS_VARIANT                        =
         IT_EVENTS                         = I_ALV_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                          = T_BSIS
       EXCEPTIONS
         PROGRAM_ERROR                     = 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.
    ENDFORM.                    " f_dispaly_open_items
    *&      Form  f_first_field_catalog
          BUILDING FIELD CATALOG FOR SECONDERY LIST
         -->us_fieldname  field name
         -->us_ref field  ref field
         -->us_ref tab    ref table
         -->us_text       text
         -->us_sum        sum
    FORM F_FIRST_FIELD_CATALOG  USING    US_FIELDNAME TYPE ANY
                                         US_REF_TAB   TYPE ANY
                                         US_COL_POS   TYPE ANY
                                         US_COLTEXT   TYPE ANY
                                         US_DO_SUM    TYPE ANY
                                         us_out       type any.
      CLEAR E_CATLOG.
      MOVE : US_FIELDNAME TO E_CATLOG-FIELDNAME,
             US_REF_TAB   TO E_CATLOG-TABNAME,
             US_COL_POS   TO E_CATLOG-COL_POS,
             US_COLTEXT   TO E_CATLOG-SELTEXT_L,
             US_DO_SUM    TO E_CATLOG-DO_SUM,
             US_out       to E_CATLOG-outputlen.
      APPEND E_CATLOG TO I_CATLOG1.
      CLEAR E_CATLOG.
      APPEND E_CATLOG TO I_CATLOG1.
      CLEAR E_CATLOG.
    ENDFORM.                    " f_first_field_catalog
    *&      Form  F_ALV_DATA_RETRIVAL
          ALV DATA VALIDATION
    FORM F_ALV_DATA_RETRIVAL .
      IF  P_OPIT EQ C_X
      AND P_OSST EQ C_SPACE .
    building field catlog for ‘open items’  list
        PERFORM f_fld_catlog_open_items.
    first list display ‘open items’ list
        PERFORM f_dispaly_open_items.
    Building Alv Layout
        PERFORM f_alv_layout_open_items.
      ENDIF.
    Code to display only summary sheet P_OSST check box
      IF  P_OPIT EQ C_X
      AND P_OSST EQ C_X.
    building field catlog for ‘open items’ Summary sheet
        PERFORM F_FLD_CATLOG_SUMSHET_OPEN.
    first list display ‘open items’ Summary sheet
        PERFORM F_DISPALY_SUMSHEET_OPEN.
      ENDIF.
    ENDFORM.                    " F_ALV_DATA_RETRIVAL
    *&      Form  F_GET_OPEN_SUMSHET
         GET SUMMARY SHEET OPEN ITEM DATA
    FORM F_GET_OPEN_SUMSHET .
      SORT T_BSIS BY SGTXT.
      UNASSIGN <FS_BSIS>.
      LOOP AT T_BSIS ASSIGNING <FS_BSIS>.
        MOVE SY-TABIX TO W_TABIX.
        IF W_TABIX EQ C_1.
          MOVE : <FS_BSIS>-SGTXT TO W_SGTXT,
                 <FS_BSIS>-PTIME TO W_PTIME,
                 <FS_BSIS>-DMBTR TO W_DMBTR,
                 <FS_BSIS>-IEDAT TO W_IEDAT.
          W_COUNT = W_COUNT + C_1.
          CONTINUE.
        ELSE.
          IF <FS_BSIS>-SGTXT EQ W_SGTXT.
            W_PTIME = W_PTIME + <FS_BSIS>-PTIME.
            W_DMBTR = W_DMBTR + <FS_BSIS>-DMBTR.
            W_COUNT = W_COUNT + C_1.
            W_IEDAT = W_IEDAT + <FS_BSIS>-IEDAT.
            CONTINUE .
          ELSE.
            W_ATIME = W_PTIME / W_COUNT.
            W_IEDAT = W_IEDAT / W_COUNT.
            MOVE : W_SGTXT TO E_SUMSHET_OPEN-SGTXT,
                   W_COUNT TO E_SUMSHET_OPEN-COUNT,
                   W_ATIME TO E_SUMSHET_OPEN-ATIME,
                   W_DMBTR TO E_SUMSHET_OPEN-DMBTR,
                   W_IEDAT TO E_SUMSHET_OPEN-IEDAT.
            APPEND E_SUMSHET_OPEN TO T_SUMSHET_OPEN.
            CLEAR: W_SGTXT,
                   W_PTIME,
                   W_DMBTR,
                   W_COUNT,
                   W_IEDAT.
            MOVE :  <FS_BSIS>-SGTXT TO W_SGTXT,
                    <FS_BSIS>-PTIME TO W_PTIME,
                    <FS_BSIS>-DMBTR TO W_DMBTR,
                    <FS_BSIS>-IEDAT TO W_IEDAT.
            W_COUNT = W_COUNT + C_1.
            CONTINUE.
          ENDIF.
        ENDIF.
      ENDLOOP.
      W_ATIME = W_PTIME / W_COUNT.
      W_IEDAT = W_IEDAT / W_COUNT.
      MOVE : W_SGTXT TO E_SUMSHET_OPEN-SGTXT,
             W_COUNT TO E_SUMSHET_OPEN-COUNT,
             W_ATIME TO E_SUMSHET_OPEN-ATIME,
             W_DMBTR TO E_SUMSHET_OPEN-DMBTR,
             W_IEDAT TO E_SUMSHET_OPEN-IEDAT.
      APPEND E_SUMSHET_OPEN TO T_SUMSHET_OPEN.
      CLEAR  E_SUMSHET_OPEN.
    ENDFORM.                    " F_GET_OPEN_SUMSHET
    *&      Form  F_TOP_OF_PAGE
          ITEMS TOP OF PAGE DATA
    FORM F_TOP_OF_PAGE .
      DATA: T_HEADER  TYPE SLIS_T_LISTHEADER,
            W_HEADER TYPE SLIS_LISTHEADER,
            T_LINE    LIKE W_HEADER-INFO.
      CLEAR W_HEADER.
    *TITLE
      MOVE C_H TO W_HEADER-TYP.
      MOVE C_TEXT TO W_HEADER-INFO.
      APPEND W_HEADER TO T_HEADER.
      CLEAR W_HEADER.
      MOVE C_S TO W_HEADER-TYP.
      MOVE C_TEXT2 TO W_HEADER-KEY.
      CONCATENATE  SY-DATUM+6(2) C_SLASH
                   SY-DATUM+4(2) C_SLASH
                   SY-DATUM(4) INTO W_HEADER-INFO.
      APPEND W_HEADER TO T_HEADER.
      CLEAR: W_HEADER.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = T_HEADER.
    ENDFORM.                    " F_TOP_OF_PAGE
    FORM F_DISPALY_SUMSHEET_OPEN .
      CLEAR w_repname.
      w_repname = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
         I_CALLBACK_PROGRAM                = w_repname
       I_CALLBACK_PF_STATUS_SET          = C_FSTAT
      I_CALLBACK_USER_COMMAND           = ' '
       I_CALLBACK_TOP_OF_PAGE            =  C_FTOPS
      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                         = e_alv_layout
         IT_FIELDCAT                       = i_catlog1[]
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
         I_DEFAULT                         = C_A
      I_SAVE                            = ' '
      IS_VARIANT                        =
         IT_EVENTS                         = i_alv_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                          = T_SUMSHET_OPEN
       EXCEPTIONS
         PROGRAM_ERROR                     = 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.
      FREE T_SUMSHET_OPEN.
    ENDFORM.                    " F_DISPALY_SUMSHEET_OPEN
    *&      Form  F_TOP_OF_PAGE_SUMSHET
          TOP OF PAGE FOR SUMMARY SHEET
    FORM F_TOP_OF_PAGE_SUMSHET .
      DATA: T_HEADER  TYPE SLIS_T_LISTHEADER,
            W_HEADER TYPE SLIS_LISTHEADER,
            T_LINE    LIKE W_HEADER-INFO.
      CLEAR: W_HEADER,
             T_HEADER,
             T_LINE.
    *TITLE
      MOVE C_H TO W_HEADER-TYP.
      MOVE C_TEXT1 TO W_HEADER-INFO.
      APPEND W_HEADER TO T_HEADER.
      CLEAR W_HEADER.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          IT_LIST_COMMENTARY = T_HEADER.
    ENDFORM.                    " F_TOP_OF_PAGE_SUMSHET
    *&      Form  F_PF_STATUS
          GET PF STATUS
    FORM F_PF_STATUS USING US_EXTAB TYPE SLIS_T_EXTAB.
      SET PF-STATUS C_STAT EXCLUDING US_EXTAB.
    ENDFORM.                    "F_PF_STATUS
    *&      Form  F_USER_COMMAND
          GET USER COMMAND
    *FORM F_USER_COMMAND USING W_UCOMM LIKE SY-UCOMM
                             US_SELFIELD  TYPE SLIS_SELFIELD.
    FORM F_USER_COMMAND USING US_UCOMM LIKE SY-UCOMM
                                      US_SELFIELD  TYPE SLIS_SELFIELD.
      CONSTANTS:C_NEXT(6)  TYPE C  VALUE '&NEXT'.
      if sy-subrc eq c_0.
        MOVE C_TEXT3 TO US_SELFIELD-TABNAME.
      endif.
      IF   P_OPIT  EQ C_X
      AND  US_UCOMM EQ C_NEXT .
        PERFORM F_FLD_CATLOG_SUMSHET_OPEN.
        PERFORM F_DISPALY_SUMSHEET_OPEN.
      ELSEIF  P_CLIT EQ C_X
      AND     US_UCOMM EQ C_NEXT.
        PERFORM F_FLD_CATLOG_SUMSHET_CLEAR.
        PERFORM F_DISPALY_SUMSHET_CLEAR.
      ELSEIF  P_ALIT EQ C_X
      AND     US_UCOMM EQ C_NEXT.
        PERFORM F_FLD_CATLOG_SUMSHET_TOTAL.
        PERFORM F_DISPALY_SUMSHET_TOTAL.
      ENDIF.
    ENDFORM.                    "F_USER_COMMAND
    *&      Form  f_alv_layout_open_items
          text
    ----

    Hi,
    Please refer to the sample code :
    *&      Form  BUILD_LAYOUT
    *       Build layout for ALV grid report
    form build_layout.
      gd_layout-no_input          = 'X'.
      gd_layout-colwidth_optimize = 'X'.
      gd_layout-totals_text       = 'Totals'(201).
    *  gd_layout-totals_only        = 'X'.
    *  gd_layout-f2code            = 'DISP'.  "Sets fcode for when double
    *                                         "click(press f2)
    *  gd_layout-zebra             = 'X'.
    *  gd_layout-group_change_edit = 'X'.
    *  gd_layout-header_text       = 'helllllo'.
    endform.                    " BUILD_LAYOUT
    Thanks,
    Sriram Ponna.

  • Refreshing contents of ALV grid

    I am displaying 2 ALV grids in a splitter container on screen 100. There is an option for refresh on this screen to refresh the entries in both the grids (if any change). This refresh works fine using method REFRESH_TABLE_DISPLAY for both top and bottom grid contents.
    After processing the contents in screen 100, the user can navigate to screen 200 to view results of the current run. This screen also holds an ALV grid display of results on a custom container. When returning to screen 100 from 200, the results in top grid of screen 100 are fixed. The refresh option now only works with the grid on bottom container and not the top. I have tried using both REFRESH_TABLE_DISPLAY and SET_TABLE_FOR_FIRST_DISPLAY options and neither worked.
    How do I refresh the ALV to use the contents from the new dataset?
    Regards,
    Suri.

    Are you used refresh in PBO of 100 ?
    Like
        call method g_grid->refresh_table_display.   " Top grid
        call method g_grid1->refresh_table_display. " bottom grid

  • Fit the ALV grid to the monitor size

    Hi all,
    Please let me know how i can fit the ALV grid to the monitor size of the user. That is The grids should be layered and expanded to the full width of the users monitor.
    Thanks in advance
    Jey Sabith Ebron

    Hi Jey,
    You can fit ALV grid to monitor size by defining the container as docking container.
    In this case, you neednot create a custom container .
    You can use the following code:
      CONSTANTS: lc_height TYPE i VALUE 1200.
    DATA: go_container       TYPE REF TO cl_gui_docking_container,
          go_alv_tree        TYPE REF TO cl_gui_alv_tree.
        CREATE OBJECT go_container
          EXPORTING
            repid                       = sy-repid
            dynnr                       = sy-dynnr
            side                        = 2                        " Top
            extension                   = lc_height
            metric                      = 1                        " Pixel
          EXCEPTIONS
            cntl_error                  = 1
            cntl_system_error           = 2
            create_error                = 3
            lifetime_error              = 4
            lifetime_dynpro_dynpro_link = 5
            OTHERS                      = 6.
        IF sy-subrc <> 0.
          MESSAGE x398(00) WITH 'ERROR'(100).
        ENDIF.
      CREATE OBJECT go_alv_tree
        EXPORTING
          parent                      = go_container
          node_selection_mode         = cl_gui_column_tree=>node_sel_mode_single
          item_selection              = c_x
          no_toolbar                  = ''
        EXCEPTIONS
          cntl_error                  = 1
          cntl_system_error           = 2
          create_error                = 3
          lifetime_error              = 4
          illegal_node_selection_mode = 5
          failed                      = 6
          illegal_column_name         = 7.
      IF sy-subrc <> 0.
        MESSAGE x398(00) WITH 'ERROR'.
      ENDIF.
    Code above is for ALV tree.
    You can define any ALV grid object using docking container.
    This will solve your problem.
    Let me know if you face any issues.
    Thanks,
    Nisha Vengal.

  • Stretch alv grid screen

    Hi,
    I've a screen with alv grid in a custom control.
    I'd like to make it stretch (+-) with the mouse, is it possible?
    Thanks in advance,
    Maria João Rocha

    Maria,
    I am assuming that the GRID is not occupying the entire space on your screen and you want to pull and fit into the screen.
    FOr this what you need to do is.
    1. On the Screen you have placed a CUSTOM CONTROL, right?
      Stretch to the extent possible - if you don't have anything else on the screen, make the control occupy the entire screen.
    2. Double click, shows the properties. There will be HORIZONTAL AND VERTICAL properties at the end of the screen. Check both the boxes and give 1 and 1 in the field next to them.
    This automatcially makes sure that the container will occupy the entire space available on the screen.
    Regards,
    Ravi
    Note : Please mark the helpful answers.

  • Maximum number of character we can print in a column uing ALV grid display

    Hi frnds,
    My requirment is to print 500 charcter data in a column using ALV grid display.
    Could any body tell me is it possible and the maximum character it can i print in a column using ALV grid dispaly.
    Regards,
    Sandipan

    Hi Sandipan,
    refer notes 857823, 910300 and 959775. All these say there is a limitation of 128 characters.
    857823 - ALV grid: Strings with a maximum of 128 characters
    Symptom
    Entries in cells of the type CHAR or string are truncated after 128
    characters in the SAP GUI.
    also refer,
    ALV Grid Control (cl_gui_alv_grid), function module (Full-screen) Grid
    (Reuse_alv_grid_display, SAPLSLVC_FULLSCREEN), SAPGUI, back end, front end
    Cause and Prerequisites
    The data table that is sent to the front end only allows character values
    with the length 128.
    Solution
    This is the standard system behavior and cannot be changed.

Maybe you are looking for

  • Error in PDF Conversion while downloading file from application server

    Hi, I am facing a problem in which i have to download file from application server which is a PDF file (output of SAP Script). I am downloading this file using following code in BSP technology: * event handler for data retrieval EMPCD = REQUEST->GET_

  • Hardware or software malfunction?

    Hi everyone. within the space of a few days my iMac early 2008 started throwing the spinning pinwheel more and more until I couldn't even do anything after logging in. Finder would just hang at the slightest click.  I got into safe mode ok and disabl

  • HT1338 How do I run a preupgrade script for Apple Mobile Device for itunes?

    My computer says that I have an update available but so far into trying to install it tells me the upgrade script is wrong.  Am I able to take care of this by myself or do I need to take it to a store?

  • Preview Playback on 2nd Monitor

    I am brand new to the Final Cut AND Mac World - just got my first Mac with Final Cut Studio two days ago. I am having some problems getting preview playback on my 2nd monitor in RAW or full screen, neither work. What I get is the current frame of the

  • Screen resolution after drop

    I dropped my ipad2 - screen didn't shatter and lcd stil works but there are some wavy areas (colors render correctly) on the screen. I sure the problem is the result of the drop. Any idea what this is and how to fix it? thanks!