ALV grid disply with edit columns in output

Hi all,
  i am using   CALL METHOD MY_GRID->SET_TABLE_FOR_FIRST_DISPLAY
to display the output in alv format.there is  3 edit columns in output display.
   if i fill one field & then put 'ENTER' then other two fields of that row should be filled with the appropriate data from the program.still control should be in output display.
which method i should use to go inside the program when i put 'ENTER' on any field of ALV output disply & how to use those methods inside the program.
i need some materials regarding OOPS (class, method ) . now i want to put OOPS concept in alv display.
correct answers will be rewarded.
Thanks & regards

Hi,
Check,
OOPS
http://help.sap.com/saphelp_nw2004s/helpdata/en/ce/b518b6513611d194a50000e8353423/frameset.htm
ABAP Objects
https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/webcontent/uuid/35eaef9c-0b01-0010-dd8b-e3b0f9ed7ccb#section7 [original link is broken]
check the below links lot of info and examples r there for OOPS
http://www.sapgenie.com/abap/OO/index.htm
http://www.geocities.com/victorav15/sapr3/abap_ood.html
http://www.brabandt.de/html/abap_oo.html
http://www.sapgenie.com/abap/OO/
http://www.sapgenie.com/abap/OO/index.htm
http://help.sap.com/saphelp_nw04/helpdata/en/c3/225b5654f411d194a60000e8353423/content.htm
http://www.esnips.com/doc/375fff1b-5a62-444d-8ec1-55508c308b17/prefinalppt.ppt
<b>Reward if helpful.</b>

