ALV grid modifying cell content

Hi ,
I'm woking on a class based ALV GRID program.
In it i have to change the content of one cell when another cell content is changed.
I have done the using
1.Handle data changed in grid
  METHOD handle_data_changed.
    PERFORM data_changed USING er_data_changed.
  ENDMETHOD.
*2
DAta :  pw_data_changed2 TYPE REF TO
cl_alv_changed_data_protocol.
  CALL METHOD pw_data_changed2->modify_cell
                  EXPORTING i_tabix     = pwl_row_id
                            i_fieldname = pw_fldname
                            i_value     = pw_fldvalue.
The problem is the cell contents are changing  only when i press enter button. Is there any way as soon as i change the contents of one cell other cell contents also changes.
Regards
Srikanth

hanks for the suggetions .
When I add the
  CALL METHOD w_grid->register_edit_event
  EXPORTING
  i_event_id = cl_gui_alv_grid=>mc_evt_modified.
My earlier statements to display the error messages from
CL_ALV_CHANGED_DATA_PROTOCOL are not working (CL_ALV_CHANGED_DATA_PROTOCOL=>ADD_PROTOCOL_ENTRY).
But when I comment
CALL METHOD w_grid->register_edit_event
  EXPORTING
  i_event_id = cl_gui_alv_grid=>mc_evt_modified.
and press enter then the error messages in the popup window are displayed.
I tried using CL_GUI_CFW=FLUSH also. But it also not working.
why CL_ALV_CHANGED_DATA_PROTOCOL=>ADD_PROTOCOL_ENTRY is not working when i add mc_evt_modified  .

