Regarding column editing in alv grid

hi experts,
i m using alv grid display for my report layout what i want that after the output dispaly when the user will select my customized button "change the amount column" then after pressing this my amount column will become editable and user can put there new aount for this i have used this codes but it is not working plz help me to sort out this,
for u here is my code.
FORM DISPLAY_LIST .
  CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      i_callback_program       = sy-cprog
      is_layout                = i_layout
      it_fieldcat              = i_fieldtab
      i_grid_title             = 'Production Incentive Details'
      I_CALLBACK_PF_STATUS_SET = 'SET_PFSTATUS'
      I_CALLBACK_USER_COMMAND  = 'USER_COMMAND'
      it_events                = global_events
    TABLES
      t_outtab                 = itab_final
    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_LIST
*&      Form  SET_PFSTATUS
      text
     -->RT_EXTAB   text
FORM SET_PFSTATUS USING rt_extab TYPE slis_t_extab..
  SET PF-STATUS 'ZPINCENTIVE' .
EXCLUDING rt_extab..
ENDFORM.                    " CREATE_PFSTATUS
*&      Form  user_command
      text
     -->R_UCOMM      text
     -->RS_SELFIELD  text
form user_command using r_ucomm like sy-ucomm
                                     rs_selfield type slis_selfield.
  case r_ucomm.
*BREAK-POINT.
    when  '&CHANGED'.        "for change the amount button.
      read table i_fieldtab into s_fieldtab with key FIELDNAME = 'AMOUNT'.
      if sy-subrc = 0.
        move:sy-tabix to index,
             'X' to s_fieldtab-edit.
        modify:i_fieldtab index index from s_fieldtab.
        clear:s_fieldtab.
      endif.

solved by own

