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

Similar Messages

  • 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

  • Open an existing file, edit and save in Forms 10G R2

    Dear all
    Could u pls tell me how can i open a file like .doc,.xls extension. and i want to input some data to that file and save.These all i need to oracle 10g R2 version click on a button. How can i open .pdf and html file(Read Only).
    Regards,
    MAR

    You can do this to show a file on the client file system...
    web.show_document('file://c:\mypath\myfile.doc', '_blank');
    This will lauch the word document in word. The user can then edit and save it from word. This basically is calling your web browser and your web browser then hands off the file to a helper app. This will work for any file type that the client has helper app to display.

  • 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

  • Is there any way to edit and save an existing spreadsheet file that was not created from my iPad? I get excel spreadsheets emailed to me and would love to edit them on my iPad and not ever use my PC.

    Is there any way to edit and save an existing spreadsheet file that was not created from my iPad? I get excel spreadsheets emailed to me and would love to edit them on my iPad and not ever use my PC.

    Thanks. I tried an app called Office2HD and it does exactly what I need. I can even email my edited file from this app.

  • 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.

  • Can I view, edit and save microsoft documents such as Word, Excel and Powerpoint using iWork applications such as Pages, Keynote and Numbers on my iPad Mini (16GB Wi-Fi)? If Yes, then can I directly load these files to my iPad mini using iTunes?

    Can I view, edit and save microsoft documents such as Word, Excel and Powerpoint using iWork applications such as Pages, Keynote and Numbers on my iPad Mini (16GB Wi-Fi)? If Yes, then can I directly load these files to my iPad mini using iTunes? Also, once I finish working on these documents, can I download these back to my Computer.

    Sorry, forgot to say:
    Thank you so much to EVERYBODY/ANYBODY who may reply with helpful information,
    Bob :) :) :)

  • How do I edit and save a word document that has been e-mailed to my ipad

    How do I edit and save a word document that has been e-mailed to my ipad and then re-send

    Use the paid version (install and activate) of Microsoft Word.
    https://itunes.apple.com/sg/app/microsoft-word-for-ipad/id586447913?mt=8

  • How can i edit and save a spreadsheet or excel sheet on my MACbook pro

    how can i edit and save and rename excel or spreedsheet on my macbook pro

    Just download LibreOffice and click on the Spreadsheet icon in the splash screen:
    ...and it will open almost any Excel document...
    (This is an old football roster created in Excel).
    Good luck,
    Clinton

  • How can I edit and save parts of songs (like a chorus).

    How can I edit and save parts of songs (like a chorus).

    The iTunes-only way is:  figure out where you want your excerpt to begin and end.  Right-click the track, Get Info, Options tab, set the Start/Stop times accordingly, and OK out.  Right-click again, and choose Create XXX version (where XXX is the format indicated in your Import settings).  Right-click one more time, and unset the Start/Stop times.
    This procedure will leave the full track in place, and will create a new file and library entry with just your excerpt.

  • How to open, edit, and save XML

    I hav a problem in creating jsp file that can open, edit, and save xml!Anyone can help me?!!!

    Use a bean to do the job. pass the required params to the bean.

  • Webdynpro for Java Edit and Save.

    Dear all,
    ter cal
    iam working on webdynpro for java i want simple code for EDIT and SAVE  after calling a rfc in for using NWDS webdynpro for java.
    1)HOW TO SAVE AND EDIT THE FRONT WEBDYNPRO FOR JAVA APPLICATION
    2)AFTER SAVING AND THE DATA THAT SHOULD BE SAVED IN PA30 ARE PA20 AND IN PARTICULAR TABLE ALSO.
    PLEASE GIVE ME GOOD TIPS.

    Hi Kishore,
    Creating/Updating entries in tables through Bapis (RFC calls) work in the same way as it is done for other Bapis like those for returning values or even structures. All you have to do is
    1. Import the model, create a model node in your context and bind it to the Input structure of the model under used models.
    2.Create an istance of the Model input structure, like
         Z_Test1_Input input = new Z_Test1_Input();
    3. Set attibutes directly under the input structure
         input.setAttr1("XYZ");
    4. Set attributes under any other structure under Input Structure by first creating the instance of the sub-structure
        Z_SubStruct1 subStrc1 = new Z_SubStruct1();
        subStrc1.setSubAttr1("ABC");
    5. Add all available instances of sub-structures to the instance of input structure
        input.set<SubStruct1>(suStrc1);
    6. Add all available instances of tables under Input Structure after setting attributes within using
    for (int iCount = 0; iCount < wdContext.nodeVn_ContactInfo().size(); iCount++) {
          Z_Table1 zTable1 = new Z_Table1();
          IPublic<YourComponent>.IVn_Table1Element tab1Ele = wdContext.nodeVn_Table1().getVn_Table1ElementAt(iCount);
          zTable1.set<TableAttr>(tab1Ele .getVa_Attr1());
          input.add<Table1>(zTable1);
    7. Bind the instance of input structure to the model node.
       wdContext.nodeMn_TestModel().bind(input);
    8. Execute the model object and then invalidate the output structure under model node (Put this code in try catch block)
       wdContext.currentMn_TestModelElement().modelObject().execute();
       wdContext.nodeMn_TestModel().nodeOutput().invalidate();
    9. Retrieve values from the attributes, tables and structures under the Output Node of the Model Node (Mn_TestModel) as usual
    and store wherever in context as required. In case of output tables, you need to use FOR loop to iterate through the tables and access elements within using index (using wdContext.node<YourRequiredNode>().get<YourRequiredNode>ElementAt(int index)).
    Hope it is helpful.

  • How can I edit and save a raw file in jpeq and open it in windows live photo gallery

    how can I edit and save a raw file in ps elements 10 and open it in windows live photo gallery?

    Change to 8 bit mode before clicking the Open Image button, then jpeg will become available as a choice.
    Click to view image

  • 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

  • Is down loading projects to DVD's a safe way to edit and save?

    Yesterday I posted "Is down loading projects to DVD's a safe way to edit and save?". It got deleted. Being a newbe I got it in the wrong forum. I got it in "Post New Thread in Forum Comments". I was asked what path I used; I opened the home page. I ticked Discussions / Start New Discussion. I was so baited by the lure to post, I did not see the small "Adobe Forums" at the top and bottom of the page. I also did not understand the large "Post New Tread in Forum Comments". It was a bit confusing to me. But thanks to you guys I see the light.
    I read the discussion I started in "Why do we keep moving Post?". I was branded as a lost soul. I want to thank all of you for helping find my way. No one was rude or even harsh. I have been on other Forums and if you make a mistake you get blasted.
    I also want to thank you for all the answers I got for my original post. I read up on SATA and I can see that is where I need to make some changes to my portioned HD. I am sure I will be leaning on you for a lot of help for such a "Lost soul". And that I am. I am your typical 61 year old who got started late on computers.
    The fact that my HD is portioned is not a good thing I learned. I am not sure if my computer has the Power Supply or the Mother Board to convert to SATA. My question is: Will eSATA work in place of the internal SATA?
    Will I need two; one for editing and one for storage.
    I have an outboard I Omega with about 650GB, I think. Not sure if it is SATA, but it has worked well for my backup videos and general files.
    Thanks Again and I hope I got it right this time.
    I'm timid about ticking the "Post Message" , but here goes......Ohhhhhhhhh.....

    The system process in control panel MAY give you some of that information
    It should ALL be available with the information the system builder gave you... he DID give you the paperwork that came with the individual components?
    Taking the side panel off the case and looking inside with a flashlight might also help... but, of course, you'll need to know what it is you are seeing, and it sounds like you don't know much about hardware, so that may not help much
    Sadly, if the person who built this "video editing" computer didn't really understand video editing, you are left with a computer that won't do what you want, and no easy way to make it work
    You may need to find a computer shop to do this for you... and make sure part of their price is giving you a written list of everything you HAVE and everything they DO in the way of additions or configuration changes

Maybe you are looking for