Problem in edittable ALV grid

Hi All,
When I click on save after editting.I have a pop-up message having two buttons-yes and cancel.When I clcik on save,data get updated.But when I click on cancel,I want that The alv grid display page should return to previous values which were there before editting.
Please answer to my query.
Thanks and Regards,
Aman

Hi Try this Code
FORM list_display .
  DATA: l_exit_by_caller(1) TYPE c,
        ls_exit_by_user     TYPE slis_exit_by_user,
        l_answer(1)         TYPE c.
  DO.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        i_callback_program       = sy-cprog
        i_callback_pf_status_set = 'F_SET_PF_STATUS'
        i_callback_user_command  = 'F_USER_COMMAND'
        i_callback_top_of_page   = 'F_TOP_OF_PAGE'
        it_fieldcat              = itab_fieldcat
        is_layout                = wa_layout
        i_save                   = 'A'
        it_events                = itab_events
      IMPORTING
        e_exit_caused_by_caller  = l_exit_by_caller
        es_exit_caused_by_user   = ls_exit_by_user
      TABLES
        t_outtab                 = itab_overall
      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.
    ELSE.
      IF ls_exit_by_user-back = 'X' OR
         ls_exit_by_user-exit = 'X' OR
         ls_exit_by_user-cancel = 'X'.
        IF itab_overall IS INITIAL.
          LEAVE LIST-PROCESSING.
        ENDIF.
        CALL FUNCTION 'POPUP_TO_CONFIRM'
          EXPORTING
            text_question         = text-prn
            text_button_1         = text-yes
            text_button_2         = text-ext
            display_cancel_button = ' '
          IMPORTING
            answer                = l_answer
          EXCEPTIONS
            text_not_found        = 1
            OTHERS                = 2.
        IF sy-subrc <> 0 OR l_answer NE '1'.
          EXIT.
        ENDIF.
      ENDIF.
    ENDIF.
  ENDDO.
Thanks
Pavan

