Error in ALV grid

Hi ALV masters,
Plz help me ..
I have an ALV grid report where i have the data in my final table t_final.
now i'm trying to populate the fieldcat using FM reuse_alv_fieldcatalog_merge but its not at all getting populated.
CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      I_PROGRAM_NAME         = l_repid
      I_INTERNAL_TABNAME     = 'T_Final'
      I_INCLNAME             = l_repid
    CHANGING
      CT_FIELDCAT            = T_FIELDCAT[]
    EXCEPTIONS
      INCONSISTENT_INTERFACE = 1
      PROGRAM_ERROR          = 2
      OTHERS                 = 3.
Please help me and if possibl try to send som sample code also.
Thanks in advance..

Hi Mukesh,
this is my code.
plz tell where i'm going rong..
*& Report  ZMMR_CHANGES                                                *
Title       : Material Master: Display Changes                       *
Description : This ABAP report will collectively list all material   *
              master changes to the fields specified in the selection*
              criteria.                                              *
Request No  : SRDK922644                                             *
Author      : Praveen Reddy                                          *
Created on  : 14-FEB-2007                                            *
REPORT  ZMMR_CHANGES
        NO STANDARD PAGE HEADING
        message-id ZSPR.
TYPE-POOLS : SLIS.
TABLES : CDHDR ,           " Change document header
         CDPOS ,           " Change document item
         MARAV ,           " View Table for Logical DB MGM
         MARC  ,           " Plant Data for Material
         MVKE  .           " Sales Data for Material
SELECTION-SCREEN BEGIN OF BLOCK A WITH FRAME TITLE TEXT-001.
SELECTION-SCREEN BEGIN OF BLOCK GENERAL WITH FRAME TITLE TEXT-002.
SELECT-OPTIONS :
         S_OBJCLS  FOR CDHDR-OBJECTCLAS           ,
         S_MATNR   FOR CDHDR-OBJECTID            ,
         S_WERKS   FOR MARC-WERKS                ,
         S_VKORG   FOR MVKE-VKORG                ,
         S_VTWEG   FOR MVKE-VTWEG                ,
         S_TABNAM  FOR CDPOS-TABNAME             ,
         S_FNAME   FOR CDPOS-FNAME               ,
         S_CHGIND  FOR CDPOS-CHNGIND             ,
         S_DATE    FOR CDHDR-UDATE               ,
         S_USER    FOR CDHDR-USERNAME            .
SELECTION-SCREEN END OF BLOCK GENERAL.
SELECTION-SCREEN END OF BLOCK A.
*Data  : G_WERKS LIKE MARC-WERKS                 ,
       G_VKORG LIKE MVKE-VKORG                 ,
       G_VTWEG LIKE MVKE-VTWEG                 ,
       G_DESC  LIKE MARAV-MAKTX                .
TYPES  : BEGIN           OF   TY_FOR_DISP        ,
         OBJCLASS        LIKE CDHDR-OBJECTCLAS   ,
         OBJID           LIKE CDHDR-OBJECTID     ,
         WERKS           LIKE MARC-WERKS           ,
         VKORG           LIKE MVKE-VKORG         ,
         VTWEG           LIKE MVKE-VTWEG         ,                
         DESC            LIKE MARAV-MAKTX        ,
         TABNAME         LIKE CDPOS-TABNAME      ,
         FNAME           LIKE CDPOS-FNAME        ,
         CHNGIND         LIKE CDPOS-CHNGIND      ,
         UDATE           LIKE CDHDR-UDATE        ,
         USERNAME        LIKE CDHDR-USERNAME     ,
         VALUE_OLD       LIKE CDPOS-VALUE_OLD    ,
         VALUE_NEW       LIKE CDPOS-VALUE_NEW    ,
         END             OF   TY_FOR_DISP        .
TYPES  : BEGIN           OF   TY_CDHDR,
         OBJCLASS        LIKE CDHDR-OBJECTCLAS   ,
         OBJID           LIKE CDHDR-OBJECTID     ,
       CHNGIND         LIKE CDPOS-CHNGIND      ,
         CHANGENR        LIKE CDHDR-CHANGENR     ,
         UDATE           LIKE CDHDR-UDATE        ,
         USERNAME        LIKE CDHDR-USERNAME     ,
       VALUE_OLD       LIKE CDPOS-VALUE_OLD    ,
       VALUE_NEW       LIKE CDPOS-VALUE_NEW    ,
         END             OF   TY_CDHDR           .
TYPES  : BEGIN           OF   TY_CDPOS,
         TABNAME         LIKE CDPOS-TABNAME      ,
         FNAME           LIKE CDPOS-FNAME        ,
         CHANGENR        LIKE CDHDR-CHANGENR     ,
         CHNGIND         LIKE CDPOS-CHNGIND      ,
         TABKEY          LIKE CDPOS-TABKEY       ,
         FIELDTEXT       LIKE DFIES-FIELDTEXT,
       UDATE           LIKE CDPOS-UDATE        ,
       USERNAME        LIKE CDPOS-USERNAME     ,
         VALUE_OLD       LIKE CDPOS-VALUE_OLD    ,
         VALUE_NEW       LIKE CDPOS-VALUE_NEW    ,
         END             OF   TY_CDPOS           .
DATA   : T_FOR_DISP      TYPE STANDARD TABLE OF TY_FOR_DISP
                         WITH HEADER LINE        ,
         T_CDHDR         TYPE STANDARD TABLE OF TY_CDHDR
                         WITH HEADER LINE        ,
         T_CDPOS         TYPE STANDARD TABLE OF TY_CDPOS
                          WITH HEADER LINE       .
DATA   : G_LANGU LIKE SY-LANGU,
         G_TABIX LIKE SY-TABIX,
         G_DATE  LIKE SY-DATUM.
DATA   : G_WERKS LIKE MARC-WERKS  ,
         G_VKORG LIKE MVKE-VKORG  ,
         G_VTWEG LIKE MVKE-VTWEG  ,
         G_DESC  LIKE MARAV-MAKTX .
*------ALV Grid Field Catalog Fields
DATA: T_FIELDCAT   TYPE SLIS_T_FIELDCAT_ALV,
      T_FIELDCAT_H LIKE T_FIELDCAT WITH HEADER LINE.
