Esitable alv, n update in database

HI Experts,
How to make an Editable ALV, and if i changed the field content that should update in database. can you give me a solution thru function modules and oops concepts.

Hi,
Making a particular field editable is pretty straight forward.
Just put edit = 'X' while preparing your fieldcatalog.
But then capturing the edited values and updating into the table is a bit tricky.
You need to catch the event of enter press and then check where you get the edited value.
I am also not 100% clear with this updation part.
Hope it helps.
Regards,
Siddhesh S.Tawate

Similar Messages

  • Change the data in fieldcat and update the database table in alv oops

    Hi,
    my requirement is i have displayed a fieldcat in change mode and when i change the data and click on save it has to be updated the database table..
    this has to be done using alv oops...

    Hi,
    This code will reflect all the changes into the internal table that is being displayed.
    * 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.
    Now after this code is executed the internal table is modified as per the changes done in alv output.
    Now you can use this internal table to update the database table.
    Hope this helps you.
    Regards,
    Tarun

  • Error while updating a database

    hi,
    i am getting an error "Object reference not set to an instance of object" while updating a database. here is my code..
    QryStr = "update OSRI set U_sqf = Val('" & sqft & "'),U_sqm = Val('" & sqmt & "') where ItemCode = '" & Code & "'"
                RecSet.DoQuery(QryStr)
                Res = True
    Edited by: puneeth shankar on Jul 2, 2008 7:27 PM

    Hi
    Maybe you are missing these sentences ..
    Dim RecSetAs SAPbobsCOM.Recordset
    RecSet= SBO_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.BoRecordset)
    and then
    QryStr = "update OSRI set U_sqf = Val('" & sqft & "'),U_sqm = Val('" & sqmt & "') where ItemCode = '" & Code & "'"
    RecSet.DoQuery(QryStr)
    Res = True
    But I think you are trying to update directly using an Update statement to a SAP table.  You must check the documentation.  I think this is not allow.  You must then use an alternate way !

  • Regardig error while updating the database table

    hi experts,
       i m trying to update the database table from the values containig in my internal table  ,,,but the system is giving this error plz help me::::
    The type of the database table and work area (or internal table)
    "ITAB_UPDATE" are not Unicode convertible. Unicode convertible.          
    my internal table name itab_update and the database table name yitab.i m using this statement::
        modify yitab from itab_update.

    Hi
    1. You  have to Declare the Itab with the same structure as DB table.
    2. Use the statement
        Modify <DBtable> from TABLE <itab>.
    or
       Update <DBtable> from TABLE <itab>.
    Hope this will solve.
    Reward .....if so.
    Regards.

  • Problem while updating a database table

    Hi experts,
                         I've used the FM 'HR_INFOTYPE_OPERATION' to update the database table. In that i used the MOD operation to update the Infotype PA0315.  But it return an error message like "Infotype does not exist". What could be the reason for this error?.
    regards,
    Shanthi.

    Hi,
          Here is my code for updation.
    CALL FUNCTION 'BAPI_EMPLOYEE_ENQUEUE'
    EXPORTING
    NUMBER = P0315-pernr
    IMPORTING
    RETURN = wf_returne.
    Update Mode
    CALL FUNCTION 'HR_INFOTYPE_OPERATION'
    EXPORTING
    INFTY = '0315'
    NUMBER = P0315-PERNR
    SUBTYPE = P0315-SUBTY
    OBJECTID = P0315-OBJPS
    LOCKINDICATOR = P0315-SPRPS
    VALIDITYEND = P0315-ENDDA
    VALIDITYBEGIN = P0315-BEGDA
    RECORDNUMBER = P0315-SEQNR
    RECORD = P0315
    OPERATION = 'MOD'
    TCLAS = 'A'
    DIALOG_MODE = '0'
    IMPORTING
    RETURN = wf_return.
    Dequeue
    CALL FUNCTION 'BAPI_EMPLOYEE_DEQUEUE'
    EXPORTING
    NUMBER = P0315-PERNR.

  • Problem viewing/updating MySQL-database with utf-8 charset

    System specs:
    Tomcat 5.5.4
    JDK1.5.0
    MySQL 4.1
    Connector/J 3.0.16
    JSTL 1.1
    I am trying to build a guestbook web-app, and want to be able to store swedish characters (available in latin1) and decided to give utf-8 a go since it would support other languages as well. I use a <Resource> in my context-xml to get the connection.
    This simply will not work; when I use the <%@ page contentType="text/html; charset=utf-8"%> declaration, the swedish characters in the raw html-code gets replaced by questionmarks. Select-queries output look ok though, as long as they don't contain the character '�'
    When removing the page-declaration, the queries show only questionmarks where swedish characters should be.
    The same goes for updating my database. Swedish characters get garbled.
    I have tried the following without success:
    *adding &useUnicode=true&characterEncoding=UTF-8 to the Resource-url -- causes my web-app to fail loading.
    *adding a <filter> to the web-apps web.xml as suggested at  http://www.javaworld.com/javaworld/jw-09-2004/jw-0906-unicode_p.html -- caused another web-app error, resulting in it not being loaded.
    *setting the form attribute accept-charset -- resulted in no improvement.
    Right now I'm half desperate and half fed-up. Is this a common problem with MySQL? Should I use another database? Or perhaps it is the Connector/J Driver that's messing things up.
    I'll appreciate any help I get greatly.

    Hello. Maybe not so interesting after a year to try to ask did you ever get a final solution to that problem in command line perspective. OR does somebody else knows solution to this problem.
    Anyway I have similar problem, I use mysql5 with latin1 charset and I can insert to my database letters ��� normally via mysql command line and they show perfectly. But the problem is my web application.
    I can insert all characters to database and retrieve them normally via web app but if i need to use mysql command line for queries it fails because those special letters appear something like ��. I still need to make queries on mysql command line as admin. I have also tried to change different drivers like
    Class.forName("org.gjt.mm.mysql.Driver"); or
    com.mysql.jdbc.Driver etc connector is 3.0.17
    I have also tried to change to utf-8 and then changed mysql def.enc to same... i have used request.setWHATEVER CHARSET.....i'm out of ideas... help?

  • Lion Mail will not open, and won't update the database. Help??

    When I try to open mail, for the first time says it needs to update my database, It seems to start then crashes. Is there a fix?

    same here, updated all devices, moved to icloud, received mail for a bit now NOTHING. no mail, no backup, won't accept my password......service must be down???

  • Data not updating in database

    Friends i have table and i have created a sequence on basis of that table.
    For 1st page i have created an html region and made few items there and a save button.
    I am filling data to the fields in page 1 and clicking the save button. In save button i have passed the address of the items of 1st page to items of 2nd page which contains the same field of page 1 and few more additional field.
    the 2nd page which i have made is on basis of form on a table or view and taken exsisting sequence there. When i clicking the submit button in page 2 it is not updating my database and throwing error called unable to fetch row. Any suggestions on this?

    Lev addition to this i wanted when my create button in 2nd page get clicks my database gets updated and also a query runs which checks the same data of combination variant_type,model_code,year_manuafacture. It means if i have 2 records in database with same variant_type,model_code,year_manufacture then in the field how_many in page 2 count of 3 gets updated and the other field solution avaiable get updated with Y.
    For this in my local system in page 2 i created a plsql process and wrote this code and applied it with create button but its not working. Any idea where i am failing?
    Declare
    l_how_many Number;
    l_sol_av Varchar2(1):= NULL;
    Begin
    select count(*)
    into l_how_many
    from quality
    where 1=1
    and variant_type= :P2_VARIANT_TYPE --'Road Bike'
    and model_code = :P2_MODEL_CODE --'6'
    and year_manufacture= :P2_YEAR_MANUFACTURE  ; --'2000'
    If l_how_many=null then
        l_sol_av := 'N' ;
    else
        l_sol_av := 'Y';
    end If ;
    :P2_SOLUTION_AVAILABLE := l_sol_av;
    :P2_HOW_MANY_RAISED       := l_how_many;
    Exception
        when no_data_found then
        null;
    end;

  • How to capture the Escalation status in Human Task & Update in database

    Hi,
    I have created a Workflow where I have a humantask. Here if the Approver Escalates the task, I want to capture this Workflow status and need to Update it in the our(Oracle) Database as Escalated. I am Updating the database as Approved when the Approver Approves and Rejected when he rejects. as we can have capture these status. Similarly I want to do for the Escalated status also.
    Please Help I have been stuck to this.
    Thanks.

    No Experts to answer this???????????????????

  • New ABAP Program to check Direct UPDATE in Database Table

    Hi all,
    As per customer requirement , I have to develop ONE  Program which find out that  in which ABAP Program , Programmer has used Open Sql command like  UPDATE , DELETE , INSERT , MODIFY to direct update in Database Table.
    Have a look on all Z-ABAPs, find out if there are statements with "update", "delete", "insert" or "modify" in the coding, then find out if updates to sap-Tables are done
    How can I achived that ?
    Please , If anybody is having idea , than please let me know..
    Thanks You ,

    Hi
    Kindly refer to the below link. This has step by step how you can achieve the checks.
    [http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/12659a90-0201-0010-c18b-9d014f9bed0d]
    But if you want to check if any program they have used 'UPDATE' then you can do like below.
    Go to SE38
    Utilities---> Find in Source Code-
    Find --- UPDATE
    In program - Z* or ZX* if you want to search only in Exits
    Regards,
    Vijay V .

  • Updating a database using EJB Inheritance

    I am new to EJB's, so please forgive my ignorance. I creating the following classes that inherit from each other along with a method to update my database:
    @Entity
    @Inheritance(strategy = InheritanceType.JOINED)
    @DiscriminatorColumn(name="TYPE", discriminatorType=DiscriminatorType.STRING)
    public abstract class ObjectA implements java.io.Serializable {
         protected String name;
         protected String desc;
         protected String type;
    @Entity
    @DiscriminatorValue("OBJECTB")
    public class ObjectB extends ObjectA implements java.io.Serializable {
         protected String str_b;
         public ObjectB(String name, String desc, String type, String str_b) {
              this.name = name;
              this.desc = desc;
              this.type = type;
              this.str_b = str_b;
    @Entity
    @DiscriminatorValue("OBJECTC")
    public class ObjectC extends ObjectB implements java.io.Serializable {
         private String str_c;
         public ObjectC(String name, String desc, String type, String str_b, String str_c) {
              this.name = name;
              this.desc = desc;
              this.type = type;
              this.str_b = str_b;
              this.str_c = str_c;
    public class MyFacade implements ServletContextListener {
         @PersistenceUnit(unitName="Pu")
        private EntityManagerFactory emf;
        @Resource
        private UserTransaction utx;
        public MyFacade() { }
        public void contextDestroyed(ServletContextEvent sce) {
            if (emf.isOpen()) emf.close();
        public void contextInitialized(ServletContextEvent sce) {
            ServletContext context = sce.getServletContext();
            context.setAttribute("MyFacade", this);
         public void updateObject(ObjectA obj) {
            EntityManager em = emf.createEntityManager();
            try{
                utx.begin();
                em.merge(obj);
                utx.commit();
            } catch(Exception exe){
                try {
                    utx.rollback();
                } catch (Exception e) {}
                throw new RuntimeException("Error updating obj", exe);
            } finally {
                em.close();
    }If I do the following:
         String name = "test name";
         String desc = "updating object c";
         String type = "OBJECTC";
         String b = "b";
         String c = "c";
         MyFacade myf = new MyFacade();
         ObjectC objC = new ObjectC(name, desc, type, b, c);
         myf.updateObject(objC);
         .....In my database, only the values associated with ObjectC get updated and nothing from ObjectA or ObjectB get updated in the database. Does the "merge" method not work on inheritance. How do I update my database using inheritance?
    Thanks!
    Message was edited by:
    FourierXForm

    did you only have ISQL for testing it?
    Can you debug the form and look, if someone happens - exceptions, ... ?
    after the update you can use
    message (SQL%ROWCOUNT); pause ;
    to look, how many records were updated

  • Help with updating a database while in cfloop

    Greetings. I'm having some difficulties in updating a
    database using cfquery inside of a cfloop.
    Background:
    I've got a text file that I need to interpret, line for line,
    and then update an existing database with information from that
    text file. For example, the text file might say
    jdoe~103 Anywhere St.~East Nowhere~New Jersey~05784~
    asmith~8963 North St.~Crabapple Cove~Maine~01390~
    (etc...you get the idea)
    So, I use a CFFILE to read the file, and then calculate the
    number of lines (records to be updated in the database) using
    listlen / 5 (in this example). From there, I:
    <cfloop index="record" from="1" to "#numberoflines#">
    <cfloop index="field" from="1" to "5">
    <cfset position = ((record - 1) * 5) + field>
    <cfelseif field EQ 1>
    <cfset form.username =
    ListGetAt(newcontents,position,"~")>
    <cfelseif field EQ 2>
    <cfset form.street =
    ListGetAt(newcontents,position,"~")>
    (etc...through EQ 5)
    </cfloop>
    <cfquery name="updatedatabase"
    datasource="clientlist">
    UPDATE clients
    SET
    Street= '#form.street#',
    (etc)
    WHERE email = '#form.username#'
    </cfquery>
    </cfloop>
    The problem I am having is that it updates the very first
    record in the set of records to update, but then it does not update
    any subsequent records.
    Why?
    Sorry if the code is crude. Is there a better way of doing
    this? If so, great detail would be helpful :) Relatively new at
    this.
    -Brian

    quote:
    Originally posted by:
    Dan Bracuk
    Updating a db from a file using cold fusion is generally
    inefficient and should only be used as a last resort. If your db
    has any bulk loading/updating utilities, consider using them. Maybe
    you can use cold fusion to upload the file and ftp it to your db
    server or something like that.
    Better yet, that file has to come from somewhere. Is there a
    way you can update your db instead of generating a file in the
    first place?
    The file starts as an output generated by a web user (an
    administrator on the software) which creates a text file containing
    email addresses, one per line. An external process which I have no
    control over takes that file and generates another file containing
    information about each of those e-mail addresses (last name, first
    name, etc) one per line. I can't change that process. So, I'm left
    with an external text file that I need to parse and then put into
    the database...all through a web interface. The goal here is that
    an administrator of the software, who does not have direct access
    to the database, can (using cold fusion processing) update the
    database with new information on each e-mail address without my
    intervention.
    -Brian

  • Subscreen data not updating to database

    Hi,
    I have created a subscreen in transaction code ME41/ME42/ME43. Whenever I put data on the custom subscreen, table ekpo is not getting updated with the input data. I have checked EXIT_SAPMM06E_013 and I did passed the new table to XEKPO. But it is still not working. Kindly advice.
    Thanks and regards,
    Marc

    Hi Marc,
    In EXIT_SAPMM06E_018 do as follows:
    e_ci_ekpo = ekpo_ci.
    The append structure CI_EKPODB is included in ekpo_ci. Moreover the screen fields should be created with reference to ekpo_ci.
    This will update the database table with values for the custom field.
    Hope this helps.
    Regards,
    Abhisek.

  • Constant failures in setting up scalable wordpress. Update ClearDB database failed.

    I've been having Constant failures in setting up scalable wordpress with no luck on finding a fix. 
    Update ClearDB database failed is the most common issue, with Update deployment being the second issue. I though maybe it had to do with Azure changes over the last few months (beta portal), but have yet to successfully deploy a site. 
    Any suggestions / fixes would be greatly appreciated. 
    Also, i've tried utilizing the support link but it seems to hang perpetually (regardless of browser) when checking my subscription. 

    Hi,
    Two points need confirmed:
    1.Have you already purse the ClearDB database?
    2.What's error did you encounter when you scalable WP site?
    Regards,
    Will 
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Application Compatibility does not update the database.

    Hi,
     I am using application compatibility manager 6.1, and SQL server 2012 as database. ACT run ok and it create the XML file but it does not update the database at "C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA" location.
    I can see the valid XML file but somehow the MDF file of database is not updated so my ACT windows does not showing anything on it.
    Any Help would be appreciated.
    Thanks
    Rakesh Patel
    rakesh patel

    Hi Rakesh,
    I am not sure if you have resloved your issue.
    But for helping others to know what to do if they meet the same issue as yours, I consider to mark the post as answered.
    If you would like further assistance, please post back and we will be always here to help you.
    Any concern about this mark behavior, you can just unmark it.
    Thanks for your understanding.
    Regards,
    Kelvin hsu
    TechNet Community Support

Maybe you are looking for

  • Is there a way to "see" what font you're using?

    Hi, I'm a bit new to PAGES. I thought when you turn "Show Invisibles" you would see things like what font you're using . . . if it's bold or underlined or italicized - things like that - you would see these characteristics in the body of the document

  • My i photo version 9.2.3 does not open. tried everything

    My I photo version does not open. Tried everything.

  • Exchange administrator pop up

    We upgrade our XP PC's at work to windows 7 and along with that installed Microsoft Outlook 2013 on them. Some of our other computers still have 2010 on them. The ones that got the new 2013 outlook keep getting a pop up saying "the Microsoft exchange

  • XMP Metadata Identification Help

    To all- Is this XMP value unique to a particular image, software or camera? Is there a way to decode the value or do any sort of analysis on the information contained within? Im in the middle of an important investigation and part of it hinges on a f

  • Default Transitions in Premiere Pro

    I'm using Premiere Pro CC (up to date) and I don't see a star shaped iris transition. The only shapes I have to select from are: Box, Cross, Diamond, and Round. I know that is pretty cheesy but it works for a specific promo that I have to update week