Problem with alv edit and save

hi all,
       can anyone find me a solution for alv edit and save...the issue is that i will be editing and just clicking on save button withot any row selction and the data changed should be updated in database.
                                                                                sunil.

Hi Bhaskar,
To make fields editable in ALV, while creating the field catalog for ALV, use:-
wa_field-edit = 'X'. " to make a field editable
To check the data changed in ALV, use code:-
ALV GRID Display
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
  EXPORTING
    i_callback_program                = sy_repid " report id
    i_callback_user_command           = 'USER_COMMAND' " to handle user command
    it_fieldcat                       = it_field " for field catalog
    it_sort                           = it_sort " for sort records info
  TABLES
    t_outtab                          = it_final "internal table with records
  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.
Sub-routine USER_COMMAND
FORM user_command USING v_okcode LIKE sy-ucomm selfield TYPE slis_selfield.
* assign the function code to variable v_okcode
  v_okcode = sy-ucomm.
* handle the code execution based on the function code encountered
  CASE v_okcode.
* when the function code is EXECUTE then process the selected records
    WHEN 'EXECUTE'.
*to reflect the data changed into internal table
      DATA : ref_grid TYPE REF TO cl_gui_alv_grid. "new
      IF ref_grid IS INITIAL.
        CALL FUNCTION 'GET_GLOBALS_FROM_SLVC_FULLSCR'
          IMPORTING
            e_grid = ref_grid.
      ENDIF.
      IF NOT ref_grid IS INITIAL.
        CALL METHOD ref_grid->check_changed_data.
      ENDIF.
* refresh the ALV Grid output from internal table
      selfield-refresh = c_check.
ENDCASE.
Hope this solves your problem.
Thanks & Regards,
Tarun Gambhir