Similar Messages

  • Need help in ALV grid editable cells

    Hi,
    I have created a ALV Grid program in which i made certain cells as editable cells.Now my question is if suppose i have 2 rows in my output then if i change the 2nd rows some cells, then some calculation has to perform till this it is fine but nw i want to modify the 3rd rows some cells as per the changes in 2nd row.
    How to do it with ALV oops concepts.
    I have refered BCALV_EDIT_02 and BCALV_EDIT_03 these std programs.
    Thanks & Regards
    Madhuri

    Hello Madhuri
    I recommend to do any post-processing of the changed data OUTSIDE your event handler method (HANDLE_DATA_CHANGED).
    Within the event handler method do all required validations and the trigger PAI by calling method CL_GUI_CFW=>SET_NEW_OK_CODE (for an example refer to my sample report ZUS_SDN_TWO_ALV_GRIDS in alv)
    Now at PAI of your screen you can do any kind of post-processing, calculation, etc. within the itab used for the ALV list.
    Regards
      Uwe

  • ALV Grid merge cells horizontally for specific record

    Hi Experts,
    We have a requirement regarding ALV Grid developement.
    In ALV Grid, we will have multiple records as normal output.
    Output will be as below.
    In that, we need Summery Text should be in from Field 2 * to*  Field 6 as a single Cell and below that all output
    will be normal each cell wise.
    That Summery will come for each new Field1.
    OUTPUT
    Field1  Field2  Field3    Field4  Field5  Field6  Field7   Field8   Field9
    001  | . ....      ..        ..  Summery  ........... |  10   |  20      |  30
    001  |  10   |    20  |     30  |   40   |    50  |   60 |    70  |   80     |
    001  |  10   |    20  |     30  |   40   |    50  |   60 |    70  |   80     |
    001  |  10   |    20  |     30  |   40   |    50  |   60 |    70  |   80     |
    001  |  10   |    20  |     30  |   40   |    50  |   60 |    70  |   80     |
    Thanks & regards
    Manglesh

    Hi Manglesh,
    sorry ALV is not as flexible as Excel may be.
    You can only define a header in that way but it would be above the column headings.
    The ALV table display allows only to change the width of the whole column.
    Regards,
    Clemens

  • ALV Grid editing cell cursor position

    Hello !
    i hope i can get the answer to my question here.
    i have an alv-grid with editable cells
    when i click in one cell (it is a textfield) where there is no more written text it marks the hole cell and when i start to write, it overwrites the whole text.
    i would like the cursor to be placed at the end of the field in this case.
    when i click in the cell where there is written text it is ok - it puts the cursor to the clicked position.
    thanks very much for your help
    Helmut

    Hi, i am also facing same probelm.
    after  call method sender->refresh_table_display.
    i am using
    call method sender->set_current_cell_via_id
          exporting
            is_row_id    = l_rowid
            is_column_id = l_colid.
    this will simply select the cell. i am not able to see curser in end or front of the cell.Can anybody please suggest me how to it.
    Thanks
    Sudhakar

  • About ALV Grid's cell merge..Helpppp

    Dear gurus:
    I just write some code in order to learn alv.
    but i find when i sort the data by 'carrid', the cells which have same data was merged. and i declare the cell_merge = space, the result is just the same, how can i solve it? i want the cells not merge.
    REPORT  zzalv17.
    TYPE-POOLS: slis.
    TABLES: spfli.
    DATA: it_sortinfo TYPE slis_t_sortinfo_alv,
          wa_sortinfo TYPE slis_sortinfo_alv,
          it_layout TYPE slis_layout_alv,
          it_spfli LIKE STANDARD TABLE OF spfli.
    SELECT *
    INTO CORRESPONDING FIELDS OF TABLE it_spfli
    FROM spfli.
    CLEAR wa_sortinfo.
    wa_sortinfo-spos = 1.
    wa_sortinfo-fieldname = 'CARRID'.
    wa_sortinfo-up = 'X'.
    APPEND wa_sortinfo TO it_sortinfo.
    it_layout-zebra = 'X'.
    it_layout-detail_popup = 'X'.
    it_layout-colwidth_optimize = 'X'.
    it_layout-cell_merge = space.
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
      EXPORTING
        it_sort          = it_sortinfo
        is_layout        = it_layout
        i_structure_name = 'SPFLI'
        i_save           = 'X'
      TABLES
        t_outtab         = it_spfli.

    Its a little miss leading, isn't it.  Anyway, I was seeing the same, so I looked into the underlying code, and it is expecting that you pass an "N" in order to suppress the merging, so set it to "N" and it will work.
    it_layout-cell_merge = 'N'.
    Regards,
    RIch Heilman

  • ALV Grid display cell color based on value ( Function Module ALV )

    Hi,
    I want to color the cell based on value eg ( Green = Green color, Red = Red color, Amber = Yello color ).
    Each and every cell is editable after displaying on screen. once the user clicks update button the contents has to be saved to a custom table.
    Can anyone help?
    Advance thanks

    Hi,
    <li>To get color for the cell, you need to set EMPHASIZE field with below information while building fieldcatalog.
    emphasize (highlight columns in color)
    value set: SPACE, 'X' or 'Cxyz' (x:'1'-'9'; y,z: '0'=off '1'=on)
    'X' = column is colored with the default column highlight color.
    'Cxyz' = column is colored with a coded color:
    C: Color (coding must begin with C)
    x: color number
    y: bold
    z: inverse
    <li> To edit the fields, you need to set EDIT = 'X' or INPUT= 'X' . Try those .
    wa_fieldcata-input = 'X'.
    <li>you need to set PF status , to do your remaining requirement.
    <li>For any help, you have to search the forum .
    Thanks
    Venkat.O

  • Editable ALV Grid column behavior under ITS standalone

    Hello experts,
    I have a straight forward implementation of an ALV Grid with 3 columns. Two columns are display only and the third is editable. My question only involves the editable column and its behavior in a web browser served by a standalone ITS server. The underlying data type is CURR. The enterable amounts are restricted to a format of 9.99. Even so, a web user can accidentally enter a non-numeric value such as 1.x0 .  We have coded a data changed event handler to check the input value for expected amounts. The event handler logic readily identifies the non-numeric value and handles the exception. Although we have full control of the internal table value, there are two problems encountered within the web browser interface:
    1) We cannot return the cursor to the problem cell to prevent the user from continuing before correcting the problem.
    2) We cannot reset/change to displayed value to the original internal table value (it will only refresh after a save or refresh action). So the user has no visual cue that they've entered a bad value unless they pay close attention.
    Running the transaction in SAPGUI, we can force the cursor back to the erroneously cell using  "CALL METHOD alv_grid->set_scroll_info_via_id" . This technique does not appear to affect the cursor within the web browser.
    After searching SDN forums and SAP documentation it appears that there is no way to programmatically control the ALV Grid active cell within the web browser interface. I'm wondering if the experts can confirm this issue? If that is the way it works within the browser interface could members please suggest "user friendly" approaches to notifying the user of a data entry problem? For example, is POPUP_TO_INFORM to only option? Perhaps there is a JavaScript routine that can enforce the edit format? Please keep in mind that the standard ALV Grid techniques that work in SAPGUI don't necessarily behave the same way in the web browser. I'm most interested in advice regarding the web browser using standalone ITS as it will be another year before we can leverage WebDynPro in this scenario.
    Thanks and best regards,
    Gary

    Hi Gary,
    can you please create a short report which recreates the issue and post the ABAP here. The goal is that webgui and SAPGUI behaves the same way. If they don't we will try to fix it.
    Best regards,
    Klaus

  • ALV Grid  screen limit for a long field

    Hi, i am having a problem making an ALV Grid of IDOC contents, i want to show de SDATA field of de EDIDD structure, but it is a 1000 char field, and when the ALV comes out i can only see part of the field.
    I think the problem is the scrollbar, because it seems it not allows to scroll unless a field is starting or ending at the right or left of the screen.
    It is a way to solve this problem?
    thanks
    best regards
    Mariano Billinghurst.

    a®s, thank you I have already tougth that solution but my client wants to see all in the alv to compare the lines.
    I anyonelse have an idea it is wellcome!
    thanks.
    mariano.

  • Problem in cell content of alv grid ...

    hi all,
         i want to get the cell content of alv grid in the handle method of event data_changed of cl_gui_alv_grid,
    i using the following code ...
    METHOD on_data_changed.
    DATA : lv_value(30) TYPE c.
    CALL METHOD ER_DATA_CHANGED->GET_CELL_VALUE
      EXPORTING
        I_ROW_ID    = 3
       I_TABIX     =
        I_FIELDNAME = 'cname'                                                                                "" my column table
      IMPORTING
        E_VALUE     = lv_value.
    MESSAGE lv_value TYPE 'I'.
        ENDMETHOD.
    endclass.           
    but i cant get the value of cell content
    Edited by: parashuram on Oct 21, 2011 3:49 PM

    Try this way
        method handle_data_changed.
          perform handle_data_changed using er_data_changed.
        endmethod.
    form handle_data_changed using p_data_changed type ref to
                                   cl_alv_changed_data_protocol.
      data: ls_mod_cell  type lvc_s_modi,
              lv_value_dni type lvc_value.
      loop at p_data_changed->mt_mod_cells into ls_mod_cell.
        call method p_data_changed->get_cell_value
          exporting
            i_row_id    = ls_mod_cell-row_id
            i_fieldname = 'FINI_SUST' <== Your field
          importing
            e_value     = lv_value_dni .
      endloop.
    endform.

  • ALV grid using methods: how to get modified cells

    Hi all,
    IAM USING alv grid using methods,
    i have few fields as editable
    if the user edits any of those fields how can i know which cell is modified and what is the new value.
    i tried to use method get_modified_cells
    but iam getting a msg saying protected method and u can  not use.
    please advise.
    thanks
    JAfar

    Jafar,
    You need to Take the Help of DATA_CHANGED event, when ever there is a change in the Grid, it will trigger, here you can capture the Cells which are modified.
    in your PAI call the method check changed data
    CL_GUI_ALV_GRID-->CHECK_CHANGED_DATA
    You need to set the handler for datachanged.
    set the handler for this, and register the event modified or enter.
    **Handler to Check the Data Change
        HANDLE_DATA_CHANGED FOR EVENT DATA_CHANGED
                             OF CL_GUI_ALV_GRID
                             IMPORTING ER_DATA_CHANGED
                                       E_ONF4
                                       E_ONF4_BEFORE
                                       E_ONF4_AFTER,
    **Handle Data Change
      METHOD HANDLE_DATA_CHANGED.
    DATA: X_CHANGE TYPE LVC_S_MODI.  "modified cells
        LOOP AT ER_DATA_CHANGED->MT_GOOD_CELLS INTO X_CHANGE.
        ENDLOOP.
      ENDMETHOD.                    "HANDLE_DATA_CHANGED
    Regards
    Vijay

  • Modifying single cell in ALV Grid via OO

    Hi All,
    Got a problem I hope someone can assist me with.  I have a custom program generating an editable ALV grid.  The users want to update a single cell in a row with value from a custom drop down.  I've got the dropdown working, but I can't work out how to get the value back into the field.  My attempts result in a 'GETWA_NOT_ASSIGNED' short dump.
    I'm using the CL_GUI_ALV_GRID->get_selected_cells_id method to get the reference for the field to be modified, but I don't know where to go from here. 
    Any thoughts would be greatly appreciated.  Btw, my knowledge of OO is passable, but not great, so any explanations of what the code is doing in a proposed solution would be greatly appreciated.
    points will be rewarded.
    Cheers,
    Stephen

    Hello Stephen
    Since your dropdown list restrict the already allowed values there should be no special need to validate the selected values.
    Simply "grab" the data from the editable ALV into your internal itab in the ABAP report.
    I have copied sample report BCALV_EDIT_07 into ZUS_SDN_BCALV_EDIT_07 and modified the report to show how to retrieve the dropdown values (which is simple). Please note that I added the GUI-function 'SAVE' to the GUI-status MAIN100.
    *       MODULE PAI INPUT                                              *
    MODULE pai INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      "$TMP
      g_grid->check_changed_data( ). " retrieve changes from editable grid
      CASE save_ok.
        WHEN 'EXIT'.
          PERFORM exit_program.
        "$TMP
        WHEN 'SAVE'.
          PERFORM save_data.
        WHEN OTHERS.
    *     do nothing
      ENDCASE.
    ENDMODULE.                    "pai INPUT
    *&      Form  SAVE_DATA
    *       text
    FORM save_data.  "$TMP
    * define local data
      data: ls_fcat   type lvc_s_fcat,
            lt_fcat   type lvc_t_fcat.
      lt_fcat = gt_fieldcat.
      ls_fcat-edit = ' '.
      modify lt_fcat from ls_fcat
          TRANSPORTING edit
        where ( edit = 'X' ).  " display ALV should be not editable
      " Simulate saving of data
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
    *     I_INTERFACE_CHECK                 = ' '
    *     I_BYPASSING_BUFFER                =
    *     I_BUFFER_ACTIVE                   =
    *     I_CALLBACK_PROGRAM                = ' '
    *     I_CALLBACK_PF_STATUS_SET          = ' '
    *     I_CALLBACK_USER_COMMAND           = ' '
    *     I_CALLBACK_TOP_OF_PAGE            = ' '
    *     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *     I_CALLBACK_HTML_END_OF_LIST       = ' '
    *     I_STRUCTURE_NAME                  =
    *     I_BACKGROUND_ID                   = ' '
          I_GRID_TITLE                      = 'Display modified list data'
    *     I_GRID_SETTINGS                   =
    *     IS_LAYOUT_LVC                     =
          IT_FIELDCAT_LVC                   = lt_fcat
    *     IT_EXCLUDING                      =
    *     IT_SPECIAL_GROUPS_LVC             =
    *     IT_SORT_LVC                       =
    *     IT_FILTER_LVC                     =
    *     IT_HYPERLINK                      =
    *     IS_SEL_HIDE                       =
    *     I_DEFAULT                         = 'X'
    *     I_SAVE                            = ' '
    *     IS_VARIANT                        =
    *     IT_EVENTS                         =
    *     IT_EVENT_EXIT                     =
    *     IS_PRINT_LVC                      =
    *     IS_REPREP_ID_LVC                  =
          I_SCREEN_START_COLUMN             = 5
          I_SCREEN_START_LINE               = 5
          I_SCREEN_END_COLUMN               = 120
          I_SCREEN_END_LINE                 = 20
    *     I_HTML_HEIGHT_TOP                 =
    *     I_HTML_HEIGHT_END                 =
    *     IT_EXCEPT_QINFO_LVC               =
    *     IR_SALV_FULLSCREEN_ADAPTER        =
        TABLES
          t_outtab                          = gt_outtab
        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.                    "SAVE_DATA
    And here is the entire coding: In order to find the modified parts of the coding simply search for $TMP.
    PROGRAM zus_sdn_bcalv_edit_07.
    * Purpose:
    * ~~~~~~~~
    * This example shows how to define dropdown listboxes for
    * particular cells of your output table.
    * To check program behavior
    * ~~~~~~~~~~~~~~~~~~~~~~~~~
    * Conceive that customers are only allowed to smoke in the
    * first class. For this reason, if the customer is a smoker
    * only the first class (F) can be chosen in column 'CLASS',
    * otherwise all classes.
    * Essential steps (search for '§')
    * ~~~~~~~~~~~~~~~
    * 1.Define an extra field in your output table
    * 2.Define a dropdown table and pass it to ALV.
    * 3.Set your dropdown field editable and assign the fieldname of the
    *   corresponding additional field to DRDN_FIELD of the fieldcatalog.
    * 4.Set the handle of your additional field of your output
    *   table according to the listbox that shall be displayed.
    DATA: ok_code LIKE sy-ucomm,
          save_ok LIKE sy-ucomm,
          g_container TYPE scrfname VALUE 'BCALV_GRID_DEMO_0100_CONT1',
          g_grid  TYPE REF TO cl_gui_alv_grid,
          g_custom_container TYPE REF TO cl_gui_custom_container,
          gt_fieldcat TYPE lvc_t_fcat,
          gs_layout TYPE lvc_s_layo,
          g_max TYPE i VALUE 100.
    *§1.Define an extra field in your output table
    *   for each column where you want to use drop down listboxes.
    *   (One additional field refers to cells of one column).
    DATA: BEGIN OF gt_outtab OCCURS 0.
            INCLUDE STRUCTURE sbook.
    DATA: drop_down_handle TYPE int4.
    DATA: END OF gt_outtab.
    *       MAIN                                                          *
    END-OF-SELECTION.
      CALL SCREEN 100.
    *       MODULE PBO OUTPUT                                             *
    MODULE pbo OUTPUT.
      SET PF-STATUS 'MAIN100'.
      SET TITLEBAR 'MAIN100'.
      IF g_custom_container IS INITIAL.
        PERFORM create_and_init_alv CHANGING gt_outtab[]
                                             gt_fieldcat.
      ENDIF.
    ENDMODULE.                    "pbo OUTPUT
    *       MODULE PAI INPUT                                              *
    MODULE pai INPUT.
      save_ok = ok_code.
      CLEAR ok_code.
      "$TMP
      g_grid->check_changed_data( ). " retrieve changes from editable grid
      CASE save_ok.
        WHEN 'EXIT'.
          PERFORM exit_program.
        "$TMP
        WHEN 'SAVE'.
          PERFORM save_data.
        WHEN OTHERS.
    *     do nothing
      ENDCASE.
    ENDMODULE.                    "pai INPUT
    *       FORM EXIT_PROGRAM                                             *
    FORM exit_program.
      LEAVE PROGRAM.
    ENDFORM.                    "exit_program
    *&      Form  SAVE_DATA
    *       text
    FORM save_data.  "$TMP
    * define local data
      data: ls_fcat   type lvc_s_fcat,
            lt_fcat   type lvc_t_fcat.
      lt_fcat = gt_fieldcat.
      ls_fcat-edit = ' '.
      modify lt_fcat from ls_fcat
          TRANSPORTING edit
        where ( edit = 'X' ).  " display ALV should be not editable
      " Simulate saving of data
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
        EXPORTING
    *     I_INTERFACE_CHECK                 = ' '
    *     I_BYPASSING_BUFFER                =
    *     I_BUFFER_ACTIVE                   =
    *     I_CALLBACK_PROGRAM                = ' '
    *     I_CALLBACK_PF_STATUS_SET          = ' '
    *     I_CALLBACK_USER_COMMAND           = ' '
    *     I_CALLBACK_TOP_OF_PAGE            = ' '
    *     I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
    *     I_CALLBACK_HTML_END_OF_LIST       = ' '
    *     I_STRUCTURE_NAME                  =
    *     I_BACKGROUND_ID                   = ' '
          I_GRID_TITLE                      = 'Display modified list data'
    *     I_GRID_SETTINGS                   =
    *     IS_LAYOUT_LVC                     =
          IT_FIELDCAT_LVC                   = lt_fcat
    *     IT_EXCLUDING                      =
    *     IT_SPECIAL_GROUPS_LVC             =
    *     IT_SORT_LVC                       =
    *     IT_FILTER_LVC                     =
    *     IT_HYPERLINK                      =
    *     IS_SEL_HIDE                       =
    *     I_DEFAULT                         = 'X'
    *     I_SAVE                            = ' '
    *     IS_VARIANT                        =
    *     IT_EVENTS                         =
    *     IT_EVENT_EXIT                     =
    *     IS_PRINT_LVC                      =
    *     IS_REPREP_ID_LVC                  =
          I_SCREEN_START_COLUMN             = 5
          I_SCREEN_START_LINE               = 5
          I_SCREEN_END_COLUMN               = 120
          I_SCREEN_END_LINE                 = 20
    *     I_HTML_HEIGHT_TOP                 =
    *     I_HTML_HEIGHT_END                 =
    *     IT_EXCEPT_QINFO_LVC               =
    *     IR_SALV_FULLSCREEN_ADAPTER        =
        TABLES
          t_outtab                          = gt_outtab
        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.                    "SAVE_DATA
    *&      Form  BUILD_FIELDCAT
    *       text
    *      <--P_GT_FIELDCAT  text
    FORM build_fieldcat CHANGING pt_fieldcat TYPE lvc_t_fcat.
      DATA ls_fcat TYPE lvc_s_fcat.
      CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
        EXPORTING
          i_structure_name = 'SBOOK'
        CHANGING
          ct_fieldcat      = pt_fieldcat.
      LOOP AT pt_fieldcat INTO ls_fcat.
    * Exchange smoker field with invoice field - just to
    * make the dependance between SMOKER and CLASS more transparent
    * (Smoking is only allowed in the first class).
        IF ls_fcat-fieldname EQ 'SMOKER'.
          ls_fcat-col_pos = 11.
          ls_fcat-outputlen = 10.
          MODIFY pt_fieldcat FROM ls_fcat.
        ELSEIF ls_fcat-fieldname EQ 'INVOICE'.
          ls_fcat-col_pos = 7.
          MODIFY pt_fieldcat FROM ls_fcat.
        ELSEIF    ls_fcat-fieldname EQ 'CLASS'.
    *§3.Set your dropdown field editable and assign the fieldname of the
    *   corresponding additional field to DRDN_FIELD of the fieldcatalog.
          ls_fcat-edit = 'X'.
          ls_fcat-drdn_field = 'DROP_DOWN_HANDLE'.
          ls_fcat-outputlen = 5.
    * Field 'checktable' is set to avoid shortdumps that are caused
    * by inconsistend data in check tables. You may comment this out
    * when the test data of the flight model is consistent in your system.
          ls_fcat-checktable = '!'.        "do not check foreign keys
          MODIFY pt_fieldcat FROM ls_fcat.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "build_fieldcat
    *&      Form  CREATE_AND_INIT_ALV
    *       text
    *      <--P_GT_OUTTAB  text
    *      <--P_GT_FIELDCAT  text
    *      <--P_GS_LAYOUT  text
    FORM create_and_init_alv CHANGING pt_outtab TYPE STANDARD TABLE
                                      pt_fieldcat TYPE lvc_t_fcat.
      DATA: lt_exclude TYPE ui_functions.
      CREATE OBJECT g_custom_container
        EXPORTING
          container_name = g_container.
      CREATE OBJECT g_grid
        EXPORTING
          i_parent = g_custom_container.
      PERFORM build_fieldcat CHANGING pt_fieldcat.
    * Optionally restrict generic functions to 'change only'.
    *   (The user shall not be able to add new lines).
      PERFORM exclude_tb_functions CHANGING lt_exclude.
      PERFORM set_drdn_table.
      PERFORM build_data CHANGING pt_outtab.
      CALL METHOD g_grid->set_table_for_first_display
        EXPORTING
          it_toolbar_excluding = lt_exclude
        CHANGING
          it_fieldcatalog      = pt_fieldcat
          it_outtab            = pt_outtab[].
    * Set editable cells to ready for input initially
      CALL METHOD g_grid->set_ready_for_input
        EXPORTING
          i_ready_for_input = 1.
    ENDFORM.                               "CREATE_AND_INIT_ALV
    *&      Form  EXCLUDE_TB_FUNCTIONS
    *       text
    *      <--P_LT_EXCLUDE  text
    FORM exclude_tb_functions CHANGING pt_exclude TYPE ui_functions.
    * Only allow to change data not to create new entries (exclude
    * generic functions).
      DATA ls_exclude TYPE ui_func.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_copy_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_delete_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_append_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_insert_row.
      APPEND ls_exclude TO pt_exclude.
      ls_exclude = cl_gui_alv_grid=>mc_fc_loc_move_row.
      APPEND ls_exclude TO pt_exclude.
    ENDFORM.                               " EXCLUDE_TB_FUNCTIONS
    *&      Form  set_drdn_table
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM set_drdn_table.
    *§2.Define a dropdown table and pass it to ALV.
    *   One listbox is referenced by a handle, e.g., '1'.
    *   For each entry that shall appear in this listbox
    *   you have to append a line to the dropdown table
    *   with handle '1'.
    *   This handle can be assigned to several columns
    *   of the output table using the field catalog.
      DATA: lt_dropdown TYPE lvc_t_drop,
            ls_dropdown TYPE lvc_s_drop.
      ls_dropdown-handle = '1'.
      ls_dropdown-value = 'F'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '2'.
      ls_dropdown-value = 'F'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '2'.
      ls_dropdown-value = 'C'.
      APPEND ls_dropdown TO lt_dropdown.
      ls_dropdown-handle = '2'.
      ls_dropdown-value = 'Y'.
      APPEND ls_dropdown TO lt_dropdown.
      CALL METHOD g_grid->set_drop_down_table
        EXPORTING
          it_drop_down = lt_dropdown.
    ENDFORM.                               " set_drdn_table
    *&      Form  build_data
    *       text
    *  -->  p1        text
    *  <--  p2        text
    FORM build_data CHANGING pt_outtab TYPE STANDARD TABLE.
      DATA: lt_sbook TYPE TABLE OF sbook,
            ls_sbook TYPE sbook,
            l_index TYPE i,
            ls_outtab LIKE LINE OF gt_outtab.
      SELECT * FROM sbook INTO TABLE lt_sbook UP TO g_max ROWS."#EC CI_NOWHERE
      IF sy-subrc NE 0.
        PERFORM generate_entries CHANGING lt_sbook.
      ENDIF.
    *§4.Set the handle of your additional field of your output
    *   table according to the listbox that shall be displayed.
      LOOP AT lt_sbook INTO ls_sbook.
        l_index = sy-tabix.
        MOVE-CORRESPONDING ls_sbook TO ls_outtab.
        CLEAR ls_outtab-class.
    * Alternate between smoker and non smoker to make
    * it more obvious what this example is about
        l_index = l_index MOD 2.
        IF l_index EQ 1.
          ls_outtab-smoker = 'X'.
        ELSE.
          ls_outtab-smoker = ' '.
        ENDIF.
        IF ls_outtab-smoker EQ 'X'.
          ls_outtab-drop_down_handle = '1'.
        ELSE.
          ls_outtab-drop_down_handle = '2'.
        ENDIF.
        APPEND ls_outtab TO pt_outtab.
      ENDLOOP.
    ENDFORM.                               " build_data
    *&      Form  generate_entries
    *       text
    *      <--P_LT_SLFIGHT  text
    FORM generate_entries CHANGING pt_sbook TYPE STANDARD TABLE.
      DATA: ls_sbook TYPE sbook,
            l_month(2) TYPE c,
            l_day(2) TYPE c,
            l_date(8) TYPE c,
      l_prebookid TYPE i.
      ls_sbook-carrid = 'LH'.
      ls_sbook-connid = '0400'.
      ls_sbook-forcurkey = 'DEM'.
      ls_sbook-loccurkey = 'USD'.
      ls_sbook-custtype = 'B'.
      DO 110 TIMES.
        l_prebookid = sy-index.
        ls_sbook-forcuram = sy-index * 10.
        ls_sbook-loccuram = ls_sbook-loccuram * 2.
        ls_sbook-customid = sy-index.
        ls_sbook-counter = 18.
        ls_sbook-agencynum = 11.
        l_month = sy-index / 10 + 1.
        DO 2 TIMES.
          l_day = 3 + l_month + sy-index * 2.
          l_date+0(4) = '2000'.
          l_date+4(2) = l_month.
          l_date+6(2) = l_day.
          ls_sbook-fldate = l_date.
          SUBTRACT 3 FROM l_day.
          ls_sbook-order_date+0(6) = l_date+0(6).
          ls_sbook-order_date+6(2) = l_day.
          ls_sbook-bookid = l_prebookid * 2 + sy-index.
          IF sy-index EQ 1.
            ls_sbook-smoker = 'X'.
          ELSE.
            ls_sbook-smoker = space.
          ENDIF.
          ls_sbook-luggweight = l_prebookid * 10.
          IF ls_sbook-luggweight GE 1000.
            ls_sbook-wunit = 'G'.
            ls_sbook-class = 'C'.
          ELSE.
            ls_sbook-wunit = 'KG'.
            ls_sbook-class = 'Y'.
          ENDIF.
          IF ls_sbook-bookid > 40 AND ls_sbook-wunit EQ 'KG'.
            ls_sbook-invoice = 'X'.
          ENDIF.
          IF ls_sbook-bookid EQ 2.
            ls_sbook-cancelled = 'X'.
            ls_sbook-class = 'F'.
          ENDIF.
          APPEND ls_sbook TO pt_sbook.
        ENDDO.
      ENDDO.
    ENDFORM.                               " generate_entries
    Regards
      Uwe

  • Capturing the current ALV grid contents. How?

    Hi forum,
    After lots of searching, I still can't find out how I can get the current contents of the ALV grid. I need this for an editable ALV grid to keep track of the data changes.
    By the way, I am using the traditional ALV, not OO ALV.
    Let me share the steps I already did but still failed.
    1
    I used the FM GET_GLOBALS_FROM_SLVC_FULLSCR to have access to the CL_GUI_ALV_GRID object. I tried using some of the methods inside that class, all to no avail.
    Some methods I tried were set_selected_columns and set_selected_rows and then call the method get_selected_cells. Basically, the idea is to simulate highlighting of cells, and select them using get_selected_cells. But the problem is that get_selected_cells is not returning the value (although it correctly returns the row and column that I set -- but not the value in that cell coordinates).
    2
    I also saw the protected method get_changed_data -- but the problem is that it is protected, so I created a subclass of CL_GUI_ALV_GRID to ZCL_GUI_ALV_GRID and copied the private attributes and methods that get_changed_data depends on. I was able to do this but GET_GLOBALS_FROM_SLVC_FULLSCR strictly returns CL_GUI_ALV_GRID. The upcast from CL_GUI_ALV_GRID to ZCL_GUI_ALV_GRID fails. So I still can't use/test get_changed_data.
    3
    I also saw some code regarding events. Here's a sample but this doesn't work:
        REFRESH lt_events.
        lwa_event-name = 'DATA_CHECK'. "Event name
        lwa_event-form = 'HANDLE_DATA_CHANGED'.
        APPEND lwa_event TO lt_events.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
            EXPORTING
                it_fieldcat_lvc         = it_fieldcat
                is_layout_lvc           = ls_layout
                it_events               = lt_events
    FORM handle_data_changed using ref_data_changed
                              type ref to cl_alv_changed_data_protocol.
        BREAK-POINT.
    ENDFORM.
    I would really appreciate it (and I know a lot of other ABAPers will, too) if you could point me to how I can get the ALV grid contents. Thanks.
    Kyle

    Hi Keshav,
    sure I will check those tomorrow when I get back to work.
    All,
    Here's the code if it helps:
    *& Report  Z_ALV_EDITABLE
    REPORT  Z_ALV_EDITABLE.
    TYPE-POOLS:
        slis
    DATA:
        BEGIN OF i_out OCCURS 0,
            operand1 TYPE i,
            operand2 TYPE i,
            operator TYPE c,
            result   TYPE i,
        END OF i_out
    START-OF-SELECTION.
        PERFORM prepareData.
        PERFORM refreshResults.
        PERFORM createALV_LVC.
    FORM prepareData.
        REFRESH i_out.
        DO 10 TIMES.
            i_out-operand1 = 1.
            i_out-operand2 = 2.
            i_out-operator = '+'.
            APPEND i_out.
        ENDDO.
    ENDFORM.
    FORM refreshResults.
        LOOP AT i_out.
            CASE i_out-operator.
                WHEN '+'.
                    i_out-result = i_out-operand1 + i_out-operand2.
                WHEN '-'.
                    i_out-result = i_out-operand1 - i_out-operand2.
                WHEN '*'.
                    i_out-result = i_out-operand1 * i_out-operand2.
                WHEN '/'.
                    IF i_out-operand2 NE 0.
                        i_out-result = i_out-operand1 - i_out-operand2.
                    ENDIF.
                WHEN OTHERS.
                    i_out-result = ''.
            ENDCASE.
            MODIFY i_out.
        ENDLOOP.
    ENDFORM.
    FORM createALV_LVC.
        DATA:
            it_fieldcat TYPE lvc_t_fcat,
            ls_layout   TYPE lvc_s_layo,
            lt_events   TYPE slis_t_event,
            lwa_event   TYPE slis_alv_event
        " Field Catalog
        PERFORM createFieldcat CHANGING it_fieldcat.
        " Sorting
        PERFORM createSort.
        " Layout
        ls_layout-cwidth_opt = 'X'.
        " Events
        REFRESH lt_events.
        lwa_event-name = 'DATA_CHECK'. "Event name
        lwa_event-form = 'HANDLE_DATA_CHANGED'.
        APPEND lwa_event TO lt_events.
        CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'
            EXPORTING
                it_fieldcat_lvc         = it_fieldcat
                is_layout_lvc           = ls_layout
    *            it_sort                 =
                it_events               = lt_events
                i_callback_program      = 'Z_ALV_EDITABLE'
                i_callback_user_command = 'USER_COMMAND'
                i_callback_pf_status_set = 'PF_STATUS_SET'
                i_save                  = 'X'
            TABLES
                t_outtab                = i_out
            EXCEPTIONS
                program_error           = 1
                OTHERS                  = 2.
    ENDFORM.
    FORM createFieldcat CHANGING it_fieldcat TYPE lvc_t_fcat.
        DATA:
            wa_fcat LIKE LINE OF it_fieldcat
        REFRESH it_fieldcat.
        DEFINE m_append_fieldcat.
            CLEAR wa_fcat.
            wa_fcat-edit      = &1.
            wa_fcat-fieldname = &2.
            wa_fcat-scrtext_m = &3.
            APPEND wa_fcat TO it_fieldcat.
        END-OF-DEFINITION.
        m_append_fieldcat '' 'OPERAND1' 'Operand 1'.
        m_append_fieldcat '' 'OPERAND2' 'Operand 2'.
        m_append_fieldcat 'X' 'OPERATOR' 'Operator'.
        m_append_fieldcat '' 'RESULT'   'Result'.
    ENDFORM.
    FORM createSort.
    ENDFORM.
    FORM PF_STATUS_SET USING    P_EXTAB TYPE SLIS_T_EXTAB.
        SET PF-STATUS 'Z_ALV_STATUS' EXCLUDING P_EXTAB.
    ENDFORM.                    "PF_STATUS_SET
    FORM user_command
        USING
            r_ucomm TYPE sy-ucomm
            ls_selfield TYPE slis_selfield.
        CASE r_ucomm.
            WHEN 'REFRESH'.
                " CHECK i_out HERE IF IT CHANGED ALONG WITH THE EDITS
                BREAK-POINT.
    *            PERFORM refreshALV.
        ENDCASE.
    ENDFORM.
    FORM handle_data_changed using ref_data_changed
                              type ref to cl_alv_changed_data_protocol.
        BREAK-POINT.
    ENDFORM.

  • Button in alv grid cell using REUSE_ALV_GRID_DISPLAY

    Hi all,
      I want to make the contents of 2 columns of my alv grid as push button with values as text on it. I am not using classes or methods but alv grid fm. On clicking the button one dialog box has to pop up which gives edit option for the values in that coloumn, my question is how to introduce button in alv grid cell? if i can use t_fieldcatalog-icon, then please give me the complete steps for that.
    Thanks.

    this may helps u
    u need to copy stadard screen elemetn to MARATAB1(at PF -STATUS)
    You should copy the 'STANDARD' GUI status from program <b>SAPLSLVC_FULLSCREEN</b>
    type this one in SE41 program name is:<b>SAPLSLVC_FULLSCREEN</b>
    status : <b>STANDARD_FULLSCREEN</b>
    and copy it ...
             Type-pool
    type-pools slis.
             Tables
    tables: mara,sscrfields.
           Selection screen
    select-options: s_matnr for mara-matnr.
    PARAMETERS: p_email TYPE somlreci1-receiver.
    TYPES: BEGIN OF t_charmara,
      matnr(18)  TYPE c,                   " Material Number
      ernam(12)  TYPE c,                   " Person Credited
      aenam(12)  TYPE c,                   " Person Changed Object
      pstat(15)  TYPE c,                   " Maintenance Status
    END OF t_charmara.
             Data Declarations
    data: rt_extab    type slis_t_extab,   " Table of inactive function
                                           codes
          wa_charmara TYPE t_charmara,     " work area of mara Table
          fs_fieldcat type slis_t_fieldcat_alv,
                                           " Field catalog with field
                                           descriptions
          t_fieldcat  like line of fs_fieldcat,
                                           " Table of Field catalog
          r_ucomm     like sy-ucomm,       " User Command
          rs_selfield TYPE slis_selfield.  " cursor position ALV
    data: filedlayout   type slis_layout_alv,
          heading       type slis_t_listheader with header line,
          t_event       type slis_t_event.
    data: fs_event      like line of t_event.
    data: fs_sort type slis_sortinfo_alv,
           t_sort type slis_t_sortinfo_alv.
    data: w_char(200) type c,
          w_matnr     type mara-matnr.
    fs_sort-fieldname = 'MATNR'.
    fs_sort-up        = 'X'.
    fs_sort-group     = '*'.
    append fs_sort to t_sort.
    clear fS_sort.
    DATA:   t_packing_list  LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE,
            t_contents      LIKE solisti1   OCCURS 0 WITH HEADER LINE,
            t_receivers     LIKE somlreci1  OCCURS 0 WITH HEADER LINE,
            t_attachment    LIKE solisti1   OCCURS 0 WITH HEADER LINE,
            t_object_header LIKE solisti1   OCCURS 0 WITH HEADER LINE,
            w_cnt           TYPE i,
            w_sent_all(1)   TYPE c,
            w_doc_data      LIKE sodocchgi1,
            gd_error        TYPE sy-subrc,
            gd_reciever     TYPE sy-subrc.
             Internal Tables
    data: begin of it_mara occurs 0,
            matnr like mara-matnr,         " Material Number
            ernam like mara-ernam,         " Person Credited
            aenam like mara-aenam,         " Person Changed Object
            pstat like mara-pstat,         " Maintenance Status
          end of it_mara.
    DATA:   it_message TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    DATA:   it_attach TYPE STANDARD TABLE OF solisti1 INITIAL SIZE 0
                    WITH HEADER LINE.
    *at selection-screen on field event
    AT SELECTION-SCREEN on s_matnr.
    PERFORM f0100_VALIDATE_MATERIAL_NUMBER.
    start-of-selection.
    retrive Data from the data base table Mara
    perform retrive_data_from_mara.
    end-of-selection.
    *Field catalog with field descriptions
    perform fieldcat.
    *perform top_of_page.
    PERFORM EVENT_LIST.
    *ALV Grid Display
    perform alv_display.
    Creating one Push button ENTER
    perform maratab1 USING    RT_EXTAB.
    *&      Form  f0100_VALIDATE_MATERIAL_NUMBER
          text
    There are no interface parameters to be passed to this subroutine
    FORM F0100_VALIDATE_MATERIAL_NUMBER .
    select matnr                          " Material Number
       from mara
      up to 1 rows
       into mara-matnr
      where matnr in s_matnr.
      endselect.
    IF sy-subrc NE 0.
          clear sscrfields-ucomm.
          MESSAGE e000 WITH 'Enter valid Material number'(003).
        ENDIF.                             " IF sy-subrc NE 0
    ENDFORM.                               " f0100_VALIDATE_MATERIAL_NUMBER
    *&      Form  retrive_data_from_mara
          text
    *There are no interface parameters to be passed to this subroutine
    FORM retrive_data_from_mara .
    select   matnr                         " Material Number
             ernam                         " Person Credited
             aenam                         " Person Changed Object
             pstat                         " Maintenance Status
        from mara
        into table It_mara
       where matnr in s_matnr.
    IF sy-subrc NE 0.
          MESSAGE i001 WITH 'Records are not found'.
          exit.
          stop.
        ENDIF.                             " IF sy-subrc NE 0
    ENDFORM.                               " retrive_data_from_mara
    *&      Form  fieldcat
          text
    *There are no interface parameters to be passed to this subroutine
    FORM fieldcat .
    *field catalog for MATNR
      t_FIELDCAT-REF_TABNAME = 'MARA'.
      t_fieldcat-fieldname   = 'MATNR'.
      t_fieldcat-col_pos     = 1.
      append t_fieldcat to fs_fieldcat.
      clear t_fieldcat.
    *field catalog for ERNAM
      t_FIELDCAT-REF_TABNAME = 'MARA'.
      t_fieldcat-fieldname   = 'ERNAM'.
      t_fieldcat-col_pos     = 2.
      append t_fieldcat to fs_fieldcat.
      clear t_fieldcat.
    *field catalog for AENAM
      t_FIELDCAT-REF_TABNAME = 'MARA'.
      t_fieldcat-fieldname   = 'AENAM'.
      t_fieldcat-col_pos     = 3.
      append t_fieldcat to fs_fieldcat.
      clear t_fieldcat.
    *field catalog for PSTAT
      t_FIELDCAT-REF_TABNAME = 'MARA'.
      t_fieldcat-fieldname   = 'PSTAT'.
      t_fieldcat-col_pos     = 4.
      append t_fieldcat to fs_fieldcat.
      clear t_fieldcat.
    ENDFORM.                               " fieldcat
    *&      Form  EVENT_LIST
          text
    *There are no interface parameters to be passed to this subroutine
    FORM EVENT_LIST .
      fs_event-name ='TOP_OF_PAGE'.
      fs_event-form = 'TOP_PAGE'.
      append fs_event TO t_EVENT.
      CLEAR FS_EVENT.
      fs_event-name ='END_OF_PAGE'.
      fs_event-form = 'END_PAGE'.
      append fs_event TO t_EVENT.
      CLEAR FS_EVENT.
      fs_event-name ='END_OF_LIST'.
      fs_event-form = 'LIST_END'.
      append fs_event TO t_EVENT.
      CLEAR FS_EVENT.
    ENDFORM.                               " EVENT_LIST
    *&      Form  alv_display
          text
    *There are no interface parameters to be passed to this subroutine
    FORM alv_display .
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK              = ' '
      I_BYPASSING_BUFFER             =
      I_BUFFER_ACTIVE                = ' '
       I_CALLBACK_PROGRAM             = SY-REPID
       I_CALLBACK_PF_STATUS_SET       = 'MARATAB1'
       I_CALLBACK_USER_COMMAND        = 'USER_COMMAND'
      I_STRUCTURE_NAME               =
      IS_LAYOUT                      =
       IT_FIELDCAT                    = FS_FIELDCAT
      IT_EXCLUDING                   =
      IT_SPECIAL_GROUPS              =
       IT_SORT                        = T_SORT
      IT_FILTER                      =
      IS_SEL_HIDE                    =
      I_DEFAULT                      = 'X'
      I_SAVE                         = ' '
      IS_VARIANT                     =
       IT_EVENTS                      = T_EVENT
      IT_EVENT_EXIT                  =
      IS_PRINT                       =
      IS_REPREP_ID                   =
      I_SCREEN_START_COLUMN          = 0
      I_SCREEN_START_LINE            = 0
      I_SCREEN_END_COLUMN            = 0
      I_SCREEN_END_LINE              = 0
      IR_SALV_LIST_ADAPTER           =
      IT_EXCEPT_QINFO                =
      I_SUPPRESS_EMPTY_DATA          = ABAP_FALSE
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER        =
      ES_EXIT_CAUSED_BY_USER         =
      TABLES
        T_OUTTAB                       = IT_MARA[]
    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.                               " alv_display
    form TOP_PAGE.
      data:tbl_listheader type slis_t_listheader,
            wa_listheader type slis_listheader .
       wa_listheader-typ = 'S'.
       wa_listheader-info = 'Created by : Vijay Pawar'.
       append wa_listheader to tbl_listheader.
       wa_listheader-typ = 'S'.
       concatenate ' Date ' sy-datum into
                  wa_listheader-info separated by space.
        append wa_listheader to tbl_listheader.
       wa_listheader-typ = 'S'.
       concatenate ' From ' s_matnr-low '  To  ' s_matnr-high into
                           wa_listheader-info separated by space.
       append wa_listheader to tbl_listheader.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = tbl_listheader
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    endform.                               " form TOP_PAGE.
    form END_PAGE.
      STATICS W_PAGE TYPE I .
      data:tbl_listheader type slis_t_listheader,
            wa_listheader type slis_listheader .
      wa_listheader-typ   = 'S'.
      wa_listheader-info  = W_PAGE.
      append wa_listheader to tbl_listheader.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = tbl_listheader
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    add 1 to w_page.
    endform.                               " form END_PAGE.
    form list_end.
      data:tbl_listheader type slis_t_listheader,
      wa_listheader type slis_listheader .
      wa_listheader-typ = 'S'.
      wa_listheader-info = '......................................Last Page'
      append wa_listheader to tbl_listheader.
    CALL FUNCTION 'REUSE_ALV_COMMENTARY_WRITE'
      EXPORTING
        IT_LIST_COMMENTARY       = tbl_listheader
      I_LOGO                   =
      I_END_OF_LIST_GRID       =
      I_ALV_FORM               =
    endform.                               " form list_end.
    *&      Form  maratab1
          text
         -->P_RT_EXTAB  text
    FORM maratab1  USING    P_RT_EXTAB.
      SET PF-STATUS 'MARATAB1' EXCLUDING rt_extab.
    ENDFORM.                               " maratab1
    FORM user_command  USING r_ucomm LIKE sy-ucomm
                         rs_selfield TYPE slis_selfield.
    case r_ucomm.
       when 'ENTER'.
       perform bulid_xls_data_table.
       PERFORM send_file_as_email_attachment
                                      tables it_message
                                             it_attach
                                       using p_email "'[email protected]'
                                    'Example .xls documnet attachment'
                                             'XLS'
                                             'filename'
                                    changing gd_error
                                             gd_reciever.
        perform populate_email_message_body.
        PERFORM initiate_mail_execute_program.
      endcase.                             " case r_ucomm.
    endform.                               " FORM user_command
    perform populate_email_message_body.
    PERFORM initiate_mail_execute_program.
         CALL FUNCTION 'RH_START_EXCEL_WITH_DATA'
    EXPORTING
       DATA_FILENAME             = 'MARA.XLS'
       DATA_PATH_FLAG            = 'W'
      DATA_ENVIRONMENT          =
       DATA_TABLE                = ITAB[]
      MACRO_FILENAME            =
      MACRO_PATH_FLAG           = 'E'
      MACRO_ENVIRONMENT         =
       WAIT                      = 'X'
      DELETE_FILE               = 'X'
    EXCEPTIONS
       NO_BATCH                  = 1
       EXCEL_NOT_INSTALLED       = 2
       INTERNAL_ERROR            = 3
       CANCELLED                 = 4
       DOWNLOAD_ERROR            = 5
       NO_AUTHORITY              = 6
       FILE_NOT_DELETED          = 7
       OTHERS                    = 8
       IF SY-SUBRC <> 0.
        MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
       ENDIF.
       leave to list-processing.
    endcase.
    *&      Form  bulid_xls_data_table
          text
    *There are no interface parameters to be passed to this subroutine
    FORM bulid_xls_data_table .
    CONSTANTS: con_cret TYPE x VALUE '0D',  "OK for non Unicode
                con_tab TYPE x VALUE '09'.   "OK for non Unicode
    *If you have Unicode check active in program attributes thnen you will
    *need to declare constants as follows
    *class cl_abap_char_utilities definition load.
    constants:
        con_tab  type c value cl_abap_char_utilities=>HORIZONTAL_TAB,
        con_cret type c value cl_abap_char_utilities=>CR_LF.
      CONCATENATE 'matnr' 'ernam' 'aenam' 'pstat'
             INTO it_attach SEPARATED BY con_tab.
      CONCATENATE con_cret it_attach  INTO it_attach.
      APPEND  it_attach.
      LOOP AT It_mara INTO wa_charmara.
        CONCATENATE wa_charmara-matnr wa_charmara-ernam
                    wa_charmara-aenam wa_charmara-pstat
               INTO it_attach SEPARATED BY con_tab.
        CONCATENATE con_cret it_attach  INTO it_attach.
        APPEND  it_attach.
      ENDLOOP.                             " LOOP AT it_mara INTO...
    ENDFORM.                               " bulid_xls_data_table
    *&      Form  send_file_as_email_attachment
       Send email
         -->P_IT_MESSAGE  text
         -->P_IT_ATTACH  text
         -->P_P_EMAIL  text
         -->P_0387   text
         -->P_0388   text
         -->P_0389   text
         -->P_0390   text
         -->P_0391   text
         -->P_0392   text
         <--P_GD_ERROR  text
         <--P_GD_RECIEVER  text
    FORM send_file_as_email_attachment tables pit_message
                                              pit_attach
                                        using p_email
                                              p_mtitle
                                              p_format
                                              p_filename
                                              p_attdescription
                                              p_sender_address
                                              p_sender_addres_type
                                     changing p_error
                                              p_reciever.
      DATA: ld_error               TYPE sy-subrc,
            ld_reciever            TYPE sy-subrc,
            ld_mtitle              LIKE sodocchgi1-obj_descr,
            ld_email               LIKE  somlreci1-receiver,
            ld_format              TYPE  so_obj_tp ,
            ld_attdescription      TYPE  so_obj_nam ,
            ld_attfilename         TYPE  so_obj_des ,
            ld_sender_address      LIKE  soextreci1-receiver,
            ld_sender_address_type LIKE  soextreci1-adr_typ,
            ld_receiver            LIKE  sy-subrc.
      ld_email               = p_email.
      ld_mtitle              = p_mtitle.
      ld_format              = p_format.
      ld_attdescription      = p_attdescription.
      ld_attfilename         = p_filename.
      ld_sender_address      = p_sender_address.
      ld_sender_address_type = p_sender_addres_type.
    Fill the document data.
      w_doc_data-doc_size = 1.
    Populate the subject/generic message attributes
      w_doc_data-obj_langu = sy-langu.
      w_doc_data-obj_name  = 'SAPRPT'.
      w_doc_data-obj_descr = ld_mtitle .
      w_doc_data-sensitivty = 'F'.
    Fill the document data and get size of attachment
      CLEAR w_doc_data.
      READ TABLE it_attach INDEX w_cnt.
      w_doc_data-doc_size =
         ( w_cnt - 1 ) * 255 + STRLEN( it_attach ).
      w_doc_data-obj_langu  = sy-langu.
      w_doc_data-obj_name   = 'SAPRPT'.
      w_doc_data-obj_descr  = ld_mtitle.
      w_doc_data-sensitivty = 'F'.
      CLEAR t_attachment.
      REFRESH t_attachment.
      t_attachment[] = pit_attach[].
    Describe the body of the message
      CLEAR t_packing_list.
      REFRESH t_packing_list.
      t_packing_list-transf_bin  = space.
      t_packing_list-head_start  = 1.
      t_packing_list-head_num    = 0.
      t_packing_list-body_start  = 1.
      DESCRIBE TABLE it_message LINES t_packing_list-body_num.
      t_packing_list-doc_type    = 'RAW'.
      APPEND t_packing_list.
    Create attachment notification
      t_packing_list-transf_bin = 'X'.
      t_packing_list-head_start = 1.
      t_packing_list-head_num   = 1.
      t_packing_list-body_start = 1.
      DESCRIBE TABLE t_attachment LINES t_packing_list-body_num.
      t_packing_list-doc_type   =  ld_format.
      t_packing_list-obj_descr  =  ld_attdescription.
      t_packing_list-obj_name   =  ld_attfilename.
      t_packing_list-doc_size   =  t_packing_list-body_num * 255.
      APPEND t_packing_list.
    Add the recipients email address
      CLEAR t_receivers.
      REFRESH t_receivers.
      t_receivers-receiver   = ld_email.
      t_receivers-rec_type   = 'U'.
      t_receivers-com_type   = 'INT'.
      t_receivers-notif_del  = 'X'.
      t_receivers-notif_ndel = 'X'.
      APPEND t_receivers.
      CALL FUNCTION 'SO_DOCUMENT_SEND_API1'
           EXPORTING
                document_data              = w_doc_data
                put_in_outbox              = 'X'
                sender_address             = ld_sender_address
                sender_address_type        = ld_sender_address_type
                commit_work                = 'X'
           IMPORTING
                sent_to_all                = w_sent_all
           TABLES
                packing_list               = t_packing_list
                contents_bin               = t_attachment
                contents_txt               = it_message
                receivers                  = t_receivers
           EXCEPTIONS
                too_many_receivers         = 1
                document_not_sent          = 2
                document_type_not_exist    = 3
                operation_no_authorization = 4
                parameter_error            = 5
                x_error                    = 6
                enqueue_error              = 7
                OTHERS                     = 8.
    Populate zerror return code
      ld_error = sy-subrc.
    Populate zreceiver return code
      LOOP AT t_receivers.
        ld_receiver = t_receivers-retrn_code.
      ENDLOOP.
    ENDFORM.                               " send_file_as_email_attachment
    *&      Form  INITIATE_MAIL_EXECUTE_PROGRAM
          Instructs mail send program for SAPCONNECT to send email.
    FORM initiate_mail_execute_program.
      WAIT UP TO 2 SECONDS.
      SUBMIT rsconn01 WITH mode = 'INT'
                    WITH output = 'X'
                    AND RETURN.
    ENDFORM.                               " INITIATE_MAIL_EXECUTE_PROGRAM
    *&      Form  POPULATE_EMAIL_MESSAGE_BODY
           Populate message body text
    form populate_email_message_body.
      REFRESH it_message.
      it_message = 'Please find attached a list test mara records'.
      APPEND it_message.
    endform.                               "form populate_email_message_bod
    rewards if it helps u

  • 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

  • Exporting content of ALV grid in Web Dynpro for ABAP

    Hello Experts
    I have a following request which seems to be giving some headaches.
    I need to export results from one of the Web Dynpro reports (ABAP) I have developed to the Excel spreadsheet. Results are stored on ALV component. Request is to add header to export file with additional information like report title, selection criteria, date when report has been executed. By default export file contains only column names and data. I have set the header for ALV grid with all extra information I need to be passed to Excel file but it does not seem to be transferred at all.
    At the moment I see 2 possible solutions: 1) write my own Excel export 2) use PDF export where it is possible to set header/footer text. None of these solutions are ideal, I'd rather set header in standard Excel export. Is that even possible? Please help.
    Regards
    Michael
    Edited by: Soltuion Manager on Apr 20, 2009 10:08 AM
    Edited by: Soltuion Manager on Apr 20, 2009 10:26 AM

    Hello Michael,
    I haven't tried using the builtin functionality of ALV to achieve a similar fnctionality as yours but can suggest you a workaround for that. As how you might be already knowing you can try using the CL_WD_RUNTIME_SERVICES=>attach_file_to_response to download the contents into Excel/notepad/word. So just can modify the internal table to contain the extra information that you need. You can use the approach below for using the attach_file_to_response method:
    1) First read the table's data into an internal table.
    2) Convert the internal table data to STRING format.
    3) Now convert it into tab separated format as how desired.
    4) Convert this STRING format to XSTRING format
    5) Make use of the attach_file_to_response method.
    Regards,
    Uday
    METHOD onactionon_submit .
      DATA: lv_node TYPE REF TO if_wd_context_node,
            lt_mara TYPE if_main=>elements_mara,
            wa_mara TYPE if_main=>element_mara,
            lead_selection_index TYPE i,
            mara_string  TYPE string,
            mara_xstring TYPE xstring.
      lv_node = wd_context->get_child_node( name = 'MARA' ).
      CALL METHOD lv_node->get_static_attributes_table
        IMPORTING
          table = lt_mara.
      LOOP AT lt_mara INTO wa_mara.
        CONCATENATE mara_string
                    wa_mara-matnr
                    wa_mara-ersda
                    wa_mara-ernam
                    wa_mara-matkl
                    wa_mara-meins
                    cl_abap_char_utilities=>cr_lf INTO mara_string
                                            SEPARATED BY cl_abap_char_utilities=>horizontal_tab.
      ENDLOOP.
    ** Now you need to add the column headers & the desired extra information through coding to
    ** mara_string
      CALL FUNCTION 'SCMS_STRING_TO_XSTRING'
        EXPORTING
          text   = mara_string
        IMPORTING
          buffer = mara_xstring.
      CL_WD_RUNTIME_SERVICES=>attach_file_to_response(  i_filename  = 'TEMP.XLS'
                                                        i_content   = mara_xstring
                                                        i_mime_type = 'EXCEL' ).
    ENDMETHOD.

