PAI is NOT trigger for ALV in subscreen

Hi, All
Currently, I am using ALV object to output ALV report in one SUBSCREEN.
When I double-click, the PAI is not trigger. But just go into double-click event directly.
However, If I use AVL function or object to output in NORMAL screen, PAI is trigger after double click.
SY-UCOMM is like %_GC 920 3

Hello Ocean
The ALV grid is a special control in terms that all the events are already pre-registered at the control (method SET_REGISTERED_EVENTS). This means that as soon as you define an event handler method and SET HANDLER for the corresponding event your application can deal with this event.
You can register all events of the ALV grid as application events (i.e. after any event handling PAI of the screen is triggered) at the CONSTRUCTOR method:
I_APPL_EVENTS = 'X'
However, I prefer to use method CL_GUI_CFW=>SET_NEW_OK_CODE because it offers more flexibility to me:
Only those event where I need to trigger PAI after event handling are affected
By setting a new ok-code I can trigger a specific logic at PAI
Regards 
  Uwe

Similar Messages

  • Why this code is not working for alv

    Dear
    Regards,
    i have implemented the same program for ALV which i have used earlier in the reports. but now it is showing no output:
    *& Report  ZTCT1_ALV2                                                  *
    REPORT  ztct1_alv2                              .
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    * INCLUDING TABLES.
    TABLES: vbrk,
            vbrp,
            kna1,
            t001w,
            makt.
    * DECLARATION OF INTERNAL TABLES.
    DATA: BEGIN OF itab OCCURS 0,  "Including the fields of VBRK and VBRP
            kunag LIKE vbrk-kunag, "Customer Code
            name1 LIKE kna1-name1, "Customer Name
            vbeln LIKE vbrk-vbeln, "Invoice #
            fkdat LIKE vbrk-fkdat, "Invoice Date
            werks LIKE vbrp-werks, "Plant
            name2 LIKE t001w-name1,"Plant Description
            matnr LIKE vbrp-matnr, "Material #
            maktx LIKE makt-maktx, "Material Description
            meins LIKE vbrp-meins, "Unit of Measure
            fklmg LIKE vbrp-fklmg, "Quantity
            netwr LIKE vbrp-netwr, "Amount
          END OF itab,
          BEGIN OF itnm OCCURS 0,  "Including the fields of VBRK and KNA1
            kunag LIKE vbrk-kunag, "Customer Code
            name1 LIKE kna1-name1, "Customer Name
          END OF itnm,
          BEGIN OF itpt OCCURS 0,  "Including the fields of VBRP and T001W
            werks LIKE vbrp-werks, "Plant
            name1 LIKE t001w-name1,"Plant Description
          END OF itpt,
          BEGIN OF itmt OCCURS 0,  "Including the fields of VBRP and MAKT
            matnr LIKE vbrp-matnr, "Material #
            maktx LIKE makt-maktx, "Material description
          END OF itmt,
          BEGIN OF itsm OCCURS 0,
            kunag LIKE kna1-kunnr,
            name1 LIKE kna1-name1,
            fklmg LIKE vbrp-fklmg,
            netwr LIKE vbrp-netwr,
          END OF itsm,
          ok_code            LIKE sy-ucomm,
          save_ok            LIKE sy-ucomm,
          g_max              TYPE i VALUE 100,
          g_repid            LIKE sy-repid,
          gs_layout          TYPE lvc_s_layo,
          g_container        TYPE scrfname VALUE 'CUST_CONT',
          grid1              TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container,
          grid2              TYPE REF TO cl_gui_alv_grid,
          gt_sort            TYPE lvc_t_sort,
          gt_fieldcatalog    TYPE lvc_t_fcat,
          w_tot_qty          LIKE vbrp-fklmg,
          w_tot_amt          LIKE vbrp-netwr,
    * Reference to Dialogbox Container.
          dialogbox_container TYPE REF TO cl_gui_dialogbox_container,
    * Reference to local class that handles events of GRID1 and
    * DIALOGBOX_CONTAINER
          event_receiver TYPE REF TO lcl_event_receiver.
    * SELECT-OPTIONS
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN BEGIN OF BLOCK input WITH FRAME TITLE text-000.
    SELECT-OPTIONS: s_werks FOR vbrp-werks, "Plant
                    s_kunag FOR vbrk-kunag, "Customer
                    s_matnr FOR vbrp-matnr, "Material Number
                    s_fkdat FOR vbrk-fkdat. "Invoice Date
    SELECTION-SCREEN END OF BLOCK input .
    SELECTION-SCREEN SKIP 1.
    * START-OF-SELECTION
    START-OF-SELECTION.
      SET SCREEN 100.
    * CLEARING INTERNAL TABLES.
      CLEAR: itab,
             itnm,
             itmt,
             itpt.
    * QUERY FOR JOINING TABLES VBRK AND VBRP
      SELECT vbrk~kunag
             vbrk~vbeln
             vbrk~fkdat
             vbrp~werks
             vbrp~matnr
             vbrp~meins
             vbrp~fklmg
             vbrp~netwr
             INTO CORRESPONDING FIELDS OF TABLE itab
             FROM vbrk
             INNER JOIN vbrp
                 ON vbrk~vbeln = vbrp~vbeln
             WHERE vbrk~kunag IN s_kunag
               AND vbrk~fkdat IN s_fkdat
               AND vbrp~matnr IN s_matnr
               AND vbrp~werks IN s_werks.
    * QUERY FOR JOINING TABLES VBRK AND KNA1
      SELECT kna1~kunnr AS kunag
             kna1~name1
             INTO TABLE itnm
             FROM kna1
             WHERE kna1~kunnr IN s_kunag.
    * QUERY FOR JOINING TABLES VBRP AND T001W
      SELECT t001w~werks
             t001w~name1
             INTO TABLE itpt
             FROM t001w
             WHERE t001w~werks IN s_werks.
    * QUERY FOR JOINING TABLES VBRP AND MAKT
      SELECT makt~matnr
             makt~maktx
             INTO TABLE itmt
             FROM makt
             WHERE makt~matnr IN s_matnr.
    * SORTING INTERNAL TABLES.
      SORT itab BY kunag.
    *    LOOP AT itab.
    *      CLEAR: itmt, itnm, itpt.
    *      READ TABLE itnm WITH KEY kunag = itab-kunag.
    *      READ TABLE itmt WITH KEY matnr = itab-matnr.
    *      READ TABLE itpt WITH KEY werks = itab-werks.
    *      itab-name1 = itnm-name1.
    *      itab-maktx = itmt-maktx.
    *      itab-name2 = itpt-name1.
    *      MODIFY itab.
    *    ENDLOOP.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'KUNAG' 'C' 'Customer Code'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'NAME1' 'C' 'Customer Name'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'VBELN' 'C' 'Invoice #'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'FKDAT' 'DATS' 'Invoice Date'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'WERKS' 'C' 'Plant'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'NAME2' 'C' 'Plant Description'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'MATNR' 'C' 'Material #'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'MAKTX' 'C' 'Material Description'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'MEINS' 'C' 'UoM'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'FKLMG' 'QUAN' 'Quantity'.
    *    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'NETWR' 'CURR' 'Amount'.
        LOOP AT itab.
          CLEAR itsm.
          READ TABLE itnm WITH KEY kunag = itab-kunag.
          itsm-kunag = itab-kunag.
          itsm-name1 = itnm-name1.
          itsm-fklmg = itab-fklmg.
          itsm-netwr = itab-netwr.
          COLLECT itsm.
        ENDLOOP.
        PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'KUNAG' 'C' 'Customer Code'.
        PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'NAME1' 'C' 'Customer Name'.
        PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'FKLMG' 'QUAN' 'Quantity'.
        PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'NETWR' 'CURR' 'Amount'.
      PERFORM sort_build USING gt_sort[].
      PERFORM layout_init USING gs_layout.
    *   LOCAL CLASSES: Definition
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
        handle_double_click
            FOR EVENT double_click OF cl_gui_alv_grid
                IMPORTING e_row e_column,
        handle_close
            FOR EVENT close OF cl_gui_dialogbox_container
                IMPORTING sender.
      PRIVATE SECTION.
        DATA: dialogbox_status TYPE c.  "'X': does exist, SPACE: does not ex.
    ENDCLASS.                    "lcl_event_receiver DEFINITION
    *   LOCAL CLASSES: Implementation
    CLASS lcl_event_receiver IMPLEMENTATION.
    *   §3.At doubleclick(1): The event DOUBLE_CLICK provides
    *      parameters of the clicked row and column.
    *      Use row parameter to select a line of the
    *      corresponding internal table.
      METHOD handle_double_click.
        DATA: ls_sm LIKE LINE OF itsm,
              wa_itab LIKE ITAB.
    *   read selected row from internal table gt_sflight
        READ TABLE itsm INDEX e_row-index INTO ls_sm.
    *   §4.At Doubleclick(2): Select booking data
    *    READ TABLE ITAB WITH KEY KUNAG = LS_SM-KUNAG.    .
        READ TABLE ITAB INTO WA_ITAB WITH KEY KUNAG = LS_SM-KUNAG.
    *   §5.At doubleclick(3): Create dialogbox to show detail list
    *     (if not already existent)
        IF dialogbox_status IS INITIAL.
          dialogbox_status = 'X'.
          PERFORM create_detail_list.
        ELSE.
          CALL METHOD dialogbox_container->set_visible
            EXPORTING
              visible = 'X'.
          CALL METHOD grid2->refresh_table_display.
        ENDIF.
      ENDMETHOD.                    "handle_double_click
      METHOD handle_close.
    *   §6.Handle the CLOSE-button of the dialogbox
    *   set dialogbox invisible
    *   (the dialogbox is destroyed outomatically when the user
    *   switches to another dynpro).
        CALL METHOD sender->set_visible
          EXPORTING
            visible = space.
    *   In this example closing the dialogbox leads
    *   to make it invisible. It is also conceivable to destroy it
    *   and recreate it if the user doubleclicks a line again.
    *   Displaying a great amount of data has a greater impact on performance.
      ENDMETHOD.                    "handle_close
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
    *   lcl_event_receiver (Implementation)
    *=====================================================================
    *       FORM EXIT_PROGRAM                                             *
    FORM exit_program.
      CALL METHOD g_custom_container->free.
      CALL METHOD cl_gui_cfw=>flush.
      IF sy-subrc NE 0.
    * add your handling, for example
        CALL FUNCTION 'POPUP_TO_INFORM'
          EXPORTING
            titel = g_repid
            txt2  = sy-subrc
            txt1  = 'Error in FLush'(500).
      ENDIF.
      LEAVE TO SCREEN 0.
    ENDFORM.                    "exit_program
    *  MODULE PBO_ALV OUTPUT
    MODULE pbo_alv OUTPUT.
      SET PF-STATUS 'MAIN'.
      SET TITLEBAR 'MAIN100'.
      g_repid = sy-repid.
      IF g_custom_container IS INITIAL.
        READ TABLE itsm.
        CREATE OBJECT g_custom_container
          EXPORTING
            container_name = g_container
          EXCEPTIONS
            cntl_error = 1
            cntl_system_error = 2
            create_error = 3
            lifetime_error = 4
            lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc NE 0.
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              titel = g_repid
              txt2  = sy-subrc
              txt1  = 'The control could not be created'(510).
        ENDIF.
        CREATE OBJECT grid1
          EXPORTING
            i_parent = g_custom_container.
        gs_layout-grid_title = 'Invoice Summary'.
        CALL METHOD grid1->set_table_for_first_display
          EXPORTING
            is_layout       = gs_layout
          CHANGING
            it_outtab       = itsm[]
            it_fieldcatalog = gt_fieldcatalog
            it_sort         = gt_sort.
        CREATE OBJECT event_receiver.
        SET HANDLER event_receiver->handle_double_click FOR grid1.
      ENDIF.
      CALL METHOD cl_gui_control=>set_focus
        EXPORTING
          control = grid1.
    ENDMODULE.                    "PBO_ALV OUTPUT
    *  MODULE PAI_ALV INPUT
    MODULE pai_alv INPUT.
      CALL METHOD cl_gui_cfw=>dispatch.
      CASE sy-ucomm.
        WHEN 'BACK' OR 'EXIT' OR 'CANCEL'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                    "PAI_ALV INPUT
    *&      Form  fieldcatalog_init
    *       text
    *      -->LT_FIELDCATtext
    *      -->VALUE(FIELDtextE)
    *      -->VALUE(FIELDtextE)
    *      -->VALUE(FIELDtextT)
    FORM fieldcatalog_init USING lt_fieldcatalog TYPE lvc_t_fcat
                           value(field_name) value(field_type) value(field_text).
      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.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
    ENDFORM.                    "fieldcatalog_init
    *&      Form  sort_build
    *       text
    *      -->LT_SORT    text
    FORM sort_build USING lt_sort TYPE lvc_t_sort.
      DATA: ls_sort TYPE lvc_s_sort.
      ls_sort-fieldname = 'KUNAG'.    "Fieldname on which to sort
      ls_sort-up        = 'X'.        "Sort Ascending
      APPEND ls_sort TO lt_sort.
      ls_sort-fieldname = 'NAME1'.    "Fieldname on which to sort
      ls_sort-up        = 'X'.        "Sort Ascending
      APPEND ls_sort TO lt_sort.
    ENDFORM.                    "sort_build
    *&      Form  layout_init
    *       text
    *      -->LS_LAYOUT  text
    FORM layout_init USING ls_layout TYPE lvc_s_layo.
      ls_layout-zebra      = 'X'.
      ls_layout-grid_title = 'Customer Details'.
      ls_layout-sel_mode   = 'A'.
      ls_layout-cwidth_opt = 'X'.
    ENDFORM.                    "layout_init
    *&      Form  create_detail_list
    *         text
    *    -->  p1        text
    *    <--  p2        text
    FORM create_detail_list.
    *   create dialogbox container as dynpro-instance
    *   When the user switches to another screen, it is
    *   destroyed by lifetime mangagement of CFW
      CREATE OBJECT dialogbox_container
          EXPORTING
            top = 150
            left = 150
            lifetime = cntl_lifetime_dynpro
            caption = 'INVOICE DETAILS'(200)
            width = 800
            height = 200.
      CREATE OBJECT grid2
          EXPORTING i_parent = dialogbox_container.
    *   Register ABAP OO event 'CLOSE'. It is not necessary to register this
    *   event at the frontend (this is done during creation).
      SET HANDLER event_receiver->handle_close FOR dialogbox_container.
    *   display data
      gs_layout-grid_title = 'Invoice Details'(100).
      CALL METHOD grid2->set_table_for_first_display
        EXPORTING
          i_structure_name = 'itab'
          is_layout        = gs_layout
        CHANGING
          it_outtab        = itab[]
          it_fieldcatalog  = gt_fieldcatalog
          it_sort          = gt_sort.
      CALL METHOD cl_gui_control=>set_focus
        EXPORTING
          control = grid2.
    ENDFORM.                    " create_detail_list[code][/
    code]

    Hi,
    I also copied and pasted the same code check once again by copying this code and create screens by double clicking on 100.
    CLASS lcl_event_receiver DEFINITION DEFERRED.
    * INCLUDING TABLES.
    TABLES: vbrk,
            vbrp,
            kna1,
            t001w,
            makt.
    * DECLARATION OF INTERNAL TABLES.
    DATA: BEGIN OF itab OCCURS 0,  "Including the fields of VBRK and VBRP
            kunag LIKE vbrk-kunag, "Customer Code
            name1 LIKE kna1-name1, "Customer Name
            vbeln LIKE vbrk-vbeln, "Invoice #
            fkdat LIKE vbrk-fkdat, "Invoice Date
            werks LIKE vbrp-werks, "Plant
            name2 LIKE t001w-name1,"Plant Description
            matnr LIKE vbrp-matnr, "Material #
            maktx LIKE makt-maktx, "Material Description
            meins LIKE vbrp-meins, "Unit of Measure
            fklmg LIKE vbrp-fklmg, "Quantity
            netwr LIKE vbrp-netwr, "Amount
          END OF itab,
          BEGIN OF itnm OCCURS 0,  "Including the fields of VBRK and KNA1
            kunag LIKE vbrk-kunag, "Customer Code
            name1 LIKE kna1-name1, "Customer Name
          END OF itnm,
          BEGIN OF itpt OCCURS 0,  "Including the fields of VBRP and T001W
            werks LIKE vbrp-werks, "Plant
            name1 LIKE t001w-name1,"Plant Description
          END OF itpt,
          BEGIN OF itmt OCCURS 0,  "Including the fields of VBRP and MAKT
            matnr LIKE vbrp-matnr, "Material #
            maktx LIKE makt-maktx, "Material description
          END OF itmt,
          BEGIN OF itsm OCCURS 0,
            kunag LIKE kna1-kunnr,
            name1 LIKE kna1-name1,
            fklmg LIKE vbrp-fklmg,
            netwr LIKE vbrp-netwr,
          END OF itsm,
          ok_code            LIKE sy-ucomm,
          save_ok            LIKE sy-ucomm,
          g_max              TYPE i VALUE 100,
          g_repid            LIKE sy-repid,
          gs_layout          TYPE lvc_s_layo,
          g_container        TYPE scrfname VALUE 'CUST_CONT',
          grid1              TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container,
          grid2              TYPE REF TO cl_gui_alv_grid,
          gt_sort            TYPE lvc_t_sort,
          gt_fieldcatalog    TYPE lvc_t_fcat,
          w_tot_qty          LIKE vbrp-fklmg,
          w_tot_amt          LIKE vbrp-netwr,
    * Reference to Dialogbox Container.
          dialogbox_container TYPE REF TO cl_gui_dialogbox_container,
    * Reference to local class that handles events of GRID1 and
    * DIALOGBOX_CONTAINER
          event_receiver TYPE REF TO lcl_event_receiver.
    * SELECT-OPTIONS
    SELECTION-SCREEN SKIP 1.
    SELECTION-SCREEN BEGIN OF BLOCK input WITH FRAME TITLE text-000.
    SELECT-OPTIONS: s_werks FOR vbrp-werks, "Plant
                    s_kunag FOR vbrk-kunag, "Customer
                    s_matnr FOR vbrp-matnr, "Material Number
                    s_fkdat FOR vbrk-fkdat. "Invoice Date
    SELECTION-SCREEN END OF BLOCK input .
    SELECTION-SCREEN SKIP 1.
    * START-OF-SELECTION
    START-OF-SELECTION.
    SET SCREEN 100.
    * CLEARING INTERNAL TABLES.
      CLEAR: itab,
             itnm,
             itmt,
             itpt.
    * QUERY FOR JOINING TABLES VBRK AND VBRP
      SELECT vbrk~kunag
             vbrk~vbeln
             vbrk~fkdat
             vbrp~werks
             vbrp~matnr
             vbrp~meins
             vbrp~fklmg
             vbrp~netwr
             INTO CORRESPONDING FIELDS OF TABLE itab
             FROM vbrk
             INNER JOIN vbrp
                 ON vbrk~vbeln = vbrp~vbeln
             WHERE vbrk~kunag IN s_kunag
               AND vbrk~fkdat IN s_fkdat
               AND vbrp~matnr IN s_matnr
               AND vbrp~werks IN s_werks.
    * QUERY FOR JOINING TABLES VBRK AND KNA1
      SELECT kna1~kunnr AS kunag
             kna1~name1
             INTO TABLE itnm
             FROM kna1
             WHERE kna1~kunnr IN s_kunag.
    * QUERY FOR JOINING TABLES VBRP AND T001W
      SELECT t001w~werks
             t001w~name1
             INTO TABLE itpt
             FROM t001w
             WHERE t001w~werks IN s_werks.
    * QUERY FOR JOINING TABLES VBRP AND MAKT
      SELECT makt~matnr
             makt~maktx
             INTO TABLE itmt
             FROM makt
             WHERE makt~matnr IN s_matnr.
    * SORTING INTERNAL TABLES.
      SORT itab BY kunag.
        LOOP AT itab.
          CLEAR itsm.
          READ TABLE itnm WITH KEY kunag = itab-kunag.
          itsm-kunag = itab-kunag.
          itsm-name1 = itnm-name1.
          itsm-fklmg = itab-fklmg.
          itsm-netwr = itab-netwr.
          COLLECT itsm.
        ENDLOOP.
    * END-OF-SELECTION.
    * If not itsm[] is initial.
    *    CALL SCREEN 100.
    * endif.
    *   LOCAL CLASSES: Definition
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
        METHODS:
        handle_double_click
            FOR EVENT double_click OF cl_gui_alv_grid
                IMPORTING e_row e_column,
        handle_close
            FOR EVENT close OF cl_gui_dialogbox_container
                IMPORTING sender.
      PRIVATE SECTION.
        DATA: dialogbox_status TYPE c.  "'X': does exist, SPACE: does not ex
    ENDCLASS.                    "lcl_event_receiver DEFINITION
    *   LOCAL CLASSES: Implementation
    CLASS lcl_event_receiver IMPLEMENTATION.
    *   §3.At doubleclick(1): The event DOUBLE_CLICK provides
    *      parameters of the clicked row and column.
    *      Use row parameter to select a line of the
    *      corresponding internal table.
      METHOD handle_double_click.
        DATA: ls_sm LIKE LINE OF itsm,
              wa_itab LIKE ITAB.
    *   read selected row from internal table gt_sflight
        READ TABLE itsm INDEX e_row-index INTO ls_sm.
    *   §4.At Doubleclick(2): Select booking data
    *    READ TABLE ITAB WITH KEY KUNAG = LS_SM-KUNAG.    .
        READ TABLE ITAB INTO WA_ITAB WITH KEY KUNAG = LS_SM-KUNAG.
    *   §5.At doubleclick(3): Create dialogbox to show detail list
    *     (if not already existent)
        IF dialogbox_status IS INITIAL.
          dialogbox_status = 'X'.
          PERFORM create_detail_list.
        ELSE.
          CALL METHOD dialogbox_container->set_visible
            EXPORTING
              visible = 'X'.
          CALL METHOD grid2->refresh_table_display.
        ENDIF.
      ENDMETHOD.                    "handle_double_click
      METHOD handle_close.
    *   §6.Handle the CLOSE-button of the dialogbox
    *   set dialogbox invisible
    *   (the dialogbox is destroyed outomatically when the user
    *   switches to another dynpro).
        CALL METHOD sender->set_visible
          EXPORTING
            visible = space.
    *   In this example closing the dialogbox leads
    *   to make it invisible. It is also conceivable to destroy it
    *   and recreate it if the user doubleclicks a line again.
    *   Displaying a great amount of data has a greater impact on
    *performance.
      ENDMETHOD.                    "handle_close
    ENDCLASS.                    "lcl_event_receiver IMPLEMENTATION
    *   lcl_event_receiver (Implementation)
    *=====================================================================
    *       FORM EXIT_PROGRAM                                             *
    FORM exit_program.
      CALL METHOD g_custom_container->free.
      CALL METHOD cl_gui_cfw=>flush.
      IF sy-subrc NE 0.
    * add your handling, for example
        CALL FUNCTION 'POPUP_TO_INFORM'
          EXPORTING
            titel = g_repid
            txt2  = sy-subrc
            txt1  = 'Error in FLush'(500).
      ENDIF.
      LEAVE TO SCREEN 0.
    ENDFORM.                    "exit_program
    *&      Module  STATUS_0100  OUTPUT
    *       text
    module STATUS_0100 output.
      SET PF-STATUS 'MAIN'.
      SET TITLEBAR 'MAIN100'.
      g_repid = sy-repid.
      IF g_custom_container IS INITIAL.
        READ TABLE itsm.
        CREATE OBJECT g_custom_container
          EXPORTING
            container_name = g_container
          EXCEPTIONS
            cntl_error = 1
            cntl_system_error = 2
            create_error = 3
            lifetime_error = 4
            lifetime_dynpro_dynpro_link = 5.
        IF sy-subrc NE 0.
          CALL FUNCTION 'POPUP_TO_INFORM'
            EXPORTING
              titel = g_repid
              txt2  = sy-subrc
              txt1  = 'The control could not be created'(510).
        ENDIF.
        CREATE OBJECT grid1
          EXPORTING
            i_parent = g_custom_container.
        gs_layout-grid_title = 'Invoice Summary'.
    PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'KUNAG' 'C'
    'Customer Code'.
        PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'NAME1' 'C'
    'Customer Name'.
        PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'FKLMG' 'QUAN'
    'Quantity'.
        PERFORM fieldcatalog_init USING gt_fieldcatalog[] 'NETWR' 'CURR'
    'Amount'.
      PERFORM sort_build USING gt_sort[].
      PERFORM layout_init USING gs_layout.
        CALL METHOD grid1->set_table_for_first_display
          EXPORTING
            is_layout       = gs_layout
          CHANGING
            it_outtab       = itsm[]
            it_fieldcatalog = gt_fieldcatalog
            it_sort         = gt_sort.
        CREATE OBJECT event_receiver.
        SET HANDLER event_receiver->handle_double_click FOR grid1.
      ENDIF.
      CALL METHOD cl_gui_control=>set_focus
        EXPORTING
          control = grid1.
    endmodule.                 " STATUS_0100  OUTPUT
    *  MODULE PAI_ALV INPUT
    MODULE USER_COMMAND_0100.
    CALL METHOD cl_gui_cfw=>dispatch.
      CASE sy-ucomm.
        WHEN 'BACK' OR 'EXIT' OR 'CANC'.
          LEAVE TO SCREEN 0.
      ENDCASE.
    ENDMODULE.                    "PAI_ALV INPUT
    *&      Form  fieldcatalog_init
    *       text
    *      -->LT_FIELDCATtext
    *      -->VALUE(FIELDtextE)
    *      -->VALUE(FIELDtextE)
    *      -->VALUE(FIELDtextT)
    FORM fieldcatalog_init USING lt_fieldcatalog TYPE lvc_t_fcat
                           value(field_name) value(field_type)
    value(field_text).
      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.
      APPEND ls_fieldcatalog TO lt_fieldcatalog.
    ENDFORM.                    "fieldcatalog_init
    *&      Form  sort_build
    *       text
    *      -->LT_SORT    text
    FORM sort_build USING lt_sort TYPE lvc_t_sort.
      DATA: ls_sort TYPE lvc_s_sort.
      ls_sort-fieldname = 'KUNAG'.    "Fieldname on which to sort
      ls_sort-up        = 'X'.        "Sort Ascending
      APPEND ls_sort TO lt_sort.
      ls_sort-fieldname = 'NAME1'.    "Fieldname on which to sort
      ls_sort-up        = 'X'.        "Sort Ascending
      APPEND ls_sort TO lt_sort.
    ENDFORM.                    "sort_build
    *&      Form  layout_init
    *       text
    *      -->LS_LAYOUT  text
    FORM layout_init USING ls_layout TYPE lvc_s_layo.
      ls_layout-zebra      = 'X'.
      ls_layout-grid_title = 'Customer Details'.
      ls_layout-sel_mode   = 'A'.
      ls_layout-cwidth_opt = 'X'.
    ENDFORM.                    "layout_init
    *&      Form  create_detail_list
    *         text
    *    -->  p1        text
    *    <--  p2        text
    FORM create_detail_list.
    *   create dialogbox container as dynpro-instance
    *   When the user switches to another screen, it is
    *   destroyed by lifetime mangagement of CFW
      CREATE OBJECT dialogbox_container
          EXPORTING
            top = 150
            left = 150
            lifetime = cntl_lifetime_dynpro
            caption = 'INVOICE DETAILS'(200)
            width = 800
            height = 200.
      CREATE OBJECT grid2
          EXPORTING i_parent = dialogbox_container.
    *   Register ABAP OO event 'CLOSE'. It is not necessary to register this
    *   event at the frontend (this is done during creation).
      SET HANDLER event_receiver->handle_close FOR dialogbox_container.
    *   display data
      gs_layout-grid_title = 'Invoice Details'(100).
      CALL METHOD grid2->set_table_for_first_display
        EXPORTING
          i_structure_name = 'itab'
          is_layout        = gs_layout
        CHANGING
          it_outtab        = itab[]
          it_fieldcatalog  = gt_fieldcatalog
          it_sort          = gt_sort.
      CALL METHOD cl_gui_control=>set_focus
        EXPORTING
          control = grid2.
    ENDFORM.                    " create_detail_list
    Nothing wrong in the code i am able to see the output with five records and the pop-up screen on double clicking a value.
    Kindly close the thread or revert back

  • Rebate Agreement saved even if the cust. or payer is not active for Rebate

    Dear All,
    In my Rebate scenarion, Customer is Payer. When i an creating the Rebate Agreement & entering the Payer number , system is giving the warning message but allow me to create the Rebate agreement.
    I want system to restrict to create Rebate agrrement if the payer or customer is not entitled for rebate.
    Thanks to All

    There is no IMG setting for this message. I suggest you should take help from ABAPer to change the message type from warning to error.

  • Colwidth_optimize not working for alv grid report

    Hi friends,
             I have developed an ALV grid report using 'REUSE_ALV_GRID_DISPLAY'.  The field catalog field columns are having the heading size more than 30 characters. So, to optimize the size of the headings, I am using SLIS_LAYOUT_ALV  and passing the value 'X' to colwidth_optimize.
    but still the column heading is not getting fully display. Rather it is display first 20 characters only.
    For your reference please find the code snippet
    *bold* **************** declarations ************************ *bold*
    DATA : fieldcat       TYPE slis_fieldcat_alv,
                 t_fieldcat     TYPE slis_t_fieldcat_alv,
                ws_layout      TYPE slis_layout_alv.
    *bold* **************** field catalogue ********************** *bold*
      CLEAR fieldcat.
      fieldcat-fieldname     = 'RFWRT_PD_MTRL'.
      fieldcat-seltext_m = 'Pending Quotation Spares Value'.   {quote} this heading not getting fully displayed {quote}
      fieldcat-tabname       = 'IT_FNL'.
    ***    FIELDCAT-REF_TABNAME   = 'VBFA'.
      fieldcat-col_pos       = col_pos.
      APPEND fieldcat TO t_fieldcat.
      ADD 1 TO col_pos.
      CLEAR fieldcat.
      fieldcat-fieldname     = 'RFWRT_PD_SERV'.
      fieldcat-seltext_m = 'Pend Quot-JobWorkVal'.
      fieldcat-tabname       = 'IT_FNL'.
      fieldcat-col_pos       = col_pos.
      APPEND fieldcat TO t_fieldcat.
      ADD 1 TO col_pos.
      ws_layout-colwidth_optimize = 'X'.
    *bold* ****************************** alv grid function call ******************** *bold*
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
    *    i_buffer_active                         = space
          i_callback_program                  = sy-repid
         i_callback_user_command        = 'USER_COMMAND'
    ***   i_callback_pf_status_set           = 'PF_STATUS'
    *   I_STRUCTURE_NAME                  =
         it_fieldcat                        = t_fieldcat[]
         is_layout                          =  ws_layout
        TABLES
          t_outtab                          = it_fnl
       EXCEPTIONS
         program_error                      = 1
         OTHERS                             = 2.
      IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      CLEAR wa_fnl.
    Please look into it.
    Searched the forum for the similar issue. but didnt got any solution.
    Thanks and regards,
    Murali Krishna

    Hi DaveL,
    Thanks alot for your help. My problem solved.
    Can you please suggest me how we can optimize the column based on the total amount which is summed up (fieldcat-do_sum)
    Regards,
    Murali.

  • Conversion routines do not run for ALV after upgrade

    Hi,
       We just upgraded from 4.6 to 6.0 and the custom created ALV reports which had fields like MATNR , VBELN , AUFNR now show leading Zeros. It seems the conversion routines are run before the list is displayed.
      If we add the REF_FIELD and the table in the Field Catalog, it seems to work, but that would a big change as we would have to manually change all the reports. Any suggestions.
    Regards,
    SG

    Thanks - our ticket should be getting closed out on it (our dba will be updating it), the scheduler has been running reliably since we took the steps in the doc mentioned.

  • Hotkeys for ALV Buttons?

    Hi experts (from SAP),
    I read the documentation about HOTKEYS (http://help.sap.com/saphelp_nw70ehp1/helpdata/en/47/b951297a6d2d65e10000000a42189c/frameset.htm) and I'm wondering why the HOTKEYS are not supported for ALVs respectively for Buttons which trigger ALV-Functions.
    In my mind i thought, that the implementing class of a button should be the same (which obviously is not), not dependig in which UI Element it is used?
    So my question is, is there a work-around for enabling Hot-Keys for ALV-Buttons and/or is SAP going to support HOTKEYS for ALVs in a later on release?
    Best regards.
    Volker

    Hello,
    I'm using this code in my program but still I'm getting error I get a null pointer exception. Is it that I forgot to reference any object or what. can you please help me
    wPanel is my JPanel
    hotKeyAction is my class where I have extended Abstract action
    JRootPane rootPane = wPanel.getRootPane();
    ActionMap parentActionMap = rootPane.getActionMap();
    ActionMap am = new ActionMap();
    am.setParent(parentActionMap);
    am.put("openClFrame",new hotKeyAction());
    rootPane.setActionMap(am);
    InputMap parentInputMap = rootPane.getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
    ComponentInputMap im = new ComponentInputMap(wPanel.getRootPane());
    im.setParent(parentInputMap);
    im.put(KeyStroke.getKeyStroke("F1"), "openClFrame");
    rootPane.setInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, im);
    Best Regards,
    Sreedhar

  • Notification classification extractor not trigger delta

    I am facing the same .we have created custom data source for Notification classification  using notification master data extractor(0NOTIFICATN_ATTR)  but delta is not trigger for any changes in the notification line items..

    Hi Madhu,
    In SAP standard, the DataSource 0NOTIFICATN_ATTR is not DELTA compatible.
    Please refer to online documentation below, only a complete upload is
    available:
    http://help.sap.com/saphelp_nw70/helpdata/en/08/b388017dbff7479cc07f0249
    0d60d8/frameset.htm
    Thanks,
    Vimal

  • Get the Change log for ALV line items

    Hello Experts,
    I am using editable ALV table to display/change data. When user modifies data from ALV line items manually (direct entry), this change is recorded in get_context_change_log method of context node. Also in the screen I have one button, on click of this button I do some calculation for selected line items in action method and update the context node with new values. But with this second approach (button action) though values gets changed this is not recorded in to get_context_change_log of context node. I tried to use method add_context_attribute_change  in button action method to add attribute changes to change log tabel but it's not adding entries to change log. Does method add_context_attribute_change only works with OVS search helps and freely programmed value helps? And is there any other way for capturing changes(done by using action method and not manually) for ALV line items?
    Thanks & Regards
    Jayant

    Here is code:
    METHOD.
    This method is in component controller, which gets called from View Action method (on click * of button).
      FIELD-SYMBOLS:<lfs> TYPE  Data.
    *Data Declaration
      DATA lo_nd_cn_apc_item TYPE REF TO if_wd_context_node.
      DATA lit_apc_item TYPE wd_this->elements_cn_apc_item.
      DATA lo_el_cn_apc_item TYPE REF TO if_wd_context_element.
      data: l_component type ref to if_wd_component,
            l_context type ref to if_wd_context,
            lfd_added type abap_bool.
      CLEAR:lo_nd_cn_apc_item,lo_el_cn_apc_item.
      navigate from <CONTEXT> to <CN_APC_ITEM> via lead selection
      lo_nd_cn_apc_item = wd_context->get_child_node( name = wd_this->wdctx_cn_apc_item ).
      REFRESH:lit_apc_item.
      @TODO handle non existant child
      IF lo_nd_cn_apc_item IS NOT INITIAL.
        lo_nd_cn_apc_item->get_static_attributes_table( IMPORTING table = lit_apc_item ).
    get element via lead selection
        lo_el_cn_apc_item = lo_nd_cn_apc_item->get_element( ).
      ENDIF.
            l_component = wd_this->wd_get_api( ).
            l_context = l_component->get_context( ).
    Calculate Cost
      LOOP AT lit_apc_item ASSIGNING  <lfs>.
            <lfs>-cal_amount = ( <lfs>-cost_percent * <lfs>-sec_amount ) / 100.
            lfd_added = l_context->add_context_attribute_change(
                element              = lo_el_cn_apc_item
                attribute_name       = 'CAL_AMOUNT'
                new_value            = <lfs>-cal_amount
      ENDLOOP.
    Bind Table.
      lo_nd_cn_apc_item->bind_table( new_items = lit_apc_item set_initial_elements = abap_true ).
    ENDMETHOD.

  • Search help (PREM) for personal no. is not coming in ALV grid table control

    hi experts,
    Search help (PREM) for personal no. is not coming in ALV grid table control.
    i have assigned the srch help (prem) to my 'ZFIEXP_PROJALLOC' table for the emp_id.
    but in output it is now showing the help.
    ls_fcat-fieldname = 'EMPLOYEE CODE'.
      ls_fcat-ref_table = 'ZFIEXP_PROJALLOC'.
      ls_fcat-ref_field = 'EMP_ID'.
      ls_fcat-outputlen = '10'.
      ls_fcat-key = 'X'.
      ls_fcat-edit = 'X'.
      ls_fcat-coltext = 'EMPLOYEE CODE'.
      ls_fcat-seltext = 'EMPLOYEE CODE'.
      append ls_fcat to pt_fieldcat.
      clear ls_fcat.
    Then i tried to solve it using the PA0002 . ie.,
    ls_fcat-fieldname = 'EMPLOYEE CODE'.
      ls_fcat-ref_table = 'PA0002'.
      ls_fcat-ref_field = 'PERNR'.
      ls_fcat-outputlen = '10'.
      ls_fcat-key = 'X'.
      ls_fcat-edit = 'X'.
      ls_fcat-coltext = 'EMPLOYEE CODE'.
      ls_fcat-seltext = 'EMPLOYEE CODE'.
      append ls_fcat to pt_fieldcat.
      clear ls_fcat.
    with this it is showing the help in employee code, but, when i click on an empl number, it is not added to my table control and allowing me to add the number by typing them.
    plz help me.
    thanks.

    Hi 
    In the layout give layout-sel_mode  = 'A'.  and
    pass  'A'    to  i_save  exporting parameter to method  set_table_for_first_display.
    The same thing if you are working with function module
    reuse_alv_grid_display.
    Reward points for useful answer.
    Venkat

  • ALV - Top of Page Trigger for Each New Page

    Hi Abapers,
    I am using the sortinfo_alv to get page break for each customer.Now my client is asking to display the cutomer name in the top of page insted in the main table. how will i do this .
    I am using alv_commentary_write to display the top of page data.
    Awaiting for reply.
    Regards,
    Rahul

    Hi
    Follow the below steps.
    Include the two forms in your program
    Pass event internal table parameter to FM ALV display.
    Declare the ALV parameter in Declaration part.
    DATA: i_events TYPE slis_t_event.            "(IT) for populating events
               g_header TYPE slis_t_listheader,  "Header for alv
           g_events TYPE slis_alv_event,     "Struc for populating events
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
         it_events                         = i_events
    *&      Form  EVENTTAB_BUILD
    *    Building Events table For ALV
    *      -->P_T_EVENTS[]  text
    FORM eventtab_build USING p_i_events.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
           EXPORTING
                i_list_type     = 0
           IMPORTING
                et_events       = i_events
           EXCEPTIONS
                list_type_wrong = 1
                OTHERS          = 2.
      CLEAR: g_events.
      READ TABLE i_events INTO g_events
           WITH KEY name = 'TOP_OF_PAGE'. "slis_ev_top_of_page.
      IF sy-subrc = 0.
        MOVE 'TOP_OF_PAGE' TO g_events-form.
        MODIFY i_events FROM g_events INDEX sy-tabix TRANSPORTING form.
        CLEAR g_events.
      ENDIF.
    ENDFORM.                    " EVENTTAB_BUILD
    *&      Form  top_of_page
    *    Header Data Population
    FORM top_of_page.
      DATA: l_htext TYPE slis_listheader,
            l_text(200) TYPE c,
            ld_lines TYPE i,
            ld_linesc(9) TYPE c.
      REFRESH g_header.
    ****************TOP OF PAGE HEADINGS****************************
    * For Headers, Key is not printed and is irrelevant. Will not cause
    * a syntax error, but is not used.
    * TYP:  Indicator: Header
      l_htext-typ = 'H'.     "H = Header,S = selection,a = action
      CONCATENATE 'Planned Order: -' s_plnum-low 'To' s_plnum-high
      INTO l_text SEPARATED BY space.
    * INFO: Information
      l_htext-info = l_text.
      APPEND l_htext TO g_header.
    * FM for dispalying text at Top of Page.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
           EXPORTING
                it_list_commentary = g_header
                i_logo =
                   'ENJOYSAP_LOGO'. " From transaction "OAOR"
    *     I_END_OF_LIST_GRID       =
    ENDFORM.                    "TOP_OF_PAGE

  • Page-break in alv background job for alv output variant not coming correctl

    Hi,
    I have created an ALV grid report. When i run the report in background i get the output with correct page-break on FIELD1. Now when i run the report in background with an "ALV output variant" (its the ALV variant that controls the fields display in the output; this is not the program variant), i do not get the page-break on FIELD1.  I have already build the sort criteria and using:
    gs_sort-group = '* '.     "New-Page
    Please let me know what could be reason for not getting the page-break in background when i am using the alv output variant and how do i correct this problem.
    Regards,
    Rakesh

    Hello Everyone,
    I have solved the problem. While running the program in background, we get the page-breaks when we use the below part of code in the sort catalogue with the condition that the program variant should not use any ALV layout variant.
    gs_sort-group = '* '.     "New-Page
    If you are using the ALV layout variant in the program variant then we can check the ROWPOS, COLPOS, and NO_OUT for that ALV layout variant and pass them along in the fieldcatalog table. You should be careful with not to pass the layout variant in the DISVARIANT. You can notice that i have cleared it and simply passing the program name into that.
    *C-- Process separately for jobs running in Background. Actually
    *C-- sortcat-group solves the problem only in Foreground. In background
    *C-- when ALV layout variant is not selected then it works otherwise it
    *C-- fails. So for background jobs we are reading the fieldcat and then
    *C-- passing the same in the display FM.
      IF sy-batch = 'X'.
        CALL FUNCTION 'REUSE_ALV_VARIANT_SELECT'
          EXPORTING
           i_dialog                  = ' '
           i_user_specific           = ' '
           i_default                 = ' '
    *   I_TABNAME_HEADER          =
    *   I_TABNAME_ITEM            =
            it_default_fieldcat       = gt_fieldcat
            i_layout                  = gs_layout
    *   I_BYPASSING_BUFFER        =
    *   I_BUFFER_ACTIVE           =
         IMPORTING
    *   E_EXIT                    =
           et_fieldcat               = lt_fieldcat
    *     et_sort                   = gt_sort[]
    *   ET_FILTER                 =
    *     es_layout                 = gs_layout
         CHANGING
           cs_variant                = gs_disvariant
         EXCEPTIONS
           wrong_input               = 1
           fc_not_complete           = 2
           not_found                 = 3
           program_error             = 4
           OTHERS                    = 5
        IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        CLEAR gs_fieldcat.
        LOOP AT gt_fieldcat INTO gs_fieldcat.
    *C-- Transfer all position changes to gt_fieldcat from lt_fieldcat
          CLEAR ls_fieldcat.
          READ TABLE lt_fieldcat
                INTO ls_fieldcat
                WITH KEY fieldname = gs_fieldcat-fieldname.
          IF sy-subrc = 0.
            gs_fieldcat-row_pos = ls_fieldcat-row_pos.
            gs_fieldcat-col_pos = ls_fieldcat-col_pos.
            gs_fieldcat-no_out = ls_fieldcat-no_out.
            MODIFY gt_fieldcat FROM gs_fieldcat INDEX sy-tabix.
            CLEAR gs_fieldcat.
          ENDIF.
        ENDLOOP.
    *C-- Clear the disvariant for the background job as it contains the ALV
    *C-- layout varinat
        CLEAR gs_disvariant.
        gs_disvariant-report = 'ZGPPMP0001'.
    Then pass gt_fieldcat to 'REUSE_ALV_GRID_DISPLAY'.
    The reason i'm doing it this way is that when we pass the layout variant name, the contents in gt_fieldcat were getting modified.
    One more thing i'd like to point out is that that, i tried to delete the fields with no_out = 'x'. Now when i ran the program in background with all the fields in sort catalog (suppose there are 2 fields field1 and field2) also in fieldcatalog it ran fine. In the next run in background i removed one of the fields in sort catalog from the fieldcatalog (delete the fields with no_out = 'x') and i got dump. Basically i had hidden field1 and so the code which was deleting fields with no_out = 'x' deleted this field from gt_fieldcat. So basically we should not delete fields with no_out = 'x'.
    I was getting ABAP runtime errors    MESSAGE_TYPE_X in the following part of the standard code.
    000310     LOOP AT CT_SORT INTO LS_SORT.
    000320
    000330       READ TABLE IT_FIELDCAT ASSIGNING <LS_FIELDCAT>
    000340            WITH KEY FIELDNAME = LS_SORT-FIELDNAME BINARY SEARCH.
    000350       IF SY-SUBRC NE 0.
         >         MESSAGE X000(0K).
    000370       ENDIF.
    000380
    000390       LS_SORT-SELTEXT = <LS_FIELDCAT>-SELTEXT.
    i have just mentioned this part because when i checked the forum many people were getting such errors "MESSAGE_TYPE_X". This could also be one of the reasons.

  • ALV grid display the subtotal not getting for one column at the output

    Hi,
    I am working one report ALV grid display and subtotal is not getting for one paricular coulumn.
    Eventhough that column has some values.
    So can anyone give the proper solution.
    Waiting quick response.
    Best Regards,
    Bansi

    Hi
    see this link .
    https://wiki.sdn.sap.com/wiki/display/ABAP/SUBTOTALinALV
    or try this program.
    REPORT zalv.
    DATA:
    t_sflight TYPE TABLE OF sflight,
    fs_sflight TYPE sflight.
    DATA:
    r_container TYPE REF TO cl_gui_custom_container,
    r_grid TYPE REF TO cl_gui_alv_grid.
    *FIELD CATALOG
    DATA:
    t_fcat TYPE lvc_t_fcat,
    fs_fcat TYPE lvc_s_fcat.
    *SORTING THE BASIC LIST
    DATA:
    t_sort TYPE lvc_t_sort,
    fs_sort TYPE lvc_s_sort.
    fs_fcat-fieldname = 'PRICE'.
    fs_fcat-do_sum = 'X'.
    APPEND fs_fcat TO t_fcat.
    fs_sort-spos ='1'.
    fs_sort-fieldname = 'CARRID'.
    fs_sort-down = 'X'.
    fs_sort-group = '*'.
    fs_sort-subtot = 'X'.
    APPEND fs_sort TO t_sort.
    SELECT * FROM sflight INTO TABLE t_sflight.
    CALL SCREEN 100.
    *& Module STATUS_0100 OUTPUT
    MODULE status_0100 OUTPUT.
    SET PF-STATUS 'SCREEN1'.
    SET TITLEBAR 'TITLE1'.ENDMODULE. " STATUS_0100 OUTPUT
    *& Module USER_COMMAND_0100 INPUT
    MODULE user_command_0100 INPUT.
    CASE sy-ucomm.
    WHEN 'BACK'.
    LEAVE TO SCREEN 0.
    ENDCASE.
    ENDMODULE. " USER_COMMAND_0100 INPUT
    **& Module HANDLER OUTPUT
    MODULE list OUTPUT.
    CREATE OBJECT r_container
    EXPORTING
    container_name = 'CONTAINER'.
    CREATE OBJECT r_grid
    EXPORTING
    i_parent = r_container.
    CALL METHOD r_grid->set_table_for_first_display
    EXPORTING
    i_structure_name = 'SFLIGHT'
    CHANGING
    it_fieldcatalog = t_fcat
    it_outtab = t_sflight
    it_sort = t_sort.
    ENDMODULE. "list OUTPUT
    Regards
    Hareesh Menon

  • After Update Trigger not triggering for first update

    Hi All,
    I have written a Trigger on AP_SUPPLIERS table to update AP_SUPPLIER_SITES_ALL when payment priority gets updated on AP_SUPPLIERS table. Trigger calls a pragma autonomous procedure after update happens, and updates sites table. We are on R12 (12.1.3) with  DB 11.2.0.3.0
    Somehow this is not working for the first update, after that for every update it is working. Any idea why this might be happening?
    Trigger Code: 
    CREATE OR REPLACE TRIGGER XX_AP_SUPPLIER_SIT_UPD_SYNC
    AFTER UPDATE
    ON AP.AP_SUPPLIERS
    REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    DECLARE
    l_vendor_id     NUMBER;
    l_paym_priority NUMBER;
    BEGIN
       XX_AP_SUPSITE_UPDATE(:NEW.PAYMENT_PRIORITY, :NEW.VENDOR_ID);
       EXCEPTION
         WHEN OTHERS THEN
           RAISE;
    END XX_AP_SUPPLIER_SIT_UPD_SYNC;
    Procedure Code:
    CREATE OR REPLACE PROCEDURE APPS.XX_AP_SUPSITE_UPDATE (p_payment_priority  IN  NUMBER,p_vendor_id IN NUMBER) AS
      PRAGMA AUTONOMOUS_TRANSACTION;
      ex_custom EXCEPTION;
      PRAGMA EXCEPTION_INIT( ex_custom, -20001 ); 
    BEGIN
      UPDATE AP_SUPPLIER_SITES_ALL
      SET PAYMENT_PRIORITY =p_payment_priority
      WHERE VENDOR_ID = p_vendor_id;
      COMMIT;
    EXCEPTION 
    WHEN OTHERS THEN
        raise_application_error( -20001, 'Error while updating payment priority on Site '||SQLERRM );
    END XX_AP_SUPSITE_UPDATE;

    Thanks for your replies Saubhik/VT,
    now my trigger is compiled. but is not triggering. pl help me to resolve .....
    create or replace
    TRIGGER AUDIT_DEV.trg2
    AFTER DELETE OR UPDATE OF EMP_STATUS ON AUDIT_DEV.AUDIT_PERSONS
    FOR EACH ROW
    declare
    OSUSER varchar2(30);
         MACHINE varchar2(30);
         logon_time date;
    db_user varchar2(30);
    USERNAME VARCHAR2(30);
    EMP_USER_MODIFIED AUDIT_PERSONS.EMP_USER_MODIFIED%TYPE;
         EMP_DATE_MODIFIED AUDIT_PERSONS.EMP_DATE_MODIFIED%TYPE;
         EMP_SK AUDIT_PERSONS.EMP_SK%TYPE;
         EMP_ID AUDIT_PERSONS.EMP_ID%TYPE;
         EMP_NAME AUDIT_PERSONS.EMP_NAME%TYPE;
    EMP_RESIGNATION_DATE AUDIT_PERSONS.EMP_RESIGNATION_DATE%TYPE;
    BEGIN
    select     username,osuser,machine,logon_time into db_user,osuser,machine,logon_time from v$session where sid=(select sid from v$mystat where rownum=1);
    INSERT INTO AUDIT_DEV.AUDIT_PERSONS_LOG (EMP_USER_MODIFIED,EMP_DATE_MODIFIED,EMP_SK,EMP_ID,EMP_NAME,EMP_RESIGNATION_DATE,EMP_STATUS_OLD,EMP_STATUS_NEW,osuser,db_user,machine)
    VALUES(EMP_USER_MODIFIED,EMP_DATE_MODIFIED,EMP_SK,EMP_ID,EMP_NAME,EMP_RESIGNATION_DATE,:old.EMP_status,:new.EMP_status,osuser,db_user,machine );
    COMMIT;
    END;
    09:59:06 AUDIT_DEV@dev>UPDATE AUDIT_DEV.AUDIT_PERSONS SET EMP_STATUS='TEST' WHERE EMP_ID='4234';
    EMP_STATUS
    TEST
    1 row selected.
    Elapsed: 00:00:00.01
    10:00:03 AUDIT_DEV@dev>commit;
    Commit complete.
    Elapsed: 00:00:00.01
    10:00:17 AUDIT_DEV@dev>select * from AUDIT_persons_log;
    no rows selected
    Elapsed: 00:00:00.00
    10:00:17 AUDIT_DEV@dev>
    Edited by: Abk on Nov 4, 2010 10:42 AM

  • 'Select ALL' not working for WD ABAP ALV

    Hi all,
    I have a web dynpro application with a tab strip with 9 tabs. Each tab has an ALV embedded in it. Each ALV is mapped to the same  node in component controller. When the application is executed 'Select ALL' works for first ALV on the first tab. However if i select a different tab i get the select all option on the left hand corner but it does nothing when chosen.
    I also tried creating custom button on ALV toolbar for this functinality. Here i am looping over all elements of the node (bound to ALV) and using method  set_selected( abap_true ) ( method of if_wd_context_element ). This also works for first ALV on the
    first tab. However again get the same issue if i choose any other tab.
    Node cardinality : 0.... n
    Node selection :  0.....n
    ALV selection mode set to MULTI using method SET_SELECTION_MODE( CL_WD_TABLE=>E_SELECTION_MODE-MULTI ) of cofig class cl_salv_wd_config_table.
    All your inputs/suggestions to resolve this issue will be greatly appreciated.
    Thanks,
    Vivek Priyadarshi

    Hi Aditya,
    Thanks for your reply. I am using 9 comp. usage of SALV_WD_TABLE to display 9 alv and all are mapped to the same comp. controller context node. The context node has the master structure with all fields, based on the chosen tab i am populating this context node with records and setting config model for ALV accordingly.
    I tried your trick, clicked on select all on first ALV (all records chosen, works correctly here) then chose the second tab on tabstrip, however records in the new (second) ALV were not selected. When i clicked 'Select all' it did nothing, no records were chosen ( original issue ).
    Did you invalidate the common node when you navigate between tabs?In my case i am populating this node with new data every time i navigate between tabs.
    One new thing i noticed. On the first tab i am able to select individual rows by clicking on the row selection buttons on the left edge of every row. However when i go the second tab clicking on row selection button it does not get selected, only way to select a row in this case is by doing CLTR+click, something doesn't feel right about this application.
    I am going to create a new context node to check if sharing a common context node is causin this issue.
    -Vivek

  • Payer 1234 is not defined for account 9999 3333

    Hi All
    When trying to block the Customer Sales Invoice in FB02 with Payment Block 'A' getting the error as 'Payer 1234 is not defined for account 99999 3333'.
    Our scenario is like this:
    1. Sale Order is raised against Customer 9999 in company code 3333.  Customer 1234 is bill to party in this sale order.  All other partners (Sold to Party, Ship to Party, Payer ) are 9999 only.
    2. Invoice is created and released to Billing.
    3. Now when we are trying to block the Invoice getting the error message mentioned above.
    I have checked the sales are partner functions for 1234 and 9999 in the master records.  for 1234 all partner functions are 1234 and for 9999, 9999 only.
    So, when I have not maintained 1234 as payer anywhere, why is it expecting to maintian alternatifve payer..
    I have replicated the same in our pre production but works fine there without any error messages.
    Can you pls advise where It's going wrong.
    Regards
    Rayala

    Hi Friends,
    I have further investigated and found that there is a substituion where in Bill to Party act as a Payer.  So system expecting Bill to party to be maintained as payer.
    Thanks all
    Rayala

Maybe you are looking for

  • How can I write an instance of a class in a static variable

    Hi ! I have an instance of a class Devisen dev = new Devisen(); In an other class I have a static method and I need there the content of some variables from dev. public static void abc() { String text=dev.textfield.getText() I get the errormessage, t

  • Jerky playback of 1080p files

    When trying to play back HD video captured with my Canon S1X, playback through QT is subtly jerky at actual size. When I decrease the window size, or strangely enter full screen, playback becomes smooth. Processors are barely working. Frame rate says

  • HT5537 How do you import/export garage band projects using the latest version of iTunes when there is no apps in the left column to select garageband?

    I am perfectly aware of how to do this using the old version of itunes. however i just got a new macbook pro retina... and it came with the latest version of itunes. and i was trying to import/export garage band files between my ipad and mac via itun

  • Hard Drive Crash Fix?

    My iMac G5 hard drive crashed. I have had this problem before and have usually been able to reinstall the OS after a target disk swap. On startup, the hard drive would make a funky noise (almost sounding like a dial-up modem). I could not figure it o

  • Migrating from 3GS to 4s

    Upgrading from 3GS to 4S nightmare! Simple question "How in the world do you do this?" I now have a legacy Apple ID from early 3G days, an enail type Apple ID, an iCloud ID and each have corresponding passwords. I have recently purchased 4S and I hav