Similar Messages

  • How to switch off column coloring of alv grid printouts?

    Hello World!
    Is there any possibility (a customizing option or a parameter) to switch off cell/column coloring of alv grid printouts?
    It is very useful to see colored columns in screens, but they are darkened in printouts. How to avoid it?
    Thanks and regards,
    Vladimir

    Hi,
    You can have different layouts for a ALV report and each layout the look and feel can be different.
    So, the manual activity is the user will have to switch to the B/W layout before printing. I am not sure if you have enabled the LAYOUT option for the user to change it by himself.
    I hope I am able to get across my point.
    If you are using OO ALV control, you can dynamically change the layout using set_frontend_layout  method. The user can also change the layout --
    choose Change layout or Settings ® Layout ® Change.
    The Change Layout dialog box shows you which columns are currently displayed and which additional columns can be displayed.
    Regards,
    Ravi
    Note - Please mark the helpful answers
    Message was edited by: Ravikumar Allampallam

  • All the columns of an alv grid report are not downloading in excel in 1 lin

    Hi All,
    I have some 60 columns in my alv grid report and user can download the report using list->export->localfile->spreadsheet.
    What the issue is that all the columns are not downloading in one line, instead they split in two rows.
    Please help.
    Regards,
    Neha Patel

    hi,
    just use this procedure it will solve your problem:
    Firstly export  the data to memory using the FM LIST_FROM_MEMORY.
    CALL FUNCTION 'LIST_FROM_MEMORY'
    TABLES
    listobject = t_listobject
    EXCEPTIONS
    not_found = 1
    OTHERS = 2.
    IF sy-subrc 0.
    MESSAGE e000(su) WITH text-001.
    ENDIF.
    then i converted it into ASCII using LIST_TO_ASCI,
    CALL FUNCTION 'LIST_TO_ASCI'
    TABLES
    listasci = t_xlstab
    listobject = t_listobject
    EXCEPTIONS
    empty_list = 1
    list_index_invalid = 2
    OTHERS = 3.
    IF sy-subrc NE 0.
    MESSAGE e003(yuksdbfzs).
    ENDIF.
    This gives the data in ASCII format separated by '|' and the header has '-', dashes. If you use this internal table directly without any proccesing in SO_NEW_DOCUMENT_ATT_SEND_API1, then you will not get a good excel sheet attachment. To overcome this limitation, i used cl_abap_char_utilities=>newline and cl_abap_char_utilities=>horizontal_tab to add horizontal and vertical tabs to the internal table, replacing all occurences of '|' with
    cl_abap_char_utilities=>horizontal_tab.
    Set the doc_type as 'XLS', create the body and header using the packing_list and pass the data to be downloaded to SO_NEW_DOCUMENT_ATT_SEND_API1 as contents_bin.
    This will create an excel attachment.
    Sample code for formatting the data for the attachment in excel format.
    u2022     Format the data for excel file download
    LOOP AT t_xlstab INTO wa_xlstab .
    DESCRIBE TABLE t_xlstab LINES lw_cnt.
    CLEAR lw_sytabix.
    lw_sytabix = sy-tabix.
    u2022     If not new line then replace '|' by tabs
    IF NOT wa_xlstab EQ cl_abap_char_utilities=>newline.
    REPLACE ALL OCCURRENCES OF '|' IN wa_xlstab
    WITH cl_abap_char_utilities=>horizontal_tab.
    MODIFY t_xlstab FROM wa_xlstab .
    CLEAR wa_xlstab.
    wa_xlstab = cl_abap_char_utilities=>newline.
    IF lw_cnt NE 0 .
    lw_sytabix = lw_sytabix + 1.
    u2022     Insert new line for the excel data
    INSERT wa_xlstab INTO t_xlstab INDEX lw_sytabix.
    lw_cnt = lw_cnt - 1.
    ENDIF.
    CLEAR wa_xlstab.
    ENDIF.
    ENDLOOP.
    Sample code for creating attachment and sending mail:
    FORM send_mail .
    u2022     Define the attachment format
    lw_doc_type = 'XLS'.
    u2022     Create the document which is to be sent
    lwa_doc_chng-obj_name = 'List'.
    lwa_doc_chng-obj_descr = w_subject. "Subject
    lwa_doc_chng-obj_langu = sy-langu.
    u2022     Fill the document data and get size of message
    LOOP AT t_message.
    lt_objtxt = t_message-line.
    APPEND lt_objtxt.
    ENDLOOP.
    DESCRIBE TABLE lt_objtxt LINES lw_tab_lines.
    IF lw_tab_lines GT 0.
    READ TABLE lt_objtxt INDEX lw_tab_lines.
    lwa_doc_chng-doc_size = ( lw_tab_lines - 1 ) * 255 + STRLEN( lt_objtxt ).
    lwa_doc_chng-obj_langu = sy-langu.
    lwa_doc_chng-sensitivty = 'F'.
    ELSE.
    lwa_doc_chng-doc_size = 0.
    ENDIF.
    u2022     Fill Packing List For the body of e-mail
    lt_packing_list-head_start = 1.
    lt_packing_list-head_num = 0.
    lt_packing_list-body_start = 1.
    lt_packing_list-body_num = lw_tab_lines.
    lt_packing_list-doc_type = 'RAW'.
    APPEND lt_packing_list.
    u2022     Create the attachment (the list itself)
    DESCRIBE TABLE t_xlstab LINES lw_tab_lines.
    u2022     Fill the fields of the packing_list for creating the attachment:
    lt_packing_list-transf_bin = 'X'.
    lt_packing_list-head_start = 1.
    lt_packing_list-head_num = 0.
    lt_packing_list-body_start = 1.
    lt_packing_list-body_num = lw_tab_lines.
    lt_packing_list-doc_type = lw_doc_type.
    lt_packing_list-obj_name = 'Attach'.
    lt_packing_list-obj_descr = w_docdesc.
    lt_packing_list-doc_size = lw_tab_lines * 255.
    APPEND lt_packing_list.
    u2022     Fill the mail recipient list
    lt_reclist-rec_type = 'U'.
    LOOP AT t_recipient_list.
    lt_reclist-receiver = t_recipient_list-address.
    APPEND lt_reclist.
    ENDLOOP.
    u2022     Finally send E-Mail
    CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
    EXPORTING
    document_data = lwa_doc_chng
    put_in_outbox = 'X'
    commit_work = 'X'
    IMPORTING
    sent_to_all = lw_sent_to_all
    TABLES
    packing_list = lt_packing_list
    object_header = lt_objhead
    contents_bin = t_xlstab
    contents_txt = lt_objtxt
    receivers = lt_reclist
    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.
    Hope it will help you
    Regards
    Rahul sharma

  • How to disable sorting for some columns in a ALV GRID?

    Hi i have requirement where I have to disable sorting for some columns in a ALV GRID. i am using REUSE_ALV_GRID_DISPLAY function module.
    Can anybody help me. how to acieve this? Any code snippets will really be appreciated.

    Hi,
    I have tried this but not completely successful. I think this can be done using the OOPS method.
      DATA: it_event_exit TYPE  slis_t_event_exit.
      DATA: w_exit TYPE slis_event_exit.
      w_exit-ucomm = '&ODN'.
      w_exit-before = 'X'.
      CLEAR w_exit-after.
      APPEND w_exit TO it_event_exit.
      w_exit-ucomm = '&OUP'.
      w_exit-before = 'X'.
      CLEAR w_exit-after.
      APPEND w_exit TO it_event_exit.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_callback_program          = w_repid
          i_callback_top_of_page      = 'ALV_TOP_OF_PAGE'
          i_callback_html_top_of_page = 'ALV_HTML_TOP_OF_PAGE'
          i_callback_user_command     = 'USER_COMMAND'  <- User command form
          is_layout                   = wm_layout
          it_fieldcat                 = wt_fieldcat
          it_events                   = i_events
          it_event_exit               = it_event_exit    <- Need to fill
          it_sort                     = wt_sort
          i_default                   = 'X'
    Now you can capture this events in the user command
    FORM user_command  USING r_ucomm LIKE sy-ucomm
                             rs_selfield TYPE slis_selfield.
      IF r_ucomm = '&OUP' and rs_selfield-SEL_TAB_FIELD = 'Your field name'.
      ENDIF.
    ENDFORM.                    "user_command
    In this form you will get the function code in 'r_ucomm' and the field selected for sorting in 'rs_selfield-SEL_TAB_FIELD'. But reseting 'r_ucomm' will not work.
    May be somebody else can give some help on this.
    But this will work if you follow the oop method.
    Please see this document for more info.
    http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webas/abap/an easy reference for alv grid control.pdf
    Thanks
    Vinod

  • Hiding a column in an ALV Grid

    Hi ,
    I want to hide a column in an ALV grid and I am doing it as such.However it doesn't work.
    data : gw_fieldcat type lvc_s_fcat,
              gt_fieldcat type lvc_t_fcat.
    perform build_grid1 changing gt_fieldcat.
    form build_grid1 changing p_gt_ss.
    gw_fieldcat-fieldname   = 'UKURS'.
    gw_fieldcat-scrtext_m   = 'Exchange rate'.
    gw_fieldcat-no_out      = 'X'.
    gw_fieldcat-col_pos     = 9.
    APPEND gw_fieldcat TO gt_fieldcat.
    endform.
    Kindly suggest.

    Hi,
    As per code it looks good..check in the debugging corresponding to the field 'UKURS is no_out has value X in the fieldcatalog.

  • Editing An ALV Grid and saving finally.

    Hİ !
    former Abap programmer I have modified CN47N as ZCN47N and made the some of the fields of the grid Editable.
    The user changes some of the fields and then press Enter occasionally. When he wants to save he clicks a Save button.
    If I use 
    call method g_d_grid->set_ready_for_input
        exporting
          i_ready_for_input = 1.
      call method g_d_grid->register_edit_event
        exporting
          i_event_id = cl_gui_alv_grid=>mc_evt_enter
        exceptions
          error      = 1
          others     = 2.
    the "data_changed " event of the ALV grid is fired every time the user press Enter BUT CAPTURES ONLY THE LAST EDITS.
    But I can update the neighboring cells of the editable cells immediately by this way.
    If I disable the mc_evt_enter event , The user can save ALL of the changes with the firing of gr_grid->checked_changed_data which fires the data_changed event.
    But by this way I can not update the neighboring cells of the editable cells with the explanation of the editable cells.
    My Question:
    1) Will data_changed_finished event suit better than data_changed_?
    2) Is there a moderate way in which I can use the enter key and capture all the changes that have been made in the grid ?
    thanks.
    erkan.

    DATA_CHANGED triggers as soon as you enter the value and move away to different cell. Parameter ER_DATA_CHANGED of the handler method of DATA_CHANGED would have MT_GOOD_CELLS and MT_BED_CELLS. Based on this you can validate the values and update the Protocol table using the method ADD_PROTOCOL_ENTRY.
    If you have to modify other cells based on the entered cells, you need to use this DATA_CHANGED method, because here you can get / change the data of the cell using the method GET_CELL_VALUE & MODIFY_CELL. in this method, the entered data is not yet visible in your ALV data table.
    DATA_CHANGED_FINISHED triggers after the data has been updated in the ALV data table. So, if you wish to change the other cells it too late. You need to modify the table and call the refresh method to actually refresh the data.
    Regards,
    Naimesh Patel

  • Total, Subtotal of a hidden column in an ALV grid

    I have a requirement for an ALV grid where I have to use a custom formula for a column's total and subtotal.
    This value is a function of another column which is hidden (No_out = 'X').
    I am unable to access the total and subtotal of this hidden column . I am able to access this only when I unhide the column in the field catalog.
    THis is how I access the total and subtotal of the GRID. I use oops ALV of the class CL_GUI_ALV_GIRD.
    call method o_grid->get_subtotals
        importing
          ep_collect00 = total
          ep_collect01 = subto.
      assign total->* to <ftotal>.
      assign subto->* to <fsubto>.
    I thought I would manipulate <ftotal>-mycolumn and <fsubto>-mycolumn . But both these are functions of a hidden column
    and <ftotal>-hiddencolumn and <fsubto>-hiddencolumn is always empty unless I unhide them. I cannot display these columns to users as they are just logical columns of a dynamic internal table I have built.  :-s

    HI,i have the same issue, how did you solve it?
    Regards.

  • Scroll text in ALV column using OO ALV grid

    Hi All,
    I have displayed ALV grid on the screen which has four columns. One of the columns is a text field with text255 domain. This Column is also editable. I have following problem and need help;
    The column for some reason displays only 130 chars. I tried to set the output length in field cat to 255 still no difference. My custom container width is equivalent to max screen width of 255.
    I also tried to crunch the other three columns to display as much characters as needed so that I am left with enough space for the last column which is comments but still it displays on 130 characters. And thoughts on why this is happening.
    Thanks,
    Yogeeta

    Hi,
    The ALV will only let you show 130 characters. You could use 2 columns to display the text.
    Martin

  • Not able to get which row is edited in alv grid

    Hi,
    I have created a Editable alv grid .
    My grid does not contain line selection cloumn so How can I get to know which row is to be changed.
    I am using get_selected_rows method but not able to get which row is changed. please help on this.
    Thanks in advance.

    Hi,
      check this ..
      it_ekko1[] = it_ekko[].
      call function 'REUSE_ALV_GRID_DISPLAY'
           exporting
                i_callback_program      = gd_repid
                i_callback_user_command = 'USER_COMMAND'
                is_layout               = gd_layout
                it_fieldcat             = fieldcatalog[]
                it_events               = i_events
                i_save                  = 'X'
           tables
                t_outtab                = it_ekko
           exceptions
                program_error           = 1
                others                  = 2.
    In user command you need to write logic to know which all records have changed.
    FORM user_command USING r_ucomm LIKE sy-ucomm
                      rs_selfield TYPE slis_selfield.
      CASE r_ucomm.
        WHEN '&IC1'.
         loop at it_ekko into wa_ekko.
           read table it_ekko1 into wa_ekko1 index sy-tabix.
           if wa_ekko <> wa_ekko1.
    write your logic further
           endif.
         endloop.    
      endcase.
    Regards,
    Srini.

  • Disabling push button column cell on alv grid control (OOABAP)

    Hello All,
    I have a requirement where I need to add one column as pushbutton in alv grid display. I have done that and it's triggering button_click event also. The problem here is that I want the few <b>push button cells</b> of that column to be disbaled (depending on my requirement). I tried using a internal table lvc_t_styl and adding a field of same lvc_t_styl in my main internal table. This works for all other fields (e.g disbaling checkbox in alv grid and other editable fields) but not for push buttons. My exact requirement is that I want some of the <b>cells of pushbutton column to be grayed out (made inactive)</b>. Can anyone tell me how to do that. Thanks.
    Note:Helpful answers will be duly rewarded.
    null

    Hi,
    I had the same problem.
    what I did I just added the  cl_gui_alv_grid=>mc_style_button at each row of the data table instead of adding it at the field catalog level.
    Hope this solve your problem.
    Thanks,
    Harish

  • Regarding PF Status In ALV Grid Dispaly

    Hi..
    Can you please tell me how to set PF status in ALV Grid Display.
    Regards
    Sandeep.

    hi,
    if u use REUSE_ALV_LIST_DISPLAY copy the standard GUI-Status named STANDARD from function group SALV in your program
    if u use REUSE_ALV_GRID_DISPLAY_LVC or REUSE_ALV_GRID_DISPLAY copy the standard GUI-Status named STANDARD_FULLSCREEN from function group SLVC_FULLSCREEN in your program
    after  that you cas set the pf-status in this way:
    >CALL FUNCTION 'REUSE_ALV_LIST_DISPLAY'                   
    > EXPORTING                                               
    >    i_callback_program                = sy-cprog         
    >    i_callback_pf_status_set          = 'STATUS'
    >    i_callback_user_command           = 'USERCOMMAND'    
    >   is_layout                           = st_layout         
    >   it_fieldcat                          = st_fieldcat      
    >  TABLES                                      
    >    t_outtab                          = outtab 
    or
    >CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY_LVC'              
    > EXPORTING                                              
    >    i_callback_program                = sy-cprog         
    >    i_callback_pf_status_set          = 'STATUS'  
    >    i_callback_user_command           = 'USERCOMMAND'   
    >    is_layout_lvc                     = wa_slis_layout  
    >    it_fieldcat_lvc                   = tb_slis_fieldcat
    >  TABLES                                                
    >    t_outtab                          = tb_app          
    where USERCOMMAND and STATUS are 2 forms in your program.
    >FORM status USING pfstat TYPE slis_t_extab.
    > SET PF-STATUS 'STANDARD' EXCLUDING pfstat.
    >ENDFORM.
    >
    > ...
    >
    >FORM usercommand USING okcode LIKE sy-ucomm
    >                       wa_selfield TYPE slis_selfield.
    >  CASE okcode.
    >      .... 
    >  ENDCASE
    >ENDFORM.
    Bye.
    Marco

  • REGARDING horizontal scroller in alv grid o/p

    hi,
       i have developed a report in alv grid its wrking fine..
      i want one thing >>>>in the o/p screen the plantid  is the first column, the second column is the plant name what i want is that, horizontal  scroller will work from plant name not from plantid for this what parameters sud i pass in the fieldcat for plantid.plz help me.

    Hi,
    U have to put for that particular plant id
    wfieldcat-key = 'X'.
    Thanks,
    Sankar M

  • Hiding few columns before displaying alv grid output

    Hi All,
    I struck up at hiding few columns before displaying alv output. I have used used FM: REUSE_ALV_GRID_DISPLAY. By using this i am displaying 29 fields to the output. But before displaying the output i want to hide few columns among them, and also those fields have to be avialable for further selection by the user by using layout.
    Kindly help me in this,
    Regards
    Srinivas K

    Hi,
    In field catalog set NO_OUT='X' for all the columns you want to hide. They will be available when changing layout for ALV, so you can show them at any time.
    Regards
    Marcin

  • Highlight the column in the ALV grid only for few entries!

    Hi all,
    I am using the FM "REUSE_ALV_GRID_DISPLAY" to dsplay the o/p of my report in ALV grid.
    Now i need to highlight 1 particluar column for only some entries(row) based on the value of the column which is to be highlighted.
    Can anyone tell me the steps to do so??

    Please make search thru this form you can find lot of threads
    For example
    https://forums.sdn.sap.com/search.jspa?threadID=&q=alvANDcellANDcolor+&objID=f50&dateRange=all&numResults=15

  • Editing in ALV grid

    Hi,
    I have designed a ALV grid and have the following requirement.
    When the user adds a new row and enters data in that row,
    and presses SAVE, the data has to get stored in the database.
    I require a method to get the selected row id, and to read the text from that row id.
    Kindly help me.

    Hi,
    check this link............
    [http://www.sapdev.co.uk/reporting/alv/alvgrid_ucomm.htm]
    rs_selfield has the selected line..
    Cheers,
    jose.

Maybe you are looking for

  • Problem in Transport Acknowledgements

    Hi I have designed a Sync-Async scenario wherein the Transport acknowledgement from File adapter(async) is used as basis for determining how the dummy response to Sync sender interface would be.. Now if i get a FTP access error/ File writing error in

  • Returning to Coscto for nano

    Had my ipod 5g 30gfor 3 months now. I miss my nano i returned for the 30 gig (punches myself) Still have the reciept and the ipod is in good condition. Will they take my ipod back for the second time so i can exchange it for the nano. When i had the

  • How to get a simple form to work

    I am just trying to make a simple contact us form and can not get it to work. I am uploading trial version of 8 but currently using dreamweaver 4. I can do simple stuff, and made the form I need, but have no idea how to get it submit to my e-mail. Ca

  • Slide show crash

    I have several 15 minute slideshows, but none will run on my iMac (27") for more than 8 minutes without crashing. Sometimes the screen goes blank but the music keeps going. Other times I get the message that "iPhoto has quit unexpectedly." I've been

  • What Could Disable "Save a Copy..." on My Website?

    I have a client that is using IE7 (and tried IE 8) with Reader 9 installed. They tell me that while able to view any of my PDFs, the Save button is visible.  When they then attempt to click on it, a red circle or some other indicator appears, telling