Edit the field in an alv report, also save the changes.

Hi Everyone,
    I have made one interactive ALV report using function
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
also i had provided the code to edit a particular col.
fs_fieldcat-fieldname = 'AENAM'.
  fs_fieldcat-tabname = 't_mara'.
  fs_fieldcat-seltext_m = 'Changed by'.
  fs_fieldcat-emphasize = 'X'.
  fs_fieldcat-edit = 'X'.
  APPEND fs_fieldcat TO t_fieldcat.
  CLEAR fs_fieldcat.
now i want to make changes in the AENAM field and save the changes done back on the database table MARA.
pls, if anyone can provide me some assitance  on how to save the changes on the alv.
Regards
Ravi Aswani.

When SAVE Using the User_command handle the Changed records, and modify the Material using BAPI.
Just check this following code sample. For this you need to handle to events one PF-STATUS and other USER_COMMAND. see the below comments.
REPORT  zalv_edit.
TYPE-POOLS: slis.
DATA: x_fieldcat  TYPE slis_fieldcat_alv,
      it_fieldcat TYPE slis_t_fieldcat_alv.
data: BEGIN OF itab OCCURS 0,
        vbeln LIKE vbak-vbeln,
        posnr LIKE vbap-posnr,
        kwmeng LIKE vbap-kwmeng,
      END OF itab.
SELECT vbeln
       posnr
       kwmeng
  FROM vbap
  UP TO 20 ROWS
  INTO TABLE itab.
x_fieldcat-fieldname = 'VBELN'.
x_fieldcat-seltext_l = 'VBELN'.
x_fieldcat-hotspot = 'X'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 1.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
x_fieldcat-fieldname = 'POSNR'.
x_fieldcat-seltext_l = 'POSNR'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 2.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
x_fieldcat-fieldname = 'KWMENG'.
x_fieldcat-tabname = 'ITAB'.
x_fieldcat-col_pos = 3.
x_fieldcat-input = 'X'.
x_fieldcat-edit = 'X'.
APPEND x_fieldcat TO it_fieldcat.
CLEAR x_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    i_callback_program       = sy-repid
    i_callback_pf_status_set = 'STATUS'
    i_callback_user_command  = 'USER_COMMAND'
    it_fieldcat              = it_fieldcat
  TABLES
    t_outtab                 = itab
  EXCEPTIONS
    program_error            = 1
    OTHERS                   = 2.
IF sy-subrc NE 0.
  MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
  WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
*&      Form  STATUS
*       PF-STATUS
FORM status USING p_extab TYPE slis_t_extab.
  "Set the Button using the staus
  "Copy the Standard status from the program SAPLKKBL status
  " STANDARD using SE41, and use that here.
  "Pf status
  SET PF-STATUS 'STATUS' EXCLUDING p_extab.
ENDFORM. " STATUS
*&      Form  USER_COMMAND
*       USER_COMMAND
FORM user_command USING r_ucomm LIKE sy-ucomm
                        rs_selfield TYPE slis_selfield.
  DATA: gd_repid LIKE sy-repid,
        ref_grid TYPE REF TO cl_gui_alv_grid.
  IF ref_grid IS INITIAL.
    CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
      IMPORTING
        e_grid = ref_grid.
  ENDIF.
  IF NOT ref_grid IS INITIAL.
    CALL METHOD ref_grid->check_changed_data .
  ENDIF.
  CASE r_ucomm.
    WHEN 'SAVE'.
      "Here you will get the data(along with modified rows/data)
      "Filter the modified rows and update to DB using BAPI/BDC
      "Accordingly
  ENDCASE.
  rs_selfield-refresh = 'X'.
ENDFORM. "USER_COMMAND