*------End
CONSTANTS : C_MATERIAL(10)    VALUE 'MATERIAL'   ,
            C_OBJCLASS(10)    VALUE 'OBJCLASS'   ,
            C_OBJECTID(8)     VALUE 'OBJID'      ,
            C_WERKS(5)        VALUE 'WERKS'      ,
            C_VKORG(5)        VALUE 'VKORG'      ,
            C_VTWEG(5)        VALUE 'VTWEG'      ,                
            C_DESC(4)         VALUE 'DESC'       ,
            C_TABNAME(7)      VALUE 'TABNAME'    ,
            C_FNAME(5)        VALUE 'FNAME'      ,
            C_CHNGIND(7)      VALUE 'CHNGIND'    ,
            C_UDATE(5)        VALUE 'UDATE'      ,
            C_USERNAME(8)     VALUE 'USERNAME'   ,
            C_VALUE_OLD(9)    VALUE 'VALUE_OLD'  ,
            C_VALUE_NEW(9)    VALUE 'VALUE_NEW'  .
*CONSTANTS: C_TABNAM_FOR_ALV_FM TYPE SLIS_TABNAME VALUE 'T_FOR_DISP'.
  INITIALIZATION   *****************
INITIALIZATION.
  CLEAR:  T_CDHDR,
          T_CDPOS,
          T_FIELDCAT,
          T_FIELDCAT_H,
          T_FOR_DISP.
  REFRESH:T_CDHDR,
          T_CDPOS.
CLEAR :  CDHDR,           " Change document header
          CDPOS.           " Change document items
****START-OF-SELECTION.
START-OF-SELECTION.
*-FETCHING DETAILS of Changes done
  PERFORM SUB_GET_DETAILS.
Get the field description.
PERFORM SUB_CALL_DDIF_FIELDINFO_GET.
****END-OF-SELECTION.
END-OF-SELECTION.
*--DISPLAYING DATA IN ALV
  PERFORM SUB_DISPLAY_ALV.
*&      Form  SUB_GET_DETAILS
   This subrouting is used to get Final output which will shown in
   ALV Grid From Table CDPOS.
FORM SUB_GET_DETAILS.
SELECT OBJECTCLAS
        OBJECTID
        CHANGENR
        UDATE
        USERNAME
        INTO TABLE T_CDHDR
        FROM CDHDR
WHERE  OBJECTCLAS IN S_OBJCLS
   AND  OBJECTID   IN S_MATNR
AND  TABNAME    IN S_TABNAM
AND  FNAME      IN S_FNAME
AND  CHNGIND    IN S_CHGIND
AND  UDATE      IN S_DATE
   AND  UDATE      IN S_DATE
   AND  USERNAME   IN S_USER  .
IF SY-SUBRC <> 0.
WRITE:/ TEXT-003.
ENDIF.
  LOOP AT T_CDHDR.
    CLEAR T_FOR_DISP.
  IF T_CDHDR-OBJCLASS = C_MATERIAL.
   SELECT SINGLE MAKTX
   INTO G_DESC
   FROM MARAV
   WHERE MATNR = T_CDHDR-OBJID+0(18)
     AND SPRAS = SY-LANGU.
  ENDIF.
    T_FOR_DISP-DESC = G_DESC.
    CLEAR G_DESC.
   CLEAR T_FOR_DISP.
    T_FOR_DISP-OBJCLASS = T_CDHDR-OBJCLASS   .
    T_FOR_DISP-OBJID    = T_CDHDR-OBJID      .
    T_FOR_DISP-UDATE    = T_CDHDR-UDATE      .
    T_FOR_DISP-USERNAME = T_CDHDR-USERNAME   .
*ENDIF.
   APPEND T_FOR_DISP.
ENDLOOP.
*ENDIF.
SELECT
       TABNAME
       FNAME
       CHANGENR
       CHNGIND
       TABKEY
     UDATE
     USERNAME
       VALUE_OLD
       VALUE_NEW
       FROM CDPOS
       INTO TABLE T_CDPOS
       FOR ALL ENTRIES IN T_CDHDR
     CDHDRCHANGENR = CDPOSCHANGENR
WHERE
       CHANGENR EQ T_CDHDR-CHANGENR
   AND TABNAME  IN S_TABNAM
   AND FNAME    IN S_FNAME
   AND CHNGIND  IN S_CHGIND         .
AND UDATE    IN S_DATE.
AND OBJECTID IN S_DATE
AND USERNAME IN S_USER           .
IF SY-SUBRC <> 0.
WRITE:/ TEXT-003.
ENDIF.
*CLEAR T_FOR_DISP.
READ TABLE T_CDPOS
      WITH KEY CHANGENR = T_CDHDR-CHANGENR.
CLEAR : G_WERKS,
         G_VKORG,
         G_VTWEG.
       G_DESC .
IF T_CDPOS-TABNAME  = 'MARC'.
             G_WERKS = T_CDPOS-TABKEY+21(4).
ENDIF.
      CHECK G_WERKS IN S_WERKS.
IF SY-SUBRC = 0.
  T_FOR_DISP-WERKS = G_WERKS.
ENDIF.
IF T_CDPOS-TABNAME  = 'MVKE'.
      G_VKORG = T_CDPOS-TABKEY+21(4).
ENDIF.
      CHECK G_VKORG IN S_VKORG.
    T_FOR_DISP-VKORG = G_VKORG.
      G_VTWEG = T_CDPOS-TABKEY+25(2).
      CHECK G_VTWEG IN S_VTWEG.
     T_FOR_DISP-VTWEG = G_VTWEG.
   T_FOR_DISP-TABNAME   = T_CDPOS-TABNAME.
   T_FOR_DISP-FNAME     = T_CDPOS-FNAME.
   T_FOR_DISP-CHNGIND   = T_CDPOS-CHNGIND.
   T_FOR_DISP-VALUE_OLD = T_CDPOS-VALUE_OLD.
   T_FOR_DISP-VALUE_NEW = T_CDPOS-VALUE_NEW.
  APPEND T_FOR_DISP.
ENDLOOP.
ENDLOOP.
CLEAR T_FOR_DISP.
ENDFORM.                    " SUB_GET_DETAILS
*&      Form  SUB_DISPLAY_ALV
This Subroutine is used to display data to ALV Grid from internal    *
tables T_CDHDR & T_CDPOS. which is filled in subroutine              *
SUB_GET_DETAILS                                                      *
FORM SUB_DISPLAY_ALV .
BREAK-POINT.
  DATA: l_layout     type slis_layout_alv,
        l_title      type lvc_title,
        l_repid      like sy-repid.
  l_repid = sy-repid.
  CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
    EXPORTING
      I_PROGRAM_NAME         = l_repid
      I_INTERNAL_TABNAME     = 'TY_FOR_DISP'
      I_INCLNAME             = l_repid
    CHANGING
      CT_FIELDCAT            = T_FIELDCAT[]
    EXCEPTIONS
      INCONSISTENT_INTERFACE = 1
      PROGRAM_ERROR          = 2
      OTHERS                 = 3.
  IF SY-SUBRC <> 0.
  WRITE:/ 'ERROR IN CALLING ALV FM'.
  ENDIF.