Similar Messages

  • Problem with ALV grid in edit mode

    Hello, gurus!
    I have a problem with ALV-grid. Sometimes when I call F4 help for a cell, data is inserted in a different cell.  And when I call check_changed_data method, my internal table (passed to ALV-control in set_table_for_first_display) does not updates properly. In what can be a problem?
    Thanks,
    Mikhail

    Hi Prabhu,
    MODULE pbo_100 OUTPUT.
      SET PF-STATUS 'MAIN100'.
      title_of_report = text-010.
      SET TITLEBAR '0100' WITH title_of_report.
      DATA: g_event_receiver TYPE REF TO lcl_event_handler.
      IF z_custom_container IS INITIAL .
        CREATE OBJECT z_custom_container
          EXPORTING
            container_name = 'ALV_ZAC'.
        CREATE OBJECT alv_grid
          EXPORTING
            i_parent = z_custom_container.
        g_repid = sy-repid.
        gs_variant-report = g_repid.
        x_save = 'A'.
        PERFORM check_alv_grid_fields.
        ps_layout-cwidth_opt = 'X'.
        ps_layout-edit = 'X'.
        CALL METHOD alv_grid->set_ready_for_input
          EXPORTING
            i_ready_for_input = '1'.
    *    CALL METHOD alv_grid->register_edit_event
    *      EXPORTING
    *        i_event_id = cl_gui_alv_grid=>mc_evt_enter.
        APPEND   s_list_rec   to it_list_rec.
        CALL METHOD alv_grid->set_table_for_first_display
          EXPORTING
            is_layout       = ps_layout
            is_variant      = gs_variant
            i_save          = x_save
          CHANGING
            it_fieldcatalog = pt_fieldcat
            it_outtab       = it_list_rec[].
        CALL METHOD alv_grid->register_edit_event
          EXPORTING
            i_event_id = cl_gui_alv_grid=>mc_evt_enter.
        CALL METHOD alv_grid->register_edit_event
          EXPORTING
            i_event_id = cl_gui_alv_grid=>mc_evt_modified.
    ENDIF.
    FORM check_alv_grid_fields .
      DATA: ls_fcat LIKE LINE OF pt_fieldcat.
    REFRESH pt_fieldcat .
    CLEAR: ps_layout, ls_fcat.
      ls_fcat-fieldname = 'VBELN'.
      ls_fcat-ref_field = 'VBELN'. ls_fcat-ref_table =  'LIPS'. " .
      ls_fcat-outputlen = 9.
    *  ls_fcat-datatype   = 'CHAR'.
    *  ls_fcat-inttype    = 'C'.
      APPEND  ls_fcat TO pt_fieldcat.
      CLEAR: ls_fcat.
      ls_fcat-fieldname = 'ERDAT'.
      ls_fcat-ref_field = 'ERDAT'. ls_fcat-ref_table = 'LIPS'.
      ls_fcat-outputlen = 9.
    *  ls_fcat-f4availabl = 'X' .
    *  ls_fcat-datatype   = 'DATS'.
    *  ls_fcat-inttype    = 'D'.
      APPEND ls_fcat TO pt_fieldcat.
      CLEAR: ls_fcat.
    ENDFORM.                    " check_alv_grid_fields
    FORM save_p .
      CLEAR l_valid.
      CALL METHOD alv_grid->check_changed_data
        IMPORTING
          e_valid = l_valid.
      IF l_valid IS INITIAL.
        CALL FUNCTION 'POPUP_TO_INFORM'
          EXPORTING
            titel = text-i01
            txt1  = text-i02
            txt2  = text-i03
            txt3  = text-i04.
      ELSE.
        i_dat_reg = zrumm_prr-cdprr.
        CLEAR is_temp_otc.
        freshit i_prrpus_fax.
        freshit i_list2_ot.
        LOOP AT it_list_rec INTO s_list_rec.
          MOVE-CORRESPONDING s_list_rec TO i_list2_ot.
          i_list2_ot-fgrup = 'RECE'.
          i_list2_ot-prrnu = i_num_prr.
          APPEND i_list2_ot.
          MOVE-CORRESPONDING s_list_rec TO i_prrpus_fax.
          APPEND i_prrpus_fax.
        ENDLOOP.
      ENDIF.
    Edited by: Mikhail Sarychev on Mar 16, 2011 6:41 AM
    Edited by: Mikhail Sarychev on Mar 16, 2011 6:49 AM
    Edited by: Mikhail Sarychev on Mar 16, 2011 6:49 AM

  • Edit and save dynamic alv.

    Hi Experts
    I have created a dynamic table then filled this dynamic table with the help of field symbols and then passed this dynamic table to grid1->set_table_for_first_display and hence the dynamic alv is shown on the screen. Now, can I do something to make this alv editable and store these values in z table. I have tried the method get_changed_cell method, but no help.
    CALL METHOD CL_ALV_TABLE_CREATE=>CREATE_DYNAMIC_TABLE
        EXPORTING
          IT_FIELDCATALOG = LT_LVC_CAT
        IMPORTING
          EP_TABLE        = LP_TABLE.
      ASSIGN LP_TABLE->* TO <LT_DATA>.
    *Create structure = structure of the internal table
      CREATE DATA LP_STRUCT LIKE LINE OF <LT_DATA>.
      ASSIGN LP_STRUCT->* TO <HEADER>.
    *  SORT gt_data BY erdat.
    *sort IT_VEWAO by MATNR.
      LOOP AT IT_VEWZO INTO WA_VEWZO.
        AT NEW VKBUR.
          CLEAR <HEADER>.
          ASSIGN COMPONENT 'VKBUR' OF STRUCTURE <HEADER> TO <FIELD>.
          IF SY-SUBRC NE 0.
            EXIT .
          ENDIF.
          <FIELD> = WA_VEWZO-VKBUR.
        ENDAT.
        MOVE WA_VEWZO-PD_HIER  TO L_COL.
        ASSIGN COMPONENT L_COL OF STRUCTURE <HEADER> TO <FIELD>.
        IF SY-SUBRC NE 0.
          EXIT .
        ENDIF.
        <FIELD> = WA_VEWZO-PLAN_QTY.
        CONCATENATE WA_VEWZO-PD_HIER '_AP' INTO WA_VEWZO-PD_HIER .
        MOVE WA_VEWZO-PD_HIER  TO L_COL.
        ASSIGN COMPONENT L_COL OF STRUCTURE <HEADER> TO <FIELD>.
        IF SY-SUBRC NE 0.
          EXIT .
        ENDIF.
        <FIELD> = WA_VEWZO-APROV_QTY.
        AT END OF VKBUR.
          APPEND <HEADER> TO <LT_DATA>.
        ENDAT .
      ENDLOOP.
    CREATE OBJECT CUSTOM_CONTAINER1
             EXPORTING
                  CONTAINER_NAME = 'CUST_CONT'.
      CREATE OBJECT GRID1
              EXPORTING
                  I_PARENT = CUSTOM_CONTAINER1.
      CALL METHOD grid1->REGISTER_EDIT_EVENT
              EXPORTING
                  i_event_id = cl_gui_alv_grid=>mc_evt_modified.
      CALL METHOD GRID1->SET_TABLE_FOR_FIRST_DISPLAY
        EXPORTING
    *      I_STRUCTURE_NAME = lv_lp_struct
          IS_LAYOUT        = LS_LAYOUT
        CHANGING
    *      IT_SORT          = LT_SORT1
          IT_FIELDCATALOG  = LT_FIELDCAT
          IT_OUTTAB        = <LT_DATA>.

    Hi,
    What help u need?
    to activate the editable field u need to pass the field catalog parameter
    EDIT = 'X'
    Then Edit values in your alv
    and press enter or define any icons in ur alv list useing user command
    check the changed values using the method
    CALL METHOD g_alvgrid1->check_changed_data( ).
    It will help you i think.
    Regards,
    Nandha

  • Problems with ALV - 2

    Hi All
    The flow of my program is as follows
    First one interactive report is shown to the user.
    When he triggers the At line selection, I am creating editable ALV (using object methods i.e. using set_table_for_first_display) and the user can make changes to the values ,once he edits and saves the program takes him to interactive report again with refreshed values. Again if he wants to edit the list I am taking him to editable ALV again now the problem is here ,this time it is not saving the changes made by the user and the ALV is not saving the changes however if I again calls the ALV i can see the changed fig. on the screen. I used the refresh table method also but it is not working. I tried to free the memory used at the time of creating object for grid etc.
    Any feedback?
    Thanks in anticipation.
    pM.

    Hi All
    You can also copy the css file in itsmobile to your internet service.
    By putting the following code into the css and updating the gui config in sicf for the internet service you can remove the vertical scroll bar. 
    this problem only seems to happen when you use the mobile4 gernation style.
    /* --- MOBILE BODY -
    .MobileHtml

  • Problem with ALV search help Dictionary Search Help

    Hello experts
    I have a problem with ALV search help.
    I use DDIC table ZXXX with text table ZXXX_T. I created DDIC search help form table ZXXX. In my WD application, in context on COMPONENTCONTROLLER i set on attribute: 'Input help mode' as 'Dictionary Search Help' and in 'Dictionary Search Help' I pass name of new created DDIC search help.
    I create a input field from that atrribute and search help works fine (there was a value and description for value from text table). So I created ALV witch contains that attribute too.
    Next I set column for this attribute in ALV as editable but on Serch help for this collumn I have only value. I DON'T HAVE TEXT DESCRIPTION FOR VALUE.
    Please help me and tell me what I do wrong?
    Miko

    Hello,
    Thank's for your help. I create DDic Search help for all fields from my ALV. Next I changed 'TYPE' for all ALV fields in COMPONENTCONTROLLER from ZXXX-Zfield to Zfield, and I changed 'Input help mode' from 'Automatic' to 'Dictionary Search Help'. Now I see Value and Description for value in Search Help in my ALV.
    Regards
    Miko

  • Export pdf    how to edit and save converted files

    I finally was able to convert to docx format, but see no way to use the converted file.  How can I edit and save in jpeg format?

    Hi Chuck,
    Please tell me what the problem is with the converted file. Are you unable to edit it, or did it not convert as you expected?
    Can you tell me how the PDF was created? (Different applications write PDF files differently, and some aren't as good as others--that can affect conversion).
    Best,
    Sara

  • Problems with dropped calls and no reception on Samsung Continuum

    My mother and I both purchased a Samsung Continuum in late March 2011, and have experienced the same problems with the phone.  The device drops at least 2-3 calls per day, often on the same conversation; we have not found that location or time of day makes a difference.  The phone freezes up frequently, even if no apps are running in the background.  We lose our 3G network reception frequently, and cannot access our texts, emails, or the internet.  The screen saver kicks in even when we are actively dialing a number, or typing in a text message.  The overall performance of the phone is also poor, and it is quite slow much of the time.
    We have raised this issue several times with a representative at one of the Verizon stores, but he states that he can find no problem with the phone, and that these issues may not be covered under our insurance plan.  None of my friends with non-Samsung phones are having the same problems with phone reception and performance.  I am aggravated enough with these issues that I am considering reactivating my old Blackberry, which worked like a charm.
    I am not upset that my phone has not been updated to Android 2.2.  I just want the phone to perform as stated, and not fail at its primary function:  making and receiving phone calls.  I am not certain if these problems originate with the phone, Verizon, or Samsung, nor do I care.  I just want to resolve these issues as soon as possible, or I will have to look at other alternatives.
    Thank you.

    If this doesn't work...now what??? I have a useless $400 plus piece of unreliable junk. My Motorola Razor was ions more reliable than this phone...very, very sad but true.
    What carrier were you using with the Razor? AT&T? Same area?
    Dave M.
    MacOSG Founder/Ambassador  An Apple User Group  iTunes: MacOSG Podcast
    Creator of 'Mac611 - Mobile Mac Support' (designed exclusively for an iPhone/iPod touch)

  • Problem with 'Word edit cell.vi' , Inputs transduced with the value of every row repeated

    Hello,
    Im using LV2013 with office 2013 report tool kit. I am trying to use Word edit cell to input values in table previously created in template .doc.
    Indeed, i trying the example Generate report from template and didnt works well. I search for solution and I see it was a problem with previous version but it seems not solve totally in this version for word office 2010. 
    http://digital.ni.com/public.nsf/allkb/4041ECB5D02BA57D862579A00002FE8D
    I checked this thread but i didnt get it to works. http://forums.ni.com/t5/LabVIEW/Problem-with-append-table-and-Word-2010/m-p/2190960#M702610
    Any way to solve it?.
    Thanks for help.
    Fred
    Attachments:
    error.png ‏32 KB
    Untitled 1.vi ‏19 KB
    exampleTemplate.doc ‏37 KB

    Hello, I solve it adding this to Word_insert_Table.
    http://forums.ni.com/t5/LabVIEW/Report-Generation-MS-Word-Table-Bug/td-p/1605170
    Thanks.
    Open [LabVIEW installation folder]\vi.lib\addons\_office\_wordsub.llb\Word_Insert_Table.vi
    There is a nested for loop that interprets the provided string array data and reformats it into a long ASCII string for the copy buffer. It should look like this:
    Change the nested loop to look like this:
    The changes I've made are twofold:
    1. Within the inner loop, replace the "\n" char with a Tab character
    2. Just after the inner loop, add a new "concatenate strings" function that adds "\n".

  • Problem with local editing after update to SP13

    Hallo,
    we have updated our Enterprise Portla 7.00 to SP13. Now many user have Problem with local editing. The error message is "The download of the document fail".
    I know that every PC needs the "Docservice" Active X component installed. The "Docservice" is also installed.
    At my PC theres only this problem with "html" documents.
    What could be the problem. ?
    Please help.
    Many thanks
    Ronald

    We found that there is a problem with the Docservice Active X Component.
    If we work in a deeper folder there is a problem with the length of the url. I changed the TEMP Setting
    "Setting a different TEMP directory:                                     
    In cases that it is problematic to use the standard %TEMP% directory,   
    setting the environment variable SAPKM_USER_TEMP pinpointing to a       
    corresponding directory path (e.g.                                      
    X:\SHARES\USERS\xxx\CheckedOutDocuments) will be also supported. If the 
    access to that directory fails the standard %TEMP% directory will be    
    used as fallback."
    I used "C:\TEMP" and now it works.......  but this cant be the solution....
    thans Ronald

  • In SharePoint 2013, some of the userswith contribute or full control rights are not able to edit and save office doucuments to SharePoint library.

    In SharePoint 2013, Office 2010 and IE 8. Office web apps is not configured.
    Some users with Contribute or full control are not able to edit and save documents back to SharePoint library.
    When they try to save they are getting following error:
    1. https://.....pptx is read-only. Do you want to save changes to a different file name?
    2. Project canot access "https://...." 
       Try one of the following
    The file may be temporarily open by another program. wait a momoment and try again.
    A file with the same name may already exists. Save it with a different file name.
    You may be trying to save to a read only folder. Save to a different folder instead.
    Please help me with this issue.
    will be waiting for any suggestions or solutions.
    Thanks
    Krish
    99

    Thanks again for quick response.
    I have requested users who are having this issue to try check in/ check out, and share the results.
    Result with CheckIn/CheckOut:
    User was able to check out but no edit option.
    'Edit Document' option under 'Files' tab was greyed out. I did check permissions every thing seems fine he has full control over the site and document library.
    Please advise.
    Thanks
    Krish
    99

  • Problem with Nokia Camera and Smart Sequence

    Hi,
    I'm having a problem with Nokia Camera and the Smart Sequence mode.
    Basically, if you take a picture using nokia camera, and view it in your camera roll, it usually says, underneath the pic "open in nokia camera".
    Well, if I take a pic using the Smart Sequence mode, it just doesn't say "open in nokia camera" so, to use the functions of smart sequence (best shot, motion focus, etc), I have to open nokia camera, go to settings and tap the "Find photos and videos shot with nokia camera" option.
    Does anyone has the same problem? Anybody solved it?
    I already tried reinstalling nokia camera, but that didn't help.
    I'm running Nokia Black on my 925.
    Thanks everyone!

    Hi,
    I had the same problem with my 1020. It did get fixed with the last update to Nokia camera.
    However, IIRC, it didn't just happen right away. When browsing the camera roll I'm pretty sure that the "open with Nokia camera" text wasn't there.
    Slightly disappointed I opened the (Nokia) camera anyway and was going to test the smart sequence again. I noticed the only precious pic I'd taken using this actually appeared top left of the screen.
    I opened it and I had all the smart sequence editing options again - that we're missing previous. Made a new picture and saved it.
    Now when in camera roll the text shows below the image and all is good.
    This probably doesn't help much except that it didn't seem to fix automatically.
    I work @Nokia so I can ask around a bit to see if this is a known / common issue (not that I know any developers)

  • I have a problem with ALV Grid User Command?

    Hi Experts,
    I have a problem with ALV GRID User Command.
    I am calling TCODE IW33 (Order Display) from the ALV output at first time by selecting an order. But, User command is calling IW33 Initial screen with blank value of order. Even I checked in debugging the value what I selected is passing properly, but once that screen (IW33 Initial) displays, value doesn't appear. Then, Manually, I  created another session and gone to TCODE IW33 and displayed an order. After that I came out from that order. Then again run my ALV program and selected another order, now order is displaying, but not what I selected current order instead of displaying previous order what I just displayed manually. If I selected any other order, system will display the same order what I dislayed manually.
    Here is my code.
    FORM user_command_alv  USING u_ucomm TYPE sy-ucomm
                           us_self_field TYPE slis_selfield.
    CASE u_ucomm.
    WHEN '&IC1'.
    READ TABLE it_final INDEX us_self_field-tabindex INTO wa_final.
            WHEN 'ORDER'.
              IF NOT wa_final-order IS INITIAL.
                SET PARAMETER ID 'COK' FIELD wa_final-order.
                CALL TRANSACTION 'IW33' AND SKIP FIRST SCREEN.
              ENDIF.
    endform.
    PARAMETER ID 'COK'  also the standard one.
    Could you please help me out, Where I did wrong?
    If I select any order, that order only should display.
    Thanks in advance.
    Regards,
    Sarayu.
    Code Formatted by: Alvaro Tejada Galindo on Jan 8, 2009 2:33 PM

    hi,
    Please check it once the Paramater ID is 'ANR' for IW33 order number.
    Hope this may help.
    Regards,
    Sravanthi

  • Problems with saving edited photos using Photoshop Elements 5.0 on WIndows 8.

    Since a week I can not save the edited photos - when I try the communicate: "Caould not complete your request because of a program error" appeares. I had no problem with saving edited photos before, with the same software. My computer runs on Windows 8, 64 bit version. My Photoshop Elements is version 5.0. Where is the problem?

    W dniu 2013-06-16 15:36, dj_paige pisze:
    >
    Yes, I did it long ago.

  • PROBLEM WITH DIGITAL EDITIONS

    Hi,
    I've always encountered this problem with digital editions: Adobe Digital Editions 2.0 has encountered a problem and needs to close.  We are sorry for the inconvenience.
    I'm using Windows XP pro 2002, service pack2  on an old computer AMD Duron 901 Mhz , 384 mb RAM.
    is there a solution ?
    Thanks

    Hi
    I had the same problem, ADE 2 won't work with older AMD computers.  See http://forums.adobe.com/thread/1081859
    Older version that does work at: http://kb2.adobe.com/cps/403/kb403051/attachments/setup.exe
    good luck

  • How to edit and save a document in Pages

    How do I edit and save a document in Pages with MacBook Air

    1) Do you want to edit a .doc(x) and then save it as a .doc(x) again? You'll need to be a bit more specific
    2) Pages is an analogy to MS Word, so editing would be just as simple as typing. Go to 'Help' in the menu bar in Pages and then select 'Pages Help' to enter How-to's and Tutorials from Apple on using Pages.

Maybe you are looking for

  • "Post Invoice and Payment seperately"

    Hi Guys, I need help on resolving this issue. We are posting a vendor downpayment using F-48. We are then doing a vendor invoice and subsequently clearing the open items using F-58. But we are getting the following error while posting "Deferred Tax :

  • How Do I Get Full YouTube Video Description in the App

    While looking at a video in the official YouTube app (iPad 4th gen, iOS 7 and I'm sure this problem was here before that too), if I click the arrow next to the title I get a two sentince description, but can't seem to see a way of getting the full de

  • I think my ipod touch got stolen

    Please help me

  • Multiple EANs per article in Basic Data Maintenance (Retail Master Data)

    Hi, Does anyone know how to prevent users from entering an EAN twice for an article? Example: EAN 123456789 for article AAA with unit of measure PC <i><u>cannot be used</u></i> for the same article AAA with unit of measure CS. Thanks.

  • Create neural looking network in Illustrator

    I've got the following "network" which I would like to resembler more a neural network (brain-kinda-looking, like this neural_networks_artist_rendition.jpg), but the overall shape should remain. How can I accomplish this? The network should remain cl