Alv data change and save in database

hello sir,
   i had  done display data in alv from any custom table and that was edit and change..but now i want that data save in database through internal table ...what is coding for save butten.....
thanks

Hi
OOPS ALV....
U should check the method handle_data_changed (in BCALV_EDIT_04), this method is triggered as soon as the table is modified.
Here you can understand if a new record is inserted or old record is updated or deleted.
Normal ALV
Here is the sample code.If you executed the program and edited something,then after pressing back you will get the changed value in output.For that,I have used loop..Endloop. after FM.SInce your requirement is to update DB,you use
modify db from table itab.
That will insert/update the entries in db.
Kindly reward points by clicking the star on the left of reply,if it helps.
TYPE-POOLS: slis.
DATA: report_id LIKE sy-repid.
DATA: ws_title TYPE lvc_title VALUE 'An ALV Report'.
DATA: i_layout TYPE slis_layout_alv.
DATA: i_fieldcat TYPE slis_t_fieldcat_alv.
types : begin of ty,
pernr type pa0001-pernr,
SEQNR type pa0001-seqnr,
end of ty.
data itab type standard table of ty.
data wa type ty.
select pernr seqnr from pa0001 into table itab.
report_id = sy-repid.
PERFORM f1000_layout_init CHANGING i_layout.
PERFORM f2000_fieldcat_init CHANGING i_fieldcat.
CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
EXPORTING
i_callback_program = report_id
i_grid_title = ws_title
is_layout = i_layout
it_fieldcat = i_fieldcat
i_save = 'A'
TABLES
t_outtab = itab
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.
*Use modify statement here instead of loop
loop at itab into wa.
write : / wa-pernr, wa-seqnr.
endloop.
FORM f1000_layout_init USING i_layout TYPE slis_layout_alv.
CLEAR i_layout.
i_layout-colwidth_optimize = 'X'.
i_layout-edit = 'X'.
ENDFORM.
FORM f2000_fieldcat_init CHANGING i_fieldcat TYPE slis_t_fieldcat_alv.
DATA: line_fieldcat TYPE slis_fieldcat_alv.
CLEAR line_fieldcat.
line_fieldcat-fieldname = 'PERNR'. " The field name and the table
line_fieldcat-tabname = 'ITAB'. " name are the two minimum req.
line_fieldcat-key = 'X'. " Specifies the column as a key (Blue)
line_fieldcat-seltext_m = 'Personal No.'. " Column Header
APPEND line_fieldcat TO i_fieldcat.
CLEAR line_fieldcat.
line_fieldcat-fieldname = 'SEQNR'.
line_fieldcat-tabname = 'ITAB'.
line_fieldcat-seltext_l = 'No. of records with same key'.
line_fieldcat-edit = 'X'. APPEND line_fieldcat TO i_fieldcat.
ENDFORM. " f2000_fieldcat_init
Regards
Vasu