*----Change Field Heading We move All field data from T_FIELDCAT To
*----another Internal table with header line namely T_FIELDCAT_H
*CLEAR T_FIELDCAT_H[].
REFRESH T_FIELDCAT_H[].
BREAK-POINT.
  MOVE T_FIELDCAT[] TO T_FIELDCAT_H[].
CLEAR G_TABIX.
LOOP AT T_FIELDCAT_H.
G_TABIX = SY-TABIX.
    CASE T_FIELDCAT_H-FIELDNAME.
      WHEN C_OBJCLASS.
        T_FIELDCAT_H-SELTEXT_L = TEXT-004.
        T_FIELDCAT_H-SELTEXT_M = TEXT-004.
        T_FIELDCAT_H-SELTEXT_S = TEXT-004.
       T_FIELDCAT_H-OUTPUTLEN = 15.
      WHEN C_OBJECTID.
        T_FIELDCAT_H-SELTEXT_L = TEXT-005.
        T_FIELDCAT_H-SELTEXT_M = TEXT-005.
        T_FIELDCAT_H-SELTEXT_S = TEXT-005.
       T_FIELDCAT_H-OUTPUTLEN = 20.
      WHEN C_DESC.
        T_FIELDCAT_H-SELTEXT_L = TEXT-006.
        T_FIELDCAT_H-SELTEXT_M = TEXT-006.
        T_FIELDCAT_H-SELTEXT_S = TEXT-006.
       T_FIELDCAT_H-OUTPUTLEN = 20.
      WHEN C_WERKS.
        T_FIELDCAT_H-SELTEXT_L = TEXT-007.
        T_FIELDCAT_H-SELTEXT_M = TEXT-007.
        T_FIELDCAT_H-SELTEXT_S = TEXT-007.
       T_FIELDCAT_H-OUTPUTLEN = 20.
      WHEN C_VKORG.
        T_FIELDCAT_H-SELTEXT_L = TEXT-008.
        T_FIELDCAT_H-SELTEXT_M = TEXT-008.
        T_FIELDCAT_H-SELTEXT_S = TEXT-008.
       T_FIELDCAT_H-OUTPUTLEN = 20.
      WHEN C_VTWEG.
        T_FIELDCAT_H-SELTEXT_L = TEXT-009.
        T_FIELDCAT_H-SELTEXT_M = TEXT-009.
        T_FIELDCAT_H-SELTEXT_S = TEXT-009.
       T_FIELDCAT_H-OUTPUTLEN = 20.
      WHEN C_TABNAME.
        T_FIELDCAT_H-SELTEXT_L = TEXT-010.
        T_FIELDCAT_H-SELTEXT_M = TEXT-010.
        T_FIELDCAT_H-SELTEXT_S = TEXT-010.
       T_FIELDCAT_H-OUTPUTLEN = 20.
      WHEN C_FNAME.
        T_FIELDCAT_H-SELTEXT_L = TEXT-011.
        T_FIELDCAT_H-SELTEXT_M = TEXT-011.
        T_FIELDCAT_H-SELTEXT_S = TEXT-011.
       T_FIELDCAT_H-OUTPUTLEN = 20.
      WHEN C_CHNGIND.
        T_FIELDCAT_H-SELTEXT_L = TEXT-012.
        T_FIELDCAT_H-SELTEXT_M = TEXT-012.
        T_FIELDCAT_H-SELTEXT_S = TEXT-012.
       T_FIELDCAT_H-OUTPUTLEN = 20.
      WHEN C_UDATE.
        T_FIELDCAT_H-SELTEXT_L = TEXT-013.
        T_FIELDCAT_H-SELTEXT_M = TEXT-013.
        T_FIELDCAT_H-SELTEXT_S = TEXT-013.
       T_FIELDCAT_H-OUTPUTLEN = 20.
      WHEN C_USERNAME.
        T_FIELDCAT_H-SELTEXT_L = TEXT-014.
        T_FIELDCAT_H-SELTEXT_M = TEXT-014.
        T_FIELDCAT_H-SELTEXT_S = TEXT-014.
       T_FIELDCAT_H-OUTPUTLEN = 20.
      WHEN C_VALUE_OLD.
        T_FIELDCAT_H-SELTEXT_L = TEXT-015.
        T_FIELDCAT_H-SELTEXT_M = TEXT-015.
        T_FIELDCAT_H-SELTEXT_S = TEXT-015.
       T_FIELDCAT_H-OUTPUTLEN = 20.
      WHEN C_VALUE_NEW.
        T_FIELDCAT_H-SELTEXT_L = TEXT-016.
        T_FIELDCAT_H-SELTEXT_M = TEXT-016.
        T_FIELDCAT_H-SELTEXT_S = TEXT-016.
       T_FIELDCAT_H-OUTPUTLEN = 20.
      WHEN OTHERS.
    CONTINUE.
    ENDCASE.
    MODIFY T_FIELDCAT_H.
   CLEAR  T_FIELDCAT_H.
  ENDLOOP.
*BREAK-POINT.
  MOVE T_FIELDCAT_H[] TO T_FIELDCAT[].
*----End
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       exporting
            i_callback_program       = l_repid
          i_callback_pf_status_set = 'SET_STATUS'
          i_callback_user_command  = 'USER_COMMAND'
           i_callback_top_of_page   = 'TOP_OF_PAGE'
           i_grid_title             = l_title
           is_layout                = l_layout
             it_fieldcat              = t_fieldcat
           i_save                   = 'A'
       tables
            t_outtab                 = T_FOR_DISP[]
       exceptions
            program_error            = 1
            others                   = 2.
IF SY-SUBRC <> 0.
   WRITE:/ TEXT-017.
ENDIF.
ENDFORM.                    " SUB_DISPLAY_ALV
*&      Form  TOP_OF_PAGE
   This subrouting is used to show heading to ALV Grid. This
   subrouting is called from subrouting 'SUB_DISPLAY_ALV', Function
  'REUSE_ALV_GRID_DISPLAY' & export param 'i_callback_top_of_page'
*Form TOP_OF_PAGE.
DATA :  L_HEADER   TYPE SLIS_T_LISTHEADER,
         L_HEADER_H TYPE SLIS_LISTHEADER.
DATA :   L_FROMDAT(10) TYPE C,
          L_TODATE(10)  TYPE C.
*CONSTANTS : C_DOT(1) TYPE C     VALUE '.',
           C_L_HEADER_H_TYP(1) VALUE 'H'.   "---ALV Grid Header Type
CLEAR : L_HEADER.
**--To Manage Date Format
CONCATENATE S_DATE-LOW+6(2)
             C_DOT
             S_DATE-LOW+4(2)
             C_DOT
             S_DATE-LOW+0(4)
        INTO L_FROMDAT.