Similar Messages

  • Tool Tip Text for field values in ALV report

    Hi,
    How to get the tool tip text for the field values in ALV report.
    Thanks & Regards,
    Pallavi.

    Hi,
    In fieldcatalog specify the TOOLTIP.
    <b>
    LVC_S_FCAT-TOOLTIP
    </b>
    In this speicfyteh tooltip you want.
    Then append this to the fieldcatalog.
    Hope this solves ur problem.

  • To capture the selected rows along with edited field contents in alv report

    Dear All,
             I do have requirement where, in alv report output one field is editable and need to save the content of the edited field along with the selected rows.
             For example If there are 10 records displayed in the alv output with 20 fields.
    Out of this 20 fields one field (say XYZ) is editable. Also i have already created a new pushbutton (say ABC) on alv output. Now in the alv output if we maintain some value in the field (XYZ ) for the 2nd and 4th record and select this two records, and when clicked on the pushbutton (ABC) it has to update the DB table.
          I am using the Func Module  'REUSE_ALV_GRID_DISPLAY'. 
          Your early reply with sample code would be appreciated.
    Thanks in Advance.

    HI Naveen ,
    There is an import parameter "i_callback_program" in the function module,
    plz pass the program name to it.
    Capture the command by passing a field of type sy-ucomm to "I_CALLBACK_USER_COMMAND ".  Check the returned command and
    and program a functionality as desired.
    u can try the event double_click or at line selection. there u can use READLINE command to c if the line has been selected.
    In case it is , process the code segment.
    Regards
    Pankaj

  • How to send the edited output fields of an ABAP report into internal table

    Hi,
    I had edited the output fields of an ALV GRID report now how can i again update the fields of the internal table with this edited new data .
    Please suggest me if any method or FM exists for this.
    Thanks in advance
    With Regards
    Ajay

    hi,
    you have to use the following code in the user command
    *&      Form  command
    *       TO HANDLE USER ACTIONS AGAINST PF-STATUS
    *      -->UCOMM      text
    *      -->SELFIELD   text
    FORM COMMAND USING UCOMM LIKE SY-UCOMM SELFIELD TYPE SLIS_SELFIELD.
      DATA : LV_OKCODE TYPE SY-UCOMM.
      LV_OKCODE = UCOMM.
      CASE LV_OKCODE.
        WHEN 'PROCESS'. "button
               selfield-refresh = 'X'.
      ENDCASE.
    ENDFORM.                    "command
    hope this helps
    Regards
    Ritesh

  • How to display the fields using field catelog in ALV Report

    Hi,
    I have rquiremrnt in ALV report.I would need to add the new fileld in the ALV output screen.I have added the field but its appearing in the layout set but not directly displaying in the output screen.
    I have written the below logic for field catelog.
    CLEAR wa_fieldcatalog.
      wa_fieldcatalog-fieldname   = 'LOGGR'.
      wa_fieldcatalog-ref_tabname = 'MARC'.
      wa_fieldcatalog-col_pos     = l_pos.
      wa_fieldcatalog-outputlen   = 13.
       wa_fieldcatalog-seltext_s   = 'Log. group'.
      wa_fieldcatalog-seltext_m   = 'Logistics group'.
      wa_fieldcatalog-seltext_l   = 'Log. handling group'.
       wa_fieldcatalog-reptext_ddic = 'Log. handling group'.
      APPEND wa_fieldcatalog TO it_fieldcatalog.
      l_pos = l_pos + 1.
    Please let me know why the added field was not displaying automaticaly in the output screen.
    Regards,
    Reddy

    hi,
             try this
    clear wa_fieldcatalog.
    wa_fieldcat-tabname       = 'ITAB' ( give the internal table which has the field LOGGR)
    wa_fieldcatalog-fieldname = 'LOGGR'.
    wa_fieldcatalog-ref_tabname = 'MARC'.
    wa_fieldcatalog-col_pos = l_pos.
    wa_fieldcatalog-outputlen = 13.
    wa_fieldcatalog-seltext_s = 'Log. group'.
    wa_fieldcatalog-seltext_m = 'Logistics group'.
    wa_fieldcatalog-seltext_l = 'Log. handling group'.
    wa_fieldcatalog-reptext_ddic = 'Log. handling group'.
    APPEND wa_fieldcatalog TO it_fieldcatalog.
    l_pos = l_pos + 1.

  • Field width in ALV report

    Hi,
    How to increase the field width of a field in ALV report.
    I mean, in a ALV report, the field description of a field is not showing correctly. IF i try to extend the field width by the mouse/coursor, it displays the correct description.
    IS there any way where for displaying the  field description correctly?
    Thanks,
    Kumar

    Hi,
    Go through the sample code,
    *& Report ZDEMO_ALVLIST *
    *& Example of a simple ALV List Report *
    *& The basic requirement for this demo is to display a number of *
    *& fields from the EKKO table. *
    REPORT zdemo_alvlist .
    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,
    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,
    gd_tab_group type slis_t_sp_group_alv,
    gd_layout type slis_layout_alv,
    gd_repid like sy-repid.
    *Start-of-selection.
    START-OF-SELECTION.
    perform data_retrieval.
    perform build_fieldcatalog.
    perform build_layout.
    perform display_alv_report.
    *& Form BUILD_FIELDCATALOG
    Build Fieldcatalog for ALV Report
    form build_fieldcatalog.
    There are a number of ways to create a fieldcat.
    For the purpose of this example i will build the fieldcatalog manualy
    by populating the internal table fields individually and then
    appending the rows. This method can be the most time consuming but can
    also allow you more control of the final product.
    Beware though, you need to ensure that all fields required are
    populated. When using some of functionality available via ALV, such as
    total. You may need to provide more information than if you were
    simply displaying the result
    I.e. Field type may be required in-order for
    the 'TOTAL' function to work.
    fieldcatalog-fieldname = 'EBELN'.
    fieldcatalog-seltext_m = 'Purchase Order'.
    fieldcatalog-col_pos = 0.
    fieldcatalog-outputlen = 10.
    fieldcatalog-emphasize = 'X'.
    fieldcatalog-key = 'X'.
    fieldcatalog-do_sum = 'X'.
    fieldcatalog-no_zero = 'X'.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'EBELP'.
    fieldcatalog-seltext_m = 'PO Item'.
    fieldcatalog-col_pos = 1.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'STATU'.
    fieldcatalog-seltext_m = 'Status'.
    fieldcatalog-col_pos = 2.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'AEDAT'.
    fieldcatalog-seltext_m = 'Item change date'.
    fieldcatalog-col_pos = 3.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'MATNR'.
    fieldcatalog-seltext_m = 'Material Number'.
    fieldcatalog-col_pos = 4.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'MENGE'.
    fieldcatalog-seltext_m = 'PO quantity'.
    fieldcatalog-col_pos = 5.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'MEINS'.
    fieldcatalog-seltext_m = 'Order Unit'.
    fieldcatalog-col_pos = 6.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'NETPR'.
    fieldcatalog-seltext_m = 'Net Price'.
    fieldcatalog-col_pos = 7.
    fieldcatalog-outputlen = 15.
    fieldcatalog-datatype = 'CURR'.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    fieldcatalog-fieldname = 'PEINH'.
    fieldcatalog-seltext_m = 'Price Unit'.
    fieldcatalog-col_pos = 8.
    append fieldcatalog to fieldcatalog.
    clear fieldcatalog.
    endform. " BUILD_FIELDCATALOG
    *& Form BUILD_LAYOUT
    Build layout for ALV grid report
    form build_layout.
    gd_layout-no_input = 'X'.
    gd_layout-colwidth_optimize = 'X'.
    gd_layout-totals_text = 'Totals'(201).
    gd_layout-totals_only = 'X'.
    gd_layout-f2code = 'DISP'. "Sets fcode for when double
    "click(press f2)
    gd_layout-zebra = 'X'.
    gd_layout-group_change_edit = 'X'.
    gd_layout-header_text = 'helllllo'.
    endform. " BUILD_LAYOUT
    *& Form DISPLAY_ALV_REPORT
    Display report using ALV grid
    form display_alv_report.
    gd_repid = sy-repid.
    call function 'REUSE_ALV_LIST_DISPLAY'
    exporting
    i_callback_program = gd_repid
    i_callback_top_of_page = 'TOP-OF-PAGE' "see FORM
    i_callback_user_command = 'USER_COMMAND'
    i_grid_title = outtext
    is_layout = gd_layout
    it_fieldcat = fieldcatalog[]
    it_special_groups = gd_tabgroup
    IT_EVENTS = GT_XEVENTS
    i_save = 'X'
    is_variant = z_template
    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 table it_ekko.
    endform. " DATA_RETRIEVAL
    Form TOP-OF-PAGE *
    ALV Report Header *
    Form top-of-page.
    *ALV Header declarations
    data: t_header type slis_t_listheader,
    wa_header type slis_listheader,
    t_line like wa_header-info,
    ld_lines type i,
    ld_linesc(10) type c.
    Title
    wa_header-typ = 'H'.
    wa_header-info = 'EKKO Table Report'.
    append wa_header to t_header.
    clear wa_header.
    Date
    wa_header-typ = 'S'.
    wa_header-key = 'Date: '.
    CONCATENATE sy-datum+6(2) '.'
    sy-datum+4(2) '.'
    sy-datum(4) INTO wa_header-info. "todays date
    append wa_header to t_header.
    clear: wa_header.
    Total No. of Records Selected
    describe table it_ekko lines ld_lines.
    ld_linesc = ld_lines.
    concatenate 'Total No. of Records Selected: ' ld_linesc
    into t_line separated by space.
    wa_header-typ = 'A'.
    wa_header-info = t_line.
    append wa_header to t_header.
    clear: wa_header, t_line.
    call function 'REUSE_ALV_COMMENTARY_WRITE'
    exporting
    it_list_commentary = t_header.
    i_logo = 'Z_LOGO'.
    endform.
    Regards,
    Raj.

  • Edit few fields in an ALV table

    Hi,
    I am working on a table maintenance kind of application using ABAP web dynpro.
    I have created an application using ALV, and also I could make all columns as editable.
    But, I want to edit only 4 fields out of 7 in a row, when the same row is selected. Not all the columns in editable mode.
    Also I want to default some of the fields which are grayed out in the same row. How to default them?
    Could anyone help me about how to do this?
    Thanks.
    Sreekanth

    Hi,
    For the Editable Row,
    Create a context attribute called 'READ_ONLY'.
    Initially populate this READ_ONLY by looping through the table accross all rows.
    When you get the column references, Loop through this columns and set the columns for which you
    want them in "INPUT" by creating the object of type 'INPUT_FIELD"  for the others make them as TEXT_VIEW type.
    Now for the table, use the SET_READ_ONLY (for fieldname) to 'READ_ONLY' and bind the attribute
    READ_ONLY of context to the each column reference method 'SET_READONLY' method.
    DATA:
        lt_colref TYPE salv_wd_t_column_ref,
        ls_colref TYPE salv_wd_s_column_ref,
        lv_id TYPE string,
        lr_colref TYPE REF TO cl_salv_wd_column,
        lr_input TYPE REF TO cl_salv_wd_uie_input_field,
        lr_cv type ref to cl_salv_wd_cv_standard.
      DATA lv_tabix type i.
      loop at lt_efforts into ls_efforts.
        lv_tabix = sy-tabix.
        if sy-tabix = lv_count.
          ls_efforts-READ_ONLY = abap_false.
        else.
          ls_efforts-READ_ONLY = abap_true.
        endif.
        modify lt_efforts from ls_efforts index
                  lv_tabix transporting READ_ONLY.
      endloop.
      CALL METHOD LO_ND_EFF->BIND_TABLE
        EXPORTING
          NEW_ITEMS            = lt_eff
          SET_INITIAL_ELEMENTS = ABAP_TRUE.
    *    INDEX                =
      CALL METHOD wd_comp_controller->gref_model_efforts->if_salv_wd_column_settings~get_columns
        RECEIVING
          value = lt_colref.
      LOOP AT lt_colref INTO ls_colref.
        lv_id = ls_colref-id.
        lr_colref = ls_colref-r_column.
        case lv_id.
          when 'COL1'.
            CREATE OBJECT lr_input
              EXPORTING
                value_fieldname = lv_id.
            CALL METHOD lr_colref->set_cell_editor
              EXPORTING
                value = lr_input.
            CALL METHOD LR_INPUT->SET_READ_ONLY_FIELDNAME
              EXPORTING
                VALUE = 'READ_ONLY'.
          when 'BEGDA'.
            CREATE OBJECT lr_input
              EXPORTING
                value_fieldname = lv_id.
            CALL METHOD lr_colref->set_cell_editor
              EXPORTING
                value = lr_input.
            CALL METHOD LR_INPUT->SET_READ_ONLY_FIELDNAME
              EXPORTING
                VALUE = 'READ_ONLY'.
          when 'ENDDA'.
            CREATE OBJECT lr_input
              EXPORTING
                value_fieldname = lv_id.
            CALL METHOD lr_colref->set_cell_editor
              EXPORTING
                value = lr_input.
            CALL METHOD LR_INPUT->SET_READ_ONLY_FIELDNAME
              EXPORTING
                VALUE = 'READ_ONLY'.
        endcase.
        CLEAR lv_id.
        CLEAR lr_colref.
      ENDLOOP.
    *Set the table Editable
    lo_value->if_salv_wd_table_settings~set_read_only( value = abap_false ).
    Regards,
    Lekha.

  • Simple way to create field catalogs in ALV Reports using subroutine

         In ALV Reports When creating field catalog, instead of giving field catalog for every field seperatly we can use following simple method to create field catalog.
         This method makes your code very easy to read as well as to understand. I am going to show code only to prepare field catalog to make this method easy to understand. Their also contains code for fetching data from requires table and calling function module for ALV . I am not including it in this program but it should be their in program -
    REPORT ZALV_INTERACTIVE_REPORT.
    TYPE-POOLS SLIS.
    TYPES : BEGIN OF TY_MARA,
         MATNR TYPE MATNR,
         MTART TYPE MTART,
         MBRSH TYPE MBRSH,
         MEINS TYPE MEINS,
    END OF TY_MARA.
    DATA IT_MARA TYPE STANDARD TABLE OF TY_MARA.
    DATA WA_MARA TYPE TY_MARA.
    " Internal table and work area for Field Catalog
    DATA IT_FIELDCAT TYPE SLIS_T_FIELDCAT_ALV.
    DATA WA_FIELDCAT LIKE LINE OF IT_FIELDCAT.
    START-OF-SELECTION.
    * PERFORM FETCH_DATA .
    " FIELDS IN FIELD CATALOG (PASSED IN SUBROUTINE):-
    "     'FIELDNAME'<SPACE> 'SELTEXT_M' <SPACE>'KEY'<SPACE> 'HOTSPOT'
    PERFORM PREP_CATALOG USING : 'MATNR' 'MATERIAL NO.' 'X' 'X' ,
                                                           'MTART' 'MATERIAL TYPE' ' ' ' ' ,
                                                           'MBRSH' 'IND SECTOR' ' ' ' ' ,
                                                           'MEINS' 'UOM' ' ' ' ' .
    * PERFORM CALL_ALV_FM .
    " Subroutine to create field catalog
    FORM PREP_CATALOG USING VALUE(P_FIELDNM)
                                                                  VALUE(P_SELTEXT)
                                                                  VALUE(P_KEY)
                                                                  VALUE(P_HOTSPOT) .
    WA_FIELDCAT-FIELDNAME = P_FIELDNM .
    WA_FIELDCAT-SELTEXT_M = P_SELTEXT .
    WA_FIELDCAT-KEY = P_KEY .
    WA_FIELDCAT-HOTSPOT = P_HOTSPOT .
    APPEND WA_FIELDCAT TO IT_FIELDCAT .
    ENDFORM .
              Above code will repeat the execution of subroutine PREP_CATALOG for every set of values passed to subroutine because we used
    USING : (chain operator) to pass value to subroutine.
              Subroutine will assign passed values to corresponding field and simply appends those values in ITAB created for field catalog(IT_FIELDCAT). It repeates this process until all the passed values are appended into ITAB.
              This method will reduce complexity of the code as well as time required to write code for every field's field catalog seperatly. It does lots of work in very few lines of codes.

    Scott,
    I don't think there is a way to divide all numbers by a million in one shot, but you could divide the numbers by million by writing code for each amount field as needed: <?FIELD1 div 1000000?> and the use the round function <?xdoxslt:round(2.777,2)?>
    combined function: <?xdoxslt:round((12345605.6 div 1000000),2)?>
    Thanks,
    Bipuser

  • Prefix Negative sign in type P field in an ALV report

    Generally, -vs sign appears after the number in an ALV report. I have a type P field where I want to prefix the -ve sign ( before the number ). I donot want to convert it to C type as I want the sorting feature. Is there any other way ?

    U can do as per the suggestion given by Raja
    or
    U can copy the fm CLOI_PUT_SIGN_IN_FRONT to CONVERSION_EXIT_SIGN_OUTPUT and activate it. Then in edit mask use this '==SIGN' or u can create one domain and refer the domain to that field. In that domain u set the convertion routine = SIGN.
    regards
    gv

  • Setting currency and measurement unit for a field in an ALV report

    Plz give sample code to set currency and measurement unit for a field in an ALV report

    dear friend
    i am seanding you
    the display form
    if you need select form
    and process form also pls keep in touch.
    if help full rewards are expecting.
    yours
    vivek
    FORM build_field_catalog .
      DATA: w_dthigh(10).
      CLEAR fcat.
      fcat-fieldname = 'VBELN'.
      fcat-outputlen = 10.
      fcat-seltext_s = 'COMMERCIAL INVOICE'.
      fcat-seltext_m = 'Commercial Invoice'.
      fcat-seltext_l = 'COMMERCIAL INVOICE'.
      fcat-ddictxt = 'M'.
      fcat-inttype = 'C'.
      fcat-datatype = 'CHAR'.
      fcat-key = 'X'.
      fcat-hotspot = 'X'.
      APPEND fcat.
      CLEAR fcat.
      fcat-fieldname = 'EXNUM'.
      fcat-outputlen = 10.
      fcat-seltext_s = 'EXCISE INVOICE'.
      fcat-seltext_m = 'Excise Invoice'.
      fcat-seltext_l = 'EXCISE INVOICE'.
      fcat-ddictxt = 'M'.
      fcat-inttype = 'C'.
      fcat-datatype = 'CHAR'.
      fcat-hotspot = 'X'.
      APPEND fcat.
      CLEAR fcat.
      fcat-fieldname = 'EXDAT'.
      fcat-outputlen = 10.
      fcat-seltext_s = 'EXCISE DATE'.
      fcat-seltext_m = 'Excise Date'.
      fcat-seltext_l = 'EXCISE DATE'.
      fcat-ddictxt = 'M'.
      fcat-inttype = 'D'.
      fcat-datatype = 'DATS'.
      APPEND fcat.
      CLEAR fcat.
      fcat-fieldname = 'NAME1'.
      fcat-outputlen = 30.
      fcat-seltext_s = 'CUSTOMER'.
      fcat-seltext_m = 'Customer'.
      fcat-seltext_l = 'CUSTOMER'.
      fcat-ddictxt = 'M'.
      fcat-inttype = 'C'.
      fcat-datatype = 'CHAR'.
      fcat-lowercase = 'X'.
      APPEND fcat.
      CLEAR fcat.
      fcat-fieldname = 'ZZPD'.
      fcat-outputlen = 15.
      fcat-seltext_s = 'COUNTRY'.
      fcat-seltext_m = 'COUNTRY'.
      fcat-seltext_l = 'COUNTRY'.
      fcat-ddictxt = 'M'.
      fcat-inttype = 'C'.
      fcat-datatype = 'CHAR'.
      fcat-lowercase = 'X'.
      APPEND fcat.
      CLEAR fcat.
      fcat-fieldname = 'WERKS'.
      fcat-outputlen = 4.
      fcat-seltext_s = 'PLANT'.
      fcat-seltext_m = 'Plant'.
      fcat-seltext_l = 'PLANT'.
      fcat-ddictxt = 'M'.
      fcat-inttype = 'C'.
      fcat-datatype = 'CHAR'.
      fcat-key = 'X'.
      APPEND fcat.
      CLEAR fcat.
      fcat-fieldname = 'ARKTX'.
      fcat-outputlen = 40.
      fcat-seltext_s = 'MATERIAL DESCRIPTION'.
      fcat-seltext_m = 'Material Description'.
      fcat-seltext_l = 'MATERIAL DESCRIPTION'.
      fcat-ddictxt = 'M'.
      fcat-inttype = 'C'.
      fcat-datatype = 'CHAR'.
      fcat-lowercase = 'X'.
      APPEND fcat.
      CLEAR fcat.
      fcat-fieldname = 'FKART'.
      fcat-outputlen = 4.
      fcat-seltext_s = 'Billing type'.
      fcat-seltext_m = 'Billing type'.
      fcat-seltext_l = 'Billing type'.
      fcat-ddictxt = 'M'.
      fcat-inttype = 'C'.
      fcat-datatype = 'CHAR'.
      fcat-key = 'X'.
      APPEND fcat.
      CLEAR fcat.
      fcat-fieldname = 'INCO1'.
      fcat-outputlen = 5.
      fcat-seltext_s = 'INCO TERMS'.
      fcat-seltext_m = 'INCO TERMS'.
      fcat-seltext_l = 'INCO TERMS'.
      fcat-ddictxt = 'M'.
      fcat-inttype = 'C'.
      fcat-datatype = 'CHAR'.
      APPEND fcat.
      CLEAR fcat.
      fcat-fieldname = 'INCO2'.
      fcat-outputlen = 10.
      fcat-seltext_s = 'INCO TERMS DES'.
      fcat-seltext_m = 'INCO TERMS DES'.
      fcat-seltext_l = 'INCO TERMS DES'.
      fcat-ddictxt = 'M'.
      fcat-inttype = 'C'.
      fcat-datatype = 'CHAR'.
      APPEND fcat.
    CLEAR fcat.
    fcat-fieldname = 'FKIMG'.
    fcat-outputlen = 14.
    fcat-seltext_s = 'QUANTITY'.
    fcat-seltext_m = 'Quantity'.
    fcat-seltext_l = 'QUANTITY'.
    fcat-ddictxt = 'M'.
    fcat-inttype = 'P'.
    fcat-datatype = 'QUAN'.
    APPEND fcat.
      CLEAR fcat.
      fcat-fieldname = 'FKLMG'.
      fcat-outputlen = 10.
      fcat-seltext_s = 'QUANTITY'.
      fcat-seltext_m = 'QUANTITY'.
      fcat-seltext_l = 'QUANTITY'.
      fcat-ddictxt = 'M'.
      fcat-inttype = 'P'.
      fcat-datatype = 'QUAN'.
      APPEND fcat.
      CLEAR fcat.
      fcat-fieldname = 'MEINS'.
      fcat-outputlen = 5.
      fcat-seltext_s = 'UNIT'.
      fcat-seltext_m = 'UNIT'.
      fcat-seltext_l = 'UNIT'.
      fcat-ddictxt = 'M'.
      fcat-inttype = 'C'.
      fcat-datatype = 'CHAR'.
      APPEND fcat.
      CLEAR fcat.
      fcat-fieldname = 'KBETR'.
      fcat-outputlen = 8.
      fcat-seltext_s = 'RATE'.
      fcat-seltext_m = 'Rate'.
      fcat-seltext_l = 'RATE'.
      fcat-ddictxt = 'M'.
      fcat-inttype = 'P'.
      fcat-datatype = 'CURR'.
      APPEND fcat.
      CLEAR fcat.
      fcat-fieldname = 'NSR'.
      fcat-outputlen = 8.
      fcat-seltext_s = 'Exmill'.
      fcat-seltext_m = 'Exmill'.
      fcat-seltext_l = 'Exmill'.
      fcat-ddictxt = 'M'.
      fcat-inttype = 'P'.
      fcat-datatype = 'CURR'.
      APPEND fcat.
      CLEAR fcat.
      fcat-fieldname = 'KURSK'.
      fcat-outputlen = 8.
      fcat-seltext_s = 'EXCHANGE RATE'.
      fcat-seltext_m = 'Exchange Rate'.
      fcat-seltext_l = 'Exchange Rate'.
      fcat-ddictxt = 'M'.
      fcat-inttype = 'P'.
      fcat-datatype = 'CURR'.
      APPEND fcat.
      CLEAR fcat.
      fcat-fieldname = 'WAERK'.
      fcat-outputlen = 5.
      fcat-seltext_s = 'CURRENCY'.
      fcat-seltext_m = 'Currency'.
      fcat-seltext_l = 'CURRENCY'.
      fcat-ddictxt = 'M'.
      fcat-inttype = 'C'.
      fcat-datatype = 'CUKY'.
      APPEND fcat.
      CLEAR fcat.
      fcat-fieldname = 'LCURR1'.
      fcat-outputlen = 14.
      fcat-seltext_s = 'GROSS AMT'.
      fcat-seltext_m = 'Gross Amt'.
      fcat-seltext_l = 'GROSS AMT'.
      fcat-ddictxt = 'L'.
      fcat-inttype = 'P'.
      fcat-datatype = 'CURR'.
    fcat-do_sum = 'X'.
      APPEND fcat.
    ================================= *****************
      fheader-typ = 'H'.
      SELECT SINGLE butxt
        FROM t001
        INTO fheader-info
       WHERE bukrs EQ '1000'.
      APPEND fheader.
      CLEAR fheader.
      fheader-typ = 'H'.
      fheader-info = 'Daily Shipments For Exp'.
      APPEND fheader.
      CLEAR fheader.
    Plant
      SORT s_werks BY low.
      READ TABLE s_werks INDEX 1.
      fheader-typ = 'S'.
      WRITE s_werks-low TO fheader-key.
      SORT s_werks BY high DESCENDING.
      READ TABLE s_werks INDEX 1.
      IF s_werks-high NE space.
        CONCATENATE fheader-key 'TO' s_werks-high INTO fheader-info
                                SEPARATED BY space.
      ELSE.
        WRITE fheader-key TO fheader-info.
      ENDIF.
      CLEAR fheader-key.
      fheader-key = 'PLANT : '.
      APPEND fheader.
      CLEAR fheader.
    Billing Typ
    SORT S_FKART BY LOW.
    READ TABLE S_FKART INDEX 1.
    FHEADER-TYP = 'S'.
    WRITE S_FKART-LOW TO FHEADER-KEY.
    SORT S_FKART BY HIGH DESCENDING.
    READ TABLE S_FKART INDEX 1.
    IF S_FKART-HIGH NE SPACE.
    CONCATENATE FHEADER-KEY 'TO' S_FKART-HIGH INTO FHEADER-INFO
                             SEPARATED BY SPACE.
    ELSE.
       WRITE FHEADER-KEY TO FHEADER-INFO.
    ENDIF.
    CLEAR FHEADER-KEY.
    FHEADER-KEY = 'DOCUMENT TYPE : '.
    APPEND FHEADER.
    CLEAR FHEADER.
    Date...
      fheader-typ = 'S'.
    FHEADER-KEY = S_FKDAT-LOW.
      WRITE s_fkdat-low  TO fheader-key.
      WRITE s_fkdat-high TO w_dthigh.
      CONCATENATE fheader-key 'TO' w_dthigh INTO fheader-info
                              SEPARATED BY space.
      CLEAR fheader-key.
      fheader-key = 'PERIOD : '.
      APPEND fheader.
      CLEAR fheader.
      CALL FUNCTION 'REUSE_ALV_EVENTS_GET'
        EXPORTING
          i_list_type     = 0
        IMPORTING
          et_events       = fevents[]
        EXCEPTIONS
          list_type_wrong = 1
          OTHERS          = 2.
      READ TABLE fevents WITH KEY name = 'TOP_OF_PAGE'.
      IF sy-subrc = 0.
        fevents-form = 'TOPOFPAGE'.
        MODIFY fevents INDEX sy-tabix.
        CLEAR fevents.
      ENDIF.
      rptname = sy-repid.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
                        EXPORTING
                          i_callback_program                = rptname
                          it_fieldcat                       = fcat[]
                          i_default                         = 'S'
                          it_events                         = fevents[]
                          i_save                            = 'X'
                         TABLES
                           t_outtab                          = it_output[]
                      EXCEPTIONS
                        PROGRAM_ERROR                     = 1
                        OTHERS                            = 2
    ENDFORM.                    " BUILD_FIELD_CATALOG

  • How can i change field width in ALV report

    hello,
    i have to modify vendor payment list. it is a ALv report
    proble is that when i gave vendor acc range for any month (range of posting date) it shows list,
    but for february it show run time error
    error description-  the resulting values are too large for the designated field.
    for posting dates 1.02.2009 to 25.02.09 it shows list. but when i gave posting date after 25 it doesnt show list.
    just i cant understand how to solve it.
    thanks in advance,
    Anuradha.

    Hi...
    Best option is first deside which format you want to put in that date field...
    then before filling internal table do one thing format that date field and then add into ur internal table which u later will use to show in ALV Grid Report...
    Example...Suppose you want DD.MM.YYYY
    then use
    concatenate Fieldname0(2) Fieldname2(2) Fieldname+4(4) into Fieldname...
    This way you can format the date in any format with proper logic. and ur problem getting solved
    Regards,
    Chintan

  • Add field in standard ALV report.

    Hi friends,
    In SAP standard ALV report, t.code- S_ALR_87012050, user wants the vendor to include information about source document - vendor number, vendor name, invoice number, original document number of the transaction in the case of payroll being capitalized.
    I tell me weather this information is already present in the report or I have to create Z report for adding this information and how do I proceed to add new fields in the created Z program.
    Please help me.
    Thanks in advance,
    Saya

    HI Saya,
    Check in the ALV output whether these fields are already there and not displaying in the ALV output, if the fields are not at all printing in the ALV output,then copy the Program to Z program and change it.
    write the Code to add the new fields to the internal table and change the Field catalaog to come your fields in the ALV output then print it
    Regards
    SUdheer

  • Editing rows and columns in alv reports in webdynpro abap

    how edit row and columns in webdynpro abap ?
    can i add colors to salv repotrs for below and above range of values  how ?
    if possible send source code for it.............

    hi
    check out this link for editing the columns of ALV
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0155eb5-b6ce-2b10-3195-d9704982d69b
    check out for this thread as well for coloring ALV
    Coloring of selected table cells: Ideas wanted
    regards,
    amit

  • Is possible to change ALV report  which include ALE change ?

    I friends , i have developed an ALV report and now a new require ment has come , it is , the client wants to make it  ALE enable . I have no idea how to include ALE changes to it ? If any body of you have any idea please help me  from beginning?

    HI,
    for ALE enabling, you have create idoc's for the alv data and distribute them to the target server.
    for step by step implementation of ALE check this link.
    http://www.sappoint.com/abap.html
    Regards,
    Wasim Ahmed
    Message was edited by: Wasim Ahmed

  • No column heading in second page in alv report when save in excel file

    Hi Expert,
    How can i remove the column header from Alv report when program execute in background and save in excel file right now
    its comming column header in each page. Client dont want header column in excel from second page. is this possible?
    with regards
    chandan_viji

    Hi Ravi,
    thanks for reply i have solved this problm throug line count and NEW-PAGE LINE COUNT 10000 bcoz client want output in excel file only one page header.
    with regards
    chandan_viji

Maybe you are looking for

  • I updated to iOS 7 and then updated my iTunes.

    Now I seem unable to run iTunes or conect my iPhone as my operaing system is too old?

  • X6 FirmWare Wishlist

    hi there if nokia is working on an update for the x6 i hope they look here or hear what the users want. so i searched for a wishlist but i didnt found one. if there is already one plz tell me. so my wishes are: 1 make the contact-overview that is ava

  • Quiz pool and hiding playbar

    I have created a project with a quiz pool.  For the quiz I want to disable the skin editor showing the navigation bar so that they cannot go backwards.  I have done this with other projects with quiz questions.  I then show the playbar on the quiz re

  • Actions won't load

    I am trying to load actions in PSE11 and every time i click load actions, the finder box opens (im on a mac) and then immediately closes. Then the Load Actions option is grayed out and i cannot do anything. Help!

  • HT5730 OSX Mountain Lion 10.8.4 messed up my MacBook Pro

    I just recently updated my MacBook Pro to 10.8.4 and now Safari, Messages, iTunes, and the App Store don't work. They "Shut down unexpectedly" as soon as I click on them.