Changing field catalog of ALV grid after first display (was: "ALV GRID")

Dear experts!
I am using CL_GUI_ALV_GRID to display an ALV, whose fieldcatalog has 5 fields (FIELD1, FIELD2, FIELD3, FIELD4 and FIELD5).
I am setting "NO_OUT = 'X' " to the fields FIELD3 and FIELD5 in the fieldcatalog before call the method SET_TABLE_FOR_FIRST_DISPLAY.
If a specific event occurs on the screen, I would like to set "NO_OUT = 'X'" to the fields FIELD2 and FIELD4 and I would like to set the "NO_OUT = ''" to the fields and FIELD3 FIELD5. This should happen at runtime after the method call "SET_TABLE_FOR_FIRST_DISPLAY".
I've tried using the method SET_FIELDCATALOG, but it is private.
Does anyone have any idea how to solve this problem?
Thank you very much!
Rubens
Edited by: Thomas Zloch on Aug 22, 2011 3:49 PM - subject corrected

Hi
Try to use the method SET_FRONTEND_FIELDCATALOG (it'll call private method SET_FIELDCATALOG)
Max

Similar Messages

  • Change field catalog in VT05 - Selective logs for collective run

    Hi,
    Through transaction VT05, we can check shipment log which having following ALV field Catalog.
    Collective run
    Date
    Time
    User
    Transaction code
    Operating mode
    Problem class
    Expiry date
    Keep until expiry
    Processing status
    But if we want check Delivery number for particular Collective Run then we have to click that collective run and then can check for the Delivery number.
    Actually our requirement is to add one more column in above ALV field Catalog of Delivery Number.
    I have searched for Enhancements and BADIs, but I did not found suitable one for VT05 log.
    Can any one help me out for above issue for adding one more column in above ALV field Catalog of Delivery Number (along with above mentioned ALV field catalog in output) of VT05 log report.

    Thanks Nabheet once again...
    I would like to show you the coding what I have done in implemented implicit Enhancements.
    Following code is written under implemented implicit Enhancements - ZSHIPMENT_DETAIL
    Properties of Enhancement Implementation           ZSHIPMENT_DETAIL                          (Active)
    Enhancem. Technique:  Source Code Plug-In
    Description           Showing SHIPMENT Detail in output
    Package               $TMP
    Original Language     EN
    Created               MNIKAM       02/09/2012
    Last Changed          MNIKAM       02/19/2012
    Superordinate Enhancement Implementation     ZSHIPMENT
    Enhanced Development Object:   V54X
    SAPLV54X          Static Enhancement Point/Section     \PR:SAPLV54X\FO:LOG_HEADER_DISPLAY\SE:BEGIN\EI
    ENHANCEMENT 1  ZSHIPMENT_DETAIL.    "active version
    TYPE-POOLS: szal.
      DATA: g_l_header_extr     TYPE header_extr.
      FIELD-SYMBOLS: <f_g_l_header_extr>  TYPE header_extr.
      DATA: g_l_log_link        TYPE log_link.
      FIELD-SYMBOLS:  <f_g_l_log_link>  TYPE  log_link.
      DATA: g_l_t_lognumbers    TYPE szal_lognumbers WITH HEADER LINE.
      FIELD-SYMBOLS: <f_log_nr> TYPE  log_nr.
      data: messages    TYPE TABLE OF balm.
      FIELD-SYMBOLS:  <f_l_s_message> TYPE balm.
      DATA: l_tabix TYPE sy-tabix.
    LOOP AT G_HEADER_EXTR_TAB ASSIGNING <f_g_l_header_extr> WHERE status ne 1.
          CLEAR: l_tabix.
          l_tabix = sy-tabix.
          READ TABLE g_log_link_tab ASSIGNING <f_g_l_log_link>
                                     WITH KEY fccnu = <f_g_l_header_extr>-fccnu
                                     BINARY SEARCH.
           READ TABLE  <f_g_l_log_link>-log_tab ASSIGNING <f_log_nr> index 1.
           CLEAR: g_l_t_lognumbers.
           g_l_t_lognumbers-item = <f_log_nr>-log_nr.
           APPEND g_l_t_lognumbers.
           CLEAR: messages.
           CALL FUNCTION 'APPL_LOG_READ_DB_WITH_LOGNO'
            TABLES
              lognumbers = g_l_t_lognumbers[]
              messages   = messages.
          delete messages WHERE MSGNO ne 371 AND MSGNO  ne 494 AND  MSGNO ne 491.
          LOOP AT messages  ASSIGNING <f_l_s_message> WHERE  LOGNUMBER = <f_log_nr>-log_nr
                                                       AND  ( MSGTY   = 'S' or  MSGTY = 'W' )   "Message Type S-success & W-warning
                                                       AND  MSGID     = 'VW'
                                                       AND  ( MSGNO   = 371 or MSGNO  = 494 or MSGNO = 491  ).  "Message Numbr through which Shipment Number gets
                   <f_g_l_header_extr>-tknum =  <f_l_S_message>-MSGV1.      "SHIPMENT NUMBER
                   CLEAR: g_l_t_lognumbers[].
                   exit.
          ENDLOOP.
    ENDLOOP.
    ENDENHANCEMENT.
    Thanks again,
    Mahesh Nikam.

  • Select ALV row right after first display

    Hi,
    I want to pre-select specific rows in my ALV already when it`s first displayed. I tried to use method set_selected_rows in the PBO where the ALV object is created, but it did not work. It only worked when I put the method in the PAI.
    Can I select rows of the ALV when it is initially displayed, that is before it`s screen`s PAI is called?
    Thanks.
    Krisz

    Hi
    Its possible to have the rows pre-selected using buttons.
    In PBO, after calling method-set_table_for_first_display
         CALL METHOD cl_grid->get_selected_rows
           IMPORTING
             et_index_rows = tb_row_id[]
    Loop on the internal table whose records are displayed in ALV,
    and set the parameter index in TB_ROW_ID as SY_TABIX.
    endloop.
         CALL METHOD cl_grid->set_selected_rows
           EXPORTING
             it_index_rows = tb_row_id.
    I have tested it and works.
    Please let me know whether it works or not
    BR
    Lavanya

  • Changing Field Labels texts: What happens after Upgrade?

    Hi All,
    my client would like to change some field label text of domains.
    The question I have is, what will happen after change of release? Will the texts be overwritten? And all have to be maintained again?
    Will I know which ones have been overwritten (SPAU)?
    Any comment, suggestion, experience?
    Thanks in advance!
    thomas

    Hello,
    Guess your question refers to field label texts of datatyps - because domains have only the technical data definition. Anyway - all modifications of Data Dictionary elements ( domains, datatyps, tables) are handled by transaction SPDD during upgrades. The difference to transaction SPAU is, that transaction SPDD is used during the upgrade - after the 'Test'-phase and before the 'Import'-phase.
    Have a look on the documentation of SPDD- it's quite good.
    Regards Wolfgang

  • ALV List -  Field Catalog - Change Column width

    Hi Friends,
    I am using Alv list to display the output of a report program. I have generated the field catalog using REUSE_ALV_FIELDCATALOG_MERGE function and to display the alv REUSE_ALV_LIST_DISPLAY.
    My Internal table has few fields like "text1 type string". So after generating the Fieldcatalog from internal table i have changed the field description, but i don't know how to change the column output display width. I have tried by changing OUTPUTLEN parameter to 50 but in the output it is taking only 10 characters instead of 50 characters.
      How can i change the field length(FOR STRING TYPE) for output display ??
    Which parameter do i need to change in field catalog for String type fields..
    Regards,
    Raju.
    Message was edited by: Narayana Raju Sampathirao

    Hi narayana,
    1. the STRING type is causing the problem.
    2. what u can do is,
      (i suppose u are modifying the alv field catalogue)
       One workaround is :
       and it works fantastic !
    3.  BOLD is important.
        (this will take care of the length)
    LOOP AT alvfc INTO alvwa.
      IF alvwa-fieldname = 'A'.
        alvwa-outputlen = '100'.
    <b>    alvwa-inttype = 'CHAR'.</b>
        MODIFY alvfc FROM alvwa.
      ENDIF.
    ENDLOOP.
    4. To get a TASTE of what i m saying,
       just copy paste in new program :
    REPORT abc.
    TYPE-POOLS : slis.
    Data
    DATA : BEGIN OF itab OCCURS 0,
           a TYPE string.
            INCLUDE STRUCTURE t001.
    DATA :  END OF itab.
    DATA : alvfc TYPE slis_t_fieldcat_alv.
    DATA : alvwa TYPE slis_fieldcat_alv.
    Select
    SELECT * FROM t001 INTO CORRESPONDING FIELDS OF TABLE itab.
    LOOP AT itab.
      itab-a = 'pppppppppppppppppppppp'.
      MODIFY itab.
    ENDLOOP.
    *-------  Field Catalogue
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
      EXPORTING
        i_program_name         = sy-repid
        i_internal_tabname     = 'ITAB'
        i_inclname             = sy-repid
      CHANGING
        ct_fieldcat            = alvfc
      EXCEPTIONS
        inconsistent_interface = 1
        program_error          = 2
        OTHERS                 = 3.
    LOOP AT alvfc INTO alvwa.
      IF alvwa-fieldname = 'A'.
        alvwa-outputlen = '100'.
        alvwa-inttype = 'CHAR'.
        MODIFY alvfc FROM alvwa.
      ENDIF.
    ENDLOOP.
    Display
    CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'
      EXPORTING
        it_fieldcat             = alvfc
      TABLES
        t_outtab                = itab
      EXCEPTIONS
        program_error           = 1
        OTHERS                  = 2.
    regards,
    amit m.

  • ALV Grid Field catalog

    Hi,
         I am trying to display data from two different tables, say 3 fields from one table and 3 fields from other table. in alv grid format using classes and using method CALL METHOD go_grid->set_table_for_first_display
    how can we build the field catalog for the internal table which consists of 6 fields from two different tables
    thanks in advance

    Hello,
    Please check,it is similar case.
    FORM set_grid.
      IF g_r_grid IS INITIAL.
        CREATE OBJECT g_r_cont
                     EXPORTING container_name = 'CUST1'.
        CREATE OBJECT g_r_grid
                     EXPORTING i_parent = g_r_cont.
        g_r_variant = sy-repid.
      Build Field Catalog
        PERFORM build_field_catalog.
      Exclude process options from ALV
        PERFORM alv_excl.
      setting ALV Grid layout
        PERFORM alv_layo.
        CALL METHOD g_r_grid->set_table_for_first_display
           EXPORTING
             is_layout                     = g_r_layo
             is_variant                    = g_r_variant
             it_toolbar_excluding          = g_r_excl
             i_save                        = 'X'
           CHANGING
             it_outtab                     = g_t_alv[]
             it_fieldcatalog               = g_t_fieldcat.
      ENDIF.
    ENDFORM.                    " set_grid
    *Form Routine ID    : build_field_catalog
    *Form Routine Name  : TO Build Field Catalog
    *Outline            : Subroutine for building the field catalog
    *Argument           : None
    *Return Value       : None
    FORM build_field_catalog.
      DATA : l_f_n TYPE i.
      REFRESH g_t_fieldcat.
      l_f_n  = 0.
    Add properties values to ALV Catalog
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MATNR' 'CHAR' l_f_n
                                text-001 'X' space ' ' 18 ' '  .
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'TXZ01' 'CHAR' l_f_n
                                text-002 'X' space 'X' 40 ' ' .
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MFRPN' 'CHAR' l_f_n
                                text-003 ' ' space ' ' 40 ' ' .
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'EBELN' 'CHAR' l_f_n
                                 text-004 space space ' ' 10 ' ' .
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'EBELP' 'NUMC' l_f_n
                                 text-005 space space ' ' 5 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'EINDT' 'DATS' l_f_n
                                 text-006 space space ' ' 10 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MENGE' 'QUAN' l_f_n
                                 text-007 space space ' ' 13 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MEINS' 'UNIT' l_f_n
                                 text-008 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MENGE1' 'QUAN' l_f_n
                                 text-009 space space ' ' 13 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'MEINS1' 'UNIT' l_f_n
                                 text-010 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'LIFNR' 'CHAR' l_f_n
                                 text-011 space space ' ' 10 'ALPHA'.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'NAME1' 'CHAR' l_f_n
                                 text-012 space space 'X' 35 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'BSART' 'CHAR' l_f_n
                                 text-013 space space ' ' 4 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'BEDAT' 'DATS' l_f_n
                                 text-014 space space ' ' 10 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'AEDAT' 'DATS' l_f_n
                                 text-015 space space ' ' 10 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'INSMK' 'CHAR' l_f_n
                                 text-016 space space ' ' 1 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'WERKS' 'CHAR' l_f_n
                                 text-017 space space ' ' 4 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'LGORT' 'CHAR' l_f_n
                                 text-018 space space ' ' 4 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'EKGRP' 'CHAR' l_f_n
                                 text-019 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PSTYP' 'CHAR' l_f_n
                                 text-020 space space ' ' 1 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'LOEKZ' 'CHAR' l_f_n
                                 text-021 space space ' ' 1 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'DISPO' 'CHAR' l_f_n
                                 text-022 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PO_TEXT' 'CHAR' l_f_n
                                 text-023 space space 'X' 10 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'BSGRU' 'CHAR' l_f_n
                                 text-024 space space ' ' 3 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PRDHA1' 'CHAR' l_f_n
                                 text-025 space space ' ' 18 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'VTEXT1' 'CHAR' l_f_n
                                 text-026 space space 'X' 40 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PRDHA2' 'CHAR' l_f_n
                                 text-027 space space ' ' 18 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'VTEXT2' 'CHAR' l_f_n
                                 text-028 space space 'X' 40 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'PRDHA3' 'CHAR' l_f_n
                                 text-029 space space ' ' 18 ' '.
      l_f_n = l_f_n + 1.
      PERFORM add_catalog USING 'VTEXT3' 'CHAR' l_f_n
                                 text-030 space space 'X' 40 ' '.
    ENDFORM.                    " build_field_catalog
    *Form Routine ID    : add_catalog
    *Form Routine Name  : To Add the Catalog for the ALV
    *Outline            : Subroutine to add properties values to ALV Catalog
    *Argument           : p_fname        "Field Name
                        p_inttype      "Intenal Type
                        p_col_pos      "Column Position
                        p_coltext      "Column Text
                        p_key          "Key Field
                        p_hotspot      "Hotspot Enabled
                        p_outlen       "Internal Length
                        p_convexit     "conversion exit name
    *Return Value       : g_t_fieldcat   "Field Catalog Table
    FORM add_catalog USING   p_fname
                             p_inttype
                             p_col_pos
                             p_col_text
                             p_key
                             p_hotspot
                             p_lowercase
                             p_outlen
                             p_convexit.
      CLEAR g_r_fieldcat.
      g_r_fieldcat-fieldname = p_fname.
      g_r_fieldcat-inttype   = p_inttype.
      g_r_fieldcat-col_pos   = p_col_pos.
      g_r_fieldcat-coltext   = p_col_text.
      g_r_fieldcat-hotspot   = p_hotspot.
      g_r_fieldcat-lowercase = p_lowercase.
      g_r_fieldcat-outputlen = p_outlen.
      g_r_fieldcat-key       = p_key.
      g_r_fieldcat-convexit  = p_convexit.
      APPEND g_r_fieldcat TO g_t_fieldcat.
    ENDFORM.                    " add_catalog
    *Form Routine ID    : alv_excl
    *Form Routine Name  : ALV Exclude List
    *Outline            : Subroutine to exclude process options from ALV
    *Argument           : None
    *Return Value       : None
    FORM alv_excl.
      APPEND cl_gui_alv_grid=>mc_mb_sum          TO g_r_excl.
      APPEND cl_gui_alv_grid=>mc_mb_subtot       TO g_r_excl.
      APPEND cl_gui_alv_grid=>mc_fc_graph        TO g_r_excl.
      APPEND cl_gui_alv_grid=>mc_fc_info         TO g_r_excl.
      APPEND cl_gui_alv_grid=>mc_fc_print_back   TO g_r_excl.
    ENDFORM.                    " alv_excl
    *Form Routine ID    : alv_layo
    *Form Routine Name  : alv_layo
    *Outline            : Subroutine to set alv layout
    *Argument           : None
    *Return Value       : None
    FORM alv_layo.
      g_r_layo-grid_title = text-100.
      g_r_layo-cwidth_opt = g_c_mark.
      g_r_layo-zebra      = g_c_mark.
      g_r_layo-no_rowmark = space.
      g_r_layo-sel_mode   = g_c_selmode.
    ENDFORM.                 
    Regards

  • Change/Display in ALV Grid

    Hello All,
    I am using FM 'REUSE_ALV_GRID_DISPLAY'.  It is required that when the user presses a button on the screen, that a few fields toggle from display mode to changed mode.  I know that setting the input and edit fields to X for the field catalog table will allow a user to change the table but only on the initial display of the grid.  Does anyone know how I toggle between the change and display mode of the ALV grid?  Thanks for your help in advance.
    John

    Hello Ashish,
    I am setting V_SELFIELD-REFRESH = 'X' in my program.  I debugged it and found that the sy-subrc is 1 after it passes the FM REUSE_ALV_LIST_LAYOUT_INFO_GET.  Do you have any idea as to why this would be 1 and not 0?  This is my code so far:
          CALL FUNCTION 'REUSE_ALV_LIST_LAYOUT_INFO_GET'
           IMPORTING
             ET_FIELDCAT                      = int_fcat[]
          TABLES
            ET_OUTTAB                        = itab[]
           EXCEPTIONS
             NO_INFOS                         = 1
             PROGRAM_ERROR                    = 2
             OTHERS                           = 3
          IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.

  • How do I define Field-Catalog and Event-Catalog in OOPs ALV

    Hi All,
    This is the piece of the code on which I'm working upon. This program is giving an exception "No Field-Catalog Found". 
    I'm new to OOPs ALV. Could anybody please tell me how to define the field-catalog and event-catalog in this.
    module PBO output.
          IF g_custom_container IS INITIAL.
              CREATE OBJECT g_custom_container EXPORTING CONTAINER_NAME = 'CCCONTAINER'.
              CREATE OBJECT g_grid             EXPORTING I_PARENT       = g_custom_container.
          CALL METHOD g_grid->set_table_for_first_display
              EXPORTING I_STRUCTURE_NAME = 'IT_MATERIAL'
                        is_layout = layout
              CHANGING IT_OUTTAB         = gt_it_material.
          ENDIF.
      endmodule.
    Regards,
    Saurabh

    hi,
    chk this sampl ceode.
    TYPE-POOLS: slis.
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    TABLES : zmpets_shipactiv, zmpets_chargebk, zmpets_shiphdr.
    DATA : BEGIN OF int_crb OCCURS 0,
           sel TYPE char1,
           icon TYPE icon_d,
           pernr LIKE zmpets_cil-pernr,
           vorna LIKE pa0002-vorna,
           movreason LIKE zmpets_shiphdr-movreason,
           shipdocnum LIKE zmpets_chargebk-shipdocnum,
           createdon LIKE zmpets_chargebk-createdon,
           chargeamount LIKE zmpets_chargebk-chargeamount,
           version LIKE zmpets_shipactiv-version,
           activity LIKE zmpets_shipactiv-activity,
           vendor LIKE zmpets_shiphdr-vendor,
          smtp_addr LIKE adr6-smtp_addr,
           empperid LIKE zmpets_167doc-empperid,
           celltab TYPE lvc_t_styl,
           END OF int_crb.
    DATA : int_crb_ver LIKE int_crb OCCURS 0 WITH HEADER LINE.
    DATA : int_crb_mail LIKE int_crb OCCURS 0 WITH HEADER LINE.
    DATA : int_shipactiv LIKE zmpets_shipactiv OCCURS 0 WITH HEADER LINE.
    DATA: gt_fieldcatalog TYPE lvc_t_fcat.
    DATA : wf_flag TYPE i.
    DATA : wf_res TYPE c.
    DATA : wf_tabix TYPE sy-tabix.
    DATA: BEGIN OF int_sin OCCURS 0,
          shipdocnum LIKE zmpets_chargebk-shipdocnum,
            shipdocnum LIKE zmpets_shipactiv-petsdocnumber,
          END OF int_sin.
    DATA: objpack   LIKE sopcklsti1 OCCURS 2 WITH HEADER LINE.
    DATA: objhead   LIKE solisti1 OCCURS 1 WITH HEADER LINE.
    DATA: objbin    LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: objtxt    LIKE solisti1 OCCURS 10 WITH HEADER LINE.
    DATA: reclist   LIKE somlreci1 OCCURS 5 WITH HEADER LINE.
    DATA: doc_chng  LIKE sodocchgi1.
    DATA: tab_lines LIKE sy-tabix.
    DATA l_num(3).
    DATA: ok_code            LIKE          sy-ucomm,
          w_repid            LIKE          sy-repid,
          wl_sno             TYPE          i         VALUE 0,
          w_max              TYPE          i         VALUE 100,
          wf_layout          TYPE          lvc_s_layo,
          cont_on_main       TYPE          scrfname   VALUE  'GRID_CONTROL',
          cont_on_dialog     TYPE          scrfname   VALUE 'GRID_CONTROL',
          grid1              TYPE          REF TO cl_gui_alv_grid,
          grid2              TYPE          REF TO cl_gui_alv_grid,
          custom_container1  TYPE          REF TO cl_gui_custom_container,
          custom_container2  TYPE          REF TO cl_gui_custom_container,
          event_receiver     TYPE          REF TO lcl_event_receiver,
          lt_exclude         TYPE          ui_functions,
          ls_celltab         TYPE          lvc_s_styl,
          lt_celltab         TYPE          lvc_t_styl.
    SELECTION-SCREEN BEGIN OF BLOCK b3 WITH FRAME TITLE text-001.
    PARAMETERS : p_cash AS CHECKBOX.
    SELECTION-SCREEN END OF BLOCK b3.
    PERFORM fieldcatalog_init USING gt_fieldcatalog[].
    Selection-Screen----
    SELECTION-SCREEN  BEGIN OF BLOCK b1 WITH FRAME TITLE text-002.
    SELECT-OPTIONS:s_chdate FOR zmpets_chargebk-createdon,
                   s_pernr FOR zmpets_shiphdr-pernr,
                   s_mvrsn FOR zmpets_shiphdr-movreason,
                   s_sin FOR zmpets_chargebk-shipdocnum NO INTERVALS
    NO-EXTENSION.
    SELECTION-SCREEN  END OF BLOCK b1.
    PERFORM f_clear_fields.
    CALL SCREEN 100.
          CLASS lcl_event_receiver DEFINITION
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
        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.
      PRIVATE SECTION.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
          CLASS lcl_event_receiver IMPLEMENTATION
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_toolbar.
    § 2.In event handler method for event TOOLBAR: Append own functions
      by using event parameter E_OBJECT.
        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.
    new button -
        MOVE 'PROCESSED' TO ls_toolbar-function.
        MOVE icon_execute_object TO ls_toolbar-icon.
        MOVE 'Process the Record'(110) TO ls_toolbar-quickinfo.
        MOVE ' Process '(200) TO ls_toolbar-text.
        MOVE ' ' TO ls_toolbar-disabled.
        APPEND ls_toolbar TO e_object->mt_toolbar.
      ENDMETHOD.                    "handle_toolbar
      METHOD handle_user_command.
    § 3.In event handler method for event USER_COMMAND: Query your
      function codes defined in step 2 and react accordingly.
        DATA: lt_rows TYPE lvc_t_row.
        CASE e_ucomm.
          WHEN 'PROCESSED'.
            CALL FUNCTION 'POPUP_TO_CONFIRM_STEP'
                     EXPORTING
                      defaultoption        = 'N'
      textline1     = 'Do you want to process the selected documents?'
              TEXTLINE2            = ' '
                       titel                = 'Process Documents'
              START_COLUMN         = 25
              START_ROW            = 6
              CANCEL_DISPLAY       = 'X'
                    IMPORTING
                      answer               = wf_res.
    *--IF THE USER CONFIRMS 'YES',
            IF wf_res = 'J'.
              PERFORM f_modify_activity.
              CALL METHOD grid1->refresh_table_display.
           PERFORM SENDINGMAIL.
            ENDIF.
        ENDCASE.
      ENDMETHOD.                           "handle_user_command
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
    MODULE pbo_100 OUTPUT
    MODULE pbo_100 OUTPUT.
      SET PF-STATUS 'MAIN100'.
      SET TITLEBAR 'MAIN100'.
      w_repid = sy-repid.
      IF custom_container1 IS INITIAL.
    *get the data from charge back table
        PERFORM select_table_chb.
    create a custom container control for our ALV Control
        CREATE OBJECT custom_container1
            EXPORTING
                container_name = cont_on_main
            EXCEPTIONS
                cntl_error = 1
                cntl_system_error = 2
                create_error = 3
                lifetime_error = 4
                lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc NE 0.
    add your handling, for example
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              titel = w_repid
              txt2  = sy-subrc
              txt1  = 'The control could not be created'(510).
        ENDIF.
        CREATE OBJECT grid1
                  EXPORTING i_parent = custom_container1.
    Set a titlebar for the grid control
        wf_layout-grid_title = 'Charge Back'(100).
    allow to select multiple lines
        wf_layout-sel_mode = 'C'.
        wf_layout-stylefname = 'CELLTAB'.
    Exclude all edit functions in this example since we do not need them:
        PERFORM exclude_tb_functions CHANGING lt_exclude.
        CALL METHOD grid1->set_table_for_first_display
                   EXPORTING
                I_BUFFER_ACTIVE               =
                I_CONSISTENCY_CHECK           =
                I_STRUCTURE_NAME              =
                IS_VARIANT                    =
                I_SAVE                        =
                I_DEFAULT                     = 'X'
                     is_layout                     = wf_layout
                IS_PRINT                      =
                IT_SPECIAL_GROUPS             =
                  it_toolbar_excluding          = lt_exclude
                IT_HYPERLINK                  =
                IT_ALV_GRAPHICS               =
              CHANGING
                it_outtab                     = int_crb[]
                it_fieldcatalog               = gt_fieldcatalog.
        CREATE OBJECT event_receiver.
        SET HANDLER event_receiver->handle_user_command FOR grid1.
        SET HANDLER event_receiver->handle_toolbar FOR grid1.
        CALL METHOD grid1->set_toolbar_interactive.
      ENDIF.                               "IF grid1 IS INITIAL
      CALL METHOD cl_gui_control=>set_focus
        EXPORTING
          control = grid1.
    ENDMODULE.                    "pbo_100 OUTPUT
    MODULE pai_100 INPUT
    MODULE pai_100 INPUT.
      CASE ok_code.
        WHEN 'EXIT'.
          PERFORM f_clear_fields.
          LEAVE PROGRAM.
        WHEN 'CANCEL'.
          PERFORM f_clear_fields.
          LEAVE TO SCREEN 0.
        WHEN 'BACK'.
          PERFORM f_clear_fields.
          LEAVE TO SCREEN 0.
      ENDCASE.
      CLEAR ok_code.
    ENDMODULE.                    "pai_100 INPUT
    **&      Form  select_table_chb
          text
    FORM select_table_chb.
      IF p_cash = 'X'.
    *Consider the pending documents also.
    *get the documents which are not processed yet,
    *Doctype -> 06 = Charge Back document type.
        SELECT zmpets_shiphdrpernr pa0002vorna
         zmpets_shiphdrmovreason zmpets_chargebkshipdocnum
         zmpets_chargebkcreatedon zmpets_chargebkchargeamount
         zmpets_shipactivversion zmpets_shipactivactivity
    zmpets_shiphdr~vendor
       adr6~smtp_addr
    zmpets_167doc~empperid
                 INTO CORRESPONDING FIELDS OF TABLE int_crb_ver
                 FROM zmpets_chargebk
                 JOIN zmpets_shiphdr
               ON zmpets_chargebkshipdocnum = zmpets_shiphdrshipdocno
                 JOIN zmpets_shipactiv
         ON zmpets_chargebkshipdocnum = zmpets_shipactivpetsdocnumber
                 JOIN pa0002
                 ON zmpets_shiphdrpernr = pa0002pernr
                    JOIN lfa1
                    ON lfa1lifnr = zmpets_shiphdrvendor
                    JOIN adr6
                    ON adr6addrnumber = lfa1adrnr
                 JOIN zmpets_167doc
                 ON zmpets_167docpernr = pa0002pernr
                           WHERE zmpets_shipactiv~doctype = '06'
                        zmpets_shipactiv~activity NE '30'
                      ZMPETS_CHARGEBK~CREATEDON IN s_chdate
                      AND ZMPETS_SHIPHDR~pernr IN s_pernr
                      AND ZMPETS_SHIPHDR~MOVREASON IN s_mvrsn
                      AND ZMPETS_CHARGEBK~SHIPDOCNUM IN s_sin
                           AND zmpets_chargebk~loekz NE 'X'
                           AND zmpets_shipactiv~loekz NE 'X'
                           AND zmpets_shiphdr~loekz NE 'X'.
        IF sy-subrc <> 0.
    *Message is 'No Pending Documents Available.'.
          MESSAGE s196(zm050).
        ELSE.
          LOOP AT int_crb_ver.
    *Not yet processed. set to red
            int_crb_ver-icon = '@0A@'.
            MODIFY int_crb_ver.
          ENDLOOP.
          PERFORM f_filter_data_pending.
        ENDIF.
      ELSE.
    *Get the document details from pa0002,zmpets_shipactiv,ZMPETS_CHARGEBK
    *table.
    *Consider document type as '01'  during the selection.
    *Doctype -> 06 = Charge Back document type.
        SELECT zmpets_shiphdrpernr pa0002vorna zmpets_shiphdr~movreason
        zmpets_chargebkshipdocnum zmpets_chargebkcreatedon
    zmpets_chargebkchargeamount zmpets_shipactivversion
    zmpets_shipactivactivity zmpets_shiphdrvendor
    *adr6~smtp_addr
    zmpets_167doc~empperid
                 INTO CORRESPONDING FIELDS OF TABLE int_crb_ver
                 FROM zmpets_chargebk
                 JOIN zmpets_shiphdr
                 ON zmpets_chargebkshipdocnum = zmpets_shiphdrshipdocno
                 JOIN zmpets_shipactiv
           ON zmpets_chargebkshipdocnum = zmpets_shipactivpetsdocnumber
                 JOIN pa0002
                 ON zmpets_shiphdrpernr = pa0002pernr
                JOIN lfa1
                    ON lfa1lifnr = zmpets_shiphdrvendor
                    JOIN adr6
                    ON adr6addrnumber = lfa1adrnr
                     JOIN zmpets_167doc
                     ON zmpets_167docpernr = pa0002pernr
                           WHERE zmpets_chargebk~createdon IN s_chdate
                           AND zmpets_shiphdr~pernr IN s_pernr
                           AND zmpets_shiphdr~movreason IN s_mvrsn
                           AND zmpets_chargebk~shipdocnum IN s_sin
                          AND zmpets_shipactiv~activity NE '30'
                           AND zmpets_shipactiv~doctype = '06'
                           AND zmpets_chargebk~loekz NE 'X'
                           AND zmpets_shipactiv~loekz NE 'X'
                           AND zmpets_shiphdr~loekz NE 'X'.
        IF sy-subrc <> 0.
    *Message is 'No Charge Back Documents Available.'.
          MESSAGE s201(zm050).
        ELSE.
          PERFORM f_filter_data.
        ENDIF.
      ENDIF.
    ENDFORM.                    "select_table_chb
    *&      Form  UPDATE_RECORDS
          text
    -->  p1        text
    <--  p2        text
    FORM update_records TABLES p_et_index_rows
                                    STRUCTURE lvc_s_row.
      DATA: ls_selected_line LIKE lvc_s_row,
              lf_row_index TYPE lvc_index.
      LOOP AT p_et_index_rows INTO ls_selected_line.
        lf_row_index = ls_selected_line-index.
      ENDLOOP.
    ENDFORM.                    " UPDATE_RECORDS
    **&      Form  fieldcatalog_init
          text
         -->P_GT_FIELDCATALOG[]  text
    FORM fieldcatalog_init  USING lt_fieldcatalog TYPE lvc_t_fcat.
      DATA: ls_fieldcatalog TYPE lvc_s_fcat.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'SEL'.
      ls_fieldcatalog-tabname  = 'INT_CRB'.
      ls_fieldcatalog-datatype = 'C'.
      ls_fieldcatalog-col_pos  = 1.
      ls_fieldcatalog-edit     = 'X'.
      ls_fieldcatalog-reptext  = 'Select for Processing'.
      ls_fieldcatalog-coltext  = 'Select for Processing'.
      ls_fieldcatalog-seltext  = 'Select for Processing'.
      ls_fieldcatalog-tooltip  = 'Select for Processing'.
      ls_fieldcatalog-checkbox = 'X'.
      ls_fieldcatalog-key = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'ICON'.
      ls_fieldcatalog-tabname   = 'INT_CRB'.
      ls_fieldcatalog-datatype  = 'CHAR'.
      ls_fieldcatalog-col_pos    = 2.
      ls_fieldcatalog-intlen     = '4'.
      ls_fieldcatalog-reptext   =  'Status'.
      ls_fieldcatalog-coltext   =  'Status'.
      ls_fieldcatalog-seltext   =  'Status'.
      ls_fieldcatalog-tooltip   =  'Status'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'PERNR'.
      ls_fieldcatalog-tabname   = 'INT_CRB'.
      ls_fieldcatalog-datatype  = 'NUMC'.
      ls_fieldcatalog-col_pos   = 2.
      ls_fieldcatalog-intlen    = '8'.
      ls_fieldcatalog-reptext   =  'Employee Number'.
      ls_fieldcatalog-coltext   =  'Employee Number'.
      ls_fieldcatalog-seltext   =  'Employee Number'.
      ls_fieldcatalog-tooltip   =  'Employee Number'.
      ls_fieldcatalog-key = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname  = 'VORNA'.
      ls_fieldcatalog-tabname    = 'INT_CRB'.
      ls_fieldcatalog-col_pos    =  3 .
      ls_fieldcatalog-datatype   = 'CHAR'.
      ls_fieldcatalog-outputlen      = '20'.
      ls_fieldcatalog-reptext    = 'Employee Name'.
      ls_fieldcatalog-coltext    = 'Employee Name'.
      ls_fieldcatalog-seltext    = 'Employee Name'.
      ls_fieldcatalog-tooltip    = 'Employee Name'.
    ls_fieldcatalog-key      = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname  = 'MOVREASON'.
      ls_fieldcatalog-tabname    = 'INT_CRB'.
      ls_fieldcatalog-col_pos    =  4.
      ls_fieldcatalog-datatype   = 'NUMC'.
      ls_fieldcatalog-outputlen  = '10'.
      ls_fieldcatalog-reptext    = 'Move Reason'.
      ls_fieldcatalog-coltext    = 'Move Reason'.
      ls_fieldcatalog-seltext    = 'Move Reason'.
      ls_fieldcatalog-tooltip    = 'Move Reason'.
    ls_fieldcatalog-key      = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'SHIPDOCNUM'.
      ls_fieldcatalog-tabname   = 'INT_CRB'.
      ls_fieldcatalog-datatype  = 'NUMC'.
      ls_fieldcatalog-outputlen = '10'.
      ls_fieldcatalog-col_pos   =  5.
      ls_fieldcatalog-reptext   = 'Shipping Document Number'.
      ls_fieldcatalog-coltext   = 'Shipping Document Number'.
      ls_fieldcatalog-seltext   = 'Shipping Document Number'.
      ls_fieldcatalog-tooltip   = 'Shipping Document Number'.
    ls_fieldcatalog-key = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'CREATEDON'.
      ls_fieldcatalog-tabname   = 'INT_CRB'.
      ls_fieldcatalog-col_pos   = 6.
      ls_fieldcatalog-datatype  = 'DATS'.
      ls_fieldcatalog-outputlen = '8'.
      ls_fieldcatalog-reptext   = 'Created On'.
      ls_fieldcatalog-coltext   = 'Created On'.
      ls_fieldcatalog-seltext   = 'Created On'.
      ls_fieldcatalog-tooltip   = 'Created On'.
    ls_fieldcatalog-DO_sum      = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
      ls_fieldcatalog-fieldname = 'CHARGEAMOUNT'.
      ls_fieldcatalog-tabname   = 'INT_CRB'.
      ls_fieldcatalog-col_pos   = 7.
      ls_fieldcatalog-datatype  = 'CURR'.
      ls_fieldcatalog-outputlen = '13'.
      ls_fieldcatalog-reptext   = 'Charge Back Amount'.
      ls_fieldcatalog-coltext   = 'Charge Back Amount'.
      ls_fieldcatalog-seltext   = 'Charge Back Amount'.
      ls_fieldcatalog-tooltip   = 'Charge Back Amount'.
    ls_fieldcatalog-DO_sum      = 'X'.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
      CLEAR ls_fieldcatalog.
    ENDFORM.                    "fieldcatalog_init
    *&      Form  f_modify_activity
    Modify the activity to 79 in zmpets_shipaciv table.
    -->  p1        text
    <--  p2        text
    FORM f_modify_activity .
      REFRESH int_crb_mail.
      int_crb_mail[] = int_crb[].
    *All the document number which is to be processed is stored in
    *the internel table 'INT_SIN'.
      LOOP AT int_crb INTO int_crb.
        IF int_crb-sel ='X'.
          MOVE int_crb-shipdocnum TO int_sin.
          APPEND int_sin.
          CLEAR int_sin.
    *Removing the processed documents.
          DELETE int_crb.
        ENDIF.
        CLEAR int_crb.
      ENDLOOP.
    *Get the details from shipactiv table.
      IF int_sin[] IS NOT INITIAL.
        SELECT * FROM zmpets_shipactiv
            INTO TABLE int_shipactiv
              FOR ALL ENTRIES IN int_sin
                    WHERE petsdocnumber = int_sin-shipdocnum.
    *Modify the activity code, version, actual date and last changed date.
        SORT int_shipactiv BY petsdocnumber version DESCENDING.
        CLEAR wf_tabix.
        LOOP AT int_shipactiv.
          wf_tabix = sy-tabix.
          AT NEW petsdocnumber.
            READ TABLE int_shipactiv INDEX wf_tabix.
            int_shipactiv-activity = '030'.
            int_shipactiv-version = int_shipactiv-version + 1.
            int_shipactiv-actdate = sy-datum.
            int_shipactiv-lastchangedby = sy-uname.
            int_shipactiv-lastchangedt = sy-datum.
    *Modify the data base table
            MODIFY zmpets_shipactiv FROM int_shipactiv.
          ENDAT.
          CLEAR int_shipactiv.
          AT LAST.
    *Message is 'Data Processed Successfully.'.
            MESSAGE s203(zm050).
          ENDAT.
        ENDLOOP.
    *-send mail to the vendor and employee that the shipment is cleared for
        LOOP AT int_crb_mail WHERE sel = 'X'.
          PERFORM f_send_mail.
        ENDLOOP.
        REFRESH int_crb_mail.
       CALL SELECTION-SCREEN 1000.
      ELSE.
    *Message is 'No Data Selected for Processing.'.
        MESSAGE s200(zm050).
      ENDIF.
    ENDFORM.                    " f_modify_activity
    *&      Form  f_clear_fields
          text
    -->  p1        text
    <--  p2        text
    FORM f_clear_fields .
      CLEAR int_crb.
      CLEAR int_crb_ver.
      CLEAR int_sin.
      REFRESH int_crb.
      REFRESH int_crb_ver.
      REFRESH int_sin.
      CLEAR int_shipactiv.
      REFRESH int_shipactiv.
      CLEAR wf_flag.
      CLEAR wf_tabix.
    ENDFORM.                    " f_clear_fields
    *&      Form  f_filter_data
          text
    -->  p1        text
    <--  p2        text
    FORM f_filter_data .
    *Take the latest Version Data.
    *take all the activities, including the activity '30'.
    then put the details in internal table 'INT_CRB'.
      SORT int_crb_ver BY shipdocnum version DESCENDING.
      CLEAR wf_tabix.
      CLEAR int_crb.
      REFRESH int_crb.
      LOOP AT int_crb_ver.
        wf_tabix = sy-tabix.
        AT NEW shipdocnum.
          READ TABLE int_crb_ver INDEX wf_tabix.
          MOVE-CORRESPONDING int_crb_ver TO int_crb.
          APPEND int_crb.
          CLEAR int_crb.
        ENDAT.
      ENDLOOP.
      IF int_crb[] IS INITIAL.
    *Message is 'No Records Available.'.
        MESSAGE s202(zm050).
      ELSE.
        CLEAR wf_tabix.
        LOOP AT int_crb.
          wf_tabix = sy-tabix.
          REFRESH lt_celltab.
          ls_celltab-fieldname = 'SEL'.
          IF int_crb-activity = '030'.
            ls_celltab-style = cl_gui_alv_grid=>mc_style_disabled.
    *status becomes green. ie processed
            int_crb-icon = '@08@'. "Green
          ELSE.
            ls_celltab-style = cl_gui_alv_grid=>mc_style_enabled.
    *status set to red. ie not yet processed
            int_crb-icon = '@0A@'. "Red
          ENDIF.
          INSERT ls_celltab INTO TABLE lt_celltab.
          INSERT LINES OF lt_celltab INTO TABLE int_crb-celltab.
          MODIFY int_crb INDEX wf_tabix.
        ENDLOOP.
      ENDIF.
    ENDFORM.                    " f_filter_data
    *&      Form  f_filter_data
          text
    -->  p1        text
    <--  p2        text
    FORM f_filter_data_pending.
    *Take the latest Version Data.
    *take all the activities, including the activity '30'.
    *then filter it with out the activities '30' and having the lastest
    *version. then put the details in internal table 'INT_CRB'.
      SORT int_crb_ver BY shipdocnum version DESCENDING.
      CLEAR wf_tabix.
      CLEAR int_crb.
      REFRESH int_crb.
      LOOP AT int_crb_ver.
        wf_tabix = sy-tabix.
        AT NEW shipdocnum.
          READ TABLE int_crb_ver INDEX wf_tabix.
          IF int_crb_ver-activity NE '030'.
            MOVE-CORRESPONDING int_crb_ver TO int_crb.
            APPEND int_crb.
            CLEAR int_crb.
          ENDIF.
        ENDAT.
      ENDLOOP.
      IF int_crb[] IS INITIAL.
    *Message is 'No Records Available.'.
        MESSAGE s202(zm050).
      ENDIF.
    ENDFORM.                    " f_filter_data_pending
    *&      Form  EXCLUDE_TB_FUNCTIONS
          text
         <--P_LT_EXCLUDE  text
    FORM exclude_tb_functions CHANGING pt_exclude TYPE ui_functions.
      DATA ls_exclude TYPE ui_func.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_move_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_cut.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_paste_new_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_undo.
      APPEND ls_exclude TO pt_exclude.
    ENDFORM.                               " EXCLUDE_TB_FUNCTIONS
    *&      Form  f_send_mail
          text
    -->  p1        text
    <--  p2        text
    FORM f_send_mail .
    *store the vendor name, vendor email id , employee name and employee
    *email id in the internal table int_crb
    Creation of the document to be sent
      CLEAR doc_chng.
      REFRESH objpack.
      REFRESH objhead.
      REFRESH  reclist.
      REFRESH objtxt.
    File Name
      doc_chng-obj_name = 'SHIPMENT'.
    Mail Subject
      CONCATENATE 'Shipment Document No.' int_crb_mail-shipdocnum
      'Cleared.'
      INTO doc_chng-obj_descr SEPARATED BY ' '.
    Mail Contents
      objtxt-line = 'Hi,'.
      APPEND objtxt.
      objtxt-line = ' '.
      APPEND objtxt.
      CONCATENATE 'Shipment Document Number ' int_crb_mail-shipdocnum
    ' cleared for move.' INTO objtxt-line SEPARATED BY ' '.
      APPEND objtxt.
      objtxt-line = ' '.
      APPEND objtxt.
      CLEAR  objtxt.
      objtxt-line = 'Regards '.
      APPEND objtxt.
      objtxt-line = ' '.
      APPEND objtxt.
      objtxt-line = 'SAP '.
      APPEND objtxt.
      CLEAR  objtxt.
      APPEND objtxt.
      DESCRIBE TABLE objtxt LINES tab_lines.
      READ TABLE objtxt INDEX tab_lines.
      doc_chng-doc_size = ( tab_lines - 1 ) * 255 + STRLEN(
    objtxt ).
    Creation of the entry for the compressed document
      CLEAR objpack-transf_bin.
      objpack-head_start = 1.
      objpack-head_num = 0.
      objpack-body_start = 1.
      objpack-body_num = tab_lines.
      objpack-doc_type = 'RAW'.
      APPEND objpack.
    Completing the recipient list
    target recipent
      CLEAR reclist.
      reclist-receiver = int_crb_mail-empperid. "employee email ID
      "wf_empperid.
      reclist-express  = 'X'.
      reclist-rec_type = 'U'.
      APPEND reclist.
    copy recipents
    CLEAR reclist.
    reclist-receiver = 'anversha.shahul@'."int_crb_mail-smtp_addr
    reclist-express  = 'X'.
    reclist-rec_type = 'U'.
    reclist-copy     = 'X'.
    APPEND reclist.
    Sending the document
      CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
        EXPORTING
          document_data              = doc_chng
        TABLES
          packing_list               = objpack
          object_header              = objhead
       contents_bin               = objbin
          contents_txt               = objtxt
          receivers                  = reclist
        EXCEPTIONS
          too_many_receivers         = 1
          document_not_sent          = 2
          operation_no_authorization = 4
          OTHERS                     = 99.
      COMMIT WORK.
      SUBMIT rsconn01
                    WITH mode = 'INT'
                    WITH output = ' '
                      AND RETURN.
    ENDFORM.                    " f_send_mail
    rgds
    anver
    pls mark hlpful answers

  • PUSH BUTTON IN FIELD CATALOG - NEED HELP

    Hi all,
    I have a requirement wherein i need to have a push button in the first column of ALV GRID DISPLAY output to be able to select multiple rows. Now am using SELKZ field in field catalog, though it creats a first column, the push button is not available. Is there any field in FIELD CATALOG other than this field which will satisfy my requirement or any other possible way to achieve this functionality.
      PERFORM alv_fieldcat USING :
          't_output' 'SELKZ' ' ' ' ',
    In form, i've written the following piece of code.
      l_fieldcat-tabname      = tabname.
      l_fieldcat-fieldname    = fieldname.
      l_fieldcat-reptext_ddic = coltext.
      l_fieldcat-hotspot      = hotspot.
    Any input in this regard will be valuable to me and highly appreciated.
    Thanks in advance,
    Vaishnavi Varadarajan

    hi here is an example ..
    Button in alv grid cell using REUSE_ALV_GRID_DISPLAY
    regards,
    venkat.

  • Data not getting displayed in ALV grid when run in background

    Hello experts!
    Could anyone help me out please?
    I need to display an ALV grid in the background. My requirements are as follows:
    I first display an ALV grid in the foreground based on some input parameters. The user selects a few records for updating it and clicks on the "update" button. On the click of this button another report must be called and here the ALV report is displayed in the background.I am using "reuse_alv_grid_display" to display the grid.
    I am using Import/Export to get the selected rows in my called report. When i execute this report in the foreground i get the ALV grid along with the data. But when i execute it in the background, i get only the grid with the fieldnames and not the data when i check in SP01.
    Thanks in advance!
    Smitha

    Hi Smitha,
    If you are able to see in SP01 and only see the output layout or "List contains no data" shows clealry that the data is not getting passed in the called program or the data is not being used correctly in the called program.
    Cheers
    VJ

  • Not display in field catalog

    hallow i have field catalog and i wont to not display some colman how can i do that ? thankes

    hi antonio,
    if you have a fieldcatalog built up, just delete the row in the fieldcatalog which has the column, and preferably re-adjust the col_pos field value for the other fields
    another option is in the fieldcatalog u might find a field called NO_OUT, just pass 'X' value to it in the column. This would be an easier option to implement.
    Hope it helps.
    Rgds
    adi

  • ALV GRID AND LIST DISPLAY

    Hi experts, how are you.
    What is the difference between ALV Grid Display and ALV List Display?

    ALV LIST Can be coded using only FMs
    ALV GRID Can be coded using FMs and object oriented concepts
    ALV LIST Can be displayed hieraicharlly
    ALV GRID cannot be displayed hierarichally
    ALV grid uses ActiveX controls
    present on the Presentation Server.
    Hence, it consumes More Memory
    on the presentation server.
    ALV LIST is Display Only.
    Whereas
    ALV Grid Can Be made EDITABLE for entry purpose.
    In alv grid, these options are possible,
    but not in alv list.
    without horizontal lines
    without vertical lines
    without cell merging during sorts
    display total lines above the entries
    Thanks
    Seshu

  • Regarding Grid n List display?

    hi..can any one tell me the difference between REUSE_ALV_LIST_DISPALY and REUSE_ALV_GRID_DISPALY?

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

  • Error in field catalog in ALV grid display using classes at do_sum = "X'.

    Hi,
    I'm using classes in ALV Grid display.
    the code for the field catalog is going to dump because of the statement in the field catalog for field 'netwr',do_sum = 'X'.
    that do_sum = 'X' is not working and going to dump when executed.with out that do_sum it is working fine. the error in dump analysys is showing sap standard incude LSLVCF01.
        assign component
               <ls_fieldcat>-fieldname of structure rt_data to <g_field>.
        if sy-subrc ne 0.
          message x000(0k).
        endif.
    sy-subrc is 4 when the program is being executed.
    CODE:
    FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat.
      DATA ls_fcat TYPE lvc_s_fcat.
      ls_fcat-fieldname = 'VBELN1'.
      ls_fcat-ref_field = 'VBELN'.
      ls_fcat-ref_table = 'VBRK'.
      ls_fcat-coltext = 'Invoice No'.
      ls_fcat-seltext = 'Invoice No'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
      ls_fcat-fieldname = 'BUDAT'.
      ls_fcat-ref_table = 'BKPF'.
      ls_fcat-coltext = 'Invoice Date'.
      ls_fcat-seltext = 'Invoice Date'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
    ls_fcat-fieldname = 'NETWR'.
      ls_fcat-ref_field = 'NETWR'.
      ls_fcat-ref_table = 'VBRK'.
      ls_fcat-coltext = 'Value of Invoice'.
      ls_fcat-seltext = 'Value of Invoice'.
      ls_fcat-datatype = 'CURR'.
      ls_fcat-do_sum = 'X'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR ls_fcat.
    ENDFORM.
    can u please look in the code and rectify the error,
    would appeciate ur response.
    regards,
    veera.

    Hi,
    try this..
    ls_fcat-fieldname = 'NETWR'.
    ls_fcat-ref_field = 'NETWR'.
    ls_fcat-ref_table = 'VBRK'.
    ls_fcat-coltext = 'Value of Invoice'.
    ls_fcat-seltext = 'Value of Invoice'.
    ls_fcat-datatype = 'CURR'.
    ls_fcat-do_sum = 'X'.
    <b>ls_fcat-cfieldname = 'WAERS'.</b>
    APPEND ls_fcat TO pt_fieldcat.
    CLEAR ls_fcat.
    Regards
    vijay

  • ALV Grid: Alternate Field Catalog per Line Type possible?

    I'm using the ALV Grid Classes: Is it possible to change the Field Catalog per line type? I have two different line types: 1) Interspersed headers and 2) data lines. The Interspersed headers should have no_zero = 'x' and the data lines no_zero = space.

    It can be done by REUSE_ALV_HIERSEQ_LIST_DISPLAY in classic ALV .
    Alternately, it can be done by ALV object model. Try SALV* and look into sample programs.

Maybe you are looking for

  • Disable calls with video silently in jabber 9.2.6

    Hello, My company just bought Jabber 9.2.6 and as an application packager I was selected to create a package that installs Jabber completely silently. I have no problems with the installation but they gave me instructions to select the "Never start c

  • Safari is way too slow

    Why doesn't my Safari open up in timely fashion, any time day or night? I get twirling circle most often and wait at least 30 to 60 seconds for lift off. Have checked internet connection which is fine. This jams up access to internet and entire worki

  • Tv @nywhere A/D supported in Win XP MCE 2005?

    According to MSI website it is and drivers/software is available but it just won't work. As soon as i install the drivers it causes the MCE Receiver service to crash. So does it really work with MCE or not? Quick response would be nice so i can retur

  • In CRM_DNO_MONITOR, "My Team" checkbox is not working

    Hi, A person has been assigned to a Support Team as a Team Member in Org Structure using PPOMA_CRM. Business Partner and Employee Role for that Business Partner has been assigned to the user. In CRM_DNO_MONITOR when he cliks on the Checkbox "My Team"

  • Which is more efficient for includes/imports?

    Which is more efficient? 1) <jsp:include 2) <%@ include file 3) <c:import 4) Custom tag version (tomcat 5) <me:header/> header.tag navigation html stuff Thanks, Karmen