CONCATENATE S_DATE-HIGH+6(2)
             C_DOT
             S_DATE-HIGH+4(2)
             C_DOT
             S_DATE-HIGH+0(4)
        INTO L_TODATE.
**---End
IF L_TODATE <> '00.00.0000'.
   CONCATENATE 'Purchase Org:'(014)
               S_VKORG-LOW
               'PO changes from'(015)
               L_FROMDAT
               'To'(013)
               L_TODATE
               INTO L_HEADER_H-INFO SEPARATED BY SPACE.
ELSE.
    G_DATE = SY-DATUM.
   CONCATENATE 'CHANGES: '
                G_DATE
               INTO L_HEADER_H-INFO SEPARATED BY SPACE.
ENDIF.
Main report header
L_HEADER_H-TYP = C_L_HEADER_H_TYP.
APPEND L_HEADER_H TO L_HEADER.
CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
   EXPORTING
     IT_LIST_COMMENTARY = L_HEADER
     I_LOGO             = ''.
*ENDFORM.                    "TOP_OF_PAGE
Plz look into this and suggest me ..thanks a lot.

Similar Messages

  • Error While ALV Grid is exported to Excel.

    Hi Experts,
    I get an error OBJECTS_NOT_CHARLIKE , while I try to download an ALV Grid , to an excel file using the standard icon Export  present on the ALV Grid.
    Regards.
    Edited by: sunitha j on May 19, 2009 1:15 PM

    This happens when your output list contains qty. or amount fields.
    To fix the error use sap table name instead of your internal table name while preparing field catalog.
    In case you are forced to use int. table name while preparing field catalog , add "quantity" field for qty figures and "currency" field for amount figures.
    Example :
    it_catalog-fieldname = 'MENGE'.
    it_catalog-quantity = 'NOS'.
    it_catalog-tabname = 'i_bseg'.
    it_catalog-seltext_s = 'Quantity'.
    APPEND it_catalog TO it_fieldcat.
    it_catalog-fieldname = 'DMBTR'.
    it_catalog-tabname = 'i_bseg'.
    it_catalog-seltext_s = 'Amount'.
    it_catalog-currency = 'INR'.
    APPEND it_catalog TO it_fieldcat.

  • Error when double clicking any field in Alv grid

    Hi All,
    I have created a custom container. To that custom container I am displaying an alv grid with all editable fields using oops concept.
    Hence when I am double clicking on any on the field of the table I am getting a dump " an exception condition ERROR raised in CL_GUI_ALV_GRID_BASE  in method SET_DRAG_DROP_ROWS".
    Kindly help

    Hi,
    Check the PF-STATUS. It seems that you have assigned F6 shortcut key for some event.
    Remove the F6 assignment & activate the pf-status.
    Best regards,
    Prashant

  • Runtime error while trying to execute custom F4 help in OOP ALV grid.

    Dear All,
    I am trying to add custom search help for one of my column in ALV grid. I'm using OOP ALV, when i click for search help for that column, the system shows runtime error like below.
    I am new to OOP concept and tried to follow program BCALV_EDIT_03. But not getting this error occur. Please help me.
    With regards.

    Hi,
    In order to be able to provide a search help for a field in an ALV you must do the following things.
    1) The field where F4 help need to be attached needs to be made editable.
    2) Create an event handler class to handle the ONF4 event. You can refer the following code:
        CLASS lcl_alv1_handler DEFINITION.
        PUBLIC SECTION.
           "Tohandle F4 helps
           METHODS handle_f4 FOR EVENT onf4 OF cl_gui_alv_grid
                   IMPORTING e_fieldname e_fieldvalue es_row_no er_event_data
                             et_bad_cells e_display.
        ENDCLASS.
       CLASS lcl_alv1_handler IMPLEMENTATION.
          METHOD handle_f4.
    CASE e_fieldname.
         WHEN 'LIFNR'.               "Set F4 for courier vendor
             SELECT lifnr name1 FROM lfa1 INTO TABLE lt_lifnr.
           IF lt_lifnr IS NOT INITIAL.
             CALL FUNCTION 'F4IF_INT_TABLE_VALUE_REQUEST'
               EXPORTING
                 retfield           = 'LIFNR'
                 window_title   = 'Vendors'
                 value_org       = 'S'
               TABLES
                 value_tab       = lt_lifnr
                 return_tab      = lt_return
               EXCEPTIONS
                 parameter_error = 1
                 no_values_found = 2
                 OTHERS          = 3.
             IF sy-subrc = 0.
               READ TABLE gt_final INTO wa_final_t INDEX es_row_no-row_id.
               IF sy-subrc = 0.
                 READ TABLE lt_return INTO wa_return INDEX 1.
                 IF sy-subrc = 0.
                   CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
                     EXPORTING
                       input  = wa_return-fieldval
                     IMPORTING
                       output = lv_lifnr.
                   wa_final_t-lifnr  = lv_lifnr.
                   MODIFY gt_final FROM wa_final_t INDEX es_row_no-row_id.
                 ENDIF.
               ENDIF.
             ENDIF.
           ENDIF.
          ENDCASE.
             CALL METHOD o_alv->refresh_table_display.
          ENDMETHOD.
       ENDCLASS.
        In the above method, GT_FINAL-LIFNR is being overwritten by the LIFNR you had selected       from F4 help. So we will call the refresh_table_display after it to see the result in the ALV.
    3) After creating the ALV object, add the fields to which the F4 has to be added. For this you
        need to declare an internal table based on  lvc_t_f4. Use the following code. Here O_ALV is    my ALV object.:
       CREATE OBJECT o_container
           EXPORTING
             container_name              = 'CUSTCON'
           EXCEPTIONS
             cntl_error                  = 1
             cntl_system_error           = 2
             create_error                = 3
             lifetime_error              = 4
             lifetime_dynpro_dynpro_link = 5
             OTHERS                      = 6.
         IF sy-subrc <> 0.
    *     MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *                WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
         ENDIF.
         CREATE OBJECT o_alv
           EXPORTING
             i_parent          = o_container
           EXCEPTIONS
             error_cntl_create = 1
             error_cntl_init   = 2
             error_cntl_link   = 3
             error_dp_create   = 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 : gt_f4, wa_f4.
       wa_f4-fieldname   = 'LIFNR'.
       wa_f4-register    = 'X'.
       wa_f4-getbefore   = space.
       wa_f4-chngeafter  = space.
       APPEND wa_f4 TO gt_f4.
       Here I am assigning F4 to LIFNR field in the final internal table that is displayed using ALV.
       After this register this field for F4.
        CALL METHOD o_alv->register_f4_for_fields
           EXPORTING
              it_f4 = gt_f4.
       CREATE OBJECT o_alv_handler.
       SET HANDLER : o_alv_handler->handle_f4 FOR o_alv1.
       The object o_alv_handler is created based on the event handler class.
    I hope that this will solve your issue. Revert if this is solved.
    Rgards,
    Abijith

  • Run-time error while executing alv grid report

    Hi everyone
    I m trying to run a alv grid report it is giving a run time error while executing the statement CALL METHOD V_ALV->SET_TOOLBAR_INTERACTIVE.
    Actually i added 2 buttons in the toolbar.after that when i execute the report i m getting errors.
    <b>Error Analysis</b>
    An exception occurred that is explained in detail below.                     
    The exception, which is assigned to class 'CX_SY_REF_IS_INITIAL', was not    
    caught in                                                                   
    procedure "TOOLBAR_MENUS_INIT" "(METHOD)", nor was it propagated by a RAISING
    clause.                                                                     
    Since the caller of the procedure could not have anticipated that the        
    exception would occur, the current program is terminated.                    
    The reason for the exception is:                                             
    You attempted to use a 'NULL' object reference (points to 'nothing')         
    access a component (variable: "ME->M_CL_MENU_BUTTON_VARIANT").               
    An object reference must point to an object (an instance of a class)         
    before it can be used to access components.                                  
    Either the reference was never set or it was set to 'NULL' using the         
    CLEAR statement.

    Hi Dinesh,
    Seems you have not initialised ( Instantiated in OO ) the object and / or the parent container.
    Check if you have create object for both the parent as well as the alv object.
    So when you instatntiate the object of ALV you pass the object ( instantiated before hand ) in the parent container position.
    Also you would have to register the events to the object using method. Then only the buttons will finction.
    eg :
    IF G_CUSTOM_CONTAINER IS INITIAL.
        CREATE OBJECT CUSTOM_CONTAINER_1
               EXPORTING CONTAINER_NAME = CONTAINER_1.
        CREATE OBJECT GRID1
               EXPORTING I_PARENT = CUSTOM_CONTAINER_1.
        CALL METHOD ALV_GRID1->SET_TABLE_FOR_FIRST_DISPLAY
             EXPORTING I_STRUCTURE_NAME = 'VBAK
             CHANGING  IT_OUTTAB        = IT_VBAK.
    Reward points if useful.

  • Display error message in ALV grid  using OOPS

    Hi,
    I have a requirement to display report in ALV. I have created ALV grid using OOPS with three editable cells and 1 button on toolbar. When user enter values in Ediatble cell  and click on the Toolbar button, sales order item should be assigned to contract.
    When the user select  the row and click on toolbar button, a salesorder item should be assigned  to contract and i am using BAPI and fine with BAPI. All the error message should be displayed in a popup and the corresponding failed row  should change its color .
    Once the user identified the failed row, he can edit the value in the ediatble cells and should reprocess in the same screen ( without going back to selection screen).
    To display POP Up, I  am using FM BAL_LOG_CREATE, BAL_LOG_MSG_ADD, BAL_DSP_PROFILE_NO_TREE_GET, BAL_CNTL_CREATE.
    by using above 4 FM , i can display POP UP. but i cannot change the color of the failed row. 
    Once I identified the failed row and reprocess from the same screen , I am successful in processing the failed row, but my error log still has the reprocessed row as failed row because,  error log is not refreshing.
    Please suggest me how to clear error log which was created by using the above FM's and change the color of the failed row .
    Thanks in Advance

    Hi
    Please suggest me how to clear error log which was created by using the above FM's....
    U can use BAL_LOG_REFRESH
    ....and change the color of the failed row
    You need to insert a new field for Colour Attributes in your output table and input its name in the layout structure:
    IS_LAYOUT-INFO_FNAME = <field name for colour>
    The field has to be a CHAR 3 and its value can be -
    > Cxy
    C is a constant
    x is the colour number (from 1 to 9)
    y is intensified (0 = off, 1 = on)
    After changing the value of output table you need to run the method REFRESH_TABLE_DISPLAY for refreshing the output
    Max

  • 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

  • CL_SALV_BS_TT_RESULT_TABLE====CP error while downloading data from ALV grid

    Hi ,
    I am  facing a problem when ever i am going to donload data from ALV grid to excel file.I am getting CL_SALV_BS_TT_RESULT_TABLE====CP error in GET_CELL_VALUE. Could you please provide me is there any OSS note or any patch required to solve this issue.
    Thanks in Advance,
    Venkatarao.

    Hi,
    Just refer to OSS note 1356898 for guidelines.
    Regards,
    Vasanth

  • Error in clicking save to local file button in alv grid?

    Hi
    I am getting error , While clicking on some buttons like save as local file button in alv grid display
    How to rectify it
    Thanks in advance

    In your REUSE_ALV_GRID_DISPLAY 
    EXPORTING
          I_SAVE                  = 'U'
    put this field....and then check it will definitely work...

  • Error in clicking save to local file button in alv grid? urgent

    >>>>>       if lr_tabledescr->applies_to_data( <coltab_any> ) eq 'X'. 
    exactly i am getting error here
    how to rectify this error
    Error in clicking save to local file button and mail receipt button in alv grid?

    In your REUSE_ALV_GRID_DISPLAY 
    EXPORTING
          I_SAVE                  = 'U'
    put this field....and then check it will definitely work...

  • ALV Grid OO Error

    Hi Guys,
    When i am executing the program for ALV grid using OO concepts i got thisn type of error
    "Short text
    Access via 'NULL' object reference not possible.
    What happened?
    Error in the ABAP Application Program
    The current ABAP program "Z_TEST_PGM" had to be terminated because it has
    come across a statement that unfortunately cannot be executed.
    Error analysis
    An exception occurred that is explained in detail below.
    The exception, which is assigned to class 'CX_SY_REF_IS_INITIAL', was not
    caught in
    procedure "ALVGRID_OO_DISPLAY" "(FORM)", nor was it propagated by a RAISING
    clause.
    Since the caller of the procedure could not have anticipated that the
    exception would occur, the current program is terminated.
    The reason for the exception is:
    You attempted to use a 'NULL' object reference (points to 'nothing')
    access a component (variable: "GRID").
    An object reference must point to an object (an instance of a class)
    before it can be used to access components.
    Either the reference was never set or it was set to 'NULL' using the
    CLEAR statement."
    The code for this one is .
    Data : grid type ref to cl_gui_alv_grid,
    g_custom_container type ref to cl_gui_custom_container,
    FCAT TYPE LVC_T_FCAT,
    gt_final1 type table of t_Final_out.
    Initialization.
    v_repid = sy-repid.
    set screen '101'.
    MODULE STATUS_0101 output.
    if g_custom_container is initial .
    create object g_custom_container
    Exporting
    Container_name = 'CCCONTAINER'.
    Create Object grid
    Exporting
    I_Parent = g_custom_container.
    Endif.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
    EXPORTING
    I_STRUCTURE_NAME = 't_final_out'
    CHANGING
    CT_FIELDCAT = FCAT[].
    ENDMODULE.
    Perform ALVGRID_OO_Display.
    Form ALVGRID_OO_Display.
    *set screen '101'.
    Call Method grid->set_table_for_first_display
    Exporting I_Structure_name = 't_final_out'
    Changing it_outtab = gt_final1.
    Endform.
    't_final_out' is the final output Structure of the Internal table.
    Please respond to this thread.
    Thanks,
    Gopi

    t_final_out is a local structure do n't give this structure create a global structure in se11 with the fields used and pass that structure to FM  'LVC_FIELDCATALOG_MERGE'. this will sove your problem.
    <b>if helpful reward some points.</b>

  • Time out error in production server  for alv grid report

    hi. i have developed alv grid report using nested select statments. when i testing in development  server it is giving the output but in production server if i give 4 months then it is showing time out error.please help me out..its urgent.
    Thanks in advance.

    Hi Manu,
    Don't use Nested selected statements.
    Use the Following  Performance Tuning Options that i have given below so that your problem can be solved.
    1)  Always check the driver internal tables is not empty, while using FOR ALL ENTRIES
    2) Avoid for all entries in JOINS
    3) Try to avoid joins and use FOR ALL ENTRIES.
    4)   Try to restrict the joins to 1 level only ie only for tables
    5)   Avoid using Select *.
    6)   Avoid having multiple Selects from the same table in the same object.
    7)  Try to minimize the number of variables to save memory.  
    8)   The sequence of fields in 'where clause' must be as per primary/secondary index ( if any)
    9)   Avoid creation of  index as far as possible
    10) Avoid operators like  <>, > , < & like % in where clause conditions
    11) Avoid select/select single statements in loops.
    12) Try to use 'binary search' in READ internal table. Ensure table is sorted before using   BINARY SEARCH.
    13) Avoid using aggregate functions  (SUM, MAX etc) in selects ( GROUP BY , HAVING,)  
    14) Avoid using  ORDER  BY in selects
    15) Avoid Nested Selects
    16) Avoid Nested Loops of Internal Tables
    17) Try  to  use FIELD SYMBOLS.
    18) Try to avoid into Corresponding Fields of
    19) Avoid using Select  Distinct, Use DELETE ADJACENT
    <b>
    Reward Points for sure if you find it useful. </b>
    Regards
    Babu

  • Control Framework: Fatal error - GUI cannot be reached-ALV Grid in Bckgrnd

    I have an ALV grid which dumps in the background. But works fine in the foreground.
    I thought I am not using Control framework anywhere. But I get 'COntrol framework :Fatal error - GU cannot be reached' error.
    I am using a docking container that I have split using a splitter.
    I have no custom container in my screen. What else could be causing the Control framework error ? Any suggestions is appreciated. But please do not tell me to use 'REUSE_ALV*' or Classical reporting
    Here are the PBO modules of my screen and here are my data declarations.
    ALV Data declarations :
    data :gt_sort type lvc_t_sort,
            gr_event_handler TYPE REF TO lcl_event_handler ,
         o_docking type ref to cl_gui_docking_container,"Docking Container
         o_grid type ref to cl_gui_alv_grid,"Grid
         o_split type ref to cl_gui_easy_splitter_container,"Splitter
         o_top_container type ref to cl_gui_container,   "Top Container
         o_bottom_container type ref to cl_gui_container,"Bottom Container
         o_document type ref to cl_dd_document.          "Document
    module status_0100 output.
    if o_docking is initial.
      set pf-status 'ZSTATUS_0100'.
      set titlebar 'ZTITLE_0100'.
    Creating Objects
      perform create_objects.
    Filling top of page
      perform fill_top_of_page.
    Filling the fieldcatalog table
    perform build_fieldcat. "we already got'em
    Displaying the output
      perform display_output.
    endif.
    Here is the Form Create_objects called in the PBO.
    form create_objects .
    Creating Docking Container
      CREATE OBJECT o_docking
             EXPORTING
               RATIO                       = '95'.
      IF sy-subrc eq 0.
    Splitting the Docking container
        CREATE OBJECT o_split
          EXPORTING
           PARENT            = o_docking
           sash_position     = 25 "Position of Splitter Bar (in Percent)
           with_border       = 0. "With Border = 1 Without Border = 0
      Placing the containers in the splitter
        o_top_container = o_split->top_left_container .
        o_bottom_container = o_split->bottom_right_container .
      Creating Grid
        CREATE OBJECT o_grid
          EXPORTING
            i_parent          =  o_bottom_container.
      Creating the document
        CREATE OBJECT o_document
        EXPORTING
            style  = 'ALV_GRID'.
         CREATE OBJECT gr_event_handler .
      ENDIF.
    endform.                    " create_objects
    form fill_top_of_page .
    data : lv_char(255) type c.
    Calling the methods for dynamic text
       CALL METHOD o_document->add_gap
        EXPORTING
          width      = 140.
      CALL METHOD o_document->add_text
        EXPORTING
          text          = 'Plant Attainment Report '
          sap_fontsize  = 'Large'
          sap_color     = cl_dd_area=>list_key_int
          sap_emphasis  = cl_dd_area=>strong. " For bold
    Display the data
      CALL METHOD o_document->display_document
        EXPORTING
           parent             = o_top_container.
    Calling the method of ALV to process top of page
      CALL METHOD o_grid->list_processing_events
        EXPORTING
          i_event_name      = 'TOP_OF_PAGE'
          i_dyndoc_id       = o_document.
    endform.                    " fill_top_of_page
    form display_output .
      gx_variant-report = sy-repid.
      gs_layout-zebra = 'X'.
      gs_layout-sel_mode ='X'.
      gs_layout-cwidth_opt = 'X'.
      call method o_grid->set_table_for_first_display
        exporting
          is_variant      = gx_variant
          i_save          = 'A'
          is_layout       = gs_layout
        changing
          it_fieldcatalog = it_fldcat
          it_outtab       = <gt_tabletotal>.
        IF sy-subrc <> 0.
           MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                       WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        SET HANDLER gr_event_handler->handle_print_top_of_page FOR o_grid .
    endform.                    " display_output 
    Edited by: Shareen Hegde on Jul 23, 2009 5:03 PM (I have no clue why 
    .. doesn't work anymore. My code looks messed up..Sorry folks!

    Nilesh,
    If i put all these create objects inside the      IF CL_GUI_ALV_GRID=>OFFLINE( ) IS INITIAL.   ENDIF , will I be still able to use ,
    call method o_grid->set_table_for_first_display
        exporting
          is_variant      = gx_variant
          i_save          = 'A'
          is_layout       = gs_layout
        changing
          it_fieldcatalog = it_fldcat
          it_outtab       = <gt_tabletotal>.
         in background ? WIll I not get - OBJECTS_OBJREF_NOT_ASSIGNED   erorr ?
    How can I call the set_table_for_first_display without creating the object reference ?
    Here is my creat object routine.
    form create_objects .
    * Creating Docking Container
    IF CL_GUI_ALV_GRID=>OFFLINE( ) .
      CREATE OBJECT o_docking
             EXPORTING
               RATIO                       = '95'.
      IF sy-subrc eq 0.
    * Splitting the Docking container
        CREATE OBJECT o_split
          EXPORTING
           PARENT            = o_docking
           sash_position     = 25 "Position of Splitter Bar (in Percent)
           with_border       = 0. "With Border = 1 Without Border = 0
    *   Placing the containers in the splitter
        o_top_container = o_split->top_left_container .
        o_bottom_container = o_split->bottom_right_container .
    *   Creating Grid
        CREATE OBJECT o_grid
          EXPORTING
            i_parent          =  o_bottom_container.
    *   Creating the document
        CREATE OBJECT o_document
        EXPORTING
            style  = 'ALV_GRID'.
         ENDIF.
         CREATE OBJECT gr_event_handler .
    endif.
    endform.                    " create_objects

  • ALV GRID Display function module giving Run time error

    Hello Experts,
    I have ALV report, In which I am using ALV grid dispaly FM to display the report.
    But when my out table which I am passing to FM is empty that time ALV grid display shows blank ALV report. but when out table is not empty that time  I am getting the Run time error, which shows message "Field symbol has not yet been assigned".
    Can any one please help me out in this.
    Thanks

    TYPES: BEGIN OF type_out,
            col00    TYPE   ytlet-rzzyyproduct,
            col01    TYPE   ytlet-kslvt,
            col02    TYPE   ytlet-kslvt,
            col03    TYPE   ytlet-kslvt,
            col04    TYPE   ytlet-kslvt,
            col05    TYPE   ytlet-kslvt,
            col06    TYPE   ytlet-kslvt,
            col07    TYPE   ytlet-kslvt,
            col08    TYPE   ytlet-kslvt,
            col09    TYPE   ytlet-kslvt,
            col10    TYPE   ytlet-kslvt,
            col11    TYPE   ytlet-kslvt,
            col12    TYPE   ytlet-kslvt,
            col13    TYPE   ytlet-kslvt,
            col14    TYPE   ytlet-kslvt,
            col15    TYPE   ytlet-kslvt,
            col16    TYPE   ytlet-kslvt,
            col17    TYPE   ytlet-kslvt,
            col18    TYPE   ytlet-kslvt,
            col19    TYPE   ytlet-kslvt,
            col20    TYPE   ytlet-kslvt,
            col21    TYPE   ytlet-kslvt,
            col22    TYPE   ytlet-kslvt,
            col23    TYPE   ytlet-kslvt,
            col24    TYPE   ytlet-kslvt,
            col25    TYPE   ytlet-kslvt,
            col26    TYPE   ytlet-kslvt,
            col27    TYPE   ytlet-kslvt,
            col28    TYPE   ytlet-kslvt,
            col29    TYPE   ytlet-kslvt,
            col30    TYPE   ytlet-kslvt,
            col31    TYPE   ytlet-kslvt,
            col32    TYPE   ytlet-kslvt,
            col33    TYPE   ytlet-kslvt,
            col34    TYPE   ytlet-kslvt,
            col35    TYPE   ytlet-kslvt,
            col36    TYPE   ytlet-kslvt,
            col37    TYPE   ytlet-kslvt,
            col38    TYPE   ytlet-kslvt,
            col39    TYPE   ytlet-kslvt,
            col40    TYPE   ytlet-kslvt,
            col41    TYPE   ytlet-kslvt,
            col42    TYPE   ytlet-kslvt,
            col43    TYPE   ytlet-kslvt,
            col44    TYPE   ytlet-kslvt,
          END OF type_out.
    DATA: t_fieldcat   TYPE slis_t_fieldcat_alv,   "Field catelog table
          w_fieldcat   TYPE slis_fieldcat_alv,     "Field catelog Work area
          w_layout     TYPE slis_layout_alv,       "Layout structure
          w_event      TYPE slis_alv_event,        "Event structure
          t_event      TYPE slis_t_event,          "Event structure
          t_sort       TYPE STANDARD TABLE OF slis_sortinfo_alv,
          t_callback_main_user_command  TYPE  slis_formname,
          v_selfield TYPE slis_selfield.
    FIELD-SYMBOLS: <ksl>.
    FORM DISPLAY_REPORT .
    *Prepare Field Catlog
      PERFORM  creat_field_catlog.
    *Set layout
      PERFORM  set_layout.
    *Get Event
      PERFORM get_event.
    *Display Report
      PERFORM display_alv_report.
    ENDFORM.                    " DISPLAY_REPORT
    FORM creat_field_catlog .
      PERFORM add_fields_catlog USING:
           '01'    'RZZYYPRODUCT'     'IT_OUT'    'MPMs' ' ',
           '02'    'KSLVT'     'IT_OUT'    'License Fee' ' ',
           '03'    'KSLVT'     'IT_OUT'    'Ad Sales' ' ',
           '04'    'KSLVT'     'IT_OUT'    'Promo Fees' ' ',
           '05'    'KSLVT'     'IT_OUT'    'Total Ad Sales/Promo' ' ',
           '06'    'KSLVT'     'IT_OUT'    'Other' ' ',
           '07'    'KSLVT'     'IT_OUT'    'Total' ' ',
           '08'    'KSLVT'     'IT_OUT'    'Dom Station' ' ',
           '09'    'KSLVT'     'IT_OUT'    'Basic Cable/Free VOD' ' ',
           '10'    'KSLVT'     'IT_OUT'    'License Fee' ' ',
           '11'    'KSLVT'     'IT_OUT'    'Ad Sales (incl Internet)' ' ',
           '12'    'KSLVT'     'IT_OUT'    'Promo Fees' ' ',
           '13'    'KSLVT'     'IT_OUT'    'Ad Sales & Promo Fees' ' ',
           '14'    'KSLVT'     'IT_OUT'    'Foreign' ' ',
           '15'    'KSLVT'     'IT_OUT'    'Pay TV' ' ',
           '16'    'KSLVT'     'IT_OUT'    'Other' ' ',
           '17'    'KSLVT'     'IT_OUT'    'Total' ' ',
           '18'    'KSLVT'     'IT_OUT'    'Home Entertainment' ' ',
           '19'    'KSLVT'     'IT_OUT'    'SPTI' ' ',
           '20'    'KSLVT'     'IT_OUT'    'All Other Divisions' ' ',
           '21'    'KSLVT'     'IT_OUT'    'Total' ' ',
           '22'    'KSLVT'     'IT_OUT'    'Total Revenue' ' ',
           '23'    'KSLVT'     'IT_OUT'  'PV Net Down & Producers Share' '',
           '24'    'KSLVT'     'IT_OUT'    'Total Net Revenue' ' ',
           '25'    'KSLVT'     'IT_OUT'    'Development Expense' ' ',
           '26'    'KSLVT'     'IT_OUT'    'SOP Deficits' ' ',
           '27'    'KSLVT'     'IT_OUT'    'Amortization' ' ',
           '28'    'KSLVT'     'IT_OUT'    'Other COS ' ' ',
           '29'    'KSLVT'     'IT_OUT'    'Total COS' ' ',
           '30'    'KSLVT'     'IT_OUT'    'Profit Before Releasing' ' ',
           '31'    'KSLVT'     'IT_OUT'    'Gross Profit %' ' ',
           '32'    'KSLVT'     'IT_OUT'    'SPT' ' ',
           '33'    'KSLVT'     'IT_OUT'    'Home Entertainment' ' ',
           '34'    'KSLVT'     'IT_OUT'    'SPTI' ' ',
           '35'    'KSLVT'     'IT_OUT'    'All Other Divisions' ' ',
           '36'    'KSLVT'     'IT_OUT'    'Other' ' ',
           '37'    'KSLVT'     'IT_OUT'    'Total' ' ',
           '38'    'KSLVT'     'IT_OUT'    'Gross Profit' ' ',
           '39'    'KSLVT'     'IT_OUT'    'SPT' ' ',
           '40'    'KSLVT'     'IT_OUT'    'Home Entertainment' ' ',
           '41'    'KSLVT'     'IT_OUT'    'SPTI' ' ',
           '42'    'KSLVT'     'IT_OUT'    'All Other Divisions' ' ',
           '43'    'KSLVT'     'IT_OUT'    'Other' ' ',
           '44'    'KSLVT'     'IT_OUT'    'Total' ' ',
           '45'    'KSLVT'     'IT_OUT'    'Net Margin' ' '.
    ENDFORM.                    " CREAT_FIELD_CATLOG
    *&      Form  ADD_FIELDS_CATLOG
          Filling of field Catlog
    FORM add_fields_catlog  USING    p_colpos
                                     p_fildname
                                     p_tabname
                                     p_fildtext
                                     p_ndisplay.
      w_fieldcat-row_pos       = '1'.
      w_fieldcat-col_pos       = p_colpos.
      w_fieldcat-fieldname     = p_fildname.
      w_fieldcat-tabname       = p_tabname.
      w_fieldcat-reptext_ddic  = p_fildtext.
      w_fieldcat-no_out        = p_ndisplay.
      APPEND w_fieldcat TO t_fieldcat.
      CLEAR: w_fieldcat.
    ENDFORM.                    " ADD_FIELDS_CATLOG
    *&      Form  SET_LAYOUT
          Set Layout
    FORM set_layout .
      w_layout-colwidth_optimize = 'X'.
    ENDFORM.                    " SET_LAYOUT
    *&      Form  GET_EVENT
          text
    FORM get_event .
      w_event-name = 'TOP-OF-PAGE'.
      w_event-form = 'F_TOP-OF_PAGE'.
      APPEND w_event TO t_event.
    ENDFORM.                    " GET_EVENT
    *&      Form  TOP-OF-PAGE
          Top of Page
    FORM top-of-page.
      DATA : t_list_commentry   TYPE slis_t_listheader,
               w_header           TYPE slis_listheader,
               lv_text(90)        TYPE c,
               l_text(90)         TYPE c,
               lv_rundate(10)     TYPE c,
               lv_runtime(10)     TYPE c.
      CONSTANTS: c_space(2) TYPE c VALUE '  ',
                 c_space2(6) TYPE c VALUE '      '.
      w_header-typ  = 'S'.
      w_header-key  = 'Program:'.
      w_header-info = sy-repid.
      APPEND w_header TO t_list_commentry.
      WRITE: sy-datum TO lv_rundate MM/DD/YYYY.
      WRITE: sy-uzeit TO lv_runtime USING EDIT MASK '__:__:__'.
    CLEAR w_header.
    w_header-typ  = 'S'.
    w_header-key  = text-021.
    w_header-info = lv_rundate.
    APPEND w_header TO t_list_commentry.
      CLEAR: w_header.
      w_header-typ  = 'S'.
      w_header-key  = 'User Id'.
      w_header-info = sy-uname.
      APPEND w_header TO t_list_commentry.
      CLEAR: w_header.
      w_header-typ  = 'S'.
      w_header-key  = 'Run Date'.
      w_header-info = lv_rundate.
      APPEND w_header TO t_list_commentry.
      CLEAR: w_header.
      w_header-typ  = 'S'.
      w_header-key  = 'Run Time'.
      w_header-info = lv_runtime.
      APPEND w_header TO t_list_commentry.
      CLEAR: w_header.
      w_header-typ  = 'H'.
      w_header-key  = 'order'.
      w_header-info = 'MCR Report'.
      APPEND w_header TO t_list_commentry.
      CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
        EXPORTING
          it_list_commentary = t_list_commentry.
    ENDFORM.                    "TOP-OF-PAGE
    FORM display_alv_report .
      CONSTANTS : gc_save TYPE c VALUE 'A'. "Save Layout
    t_callback_main_user_command  = c_user_command.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
       EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
         i_callback_program                = sy-repid
      I_CALLBACK_PF_STATUS_SET          = ' '
        i_callback_user_command           = t_callback_main_user_command
         i_callback_top_of_page            = 'TOP-OF-PAGE'
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
         is_layout                         = w_layout
         it_fieldcat                       = t_fieldcat
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
         i_save                            = gc_save
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        TABLES
          t_outtab                          = it_out
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
       ENDIF.

  • Runtime Error - TABLE_FREE_IN_LOOP in editable ALV GRID

    While modifying editable ALV Grid, (CL_GUI_ALV_GRID) I am getting an unexpected dump as follows -
    "Runtime Error          TABLE_FREE_IN_LOOP".
       In a Editable ALV grid whenever new row is added using standard append row button, And while saving, i check for any initial values, in that case iam displaying a warning message. So after that when i try to modify the row, and press enter key, Iam getting this dump "TABLE_FREE_IN_LOOP".
    Can you please help on this regard.
    Thanks in advance..
    Best regards,
    Prasad.

    Hello Krishna
    take a additional internal table which is exactly of same type of the internal table which you want to modify . try modifying the second internal table. and then proceed for db update(if required).
    Regards,
    Suvendu

Maybe you are looking for