Similar Messages

  • Problem in data format of quantity in edittable alv grid

    Hi All,
    In edittable alv grid,I have a quantity field which has been specified as type p in program code.
    In table i have taken datatype as dec and 4 decimal palces.
    when i put value in edittable grid as 255.It changes it to .0255
    Also if i take value as 2.58,it gives error and it changes it to .0258
    Please help me to solve my query.
    Thanks and Regards,
    Aman

    Hi..
    I have taken the field as type char and then taken it in p with dec 4.It is working correct.But it should take 5 char only.whereas if i put more than 5 decimals it is also working fine which is an error.
    Please help em to solve my query.
    Regards,
    Aman

  • Problem in displaying Alv grid output  using oops........

    hi,
    i have two problems in displaying ALV grid output Using Oops.
    1) How to modify the fieldcatalog after we getting a field catalog using general FM.
    2) initialy it is displaying 13 fields but there are 63 fields .
       eventhough we chage the layout to 63 fields it is displaying only 13 fields , these 13 fields may be different based on our selection but count  of displayed fileds are same . how can display 63 fields at a time .

    Hi,
    You can chnage using below code:
    loop at gt_fieldcat.
    if <gt_fieldcat-field_name> = 'FIELDNAME'.
    endif.
    modify gt_fieldcat.
    clear gt_fieldcat.
    endloop.
    Make sure that all the field should not have no_out = 'X' and tech = 'X'.
    Thanks,
    Sriram Ponna.

  • Facing problem while downloading ALV grid Output into Excel

    Hi Guys,
    I am facing problem while downloading ALV grid Output into Excel.
    It is downloading into excel, but all character columns first and next all quantity columns it is displaying. But I need columns order as it is in the grid.
    If I take all columns as characters it works fine. But it will be problem for calculating total, subtotals of quantity columns
    Can someone help me regarding this
    thanks for your help

    Hi,
    Open up Excel on your desktop. Goto Tools > Macro > Security.
    Make sure that your security is set to Medium (or less). SAP uses OLE automation to run the Excel instance and in Office 2003 (for example), Microsoft has increased their default security setting to High. With the High setting, the output to Excel fails.
    Was this your problem? Don't forget those points, either.
    check with this wetther it is solved or not.
    Regards,
    sana.

  • Urgent : Problem with Editable  ALV Grid  for Quantity and Currency Fields

    Hi All,
    I am using Editable ALV Grid display and have quantity and value as editable fields in the display.
    When user changes these values these values are not changing properly .
    For the quantity field the domain is MENG13 with 3 deciamal places and here  if we enter 500 it takes it as 0.500   .
    The same problem is for the currency field. Here the Domain is WERT7 with 3 decimal places.
    Here also it takes last 2 digits after decimal places by default.
    Please advice how to get proper values in this case from ALV editable fields.
    Thanks and Regards
    Harshad
    Edited by: Harshad Rahirkar on Dec 25, 2007 7:39 AM

    for all the currency field , it will display like that only.
    u have to manipulate uin program before displaying.
    if they are giving 500, in program multiply with 100 and move it to table.
    when u are getting from table, divinde and display.
    this is what I am doing.
    Reward if helpfull.

  • Problem: User has problems to export ALV Grid to Excel...

    Hello experts,
    I have a very strange problem with an single user: when she tries to export ALV Grid data from SAP into Excel by List/Export/Spreadsheet, she's only able to export this to an xml-based file on her local client, every other user gets the popup to choose the spreadsheet format (XXL...).
    What I did so far:
    - Look up Excel Makro Security --> the same as on other desktops
    - SAP GUI Patch Level --> the same as on other desktops
    - Test with an different user on her desktop on SAP Report S_ALR_87012284 --> it worked perfectly
    - User parameters are the same as for the test user
    - Security regarding ALV is the same (S_GUI ACTVT = 61...)
    Has there ever been a similar problem to anyone else?
    Many thanks in advance for your feedback!

    Hi ,
    This problem looks very weired. Just try running that FM from SE37 from the same system and see that what is happening there.... if the problem is similar then it is not the problem of your report and some patch may be missing in that system.

  • Problem while downloading ALV GRID Output to Local Spreadsheet(Excel) File.

    Hi,
    I am displaying output in ALV GRID. While downloading the output to Excel file using "Local File" option provided by ALV.
    But while downloading the columns and their respective values are coming in single column vertially of excel file instead of horizontal.
    e.g. Grid output is as follows.
    F1 F2
    V1 V2
    (F represents Field Title, and V represent Value)
    Downloaded Excel File content:-
    F1
    F2
    V1
    V2
    Please help.

    Hi ,
    Please use below FM :
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    filename = 'C:\Documents and Settings\akshayr2403\Desktop\docs\rep.xls'
    FILETYPE = 'WK1'
    WRITE_FIELD_SEPARATOR = 'X'
    tables
    data_tab = it_vbak
    EXCEPTIONS
    FILE_WRITE_ERROR = 1
    NO_BATCH = 2
    GUI_REFUSE_FILETRANSFER = 3
    INVALID_TYPE = 4
    NO_AUTHORITY = 5
    UNKNOWN_ERROR = 6
    HEADER_NOT_ALLOWED = 7
    SEPARATOR_NOT_ALLOWED = 8
    FILESIZE_NOT_ALLOWED = 9
    HEADER_TOO_LONG = 10
    DP_ERROR_CREATE = 11
    DP_ERROR_SEND = 12
    DP_ERROR_WRITE = 13
    UNKNOWN_DP_ERROR = 14
    ACCESS_DENIED = 15
    DP_OUT_OF_MEMORY = 16
    DISK_FULL = 17
    DP_TIMEOUT = 18
    FILE_NOT_FOUND = 19
    DATAPROVIDER_EXCEPTION = 20
    CONTROL_FLUSH_ERROR = 21
    OTHERS = 22
    IF sy-subrc 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Also, if your problem still persist, please refer SAP's demo code on ALV "BCALV_FULLSCREEN_DEMO".
    There are many sample codes available, what you need to do is just go to SE38 and put BCALV* and do F4.
    I hope this will help you.
    Regards,
    Rahul Mahajan

  • Edittable alv grid

    hi,
    i have two alv grids in one screen.both  having one field as edittable.how can i know which grid the user editted.

    Hi Reshma,
    Below is the sample code for the Editable ALV.
    REPORT  ZDEMO_ALVGRID_EDIT                 .
    TABLES:     ekko.
    TYPE-POOLS: slis.                                 "ALV Declarations
    *Data Declaration
    TYPES: BEGIN OF t_ekko,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
      statu TYPE ekpo-statu,
      aedat TYPE ekpo-aedat,
      matnr TYPE ekpo-matnr,
      menge TYPE ekpo-menge,
      meins TYPE ekpo-meins,
      netpr TYPE ekpo-netpr,
      peinh TYPE ekpo-peinh,
      field_style  TYPE lvc_t_styl, "FOR DISABLE
    END OF t_ekko.
    DATA: it_ekko TYPE STANDARD TABLE OF t_ekko INITIAL SIZE 0,
          wa_ekko TYPE t_ekko.
    *ALV data declarations
    DATA: fieldcatalog TYPE slis_t_fieldcat_alv WITH HEADER LINE.
    DATA: it_fieldcat TYPE lvc_t_fcat,     "slis_t_fieldcat_alv WITH HEADER LINE,
          wa_fieldcat TYPE lvc_s_fcat,
          gd_tab_group TYPE slis_t_sp_group_alv,
          gd_layout    TYPE lvc_s_layo,     "slis_layout_alv,
          gd_repid     LIKE sy-repid.
    *Start-of-selection.
    START-OF-SELECTION.
      PERFORM data_retrieval.
      PERFORM set_specific_field_attributes.
      PERFORM build_fieldcatalog.
      PERFORM build_layout.
      PERFORM display_alv_report.
    *&      Form  BUILD_FIELDCATALOG
    *       Build Fieldcatalog for ALV Report
    FORM build_fieldcatalog.
      wa_fieldcat-fieldname   = 'EBELN'.
      wa_fieldcat-scrtext_m   = 'Purchase Order'.
      wa_fieldcat-col_pos     = 0.
      wa_fieldcat-outputlen   = 10.
      wa_fieldcat-emphasize   = 'X'.
      wa_fieldcat-key         = 'X'.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'EBELP'.
      wa_fieldcat-scrtext_m   = 'PO Item'.
      wa_fieldcat-col_pos     = 1.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'STATU'.
      wa_fieldcat-scrtext_m   = 'Status'.
      wa_fieldcat-col_pos     = 2.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'AEDAT'.
      wa_fieldcat-scrtext_m   = 'Item change date'.
      wa_fieldcat-col_pos     = 3.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'MATNR'.
      wa_fieldcat-scrtext_m   = 'Material Number'.
      wa_fieldcat-col_pos     = 4.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'MENGE'.
      wa_fieldcat-scrtext_m   = 'PO quantity'.
      wa_fieldcat-col_pos     = 5.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'MEINS'.
      wa_fieldcat-scrtext_m   = 'Order Unit'.
      wa_fieldcat-col_pos     = 6.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'NETPR'.
      wa_fieldcat-scrtext_m   = 'Net Price'.
      wa_fieldcat-edit        = 'X'. "sets whole column to be editable
      wa_fieldcat-col_pos     = 7.
      wa_fieldcat-outputlen   = 15.
      wa_fieldcat-datatype     = 'CURR'.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
      wa_fieldcat-fieldname   = 'PEINH'.
      wa_fieldcat-scrtext_m   = 'Price Unit'.
      wa_fieldcat-col_pos     = 8.
      APPEND wa_fieldcat TO it_fieldcat.
      CLEAR  wa_fieldcat.
    ENDFORM.                    " BUILD_FIELDCATALOG
    *&      Form  BUILD_LAYOUT
    *       Build layout for ALV grid report
    FORM build_layout.
    * Set layout field for field attributes(i.e. input/output)
      gd_layout-stylefname = 'FIELD_STYLE'.
      gd_layout-zebra             = 'X'.
    ENDFORM.                    " BUILD_LAYOUT
    *&      Form  DISPLAY_ALV_REPORT
    *       Display report using ALV grid
    FORM display_alv_report.
      gd_repid = sy-repid.
    *  call function 'REUSE_ALV_GRID_DISPLAY'
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
           EXPORTING
                i_callback_program      = gd_repid
    *            i_callback_user_command = 'USER_COMMAND'
                is_layout_lvc               = gd_layout
                it_fieldcat_lvc             = it_fieldcat
                i_save                  = 'X'
           TABLES
                t_outtab                = it_ekko
           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.
    ENDFORM.                    " DISPLAY_ALV_REPORT
    *&      Form  DATA_RETRIEVAL
    *       Retrieve data form EKPO table and populate itab it_ekko
    FORM data_retrieval.
      SELECT ebeln ebelp statu aedat matnr menge meins netpr peinh
       UP TO 10 ROWS
        FROM ekpo
        INTO  CORRESPONDING FIELDS OF TABLE it_ekko.
    ENDFORM.                    " DATA_RETRIEVAL
    *&      Form  set_specific_field_attributes
    *       populate FIELD_STYLE table with specific field attributes
    form set_specific_field_attributes .
      DATA ls_stylerow TYPE lvc_s_styl .
      DATA lt_styletab TYPE lvc_t_styl .
    * Populate style variable (FIELD_STYLE) with style properties
    * The NETPR field/column has been set to editable in the fieldcatalog...
    * The following code sets it to be disabled(display only) if 'NETPR'
    * is gt than 10.
      LOOP AT it_ekko INTO wa_ekko.
        IF wa_ekko-netpr GT 10.
          ls_stylerow-fieldname = 'NETPR' .
          ls_stylerow-style = cl_gui_alv_grid=>mc_style_disabled.
                                                 "set field to disabled
          APPEND ls_stylerow  TO wa_ekko-field_style.
          MODIFY it_ekko FROM wa_ekko.
        ENDIF.
      ENDLOOP.
    endform.                    " set_specific_field_attributes
    Thanks,
    Chidanand

  • Edittable ALV grid using CL_GUI_ALV_GRID supported in ERP 4.7

    Hi..
    I like to know whether EDItable ALV grid is Supported in  version 4.7 .....
    ..Thanks & Regards
    Ashish

    Hi..
    1. To make the whole grid editable: pass EDIT field for layout structure(lvc_s_layo) as 'X', in this way your whole grid would be editable.
    2. To make few fields editable: pass EDIT field for catalog(lvc_t_fcat) for the relevant fields as 'X', your grid with those relevant fields will be editable.
    3. To make columns editable: This is bit tricky...you have to include a field with type LVC_T_STYL(this is a table type) in your internal table which is used for final display, you have to append all those fields in this table type field and pass the field style the value as "cl_gui_alv_grid=>mc_style_enabled"(this means making the field ediable)
    Regards,
    Mark

  • Total problem in Exporting ALV GRID to Excel

    Hi all,
    I have manipulated the Total of ALV Grid by using GET_SUBTOTALS and REFRESH method of CL_GUI_ALV_GRID. The ALV Output is also correct. When i export to Excel,only the Original total is displaying not the calculated one. How to download the exact output which is displaying in the ALV Grid to Excel.
    Please help me out to solve this.
    Thanks,
    Ramesh

    DEAR,
    AS U WANT UPLOAD WITH THE SUB TOTAL YOU TRY THIS.
    FIRST to get subtotal in ALV output you select at least one column of total and then press ctrl + F6 . u will see the sub total .
    and now how to download it so press  ctrl + shift + F9 .
    now screen appears and select second option ie spreadsheet and press enter
    now a screen appear  in wich u have to give file name.
    so double click on search button of file name . click on desktop  give ur file name as u want suppose zreport u have given.
    and save type = excel file.
    now save it and then generate it your output bytes will be transmitted .
    now u can see in your desktop in your file name . ur output with subtotal.
    regards
    navin

  • Problem in downloading ALv Grid output

    Hi Friends,
       I've made an ALV report using the FM: REUSE_ALV_GRID_DISPLAY. Now when I try to download the output in excel using the path:LIST->EXPORT->EXCELSHEET, the 'excelsheet' option is showing as disabled. This is happening only for this report, while I'm successfully ablw to do this for other ALV grid reports. I'm on ECC6.0 & trying to download the output in XXL format.Kindly help me as what exactly needs to looked into.
    Thanks:
    Gaurav

    hi,
    Think that you does n't have authorization for that (auth group "J_1IDNLD").
    You can try to do with another user which is ahving authorisation.
    Get authorization for above grp.    Hope it will helps you.       Thanks!
    Kishore

  • Problem double click ALV GRID

    Hi folks,
    I'm trying to get an ALV GRID to make something if I double click one line, this is my code:
    FORM create_alv.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
                 i_callback_program = sy-repid
                 I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
                 is_layout          = gs_layout
                 it_fieldcat        = gt_itab_catalog[]
                 i_default          = 'X'
                 i_save             = 'A'
                 it_events          = events[]
            TABLES
                 t_outtab           = itab_all
            EXCEPTIONS
                 program_error      = 1
                 OTHERS             = 2.
      IF sy-subrc <> 0.
      ENDIF.
    ENDFORM. 
    FORM USER_COMMAND USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
      break-point.
      CASE r_ucomm.
        WHEN '&IC1'.
          READ TABLE itab_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
    *      PERFORM build_fieldcatlog_ekpo.
    *      PERFORM event_call_ekpo.
    *      PERFORM populate_event_ekpo.
    *      PERFORM data_retrieval_ekpo.
    *      PERFORM build_listheader_ekpo USING it_listheader.
    *      PERFORM display_alv_ekpo.
      ENDCASE.
    ENDFORM. "user_command
    Why when I'm double clicking the form USER_COMMAND isn't being executed. The break-point I set in there doesn't get executed.
    Can anyone tell me if i'm missing something.
    Thanks for your help in advance.
    Regards,
    Gilberto Li

    Hi again,
    Ok here's the code:
    FORM init_catalog.
    * SOCIEDAD
        gt_itab_catalog-fieldname = 'BUKRS'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Sociedad'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 1.
        gt_itab_catalog-outputlen = 10.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * CONTRATO
        gt_itab_catalog-fieldname = 'EBELN'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Contrato Marco'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 2.
        gt_itab_catalog-outputlen = 15.
        gt_itab_catalog-hotspot = 'X'.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * CLASE DE DOC
        gt_itab_catalog-fieldname = 'BSART'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Clase de Contrato'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 3.
        gt_itab_catalog-outputlen = 15.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * RIGE DESDE
        gt_itab_catalog-fieldname = 'KDATB'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Rige desde'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 4.
        gt_itab_catalog-outputlen = 10.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * VENCE
        gt_itab_catalog-fieldname = 'KDATE'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Vence el'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 5.
        gt_itab_catalog-outputlen = 10.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * FECHA DE CREACION
        gt_itab_catalog-fieldname = 'AEDAT'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Creado el'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 6.
        gt_itab_catalog-outputlen = 10.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * PROVEEDOR
        gt_itab_catalog-fieldname = 'LIFNR'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Proveedor'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 7.
        gt_itab_catalog-outputlen = 10.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * NOMBRE DE PROVEEDOR
        gt_itab_catalog-fieldname = 'NAME1'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Nombre Proveedor'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 8.
        gt_itab_catalog-outputlen = 20.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * CED JURIDICA
        gt_itab_catalog-fieldname = 'STCD1'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Cédula Jurídica'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 9.
        gt_itab_catalog-outputlen = 10.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * MATERIAL
        gt_itab_catalog-fieldname = 'MATNR'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Material'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 10.
        gt_itab_catalog-outputlen = 18.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * NOMBRE DE MATERIAL
        gt_itab_catalog-fieldname = 'MAKTX'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Desc. Material'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 11.
        gt_itab_catalog-outputlen = 20.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * MONTO
        gt_itab_catalog-fieldname = 'NETPR'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Monto'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 12.
        gt_itab_catalog-outputlen = 16.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    * MONEDA
        gt_itab_catalog-fieldname = 'WAERS'.
        gt_itab_catalog-tabname = 'ITAB_ALL'.
        gt_itab_catalog-seltext_l  = 'Moneda'.
        gt_itab_catalog-just = 'L'.
        gt_itab_catalog-col_pos = 13.
        gt_itab_catalog-outputlen = 10.
        APPEND gt_itab_catalog.
        CLEAR gt_itab_catalog.
    ENDFORM.                    "init_catalog
    FORM init_layout.
      gs_layout-zebra = 'X'.
      gs_layout-f2code = '&amp;ETA'.
      gs_layout-detail_popup = 'X'.
      gs_layout-no_totalline = 'X'.
    ENDFORM.  "init_layout
    FORM listado.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
            EXPORTING
                 i_callback_program = g_repid
                 I_CALLBACK_USER_COMMAND = 'USER_COMMAND'
                 it_fieldcat        = gt_itab_catalog[]
            TABLES
                 t_outtab           = itab_all
            EXCEPTIONS
                 program_error      = 1
                 OTHERS             = 2.
      IF sy-subrc <> 0.
      ENDIF.
    ENDFORM. 
    FORM USER_COMMAND USING r_ucomm LIKE sy-ucomm
    rs_selfield TYPE slis_selfield.
      break-point.
      CASE r_ucomm.
        WHEN '&IC1'.
          READ TABLE itab_ekko INTO wa_ekko INDEX rs_selfield-tabindex.
    *      PERFORM build_fieldcatlog_ekpo.
    *      PERFORM event_call_ekpo.
    *      PERFORM populate_event_ekpo.
    *      PERFORM data_retrieval_ekpo.
    *      PERFORM build_listheader_ekpo USING it_listheader.
    *      PERFORM display_alv_ekpo.
      ENDCASE.
    ENDFORM. "user_command
      PERFORM init_catalog.
      PERFORM init_layout.
      PERFORM listado.
    I just post the ALV GRID creation code.
    Hope you guys can guide me through this.
    Thanks again.
    Regards,
    Gilberto Li

  • Problem with Interactive ALV GRID

    Hi Friends,
    I am using CL_GUI_ALV_GRID for my ALV.
    IT is an interactive report.
    On double click of First grid, i am displaying the secondary ALV.
    Problem 1.
    When i come back from Secondary to First List, click a different row and go to Secondary List, the secondary list is still showing the previous records? what could be the problem. I have used
    +CALL METHOD cl_gui_cfw=>flush.
          lgrid_200->refresh_table_display(
                            EXPORTING  is_stable = wa_stable ).
          REFRESH it_bcont_sec. -> Internal table for secondary ALV
          SET SCREEN 0.
          LEAVE SCREEN. +
    Problem 2.
    When i come back from secondary list to primary list, i am still able to see the secondary list in the background. How can i overcome this?
    I wrote
    +      SET SCREEN 0.
          LEAVE SCREEN +
    Any clue or help is highly appreciated.
    Thanks,
    Ajay

    I am using DoubleClick to jump to secondary ALV.
    This is my code in Handle Double Click method:
      READ TABLE it_bcont_count INTO wa_bcont_count INDEX p_e_row-index.
      IF sy-subrc EQ 0.
        populate Internal table for secondary alv in Screen 200
      ENDIF.
      IF NOT it_bcont_sec IS INITIAL.
        CALL SCREEN 200.
      ENDIF.
    Edited by: ajay matam on Feb 25, 2011 4:27 PM

  • Problem in format of quantity in alv grid

    Hi All,
    In edittable alv grid,I have a quantity field which has been specified ad type p in program code.
    In table i have taken the data type as dec with 4 decimals.
    when i put value in edittable grid as 255.It changes it to .0255
    Also if i take value as 2.58,it gives error and it changes it to .0258
    Please help me to solve my query.
    Thanks and Regards,
    Aman

    Hi,
    clear afield.
      afield-fieldname = 'VERME'.
      afield-ref_tabname = 'LQUA'.
      *afield-qfieldname = 'MEINS'.*
      append afield to xfield.
    Try this !!
    Edited by: Raj on May 6, 2008 6:15 PM

  • ALV  Grid downloading problem

    Hi expert,
      I got problem while downloading ALV GRID ouput to any local file.  The  output contains two records.  but while downloading  no records will be downloaded. only field headings are downloaded.  What is the problem.
    Pls help me to do.
    Thanks
    Murugan Arumugam

    I would suggest you add an additional button to the ALV grid toolbar. When the user clicks on this button you call in your event handler method for USER_COMMAND the method CL_GUI_FRONTEND_SERVICES=>GUI_DOWNLOAD with the entire itab.
    Or
    Set the NO_OUT as 'X' in your fieldcatalog for the particular field.
    Reward points if useful

Maybe you are looking for