Similar Messages

  • Alv data upload and delete in database table

    hi .
       i have done data save in date base but not update and delete..writen this code..
    form save_data.
      CALL METHOD cont_editalvgd->check_changed_data.
      IF lt_display EQ it_city.
        MESSAGE s002(00) WITH 'No data changed'.
      ELSE.
        CLEAR: gd_answer.
        CALL FUNCTION 'POPUP_TO_CONFIRM'
          EXPORTING
            text_question  = 'Save_data?'
          IMPORTING
            answer         = gd_answer
          EXCEPTIONS
            text_not_found = 1
            OTHERS         = 2.
           delete
        IF sy-subrc EQ 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        IF ( gd_answer = '1' ). " yes
            lt_display = it_city.
         else.
         MESSAGE s001(00) WITH 'Action cancelled by user' .
         endif.
         endif.
        DELETE ADJACENT DUPLICATES FROM it_city.
       update zmg_city1 from it_city.
        MODIFY zmg_city1 FROM TABLE it_city.
    *DELETE  zmg_city1  FROM it_city.
        clear it_city.
        COMMIT WORK.
       else.
         DELETE ADJACENT DUPLICATES FROM it_city.
      IF SY-SUBRC EQ 0.
         DELETE ADJACENT DUPLICATES FROM it_city.
         update zmg_city1 from it_city.
        COMMIT WORK.
      endif.
    *ent rows from it_city
       DELETE ADJACENT DUPLICATES FROM it_city.
       update zmg_city1 from it_city.
    endform.                    "save_data
    not working update and delete ...plz say

    hi .
       i have done data save in date base but not update and delete..writen this code..
    form save_data.
      CALL METHOD cont_editalvgd->check_changed_data.
      IF lt_display EQ it_city.
        MESSAGE s002(00) WITH 'No data changed'.
      ELSE.
        CLEAR: gd_answer.
        CALL FUNCTION 'POPUP_TO_CONFIRM'
          EXPORTING
            text_question  = 'Save_data?'
          IMPORTING
            answer         = gd_answer
          EXCEPTIONS
            text_not_found = 1
            OTHERS         = 2.
           delete
        IF sy-subrc EQ 0.
         MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
        IF ( gd_answer = '1' ). " yes
            lt_display = it_city.
         else.
         MESSAGE s001(00) WITH 'Action cancelled by user' .
         endif.
         endif.
        DELETE ADJACENT DUPLICATES FROM it_city.
       update zmg_city1 from it_city.
        MODIFY zmg_city1 FROM TABLE it_city.
    *DELETE  zmg_city1  FROM it_city.
        clear it_city.
        COMMIT WORK.
       else.
         DELETE ADJACENT DUPLICATES FROM it_city.
      IF SY-SUBRC EQ 0.
         DELETE ADJACENT DUPLICATES FROM it_city.
         update zmg_city1 from it_city.
        COMMIT WORK.
      endif.
    *ent rows from it_city
       DELETE ADJACENT DUPLICATES FROM it_city.
       update zmg_city1 from it_city.
    endform.                    "save_data
    not working update and delete ...plz say

  • I have created a form in InDesign, exported to a pdf, created an editable form and saved.  When I open the form and make changes and save, the reopen the changes are there.  If try to email this form as an attachment after editing, the attachment is alway

    I have created a form in InDesign, exported to a pdf, then created an editable form and saved.  When I open the form and make changes and save, then reopen the changes are there.  If try to email this form as an attachment after editing, the attachment is always minus the edits.   ????

    Hi chuck,
    If you ave created the form and then filling it yourself and saving the form, the filled data should be there when you reopen the same form.
    Can you please send the form to me at [email protected]  so that I can have a look.
    Regards,
    Rave

  • SQL Server data change and Security

    in our environ any user who login with sa they can change any table data.
    so i write trigger to capture changed data like who change, from which IP etc this
    CREATE TRIGGER [TRG_Users]
    ON [dbo].[UserRights] AFTER INSERT, UPDATE, DELETE
    AS
    DECLARE @strIP VARCHAR(MAX)
    SET @strIP=(SELECT dbo.GetCurrentIP())
    IF EXISTS (SELECT * FROM INSERTED) AND EXISTS (SELECT * FROM DELETED)
    --PRINT 'Update happened';
    INSERT INTO Logger(IPAddress,Status)
    VALUES (@strIP,'UPDATE')
    ELSE
    IF EXISTS (SELECT * FROM INSERTED)
    --PRINT 'Insert happened';
    INSERT INTO Logger(IPAddress,Status)
    VALUES (@strIP,'INSERT')
    ELSE
    --PRINT 'Delete happened';
    INSERT INTO Logger(IPAddress,Status)
    VALUES (@strIP,'DELETE')
    CREATE FUNCTION [dbo].[GetCurrentIP] ()
    RETURNS varchar(255)
    AS
    BEGIN
    DECLARE @IP_Address varchar(255);
    SELECT @IP_Address = client_net_address
    FROM sys.dm_exec_connections
    WHERE Session_id = @@SPID;
    Return @IP_Address;
    END
    but the problem is user can change data after disabling the trigger on specific table. so trigger will not fire and user can seamlessly change data.
    so guide me what is the best way to capture data change and log them. so no one can bypass the security. please do not tell me disable sa account because i am looking for different approach to capture the change data. is there any secure way exist in sql
    server 2005/2008 if yes then please discuss here. thanks

    If you have shared SA password with different users you are bound to get these scenarios.Instaed of focussing on how to capture I would like you to talk with different users and only provide them access which is required.Follow policy f minimum privilege
    your environement will be less complex .
    You can use combination of Logon trigger and CDC to capture it.But again why o make things complex by sharing SA password with many users.
    https://www.simple-talk.com/sql/learn-sql-server/introduction-to-change-data-capture-%28cdc%29-in-sql-server-2008/
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • I keep getting a warnin that my pages document could not be auto saved. The file has been changed by another application. Click save anyway to keep your changes and save the changes made by the other application as a version, or click revert to keep the c

    I keep getting a warning stating that the document could not be auto saved in pages. The file has been changed by another application. Then it says click save any way to keep your changes and save the changes made by the other application as a version, or click revert to keep the changes from the other application and save your changes to a version.
    What in the heck does all that mean, and why are they trying to behave like a Windows product or a Microsoft office product. I just don't get it.
    Why is another application changing my documents? It's like they've created a virus within their own programs. It's a pain in the neck and makes no sense.

    I am also having the issue of a warning saying "could not be auto-saved in Pages. The file has been changed in another application. I then hit "save anyway", the warning will go away for a time, sometimes minutes, sometimes hourr, but then the warming reapprears saying the same thing. This is not the case with all Pages documents but it is the case with many.
    Working with a Retina Macbook Pro and current software
    These are newly created documents

  • How to change and save a new file in Edge web Lumira server for Team ?

    Hi Lumira folks,
    I've installed SAP Lumira 1.0, Edge edition and View a sample 'Dairy Wholesaler-Sample"
    I'd like to change it and save as new file, but "Save" button is disabled and when I put my mouse over the button,
    it says "Save Option is disabled in this version".
    Is there any idae how to change and save as a new file in Lumira Edge ?
    Many Thanks.
    JH

    I've just found the reason as below.
    http://scn.sap.com/community/lumira/blog/2015/03/20/lumira-server-for-teams-edge-edition-version-compatibility
    The current version of Lumira
    server for teams is 1.0. This version uses Lumira 1.22 as its 'engine' as this
    was the version of Lumira Desktop that was shipped at the same time.
    Hence with the current Lumira
    version compatibility; namely that a newer version of the product can open an
    older document, but an older version cannot open a newer document, care must be
    taken when deploying Lumira server for teams.
    Lumira server for teams is only
    compatible with Lumira desktop 1.22. If you intend to deploy Lumira server for
    teams, ensure your desktop users do not move to a later version of the desktop.
    Content created in a later version of Lumira desktop can be uploaded and shared
    via Lumira server for teams, but it cannot be viewed or edited online in the
    browser.
    Ensure desktop users disable the
    auto update capabilities in the desktop preferences, and set the update to
    none.

  • DB link problem between active Data Guard and report application database

    My database version in 11.2.0.2.0 and OS is Oracle Solaris 10 9/10.
    I am facing a problem in my Active data guard Database for reporting purpose. Active Data guard information is as below.
    SQL> select name, database_role, open_mode from v$database;
    NAME DATABASE_ROLE OPEN_MODE
    ORCL PHYSICAL STANDBY READ ONLY WITH APPLY
    Problem detail is below
    I have created a db link (Name: DATADB_LINK) between active data guard and report application database for reporting purpose.
    SQL> create database link DATADB_LINK connect to HR identified by hr using 'DRFUNPD';
    Database link created.
    But when I run a query using db link from my report application database I got this below error.
    ORA-01555: snapshot too old: rollback segment number 10 with name "_SYSSMU10_4261549777$" too small
    ORA-02063: preceding line from DATADB_LINK
    Then I check Active Data Guard database alart log file and get below error
    ORA-01555 caused by SQL statement below (SQL ID: 11yj3pucjguc8, Query Duration=1 sec, SCN: 0x0000.07c708c3):SELECT "A2"."BUSINESS_TRANSACTION_REFERENCE","A2"."BUSINESS_TRANSACTION_CODE",MAX(CASE "A1"."TRANS_DATA_KEY" WHEN 'feature' THEN "A1"."TRANS_DATA_VALUE" END ),MAX(CASE "A1"."TRANS_DATA_KEY" WHEN 'otherFeature' THEN "A1"."TRANS_DATA_VALUE" END )
    But the interesting point if I run the report query directly in Active Data Guard database, I never got error.
    So is it a problem of DB link between active Data Guard and other database?

    Fazlul Kabir Mahfuz wrote:
    My database version in 11.2.0.2.0 and OS is Oracle Solaris 10 9/10.
    I am facing a problem in my Active data guard Database for reporting purpose. Active Data guard information is as below.
    SQL> select name, database_role, open_mode from v$database;
    NAME DATABASE_ROLE OPEN_MODE
    ORCL PHYSICAL STANDBY READ ONLY WITH APPLY
    Problem detail is below
    I have created a db link (Name: DATADB_LINK) between active data guard and report application database for reporting purpose.
    SQL> create database link DATADB_LINK connect to HR identified by hr using 'DRFUNPD';
    Database link created.
    But when I run a query using db link from my report application database I got this below error.
    ORA-01555: snapshot too old: rollback segment number 10 with name "_SYSSMU10_4261549777$" too small
    ORA-02063: preceding line from DATADB_LINK
    Then I check Active Data Guard database alart log file and get below error
    ORA-01555 caused by SQL statement below (SQL ID: 11yj3pucjguc8, Query Duration=1 sec, SCN: 0x0000.07c708c3):SELECT "A2"."BUSINESS_TRANSACTION_REFERENCE","A2"."BUSINESS_TRANSACTION_CODE",MAX(CASE "A1"."TRANS_DATA_KEY" WHEN 'feature' THEN "A1"."TRANS_DATA_VALUE" END ),MAX(CASE "A1"."TRANS_DATA_KEY" WHEN 'otherFeature' THEN "A1"."TRANS_DATA_VALUE" END )
    But the interesting point if I run the report query directly in Active Data Guard database, I never got error.
    So is it a problem of DB link between active Data Guard and other database?
    Check this note which is applicable for your environment
    *ORA-01555 on Active Data Guard Standby Database [ID 1273808.1]*
    also
    http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:8908307196113

  • How can I save my original IMovie and then use that same movie, make a few changes and save as something else?

    I made an IMovie.  Now I want to keep that original Imovie but make another one using the original IMovie, make changes and save it as another IMovie.  How do I do this.

    In iMovie version 10 select your Project in the Libaray and choose Edit>Duplicate Movie to create a copy of your Project. Then make your changes to the copy.
    In iMovie verison 9 select your Project and choose File>Duplicate Project.
    Matt

  • Load and Save MySql Database

    In what way in java can I load and save a full database ,from MySql, in java , a dump operation .

    This is how I am parsing and requesting the information.. I know it's in there somewhere I just can't get the variables, do I need to add them ? It's not making much sense to me at the moment, I'm sorry !! I need to add the variables to the request somehow.. so I can receive the info, no ?
    var tab = "SQLtab";
    var filesend = "path to php file";
    var modesend = "post";
    function variableTransaction(fichier, modesend, tab, var1, var2) {
         var URLload = new URLLoader();
         var URLrequest = new URLRequest(fichier);
         var variables:URLVariables = new URLVariables();
         variables.tab = tab;
         variables.var1 = var1;
         variables.var2 = var2;
         if (modesend == "post") {
              URLrequest.method = URLRequestMethod.POST;
         } else if ( modesend == "get") {
              URLrequest.method = URLRequestMethod.GET;
         if (var1 == false && var2 == false) {
              URLload.dataFormat = URLLoaderDataFormat.VARIABLES;
              URLrequest.data = variables;
              URLload.load(URLrequest);
              URLload.addEventListener(Event.COMPLETE, loadComplete, false, 0, true);
         } else {
              URLrequest.data = variables;
              URLload.load(URLrequest);
              var receiveObject = variableTransaction(filesend, modesend, tab, false, false);

  • Dropship PO schedule line date changes and impact in SO

    Hi,
    Please suggest where senario; Drop ship PO created and Changed Schedule delivery date on Purchase order and automaticaly changes in Sales order schedule line level.
    SO- PR - PO
    Senario1;
    When Vendor not confirms requested delivery quantity on date, he confirms partially qty and later confirmes remaining quanity. When we split in Purchase order delivery schedule directly it will not update at sales order it confirms and changes initially qty only on SO schedule line level. how can i copy back to sales order schedule qty partial split done on PO.
    Senario2;
    When SO created and PR - PO generated later when we Add new line item in SO or Directly add PO line item how can i make sync between the two documents automatically.
    SO Schedule delivery date and PO schedule delivery date how can i see the link b/w to document back to back updates automatically when we change any one doc.
    Thanks in advance
    JACK

    Hi Caetano,
    thanks for your suggestion
    Yes, we use firm zone for few of the vendors. there the system don't change the schedule lines.
    Also for the stock transfer PR's there is no firm zone and the lead time is one day. in this case it changes everyday after the MRP run.
    the stock transfer PR's leads to the creation of Schedule lines from the source plant. Since this PR gets changed everyday. the alerts coming out of MD07 gets changed and we really did not know if this order is delayed or not.  In the source plant we use the firm zone to avoid moving the schedule line. But then the alerts are always not correct.
    is there any setting which helps in not moving the PR everyday without using " start in the past"
    thanks
    Nagendra Kumar

  • Distributing fillable form to a Group so they can save changes and "save as" ?

    How do I distribute my finalized document to a group who can fill in the information and save or save as the document to their files?

    HI;
    It sounds like distributing your form as a PDF is probably the way you want to go.  The following FAQs will help you decide.
    Should I distribute a Web or PDF form?
    Tutorial: Creating and Distributing fillable PDF forms
    This page has some more PDF related FAQs as well if you do choose to distribute as PDF
    Thanks,
    Josh

  • Change and Save records on ALV List

    Hi,
    i made alv list with fieldcatalog-edit to change records on alv list. But i want to save it to my dictionary table after changed. I think i should use dialog program to do that. The problem is how i can use dialog program.(i dont have an idea which user-command perform fields on alv list) I have used dialog programs before but i am new on this so i am not sure how i can do that. I will be pleased if you can help me.
    Regards.

    Hello Masuke,
    You have to code that in the AT- USER COMMAND event.
    Follow the below sample code.
    If the record is changed then track its index no.
            and populate it in an internal table for future
            action
              IF sy-subrc = 0 AND <dyn_wa> <> <l_wa>.
                <dyn_wa> = <l_wa>.
                i_index = rs_selfield-tabindex.
                APPEND i_index.
              ENDIF.
            ENDIF.      ENDIF.*   When save button is pressed
        WHEN 'SAVE'.*     Sort the index table
          SORT i_index.*     Delete all duplicate records
          DELETE ADJACENT DUPLICATES FROM i_index.      LOOP AT i_index.*       Find out the changes in the internal table
          and populate these changes in another internal table
            READ TABLE <dyn_table> ASSIGNING <dyn_wa> INDEX i_index.
            IF sy-subrc = 0.
              APPEND <dyn_wa> TO <dyn_tab_temp>.
            ENDIF.      ENDLOOP.*     Lock the table
          CALL FUNCTION 'ENQUEUE_E_TABLE'
            EXPORTING
              mode_rstable   = 'E'
              tabname        = p_table
            EXCEPTIONS
              foreign_lock   = 1
              system_failure = 2
              OTHERS         = 3.      IF sy-subrc = 0.*       Modify the database table with these changes
            MODIFY (p_table) FROM TABLE <dyn_tab_temp>.        REFRESH <dyn_tab_temp>.*       Unlock the table
            CALL FUNCTION 'DEQUEUE_E_TABLE'
              EXPORTING
                mode_rstable = 'E'
                tabname      = p_table.      ENDIF.
      ENDCASE.  rs_selfield-refresh = 'X'.
    Hope it helps you.
    Best Regards
    Santosh

  • Layout change and save for ALV report

    Hi,
    I ahve created R3 report in which report has been displayed using ALV grid, I am able to change the layout as I can see the layout -> change option in settings menu, but save and choose option is disabled.
    Please advise how to enable layoutr save and choose option for ALV grid.
    Thanks,
    Piyush

    Hi,
    According to sap help you need authorization to save Layout
    [ALV -Layout|http://help.sap.com/saphelp_sm32/helpdata/en/82/839d37664e4d45e10000009b38f8cf/content.htm]
    To save layouts for all users, you need the authorization S_ALV_LAYO with activity 23 as of Release 4.6C. You can only go to the layout administration if you have this authorization.
    You must maintain the authorization object S_ALV_LAYO using the user administration.
    If you would like to use or save the Excel view in your layout, you also require the additional authorization S_BDS_DS with activity 01,02,03,06,30; CLASSNAME ALVLAYOUTTEMPLATES and CLASSTYPE OT.
    Furthermore, there are applications that have their own authorization checks installed.
    In some ALV lists, you can only save user-specific layouts. In these cases, the indicator "user-specific" is active , on a grey background and unable to be changed. This is related to the parameter I_SAVE. This controls which options you have to save the layout.
    To be able to define default layouts, the parameter I_DEFAULT must have the value 'X'.
    Notes 409190 and 601803 also provide further information on authorizations.

  • Generate Script from table with Clob and save other Database

    Hi
    How can I to read data from Clob column and insert into other table in other Database,
    The fist Table is in Test Quality and second in Production
    Are there way without to use Export/ Import ?
    Can I to use Loader ?
    Using 9i

    3360 wrote:
    muttleychess wrote:
    mschnatt wrote:
    than you only can try the db-link
    CREATE DATABASE LINK <dblink-name> CONNECT TO <user> IDENTIFIED BY <pwd> USING '<tnsnames-entry>';
    and make table
    create table ....
    as select ....Thank , but too no work :-( :-(
    SQL> select id,clob_data from myclob@teste;
    select id,clob_data from myclob@teste
    ERRO na linha 1:
    ORA-22992: cannot use LOB locators selected from remote tables
    Well you didn't do what the reply said to do
    and make table
    create table ....
    as select ....Also in the manual, you could save yourself a lot of time if you would open it.
    http://docs.oracle.com/cd/B14117_01/appdev.101/b10796/adlob_wo.htm#1006314
    >
    The following syntax is supported on remote LOB columns:
    CREATE TABLE t AS SELECT * FROM table1@remote_site;
    INSERT INTO t SELECT * FROM table1@remote_site;
    UPDATE t SET lobcol = (SELECT lobcol FROM table1@remote_site);
    INSERT INTO table1@remote_site select * from local_table;
    UPDATE table1@remote_siteset lobcol = (SELECT lobcol FROM local_table);
    DELETE FROM table1@remote_site <WHERE clause involving non_lob_columns>
    This is the only supported syntax involving LOBs in remote tables. No other usage is supported.
    >[h1]Thank you very much, very very good [h1]

  • Data changed and REUSE_ALV_GRID_DISPLAY

    Hi,
    I have a problem for get the data which changed on my internal table : wlt_final
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
        EXPORTING
          i_buffer_active         = space
          i_callback_program      = sy-repid
          I_CALLBACK_USER_COMMAND = c_user_command
          is_layout               = wa_alv_presentation
          i_structure_name        = 'ZTYPFAC'
          IT_FIELDCAT             = t_catalogue_pv[]
        TABLES
          T_OUTTAB                = wlt_final
        EXCEPTIONS
          PROGRAM_ERROR           = 1
          OTHERS                  = 2.
    My Usercommand :
    FORM USER_COMMAND USING F_UCOMM LIKE SY-UCOMM
                    I_SELFIELD TYPE SLIS_SELFIELD.
      DATA: F_SUBRC LIKE SY-SUBRC,
            s_final like wls_final.
      READ TABLE wlt_final INDEX i_selfield-tabindex INTO s_final.
      break epetrini.
      CASE F_UCOMM.
        WHEN '&IC1'.
          CASE i_SELFIELD-SEL_TAB_FIELD.
            WHEN 'wlt_final-BELNR'.
              "CHECK NOT wlt_final-BELNR IS INITIAL.
              SET PARAMETER ID 'BLN' FIELD s_final-BELNR.
              SET PARAMETER ID 'BUK' FIELD s_final-BUKRS.
              SET PARAMETER ID 'GJR' FIELD s_final-GJAHR.
              CALL TRANSACTION 'FB03' AND SKIP FIRST SCREEN.
            WHEN 'wlt_final-VBELN'.
              "CHECK NOT wlt_final-BELNR IS INITIAL.
              SET PARAMETER ID 'VF' FIELD s_final-VBELN.
              CALL TRANSACTION 'VF03' AND SKIP FIRST SCREEN.
          ENDCASE.
        when '&DATA_SAVE'.
             data : wls_ZTYPFAC2 type ZTYPFAC2.
             break epetrini.
             loop at wlt_final into s_final where flag <> '' or MAJ = 'X'.
                  clear wls_ZTYPFAC2.
                  select single * from ZTYPFAC2 into wls_ZTYPFAC2 where VBELN = s_final-VBELN and BELNR = s_final-BELNR and MAJ = 'X'.
                    if sy-subrc = 0.
                        update ZTYPFAC2
                        set FLAG  = s_final-FLAG
                            COMM  = s_final-COMM
                            uname = sy-uname
                            datem = sy-datum
                        where VBELN = s_final-VBELN and BELNR = s_final-BELNR.
                    else.
                        wls_ZTYPFAC2-flag  = s_final-flag.
                        wls_ZTYPFAC2-VBELN = s_final-VBELN.
                        wls_ZTYPFAC2-BELNR = s_final-BELNR.
                        wls_ZTYPFAC2-COMM  = s_final-COMM.
                        wls_ZTYPFAC2-uname = sy-uname.
                        wls_ZTYPFAC2-datem = sy-datum.
                        wls_ZTYPFAC2-MAJ   = 'X'.
                        insert into ZTYPFAC2 values wls_ZTYPFAC2.
                    endif.
             endloop.
      ENDCASE.
    ENDFORM.                    "USER_COMMAND
    i use the User command for modify the different line of my ALV but when i do my Update i can't get only the line of the ALV which have changed !
    Thank you very much for your answer
    Edited by: Emilien P. on Sep 14, 2010 9:33 AM

    Hi,
    In your user command write the following code :
    *&      Form  USER_COMMAND
    FORM USER_COMMAND USING R_UCOMM LIKE SY-UCOMM
            RS_SELFIELD TYPE SLIS_SELFIELD.
      DATA : REF_GRID TYPE REF TO CL_GUI_ALV_GRID.
      DATA: L_VALID TYPE C.
    *Code to reflect the changes done in the internal table
      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
          IMPORTING
            E_VALID = L_VALID.
      ENDIF.
    "After calling the above method and FM you will get the changed data from ALV
      CASE SY-UCOMM.
        WHEN 'FCODE'.
        "Write your code here
       ENDCASE.
    ENDFORM.
    Thanks & Regards,
    Rock.

Maybe you are looking for

  • No volume only when logged in in lion

    I am having trouble with my volume. The speakers are not the problem because when i boot it up, i get the Mac's startup sound loud and clear. After i log in to any of my accounts the volume gone. It is not on mute. I am running Mac OS X Lion. Please

  • Air printer that works with HP c7280

    Trying to print from iPad air to HPc7280 printer? How to?

  • IMovie (Mavericks) crashes everytime I open the Titles menu.

    I run a Web Series on youtube that has had its latest episode delayed for a month while i try to find out how to fix this.  Can anyone help? Everything else seems to work fine.  Here are the processes i get from the crash report Process:         iMov

  • FI Doc in copa

    Hi i would like to know what is the last FI document for which i have run the COPA Assessment Cycle for a particular period. For Eg. I ran my COPA assess cycle on 2.5.08 (previous period i.e. April) and the cycle posted some COPA document  ranging  f

  • Satellite A45 - CPU usage is high and applications slow

    Hi all, I'm trying to debug a hardware problem on my Toshiba Satellite A45. I'm running Ubuntu 10.04, but I don't believe this is OS or software related. THE PROBLEM: CPU usage is high and applications slow to a crawl after using a memory intensive a