Maybe you are looking for

  • Acrobat not displaying correctly in Win7 1920x1080 screen

    Been puzzling over why Acrobat 9.4.1 doesn't display correctly on my new Dell laptop (D6550), i7 cpu, 1920x1080 display, WIN7 64 bit.  Strange part is that it appears that the window overflows the top and right side of the screen a little, and that t

  • ZBFW Intra zone traffic not working

    I am having an issue on one of our 2811 routers where I can't get traffic between interfaces within the same zone to flow. I know this should happen by default and that's why it is so confusing. One of the interfaces is fastethernet0/0.1 which is int

  • CalDAV Calendars are Read-Only?

    When trying to add a CalDAV calendar (Google Calendar in this case), the end result is that it is a read-only calendar. I can not add/edit/delete anything from the calendar and even the edit option for the events doesn't even show up. Does anyone her

  • Where or How Can I Find a Viewer of my Download by Time, Percentage and KB so to know how long it will take

    I'm trying to Download mbam Malwarebytes-Anti-Malware, because of a lot of trouble getting my Browser to get things on the Internet. I want to clean up this stuff, but I need the Program. I go on Site and Hit the Download and then See Nothing. I don'

  • Remove of non-printable characters from string

    Hi Gurus, How can I achive that? I have a string in which sign "end of line" occurss. How can I delete them? BR Marcin Cholewczuk