Similar Messages

  • Group feature at ALV grid with editable columns

    Am I right ?
    Group function by using a sorted layout is disabled while having one (or more) editable columns, isn't it ?
    ... or is there a possibility to use gouped rows ?
    Greetings
    Markus

    Also...
    *& Report ZDEMO_ALVGRID_EDIT *
    *& Example of a simple ALV Grid Report *
    *& The basic ALV grid, Enhanced to display specific fields as *
    *& editable depending on field value *
    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
    REWARD POINTS IF usefful !!

  • ALV grid display with more than 1000 columns

    Hi Friends,
    I have to prepare a report output which have 1015 columns.
    User will give 100 weeks of data to retrieve. I have to display the output in day wise.
    100*7 + 315 = 1015 columns.
    I am using ALV grid display for this in 4.6C.
    My Question is, whether I have to declare the output table type with 1015 fields.?
    Is there any other way to do this, without declaring 1015 cloumns.
    Please guide me to solve this.
    Regards,
    Viji.

    I'm thinking when your End-user will press Ctrl + P feeding A4 size to printer
    Thomas:
    Maybe the functional consultant is pulling your leg?
    May be OP is pulling our legs or something further?
    Cheers

  • ALV GRID Problem with reading contents

    Hi there! I'm quite new with ABAP and I have some problems with the syntax of it. Maybe I should first describe my aim and then I'll show you my code.
    1. I read contents from two database tables, called 'zbc_dan_registry' and 'zbc_dan_category'.
    'zbc_dan_registry' has 2 columns: name, value.
    zbc_dan_category' has 1 column: category.
    Now I want to have an ALV Grid, that displays the contents of 'zbc_dan_registry' and one additional column with dropdown fields, where the user can select a category for each row. This is, what my code already does.
    Now I want to save the contents of the whole table in a new table 'zbc_dan_registrz' (you see: 'registrz', not 'registry'!) with 3 columns:
    name, category, value.
    My problem is, how can I read the contents of the ALV Grid, with the user selected category for each row, and save them in an internal table? I've tried to adapt the code of "BCALV_EDIT_04", but I don't get it running.
    Some detailled help would be great, you know, I'm really working hard to understand ABAP, but it's really hard for me. Thanks for your support and help!!
    Here's my code so far:
    *& Report  ZBC400_DAN_TESTNO4
    REPORT  ZBC400_DAN_TESTNO4.
    DATA: lt_registrz TYPE TABLE OF zbc_dan_regstrz WITH HEADER LINE,
          lt_category TYPE TABLE OF zbc_dan_category WITH HEADER LINE,
          ls_category TYPE zbc_dan_category, "Struktur Kategorie
          ok_code LIKE sy-ucomm,
          container_r TYPE REF TO cl_gui_custom_container,
          grid_r TYPE REF TO cl_gui_alv_grid,
          gc_custom_control_name TYPE scrfname VALUE 'CONTAINER_REG',
          fieldcat_r TYPE lvc_t_fcat,
          layout_r TYPE lvc_s_layo,
          lt_ddval TYPE lvc_t_drop,
          ls_ddval TYPE lvc_s_drop,
          c TYPE i.
    CLASS lcl_event_receiver DEFINITION DEFERRED.
      DATA g_verifier TYPE REF TO lcl_event_receiver.
      DATA: BEGIN OF gt_outtab OCCURS 0.
        INCLUDE STRUCTURE zbc_dan_regstrz.
        DATA: celltab TYPE lvc_t_styl.
      DATA: END OF gt_outtab.
    CLASS lcl_event_receiver DEFINITION.
      PUBLIC SECTION.
      TYPES: BEGIN OF lt_registrz_key.         "Struktur mit den Schlüsseln der Tabelle 'Registry'
        TYPES:  name TYPE zbc_dan_name,
                value TYPE zbc_dan_value,
                category TYPE zbc_dan_cat.
      TYPES: END OF lt_registrz_key.
      TYPES:  ls_registrz_keys TYPE STANDARD TABLE OF lt_registrz_key,
              ls_registrz_table TYPE STANDARD TABLE OF zbc_dan_regstrz.
      METHODS: get_inserted_rows EXPORTING inserted_rows TYPE ls_registrz_keys.
      METHODS: refresh_delta_tables.
      METHODS: handle_data_changed FOR EVENT data_changed OF cl_gui_alv_grid IMPORTING er_data_changed.
    *  METHODS: get_inserted_rows EXPORTING inserted_rows TYPE registrz_keys.
    *  METHODS: refresh_delta_tables.
      PRIVATE SECTION.
      DATA: inserted_rows TYPE ls_registrz_keys.
      DATA: error_in_data TYPE c.
      METHODS: get_cell_values IMPORTING row_id TYPE int4 pr_data_changed TYPE REF TO cl_alv_changed_data_protocol EXPORTING key TYPE lt_registrz_key.
    ENDCLASS.
    CLASS lcl_event_receiver IMPLEMENTATION.
      METHOD handle_data_changed.
        DATA: ls_good TYPE lvc_s_modi,
              ls_new TYPE lvc_s_moce.
        error_in_data = space.
        IF error_in_data = 'X'.
          CALL METHOD er_data_changed->display_protocol.
        ENDIF.
      ENDMETHOD.
      METHOD get_cell_values.
        CALL METHOD pr_data_changed->get_cell_value
          EXPORTING i_row_id = row_id i_fieldname = 'NAME'
            IMPORTING e_value = key-name.
        CALL METHOD pr_data_changed->get_cell_value
          EXPORTING i_row_id = row_id i_fieldname = 'VALUE'
            IMPORTING e_value = key-value.
        CALL METHOD pr_data_changed->get_cell_value
          EXPORTING i_row_id = row_id i_fieldname = 'CATEGORY'
            IMPORTING e_value = key-category.
      ENDMETHOD.
      METHOD get_inserted_rows.
        inserted_rows = me->inserted_rows.
      ENDMETHOD.
      METHOD refresh_delta_tables.
        clear me->inserted_rows[].
      ENDMETHOD.
    ENDCLASS.
    START-OF-SELECTION.
        SELECT client name value
          INTO CORRESPONDING FIELDS OF TABLE lt_registrz FROM zbc_dan_regstry.
        SELECT category INTO CORRESPONDING FIELDS OF TABLE lt_category FROM zbc_dan_category.
    CALL SCREEN 0100.
    MODULE user_command_0100 INPUT.
      CASE ok_code.
        WHEN 'BACK'.
          SET SCREEN 0.
          MESSAGE ID 'BC400' TYPE 'S' NUMBER '057'.
        WHEN 'SAVE'.
          PERFORM save_data.
        WHEN OTHERS.
      ENDCASE.
    ENDMODULE.
    MODULE clear_ok_code OUTPUT.
      CLEAR ok_code.
    ENDMODULE.
    MODULE status_0100 OUTPUT.
      SET PF-STATUS 'DYNPRO100'.
      SET TITLEBAR 'D0100'.
    ENDMODULE.
    MODULE display_alv OUTPUT.
      PERFORM display_alv.
    ENDMODULE.
    FORM display_alv.
    IF grid_r IS INITIAL.
    *----Creating custom container instance
      CREATE OBJECT container_r
      EXPORTING
        container_name = gc_custom_control_name
      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.
    *--Exception handling
        ENDIF.
    *----Creating ALV Grid instance
        CREATE OBJECT grid_r
        EXPORTING
          i_parent = container_r
        EXCEPTIONS
          error_cntl_create = 1
          error_cntl_init = 2
          error_cntl_link = 3
          error_dp_create = 4
          others = 5.
          IF sy-subrc <> 0.
    *--Exception handling
          ENDIF.
          CREATE OBJECT g_verifier.
          SET HANDLER g_verifier->handle_data_changed FOR grid_r.
    *----Preparing field catalog.
          PERFORM prepare_field_catalog CHANGING fieldcat_r.
    *----Preparing layout structure
          PERFORM prepare_layout CHANGING layout_r.
    *----Here will be additional preparations
    *--e.g. initial sorting criteria, initial filtering criteria, excluding
    *--functions
          CALL METHOD grid_r->set_table_for_first_display
          EXPORTING
    * I_BUFFER_ACTIVE =
    * I_CONSISTENCY_CHECK =
    * I_STRUCTURE_NAME =
    * IS_VARIANT =
    * I_SAVE =
    * I_DEFAULT = 'X'
            is_layout = layout_r
    * IS_PRINT =
    * IT_SPECIAL_GROUPS =
    * IT_TOOLBAR_EXCLUDING =
    * IT_HYPERLINK =
          CHANGING
            it_outtab = lt_registrz[]
            it_fieldcatalog = fieldcat_r
    * IT_SORT =
    * IT_FILTER =
          EXCEPTIONS
            invalid_parameter_combination = 1
            program_error = 2
            too_many_lines = 3
            OTHERS = 4.
          IF sy-subrc <> 0.
    *--Exception handling
          ENDIF.
          ELSE.
            CALL METHOD grid_r->refresh_table_display
    * EXPORTING
    * IS_STABLE =
    * I_SOFT_REFRESH =
          EXCEPTIONS
            finished = 1
            OTHERS = 2.
          IF sy-subrc <> 0.
    *--Exception handling
          ENDIF.
        ENDIF.
        CALL METHOD grid_r->register_edit_event
          EXPORTING
            i_event_id = cl_gui_alv_grid=>mc_evt_enter.
        CALL METHOD grid_r->register_edit_event
          EXPORTING
            i_event_id = cl_gui_alv_grid=>mc_evt_modified.
    ENDFORM.
    FORM prepare_field_catalog CHANGING pt_fieldcat TYPE lvc_t_fcat.
      DATA ls_fcat TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
      EXPORTING
        i_structure_name = 'ZBC_DAN_REGSTR2'
      CHANGING
        ct_fieldcat = pt_fieldcat[]
      EXCEPTIONS
        inconsistent_interface = 1
        program_error = 2
        OTHERS = 3.
      IF sy-subrc <> 0.
    *--Exception handling
      ENDIF.
      LOOP AT pt_fieldcat INTO ls_fcat.
        CASE ls_fcat-fieldname.
          WHEN 'NAME'.
            ls_fcat-coltext = 'Name'.
            ls_fcat-outputlen = '40'.
            MODIFY pt_fieldcat FROM ls_fcat.
          WHEN 'VALUE'.
            ls_fcat-coltext = 'Wert'.
            ls_fcat-outputlen = '30'.
            MODIFY pt_fieldcat FROM ls_fcat.
          WHEN 'CATEGORY'.
              LOOP AT lt_category into ls_category.
                ls_ddval-handle = 1.
                ls_ddval-value = ls_category-category.
    *            ls_ddval-style = cl_gui_alv_grid=>mc_style_enabled.
                APPEND ls_ddval TO lt_ddval.
             ENDLOOP.
             CALL METHOD grid_r->set_drop_down_table
                EXPORTING it_drop_down = lt_ddval.
            ls_fcat-edit = 'X'.
            ls_fcat-drdn_hndl = '1'.
            ls_fcat-coltext = 'Kategorie'.
            MODIFY pt_fieldcat FROM ls_fcat.
        ENDCASE.
      ENDLOOP.
    ENDFORM.
    FORM prepare_layout CHANGING ps_layout TYPE lvc_s_layo.
      ps_layout-zebra = 'X'.
      ps_layout-grid_title = 'Kategorie zur Registry hinzufügen'.
      ps_layout-smalltitle = 'X'.
    ENDFORM.
    FORM save_data.
      DATA: ls_ins_keys TYPE g_verifier->ls_registrz_keys,
            ls_ins_key TYPE g_verifier->lt_registrz_key,
            ls_registrz TYPE zbc_dan_regstrz,
            ls_outtab LIKE LINE OF gt_outtab,
            lt_instab TYPE TABLE OF zbc_dan_regstrz.
      CALL METHOD g_verifier->get_inserted_rows IMPORTING inserted_rows = ls_ins_keys.
      LOOP AT ls_ins_keys INTO ls_ins_key.
        READ TABLE gt_outtab INTO ls_outtab
        WITH KEY  name = ls_ins_key-name
                  value = ls_ins_key-value
                  category = ls_ins_key-category.
        IF sy-subrc = 0.
          MOVE-CORRESPONDING ls_outtab TO ls_registrz.
          APPEND ls_registrz TO lt_instab.
        ENDIF.
      ENDLOOP.
      INSERT zbc_dan_regstrz FROM TABLE lt_instab.
      CALL METHOD g_verifier->refresh_delta_tables.
      ENDFORM.

    Hi Hans,
    You raised the Question in the Webdynpro ABAP forum. Here its very diffcult to get the answer from this forum. Please close it here and raise the same question in ABAP General Forum there you will get faster and so many anwsers.
    Please close the question here.
    Warm Regards,
    Vijay

  • Need simple ALV Grid prgm with interactive

    Hi experts,
    pls anyone provide some sample code for simple alv grid for the study purpose.
    i want to knw how the Interactive alv works, how to display some header details like company name and address in the top of the grid.

    hi,
    check this programme..
    Display a Secondary List using ALV Grid
    To display a secondary list when you click on one of the row items in an alv grid. The secondary list should also be an alv.
    Try out this code. You will have to make a structure ZSTR same as the output internal table.
    REPORT ZTEST_REP1 .
    TABLES : MARA,
             BHDGD,
             zstr.
    TYPES:     BEGIN OF T_MARA,
                  MATNR LIKE MARA-MATNR,
                  ERNAM LIKE MARA-ERNAM,
               END OF T_MARA.
    CLASS LCL_EVENT_RECEIVER DEFINITION DEFERRED.
    *Constants for ALV Implementation
    CONSTANTS:  C_SET                        VALUE 'X',
                C_RESET                      VALUE '0',
                C_SAVE                       VALUE 'A',
                C_EXIT(4)                    VALUE 'EXIT',
                C_BACK(4)                    VALUE 'BACK',
                C_CANC(4)                    VALUE 'CANC',
                C_PGTOP(5)                   VALUE 'PGTOP',
                C_PGUP(4)                    VALUE 'PGUP',
                C_PGDN(4)                    VALUE 'PGDN',
                C_PGEND(5)                   VALUE 'PGEND'.
    DATA : I_MARA TYPE STANDARD TABLE OF T_MARA WITH HEADER LINE,
         Internal table for fields catalouge
           I_FIELDCAT TYPE LVC_T_FCAT WITH HEADER LINE,
          i_fieldcat2 type lvc_t_fcat with header line,
         Internal table for cursor position
           I_GT_SELROWS TYPE LVC_T_ROW .
    DATA : WA_MARA LIKE I_MARA,
           WA_GRIDROW LIKE LVC_S_ROW,
           WA_GRIDCOL LIKE LVC_S_COL.
    *Data for ALV Implementation.
    DATA:  OK_CODE       LIKE SY-UCOMM,
           W_OK_CODE     LIKE SY-UCOMM,
           W_CALL        TYPE I VALUE 1,
           W_TAB         LIKE SY-UCOMM VALUE 'TAB1',
           W_SAVE,                                 "For Parameter I_SAVE
           W_VARIANT     TYPE DISVARIANT,          "For parameter IS_VARIANT
           W_GRID        TYPE REF TO CL_GUI_ALV_GRID,
          w_grid1       type ref to cl_gui_alv_grid,
           W_CONTAINER  TYPE REF TO CL_GUI_CUSTOM_CONTAINER,
          w_container1  type ref to cl_gui_custom_container,
           W_REPID       LIKE SY-REPID,
           W_GS_PRINT    TYPE LVC_S_PRNT,
           W_GS_LAYOUT   TYPE LVC_S_LAYO,
           W_EVENT_REC   TYPE REF TO LCL_EVENT_RECEIVER,
           W_CONT_MAIN   TYPE SCRFNAME VALUE 'CCCONTAINER',
           W_LN          TYPE I,                            "line number
           W_INDEX       LIKE SY-TABIX,
           W_FLAG,
           W_TEMP_VAL    TYPE I.
    Definition:
    CLASS LCL_EVENT_RECEIVER DEFINITION.
      PUBLIC SECTION.
        METHODS:
        HANDLE_TOP_OF_PAGE
            FOR EVENT PRINT_TOP_OF_PAGE OF CL_GUI_ALV_GRID,
        HANDLE_DOUBLE_CLICK
            FOR EVENT DOUBLE_CLICK OF CL_GUI_ALV_GRID
                    IMPORTING E_ROW E_COLUMN.
    ENDCLASS.
    CLASS LCL_EVENT_RECEIVER IMPLEMENTATION
    CLASS LCL_EVENT_RECEIVER IMPLEMENTATION.
      METHOD HANDLE_TOP_OF_PAGE.
        PERFORM F_GET_HEADER.
      ENDMETHOD.                           "handle_top_of_page
      METHOD HANDLE_DOUBLE_CLICK.
      The event DOUBLE_CLICK provides parameters for row and column
      of the click. We use row parameter to select a line of the
      corresponding internal table.
      read selected row from internal table
          READ TABLE I_MARA INDEX E_ROW-INDEX INTO WA_MARA.
          IF SY-SUBRC <> 0.
           message i001. " Cursor position not correct.
          ELSE.
          call dialog screen and display the details
            call screen 200 starting at 10 5.
          ENDIF.
      ENDMETHOD.                           "handle_double_click
    ENDCLASS.
    start-of-selection.
    START-OF-SELECTION.
    SELECT MATNR ERNAM FROM MARA INTO TABLE I_MARA.
    End-of-Selection.
    END-OF-SELECTION.
    Start of ALV part.
      W_REPID = SY-REPID.
      W_VARIANT-REPORT = W_REPID.
      W_SAVE = C_SAVE.
      W_CONT_MAIN = W_CONT_MAIN.
      W_GS_LAYOUT = W_GS_LAYOUT.
      W_GS_PRINT  = W_GS_PRINT.
      I_FIELDCAT  = I_FIELDCAT.
      CALL SCREEN 100.
    *&      Form  f_get_header
          text
    -->  p1        text
    <--  p2        text
    FORM F_GET_HEADER.
      DATA: L_LINE1 LIKE BHDGD-LINE1,
            L_LINE2 LIKE BHDGD-LINE2.
      CONSTANTS LC_SPACE VALUE ' '.
      DATA: L_F1(7), L_F2(11), L_F3(9), L_F4(6), L_F5(11), L_F6(4), L_F7(8),
            L_F8(4),L_F9(10), L_F11(11), L_F12(24), L_F13(4),
            L_F14(3).
    take the values of line1 and line2 into two new variables, otherwise
    after coming back to the first screen from the print preview, the
    header shows the condensed lines
      L_LINE1 = BHDGD-LINE1.
      L_LINE2 = BHDGD-LINE2.
      CONDENSE L_LINE1.
      CONDENSE L_LINE2.
    *split the lines to display the whole lines within the
    *stipulated report-width
    SPLIT L_LINE1 AT LC_SPACE INTO L_F1 L_F2 L_F3 L_F4 L_F5 L_F6 L_F7 L_F8
                                        L_F9 .
      SPLIT L_LINE2 AT LC_SPACE INTO L_F11 L_F12 L_F13 L_F14.
      L_F14 = SY-PAGNO.
        WRITE:/1 L_F1, 9 L_F2, 40 L_F3, 50 L_F4, 57 L_F5, 88 L_F6, 93 L_F7 ,
               103 L_F8 , 108 L_F9 .
        WRITE:/1 L_F11, 40 TEXT-012, 78 L_F12, 103 L_F13, 108 L_F14.
    ENDFORM.                    " f_get_header
    *&      Module  STATUS_0100  OUTPUT
          text
    MODULE STATUS_0100 OUTPUT.
      SET PF-STATUS 'STAT'.
      SET TITLEBAR 'TITL'.
    ENDMODULE.                 " STATUS_0100  OUTPUT
    *&      Module  USER_COMMAND_0100  INPUT
          text
    MODULE USER_COMMAND_0100 INPUT.
      CASE SY-UCOMM .
        WHEN C_EXIT OR C_BACK OR C_CANC.
          IF NOT W_CONTAINER  IS INITIAL.
            CALL METHOD W_CONTAINER->FREE.
          ENDIF.
          LEAVE TO SCREEN 0.
        WHEN C_PGTOP.
          WA_GRIDROW-INDEX = 1.
        WHEN C_PGUP.
          IF WA_GRIDROW-INDEX <= 15.
            WA_GRIDROW-INDEX = 1.
          ELSE.
            WA_GRIDROW-INDEX = WA_GRIDROW-INDEX - 15.
          ENDIF.
        WHEN C_PGDN.
          PERFORM F_GET_NO_ROWS.
          W_TEMP_VAL = W_LN - WA_GRIDROW-INDEX.
          IF W_TEMP_VAL < 15.
            WA_GRIDROW-INDEX = W_LN.
          ELSE.
            WA_GRIDROW-INDEX = WA_GRIDROW-INDEX + 15.
          ENDIF.
        WHEN C_PGEND.
          PERFORM F_GET_NO_ROWS.
          WA_GRIDROW-INDEX = W_LN.
      ENDCASE.
    ENDMODULE.                 " USER_COMMAND_0100  INPUT
    *&      Form  f_get_no_rows
          text
    -->  p1        text
    <--  p2        text
    FORM F_GET_NO_ROWS.
        DESCRIBE TABLE I_MARA  LINES W_LN.
    ENDFORM.                    " f_get_no_rows
    *&      Module  DISPLAY_0100  OUTPUT
          text
    MODULE DISPLAY_0100 OUTPUT.
      IF NOT WA_GRIDROW IS INITIAL
      AND NOT WA_GRIDCOL IS INITIAL.
        CALL METHOD W_GRID->SET_SCROLL_INFO_VIA_ID
          EXPORTING
            IS_ROW_INFO = WA_GRIDROW
            IS_COL_INFO = WA_GRIDCOL .
        CALL METHOD W_GRID->SET_CURRENT_CELL_VIA_ID
          EXPORTING
            IS_ROW_ID = WA_GRIDROW
            IS_COLUMN_ID = WA_GRIDCOL .
      ENDIF.
      CALL METHOD W_GRID->GET_SCROLL_INFO_VIA_ID
      IMPORTING
        ES_ROW_INFO = WA_GRIDROW
        ES_COL_INFO = WA_GRIDCOL .
      CALL METHOD W_GRID->GET_SELECTED_ROWS
        IMPORTING
          ET_INDEX_ROWS = I_GT_SELROWS[].
    Build the fieldcat according to structure
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
           EXPORTING
                I_STRUCTURE_NAME = 'ZSTR'
           CHANGING
                CT_FIELDCAT      = I_FIELDCAT[].
      LOOP AT I_FIELDCAT.
        W_INDEX = SY-TABIX.
        CASE I_FIELDCAT-FIELDNAME.
          WHEN 'MATNR'.
            I_FIELDCAT-SCRTEXT_S = 'MATNR'.
            I_FIELDCAT-KEY       = ' '.
            I_FIELDCAT-COL_POS   = '1'.
          WHEN 'ERNAM'.
            I_FIELDCAT-SCRTEXT_S = 'ERDAT'.
            I_FIELDCAT-OUTPUTLEN = '18'.
            I_FIELDCAT-COL_POS   = '2'.
        ENDCASE.
        MODIFY I_FIELDCAT INDEX W_INDEX.
      ENDLOOP.
      READ TABLE I_FIELDCAT INDEX 1 .
      IF W_CALL = 1.
        PERFORM F_STD_HEADER.
        CALL METHOD W_GRID->SET_TABLE_FOR_FIRST_DISPLAY
                          EXPORTING
                            IS_VARIANT                    = W_VARIANT
                            I_SAVE                        = W_SAVE
                          CHANGING
                            IT_OUTTAB                     = I_MARA[]
                            IT_FIELDCATALOG               = I_FIELDCAT[]
                         EXCEPTIONS
                           INVALID_PARAMETER_COMBINATION = 1
                           PROGRAM_ERROR                 = 2
                           OTHERS                        = 3.
        IF SY-SUBRC <> 0.
          MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                     WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          EXIT.
        ENDIF.
        CREATE OBJECT W_EVENT_REC.
        SET HANDLER W_EVENT_REC->HANDLE_TOP_OF_PAGE FOR W_GRID.
        CREATE OBJECT W_EVENT_REC.
        SET HANDLER W_EVENT_REC->HANDLE_DOUBLE_CLICK FOR W_GRID.
        W_FLAG = C_RESET.
        CALL METHOD CL_GUI_CONTROL=>SET_FOCUS EXPORTING CONTROL = W_GRID.
        W_CALL = 0.
      ENDIF.
    ENDMODULE.                 " DISPLAY_0100  OUTPUT
    *&      Form  f_std_header
          text
    -->  p1        text
    <--  p2        text
    FORM F_STD_HEADER.
    ENDFORM.                    " f_std_header
    *&      Module  DYNPRONR_CHECK_500  OUTPUT
          text
    MODULE DYNPRONR_CHECK_500 OUTPUT.
    if w_dynpronr is initial.
       w_dynpronr = '0100'.
    endif.
      ENDMODULE.                 " DYNPRONR_CHECK_500  OUTPUT
    *&      Module  create_objects_0100  OUTPUT
          text
    MODULE create_objects_0100 OUTPUT.
      check w_container is initial .
      create object w_container
        exporting
           container_name = 'CC'.
      create object w_grid
        exporting
           i_parent = w_container.
      w_flag = c_set.
      w_flag = w_flag.
    ENDMODULE.                 " create_objects_0100  OUTPUT
    *&      Module  STATUS_0200  OUTPUT
          text
    MODULE STATUS_0200 OUTPUT.
      SET PF-STATUS 'ST20'.
      SET TITLEBAR '200'.
      zstr-matnr    = wa_mara-matnr.
      zstr-ernam    = wa_mara-ernam.
    ENDMODULE.                 " STATUS_0200  OUTPUT
    *&      Module  USER_COMMAND_0200  INPUT
          text
    MODULE USER_COMMAND_0200 INPUT.
      move ok_code to w_ok_code.
      clear ok_code.
      case w_ok_code.
        when c_back or c_exit or c_canc.
          leave to screen 0.
      endcase.
      clear w_ok_code.
    ENDMODULE.                 " USER_COMMAND_0200  INPUT
    *-- End of Program
    Regards,
    Deepthi.

  • ALV GRID ONE LINE EDIT

    Hi,
    I have a ALV grid where I have a column as a editable. Now the problem is ALV grid is displaying 2 rows and only first line should be editable. Any idea how to do.
    KK.

    Hi,
    1. * Type of final output table
    TYPES : BEGIN OF ty_output.
            INCLUDE STRUCTURE zjay_alv.
    For cell editing and displaying cell as push button
    TYPES : <b>cellstyles TYPE lvc_t_styl</b> ,
            END OF ty_output.
    data        itab2 TYPE STANDARD TABLE OF ty_output.
    2. w_layout-stylefname = 'CELLSTYLES' ."
    3. CLEAR : wa2, w_style.
        READ TABLE itab2 INTO wa2 index 2.
        IF sy-subrc EQ 0.
          w_style-fieldname = 'ERSDA'.
          w_style-style = cl_gui_alv_grid=>mc_style_disabled.
          REFRESH wa2-cellstyles.
          APPEND w_style TO wa2-cellstyles.
          MODIFY itab2 FROM wa2 TRANSPORTING cellstyles
          WHERE matnr = wa2-matnr.
        ENDIF.
    4.    CALL METHOD o_grid->set_table_for_first_display
          EXPORTING
          is_layout                     = w_layout
          CHANGING
          it_outtab                     = itab2
          it_fieldcatalog               = i_fieldcat.
    Kindly reward points by clicking the star on the left of reply,if it helps.

  • Hotspot click for only some rows in ALV grid for a particular column ?

    Hi there,
            In ALV grid, we can make Hotspot enable for all rows in a specified column
    by specifying in the fieldcatalog with Hotspot attribute set as true.
    But I want to enable Hotspot only for certain rows in the particular column. I tried with MC_STYLE4_LINK , but I didnt got the required result.
    So , how could I achieve that in ALV grid.
    Points would be rewarded for helpful answers.
    Regards,
    Anil .

    Hi,
    You can do it for a column. Please refer to the code snippet below,
      DATA : it_fcat TYPE lvc_t_fcat,
             wa_fcat LIKE LINE OF it_fcat.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
       EXPORTING
      I_BUFFER_ACTIVE              =
         i_structure_name             = 'SMMW_ALERTS_ICON_S'
      I_CLIENT_NEVER_DISPLAY       = 'X'
      I_BYPASSING_BUFFER           =
      I_INTERNAL_TABNAME           =
        CHANGING
          ct_fieldcat                  = it_fcat
       EXCEPTIONS
         inconsistent_interface       = 1
         program_error                = 2
         OTHERS                       = 3
    LOOP AT it_fcat INTO wa_fcat.
      IF wa_fcat-fieldname = 'STATUS'.
        wa_fcat-hotspot = 'X'.
        MODIFY it_fcat FROM wa_fcat.
        CLEAR wa_fcat.
      ENDIF.
    ENDLOOP.
    CALL METHOD l_obj_alv_grid->set_table_for_first_display
          EXPORTING
        i_structure_name              = 'SMMW_ALERTS_ICON_S'
       CHANGING
            it_outtab                     = lt_alerts_st
            it_fieldcatalog               = it_fcat.
    In the above replace the structure 'SMMW_ALERTS_ICON_S' with your structure and column 'STATUS' with your desired column.
    Hope this helps,
    Regards,
    Vinodh

  • ALV Grid Exporting to Excel - Columns out of order

    Hi,
    In my ALV grid everything is in order as it is in the structure. When however I export to excel from ALV grid, the columns are out of order. First it lists the string columns, then number columns and lastly date columns. Is there a way to make excel keep the same order as it is in ALV grid?
    Thanks,
    Sergiy

    I am not much of an ABAPer but I was able to set the column position during data declaration with
    gs_fcat_line-col_pos = 1, for example.
    That would put the column in the first position in ALV as well as the excel export.
    Thanks for your inputs.
    Sergiy

  • Alv grid display with dynamic colums

    Hi,
    i have an alv grid program in which i have to display the 22 fields as rows and i want to freeze them.i also want to display data for the 22 fields for a variable date range i.e. if you consider i have colums A to Z then i have have this sort of display:
    Sel screen:
    year(select-options):
    alv output:
                   Year1 Year2 ...........................Year N
    A
    B
    C
    D
    E
    F
    Z
    Please help me.
    i tried using fieldcatalog-row_pos = my row numbers i.e. 1,2....22.
    Thanks,
    Anand.

    Hi Anand,
    U need to create a dynamic field catalog as well as internal table to handle the year select option and to display the grid.
    See the below code creating dynamic field catalogue and internal table.   The same requirement like urs.
        LOOP AT i_month.
          CASE i_month-date+4(2).
            WHEN '01'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual JAN-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With JAN-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '02'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual FEB-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With FEB-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '03'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual MAR-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With MAR-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '04'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual APR-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With APR-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '05'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual MAY-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With MAY-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '06'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual JUN-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With JUN-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '07'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual JUL-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With JUL-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '08'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual AUG-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With AUG-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '09'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual SEP-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With SEP-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '10'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual OCT-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With OCT-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '11'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual NOV-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With NOV-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
            WHEN '12'.
              IF i_month-tag = 'A'.
                CONCATENATE 'Actual DEC-'
                            i_month-date(4)
                            ' Surcharge'
                       INTO i_month-desc.
              ELSE.
                CONCATENATE 'With DEC-'
                            i_month-date(4)
                            ' Pricing'
                       INTO i_month-desc.
              ENDIF.
          ENDCASE.
          MODIFY i_month.
          IF i_month-tag = 'A'.
    Field for reference month surcharge
           CONCATENATE i_month-tag i_month-date(6) INTO
    fs_fldcat-fieldname.
            fs_fldcat-datatype  = 'CHAR'.
            fs_fldcat-intlen    = 18.
            CONDENSE fs_fldcat-fieldname NO-GAPS.
            APPEND fs_fldcat TO i_fldcat.
          ELSE.
    Fields for Compared month surcharge
           CONCATENATE i_month-tag i_month-date(6) INTO
    fs_fldcat-fieldname.
            fs_fldcat-datatype  = 'CHAR'.
            fs_fldcat-intlen    = 18.
            CONDENSE fs_fldcat-fieldname NO-GAPS.
            APPEND fs_fldcat TO i_fldcat.
    Field for indicator
            CONCATENATE 'I' i_month-date(6) INTO fs_fldcat-fieldname.
            fs_fldcat-datatype  = 'CHAR'.
            fs_fldcat-intlen    = 1.
            CONDENSE fs_fldcat-fieldname NO-GAPS.
            APPEND fs_fldcat TO i_fldcat.
    Field for difference surcharge
            CONCATENATE 'D' i_month-date(6) INTO fs_fldcat-fieldname.
            fs_fldcat-datatype  = 'CHAR'.
            fs_fldcat-intlen    = '18'.
            CONDENSE fs_fldcat-fieldname NO-GAPS.
            APPEND fs_fldcat TO i_fldcat.
          ENDIF.                           " IF i_month-tag = 'A'.
        ENDLOOP.                           " LOOP AT i_month.
      ENDIF.                               " IF NOT i_month[] IS INITIAL.
    Method to create dynamic table.
      IF NOT i_fldcat[] IS INITIAL.
        CALL METHOD cl_alv_table_create=>create_dynamic_table
          EXPORTING
            it_fieldcatalog           = i_fldcat[]
          IMPORTING
            ep_table                  = i_table
          EXCEPTIONS
            generate_subpool_dir_full = 1
            OTHERS                    = 2
        IF sy-subrc <> 0.
        ENDIF.                             " IF sy-subrc <> 0.
        ASSIGN i_table->* TO <i_output>.
        CREATE DATA fs_line LIKE LINE OF <i_output>.
        ASSIGN fs_line->* TO <fs_output>.
      ENDIF.                               " IF NOT i_fldcat[] IS INITIAL.

  • ALV Grid fields from editable to non-editable mode

    Hi,
    I am displaying my data through ALV Grid. In my grid the non-key fields are in editable mode.
    When I edit any of the editable fields and place the cursor on other field the field which I have edited should become disable(non-editable). Again if I want to edit the same field which is now in non-editable mode should again change to editable mode when the cursor is placed on it.
    Thanks & Regards,
    Adithya M.

    Hi Adithya,
    I am confused by your statement "place the cursor on other field the field which I have edited should become disable" -- are you stating that this is the requirement or what is currently happening with your program.  The way the edit fields should work by default is they are editable at all times unless you tell it otherwise. 
    If you are saying your requirement is to change the field to disabled once the field is edited (runtime change), first you want to handle the event on data changed then within your method of handling on data changed, you can disable the field from being edited by using cell styles and changing the value to disabled. 
    If you look at program BCALV_GRID_EDIT,
    You will find code where it disables the field for edit using Cell Style -- this will give you an idea how Cell Style controls editable fields and display fields:
            ls_cell-style  = cl_gui_alv_grid=>mc_style_enabled.
            ls_cell-maxlen = 4.
            ls_cell-fieldname = 'CARRNAME'.
            append ls_cell to gt_sflight-cell.
    This specific code will set the field disabled when the program is first exectued, in your case if you need to do this at run time, after someone edits the field, you need to implement handling the event on data changed, in the same program you will find:
    method handle_data_changed.                 
       perform data_changed using er_data_changed.
    endmethod.                     
    It is within this method that you can disable a field for editing.
    However, once it is disabled you will not get back into the handle_data_changed method.  I'm not sure I understand your statement "Again if I want to edit the same field which is now in non-editable mode should again change to editable mode when the cursor is placed on it."  Why would you want the user to be able to edit something, then show it disabled, then let them click on it and edit it again?  Why not just leave it in edit mode?  Maybe if I understand the requirement better, I can answer this portion of the question. 
    If this is based on security or changing from edit to display for the entire grid, you can run the same program mentioned above and click on the Change/Display button in the top left to see how it enables and disables the entire grid for editing.
    Cheers,
    Bonnie

  • ALV Grid Download to Excel - Columns in wrong order

    I'm using the object cl_gui_alv_grid to output an ALV grid to the screen.  I've populated the field catalogue as follows:
    wa_alvfieldcat-col_pos = 1.
    wa_alvfieldcat-just = 'L'.
    wa_alvfieldcat-reptext = 'Customer Name'.
    wa_alvfieldcat-scrtext_s = 'Customer'.
    wa_alvfieldcat-scrtext_m = 'Customer'.
    wa_alvfieldcat-scrtext_l = 'Customer Name'.
    wa_alvfieldcat-outputlen = 35.
    wa_alvfieldcat-tabname = 'GTBL_REPORT'.
    wa_alvfieldcat-fieldname = 'CUST_NO'.
    The screen shows the table correctly in the order I've specified using COL_POS.  But when I select the download function from the ALV grid it moves all the date fields to the end instead of using the order I wanted.
    Any ideas?

      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'ZCONTRACT_REPORT'
        CHANGING
          ct_fieldcat      = tbl_alvfieldcat.
    then
      LOOP AT tbl_alvfieldcat INTO wa_alvfieldcat.
        MOVE 'GTBL_REPORT' TO wa_alvfieldcat-tabname.
        CASE wa_alvfieldcat-fieldname.
          WHEN 'DATE_ORDER'.
            wa_alvfieldcat-col_pos = 4.
            wa_alvfieldcat-just = 'L'.
            wa_alvfieldcat-reptext = 'Date Order'.
            wa_alvfieldcat-scrtext_s = 'Date Order'.
            wa_alvfieldcat-scrtext_m = 'Date Order'.
            wa_alvfieldcat-scrtext_l = 'Date Order'.
            wa_alvfieldcat-outputlen = 10.

  • Reg: Download alv grid data with top of page into excel sheet

    Hi All,
    I have a selection screen with radio button for download .
    If that radio button was selected then the data will download into excel sheet (like if we execute normal ALV grid display from there we can download top-of-page and body as it is).
    AOO : 2009P               
    Fiscal year : 2009               
    Posting period : 00               
    Local Currency : USD               
    CO Area Currency :               
    Accounting standard:               
    Sector : 23               
    BB code     Period Value LC     Periodic Quantity
    AHDKGKAJ   200                         0

    Did not get your question

  • ALV grid case-sensitive edit field

    Hello,
    i've a editable field on a alv grid.
    The field is case-sensitive in the domain.
    But when i enter a field an click rturn, the letters get uppercase.
    What's the problem?
    Best regards,
    TomSd

    Hi,
    Add the attribute  lowercase = 'X'  while preapring field catalog for this field.
    Regards,
    Gopi.
    Reward points if helpfull.

  • Bsp table with editable columns

    Hi,
    I want to create a table with some columns and include check box.
    Is it possible?
    I want to do this
    Table :
    Date   Time    Checkbox   Checkbox
    Also how can i make the columns editable ?
    Thank you

    hello,
    The basic idea would be use ITERATOR class reference in your 'Tavleview' HTMLB element
    Iterator class should user interface 'IF_HTMLB_TABLEVIEW_ITERATOR', here you can modify column properties (GET_COLUMN_DEFINITIONS method) and cell properties (RENDER_CELL_START)
    For your need:
    RENDER_CELL_START method, example coding would be:
    CASE p_column_key.
         WHEN 'Column name'.
        p_replacement_bee = cl_htmlb_checkbox=>factory(
                            id       = p_cell_id
                            _checked = p_cell_binding
                            disabled = 'X' ).
      ENDCASE.
    Thanks

  • ALV Grid Details Screen Editable

    Hi All,
    I have requirement to Edit the ALV grid.
    ie I have ALV grid , after selecting (highlighting a line ), the user will go to the details screen, i need to be the details screen
    should be editable. Please give info about this.
    Thanks
    aRs

    My problem is if you put details screen also displayed in horizontal way. I need to display the fields in vertical order.and it should editable
    If you press details icon the grid, you see the selected records displays like the following , but i need to editable
    eg.
    Number     :  XXXXXX
    Desc        :   XXXXXXXXXXXXXXXXX
    Name        :  XXXXXXXXXXXXXXXXX
    Thanks
    aRs

Maybe you are looking for

  • How to change ui element from input field to TextArea?

    Dear colleagues, When I try to add an attribute of type string  in Ui configuration, I found it's by default INPUT_FIELD and can not change to text_area, does any one know how to do this? It will be better if you can tell me how to set text and get t

  • How to cancell material document in decentralized scenario

    Dear All, How to cancel material document in a decentralized WM (WMS)??? I know that in a centralized scenario I should use MBST or VL09. Is there any solution? I would be grateful if you help me. Piotrek

  • ORA-01436: CONNECT BY loop in user data OBIEE

    Datatemplate errors out with this.. <dataTemplate name="ROWSET" defaultPackage="" > <properties> <property name="include_parameters" value="true"/> <property name="include_null_Element" value="true"/> <property name="include_rowsettag" value="false"/

  • Caching Swings Graphics

    I'm running a big application, with many screens (JPanels) on a slow system. The average time for the system to change screens is about 200ms. The first time you visit a screen, the average time to load is 400ms. Every time after that, its about 200m

  • Language based on Java?

    I am completely new to this, and the is the most relevant forum I could find... Anyway, I am interested in writing a new language based on Java. Basically, it will just be a different programming paradigm than OOP, but be Java. Therefore, I would lik