Tracking changes in database tables

Hi,
I have a couple of database tables on which more than 20 people work each day, throughout the day. I have the requirement of tracking each and every change made on any row of the table.
For example, If a user accesses a specific row, and updates, or deletes it, i need to keep a track of the userid of the user who did it.
Is that possible?

Hi Bharat,
If they are Z tables i.e custom tables then you can incorporate two more fields userid and time. Now goto Table maintanence generator through SE11.Then select Environment->Modification->events. Now in the next screen select F4 for first field to select the event i.e when your code has to be executed.Then give a new form name and click on editor icon. write your code here. When ever a user changes any record his name will be included in user id and sy-uzeit in time field. This way you can track who has changed the record. Other option is activating table changes recording by selecting "LogChanges " check box in technical settings of table.and profile parameter rec/client should also be switched on. Then you can see your table changes in SCU3 transaction. Hope this helps.
Regards,
Kalyan.

Similar Messages

  • Custom change document is not tracking changes for SAP tables

    Hi gurus,
    I have created a custom change document for tables EKBE and KONV. But the change document is not tracking changes in BDCP table for changes in EKBE or KONV.
    Please help me out.........

    HI,
    Use this link for change pointers concept.
    change pointers
    let me know if u have any issue.
    ~linganna

  • How to track changes on the table not using triggers

    Hi,
    I would like to track DML changes on the tables. As I have many tables it is not efficient to write triggers.
    Is there any setup I can do at database level.
    I am using 11g R2.
    Thanks

    thanks fran.
    I would like to know old and new data in case of updates. This method will not show me.are you sure??
    SQL> sho parameter audit_trail
    NAME                                 TYPE        VALUE
    audit_trail                          string      DB, EXTENDED
    SQL> audit select, insert, update on fran.test1;
    AuditorÝa terminada correctamente.
    SQL> conn fran/fran
    Conectado.
    SQL> select * from test1;
    ninguna fila seleccionada
    SQL> insert into fran.test1 values('EX',2);
    1 fila creada.
    SQL> update fran.test1 set object_id=3 where object_id=2;
    1 fila actualizada.
    SQL> commit;
    Confirmaci¾n terminada.
    SQL> conn / as sysdba
    Conectado.
    SQL> select sqltext from aud$ where sqltext is not null;
    SQLTEXT
    select * from test1
    insert into fran.test1 values('EX',2)
    update fran.test1 set object_id=3 where object_id=2If you want more data, FGA is your goal
    I have read some where on flashback database ..
    would this create a replica table with old changesflashback database is to set the current data like in the past. I mean:
    SQL> conn / as sysdba
    Conectado.
    SQL> alter table fran.test1 enable row movement;
    Tabla modificada.
    SQL> drop table fran.test1;
    Tabla borrada.
    SQL> select * from fran.test1;
    select * from fran.test1
    ERROR en lÝnea 1:
    ORA-00942: la tabla o vista no existe
    SQL> flashback table fran.test1 to before drop;
    Flashback terminado.
    SQL> select * from fran.test1;
    OBJECT_NAME                    OBJECT_ID
    EX                             3

  • Track changes on 'Z' tables

    Hi,
    We have a requirement that to track changes on our Z tables. Could any one help me in process of doing this ?
    Thank you,
    Surya

    HI,
      U Read follow this for clarifies u r doubt..........
    As with business objects, we recommend that you activate the logging of changes to table data for those tables that are critical or susceptible to audits. (See the SAP – Audit Guidelines R/3 FI, in Section 4.3.5, for examples of important tables. This document is available at
    http://www.sap.com/germany/aboutSAP/revis/infomaterial.asp. You must also explicitly activate this logging. Note the following: 
    ·        You must start the SAP System with the rec/client profile parameter set. This parameter specifies whether the SAP System logs changes to table data in all clients or only in specific clients. We recommend setting this parameter to log all clients in your productive system.
    ·        In the technical settings (use transaction SE13), set the Log data changes flag for those tables that you want to have logged.
    If both of these conditions are met, the database logs table changes in the table DBTABPRT. (Setting the Log data changes  flag only does not suffice in recording table changes; you must also set the rec/clientparameter.)
    You can view these logs using the transaction SCU3.
    Although we do deliver pre-defined settings, you generally have to modify them to meet your own requirements. Use the report RSTBHIST to obtain a list of those tables that are currently set to be logged. Use transaction SE13 to change the Log data changes flag for these or other tables.
    For more information, also see SAP Notes 1916 and 112388.
    regards,
    sudheer.

  • Bank Key field change from database table

    Dear All,
    At our client, 4 house banks are maintained. The bank keys entered for these are not BSR Codes but something like 100,200,300,400.
    This is not correct as we need to maintain BSR Code in Bank Key field as it is required on Form 16 A (TDS Cetificate)
    The Bank Key field is in display mode. I am thinking of changing wrong value from database table T012 & BNKA .
    Has anybody done this before? Will it affect my past or future transactions?
    Thanks & regards,
    Gov

    Dear Gulshan,
    What you are saying is correct & I subscribe to your view also.
    Creation of House Bank all over again seems to be one of the better options.
    We tried doing one more thing & which is working fine on Development.
    Our primary requiremnt is to have BSR Code on the From 16 A. System picks up the Bank key for this.
    We copied the standard Form 16A & created a Z. Then abaper created a subroutine. It is like when Bank key 100 comes to Form16A, replace it with say 0098500 (Correct BSR Code of the Bank)
    This helped to get the correct BSR Code in Form 16A & saved us from recreation of House Bank data.
    Your comments are welcome.
    Regards,
    Gov

  • How to track changes to config tables?

    Hi,
    I would like to track the changes that have been done to the config tables and would like to know the name of the transport request which might have done this?
    My SAP is on ECC 5.0
    Can some one please help?
    Thanks
    Vijay

    Hello Vijay,
    In SPRO transaction, you have an option to view change logs , you can use this option.
    In SPRO->SAP Reference IMG and then drill down to the customizing you are interested in.
    Click on that node and click on the Change Log button.
    The rest is self explanatory.
    Later when you find the table name of the affected config.
    You can take the table name and search for the object in transaction SE03 -> Objects in Request -> Search for Objects in Request
    Regards,
    Siddhesh

  • Tracking changes to a table

    Folks,
    I want to find out as to who has updated/inserted a table. I tried to put the following into a database trigger for that table:
    SELECT NVL(s.osuser, 'Unknown'),
    NVL(s.username, 'Unknown'),
    NVL(s.terminal, 'Unknown'),
    NVL(s.serial#, 0)
    FROM v$session s, v$sqlarea a, v$process p
    WHERE s.type = 'USER'
    AND s.username = (SELECT user FROM DUAL)
    AND a.address = s.sql_address
    AND a.hash_value = s.sql_hash_value
    AND s.paddr = p.addr;
    But the above statement does not work in the trigger (zero records found) though it works at sql prompt.
    Does anyone know how to make this work in a database trigger?

    Hi,
    You can audit update/insert onto a table :
    See columns of table all_def_audit_opts :
    ALT AUD COM DEL GRA IND INS LOC REN SEL UPD REF EXE
    These correspond to the following object options respectively:
    alter, audit, comment, delete, grant, index, insert, lock, rename, select, update, reference and execute .
    SQL> connect system/manager
    SQL> audit select on scott.emp by session;
    SQL> select * from dba_obj_audit_opts
    where owner='SCOTT' and OBJECT_NAME='EMP';
    OWNER OBJECT_ OBJECT_TY ALT AUD COM DEL GRA IND INS LOC REN SEL UPD REF EXE
    SCOTT EMP TABLE -/- -/- -/- -/- -/- -/- -/- -/- -/- S/S -/- -/- -/-
    SQL> connect scott/tiger
    SQL> select * from emp;
    SQL> connect t/tl
    SQL> select * from scott.emp;
    => ERROR at line 1:
    ORA-00942: table or view does not exist
    SQL> connect system/manager
    SQL> select * from scott.emp;
    Results of auditing:
    SQL> connect system/manager
    SQL> select username, priv_used, ses_actions from dba_audit_object where obj_name='EMP' and owner='SCOTT';
    USERNAME PRIV_USED SES_ACTIONS
    SYSTEM SELECT ANY TABLE ---------S---
    T ---------F---
    SCOTT ---------S---
    Hope this help you.
    Nicolas.

  • How to identify or track the latest changes in database objects

    Hi,
    I am working in an application which has Oracle 10 g for backend.
    the application in total has around 30 tables and around 25 packages. I want to track the latest changes made in database. The database is accessible to my team of 20 members and i want to keep track what all changes in database(tables ,packages) are being made by them.Which package or table is being affected?
    Can yanyone please suggest how to track the same?

    To track table changes see following discussion: Re: How to find Last modified/updated time of a particular table

  • How to track changes in a custom table

    HI all,
       Requirement is
    1. In custom table instead of using table maintence generator ALV gird has to be display to see table entries. But where i have to write the code when user press CONTENTS button?
    2. In alv gird there shuld be one button which shows the change history of selected record and modify the content of selected record. For track changes i have registered custom table name in SCDO. so that changes made will reflect in CDPOS/CDHDR.
    but how can i track changes thru dis table? i didnt find field contents of custom table in CDPOS/CDHDR tables?
    Please help me with these Ques.

    Hello,
    SAP has provided many changes tracking related programs for Sales order, Vendor changes etc.
    They all use the standard function Module
      call function 'CHANGEDOCUMENT_READ_HEADERS'
    call function 'CHANGEDOCUMENT_READ_POSITIONS'
    so with these you can get the changed records
    Let me know if this helps you
    Thanks and Regards
    Pushkar Joshi

  • Modify an database table

    hi ,
    can we use modify command in database table .(not update command)
    if yes means how to use it . give syntax ..
    i want to modify the database table based on internal table i.e
    how to do this .
    Regards,
    kumar

    Hello Kumar,
    Always use MODIFY command rather than using INSERT or UPDATE.
    When u r using MODIFY command and u can able to update a record and insert a record inside the table.
    MODIFY - Change a database table
    Variants:
    1. MODIFY dbtab. or
    MODIFY *dbtab. or
    MODIFY (dbtabname) ... ..
    2. MODIFY dbtab FROM TABLE itab. or
    MODIFY (dbtabname) FROM TABLE itab.
    3. MODIFY dbtab VERSION vers. or
    MODIFY *dbtab VERSION vers.
    Effect
    Inserts new lines or updates existing lines in a database table (s. relational database). If a line with the specified primary key already exists, an UPDATE is executed. Otherwise, an INSERT is performed. You can specify the name of the database table either in the program itself in the form MODIFY dbtab ... or at runtime as the contents of the field dbtabname in the form MODIFY (dbtabname) ... . In both cases, the database table must be defined in the ABAP Dictionary. Normally, records are inserted or updated only in the current client. Data can only be inserted or updated using a view, if the view refers to a single table and was created in the ABAP Dictionary with the maintenance status "No restriction".
    MODIFY belongs to the Open SQL command set.
    When the statement has been executed, the system field SY-DBCNT contains the number of edited lines.
    The return code is set as follows:
    SY-SUBRC = 0:
    All lines were successfully inserted or updated.
    SY-SUBRC = 4:
    One or more lines could not be inserted or updated.
    Notes
    You cannot modify a line if there is already a line in the table with identical key field values in a UNIQUE index.
    Automatic definition of INSERT and UPDATE is expensive. You should therefore use MODIFY only if you cannot define the INSERT and UPDATE cases yourself in the program.
    Since the MODIFY statement does not perform authority checks, you have to program them yourself.
    Adding or changing lines with the MODIFY command is only completed after a database commit (see LUW) has been performed. Before the database commit has been performed, any database changes can be reversed with a database rollback (see Programming transactions).
    Synchronization of simultanous accesses by several users to the same set of data cannot be guaranteed exclusively with the lock mechanism of the database system. In several cases, you are recommended to use the SAP lock mechanism.
    Variant 1
    MODIFY dbtab. or
    MODIFY *dbtab. or
    MODIFY (dbtabname) ... .
    Additions:
    1. ... FROM wa
    2. ... CLIENT SPECIFIED
    See Short forms not allowed and * work areas not allowed.
    Effect
    Inserts a new line or updates an existing line in a database table. If you specify the name of the database table yourself, the primary key for identifying the line to be inserted or updated and the relevant values are taken from the table work area dbtab or *dbtab (see TABLES). If you specify the name of the database table directly, the program must contain a corresponding TABLES statement. If the name of the database table is not determined until runtime, you need to use the addition ... FROM wa.
    Example
    Insert or change data of the customer Robinson in the current client:
    TABLES SCUSTOM.
    SCUSTOM-ID        = '12400177'.
    SCUSTOM-NAME      = 'Robinson'.
    SCUSTOM-POSTCODE  = '69542'.
    SCUSTOM-CITY      = 'Heidelberg'.
    SCUSTOM-CUSTTYPE  = 'P'.
    SCUSTOM-DISCOUNT  = '003'.
    SCUSTOM-TELEPHONE = '06201/44889'.
    MODIFY SCUSTOM.
    Addition 1
    ... FROM wa
    Effect
    The values for the line to be inserted or updated are not taken from the table work area dbtab, but from the explicitly specified work area wa. When doing this, the data is read from left to right according to the structure of the table work area dbtab (see TABLES). Since the structure of wa is not taken into account, the work area wa must be at least as wide (see DATA) as the table work area dbtab and the alignment of the work area wa must correspond to the alignment of the table work area. Otherwise, a runtime error occurs.
    Note
    If a work area is not explicitly specified, the values for the line to be inserted or updated are also taken from the table work area dbtab if the statement is in a FORM or FUNCTION where the table work area is stored in a formal parameter or local variable of the same name.
    Addition 2
    ... CLIENT SPECIFIED
    Effect
    Switches off automatic client handling. This allows you to edit data across all clients even when dealing with client-specific tables. The client field is treated like a normal table field that can be programmed to accept values in the table work area dbtab or *dbtab where the line to be edited occurs.
    The addition CLIENT SPECIFIED must be specified immediately after the name of the database table.
    Variant 2
    MODIFY dbtab FROM TABLE itab.or MODIFY (dbtabname) FROM TABLE itab.
    Addition:
    ... CLIENT SPECIFIED
    Effect
    Mass modify: Inserts new lines or updates existing lines of a database table. The primary keys for identifying the lines to be inserted or updated and the relevant values are taken from the internal table itab. The lines of the internal table itab must satisfy the same conditions as the work area wa in addition 1 to variant 1.
    Note
    If the internal table itab is empty, SY-SUBRC and SY-DBCNT are set to 0.
    Addition
    ... CLIENT SPECIFIED
    Effect
    As for variant 1.
    Variant 3
    MODIFY dbtab VERSION vers. or MODIFY *dbtab VERSION vers.
    This variant is not allowed in an ABAP Objects context. See VERSION addition not allowed.
    Note
    This variant is obsolete.
    Effect
    Inserts a new line or updates an existing line in a database table, the name of which is taken from the field vers at runtime. If no line exists with the specified primary key, an INSERT is executed. Otherwise, an UPDATE is performed. The database table must be defined in the ABAP/4 Dictionary and its name must conform to the naming conventions for R/2 ATAB tables. These stipulate that the name must begin with 'T' and may contain up to four further characters. The field vers must contain the table name without the leading 'T'. Only lines in the current client are inserted or updated. The line to be inserted is taken from the statically specified table work area dbtab or *dbtab.
    SY-SUBRC is set to 0 if the line is successfully inserted or updated. SY-SUBRC <> 0 is not possible since any other result causes a runtime error.
    Additional help
    Inserting or Changing Table Records
    If useful reward.
    Vasanth

  • Keeping track of changes in Database

    Hi ,
    I need to keep track to the changes in tables (New Inserts , Updates , Deletions) and Procedure / Package source changes that are done , The trace is required on OSUSER
    <br><br>
    Kindly guide if there is a way to do this .
    <br><br>
    Many thanks.
    <br><br>
    Ashish Roy.

    Hi,
    You can enable auditing for tarcking any changes in database.
    http://download.oracle.com/docs/cd/B19306_01/network.102/b14266/cfgaudit.htm
    regards
    Jafar
    http://www.oracledbarea.blogspot.com

  • How to tracke the new entries in database table ?

    Hi,
    How to tracke the new entries in database table ? is there any FM or report is there to check it ?
    regards
    vishnu

    Hi Vishnu,
    u can write a report program for this and in that use the event  :
    AT NEW <field-name> ( use primary key)
    your statements
    ENDAT
    for eg.
    loop at itab ( herfe itab must be of type of table for which u want to track new entries)
    at new matnr
    write:/ new record
    endat
    endloop.
    schedule this report in background to run in every 5 or 10 mins as per your requirement and hence changes can be tracked.
    regards
    Vinod

  • Z database table needs to have field creation/update/deletion tracked

    Hi,
    I have a Z database table.
    I have a program that gets data from an excel file and uploads the content to the Z database table.
    I need to track the creation/update/deletion of the records in the Z database table.
    The Z database table can also have records changed/updated/deleted manually thru table maintenance. These changes also need to be tracked.
    How do I do this?
    ~ Eric

    Hi
    For a my z-table (called ZFAGTD01), I created the object for change documents, this is the log after generating it:
    Change documents: Display information about generated sources                                                                               
    Change doc. object Z_PROAGE_PRV                                                                               
    Generation on      23.07.2004 11:51:28                                 
                of     SVIL01                                                                               
    Include programs and function modules                                  
    Data declaration, TOP...................... FZAGPCDT                   
    Consisting of............................. FZAGPCDF                   
    and....................................... FZAGPCDV                   
    Update function module..................... Z_PROAGE_PRV_WRITE_DOCUMENT
    Call update function module................ FZAGPCDC                                                                               
    Dictionary structures                                                  
    VZFAGTD01
    Just as you see, the system has created the fm and some includes containing all data it needs to call the fm.
    So u need only to use those includes, just only u need to consider before calling the fm u need to fill:
    - The change flag: usually called UPD_<Z table>;
    - Fill the header Y<ZTABLE> of z-table with old data;
    - Fill the header X<ZTABLE> of z-table with new data;
    - Fill the variables   TCODE, UTIME,  UDATE,  USERNAME,
    - Fill the variable OBJECTID with the key of Z-table
    For example my object is used in my program in this way:
    FORM INSERT_CHANGE_DOCUMENT.
      CHECK FL_CHANGE_DOC = 'X'.
      CHECK SY-SUBRC = 0.
      CONCATENATE XZFAGTD01-MANDT XZFAGTD01-BUKRS XZFAGTD01-GJAHR
                                              XZFAGTD01-BELNR INTO OBJECTID.
      TCODE = SY-TCODE.
      UTIME = SY-UZEIT.
      UDATE = SY-DATUM.
      USERNAME = SY-UNAME.
    * Load old data: header
      IF ZFAGTD0K IS INITIAL.
        CLEAR YZFAGTD0K.
      ELSE.
        SELECT SINGLE * INTO YZFAGTD0K
                        FROM ZFAGTD0K WHERE BUKRS   = XZFAGTD01-BUKRS
                                        AND GJAHR   = XZFAGTD01-GJAHR
                                        AND BELNR   = XZFAGTD01-BELNR.
      ENDIF.
    * Load old data: items
      SELECT * INTO TABLE YZFAGTD01 FROM ZFAGTD01
                                FOR ALL ENTRIES IN XZFAGTD01
                                       WHERE BUKRS   = XZFAGTD01-BUKRS
                                          AND GJAHR   = XZFAGTD01-GJAHR
                                          AND BELNR   = XZFAGTD01-BELNR
                                          AND POSNR_P = XZFAGTD01-POSNR_P.
      SORT: XZFAGTD01 BY POSNR_P,
            YZFAGTD01 BY POSNR_P.
    * Check if heade was changed
      IF YZFAGTD0K <> ZFAGTD0K.
        UPD_ZFAGTD0K = 'U'.
      ELSE.
        CLEAR UPD_ZFAGTD0K.
      ENDIF.
      UPD_ZFAGTD01 = 'U'.
      PERFORM CD_CALL_Z_PROAGE_PRV.
      REFRESH XZFAGTD01.
    ENDFORM.                    " INSERT_CHANGE_DOCUMENT
    Max

  • How to change a field of type CHAR of a database table to DATS

    Dear ABAP experts,
    I have a database table: ZLT_aztnew with fields M1, M2, K1, K2, A1, A2, P1, P2, S2, D1, D2,  STD, BES. All these fields are of type 'Character'.  except D2 which is of type DATS. The field D1 is date and is in format DD.MM.YYYY.
    I want to convert this field D1 to type DATS so that I can use a date range through 'selection option' to select other  data of other fields (M1, M2, K1, K2, A1, A2, P1, P2, S2, D1, STD, BES.) related to field D1 from the database table Zlt_aztnew.
    How should I introduce this change (CONVERSION OF D1 CHAR to DATS in the .AZT file upload code itself.
    Problem: If I define D1 as Type  DATS in database table ZLT_AZTNEW then the UPLOAD fails.
    The AZT file upload code is:
    Data  it_string   type stringtab.
    Data  lv_string    type string.
    DATA:  itab  TYPE STANDARD TABLE OF zlt_aztnew.
    DATA:  wa_tab    TYPE zlt_aztnew.
    DATA: file_str1 type string.
    Data: it_tab TYPE STANDARD TABLE OF file_table,
            lw_file LIKE LINE OF it_tab,
            gd_subrc TYPE i.
    SELECTION-SCREEN begin of block blk with frame title text-100.
      SELECTION-SCREEN SKIP 2.
        parameters : p_file like rlgrap-filename .
    SELECTION-SCREEN end of block blk.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
    CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
        window_title = 'Select only Text File'
        default_filename = '.azt'
        multiselection = 'X'
        CHANGING
        file_table = it_tab
        rc = gd_subrc.
    READ TABLE it_tab INTO lw_file INDEX 1.
       p_file = lw_file-FILENAME.
    Start-of-Selection.
      file_str1 = P_file.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = file_str1
    *    filename                      = '\\10.10.1.92\Volume_1\_projekte\Zeiterfassung-SAP\test.azt'
      tables
        data_tab                      = it_string
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT it_string  INTO lv_string.
    clear wa_tab.
    SPLIT lv_string AT ';' INTO  wa_tab-M2   wa_tab-k2   wa_tab-A2   wa_tab-P2  wa_tab-S2   wa_tab-D1  wa_tab-STD  wa_tab-BES.
    Append wa_tab to itab.
    Write: sy-uline(120),
              / sy-vline,
                2 wa_tab-M2,
               11 sy-vline,
               13 wa_tab-k2,
               25 sy-vline,
               27 wa_tab-A2,
               32 sy-vline,
               34 wa_tab-P2,
               39 sy-vline,
               41 wa_tab-S2,
               46 sy-vline,
               48 wa_tab-D1,
               60 sy-vline,
               62 wa_tab-STD,
               72 sy-vline,
               74 wa_tab-BES,
              120 sy-vline.
    ENDLOOP.
    DATA: Answer.
    UPDATE zlt_aztnew From Table itab.
    * INSERT ZLT_aztnew From Table itab accepting duplicate keys.
    If sy-subrc NE 0.
    CALL FUNCTION 'POPUP_TO_CONFIRM'
      EXPORTING
       TITLEBAR                    = 'TITLE '
    *   DIAGNOSE_OBJECT             = ' '
        text_question               = 'Wollen Sie die vorhandenen Inhalte ändern'
       TEXT_BUTTON_1               = 'Ja'(001)
    *   ICON_BUTTON_1               = ' '
       TEXT_BUTTON_2               = 'Nein'(002)
    *   ICON_BUTTON_2               = ' '
       DEFAULT_BUTTON              = '1'
       DISPLAY_CANCEL_BUTTON       = 'X'
    *   USERDEFINED_F1_HELP         = ' '
    *   START_COLUMN                = 25
    *   START_ROW                   = 6
    *   POPUP_TYPE                  =
    *   IV_QUICKINFO_BUTTON_1       = ' '
    *   IV_QUICKINFO_BUTTON_2       = ' '
    IMPORTING
       answer                      = answer
    * TABLES
    *   PARAMETER                   =
    EXCEPTIONS
       TEXT_NOT_FOUND              = 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.
    IF Answer = '1'.
    WRITE: / 'Die vorhandenen Inhalte war geändernt'.
    MODIFY zlt_aztnew From Table itab.
    ENDIF.
    ENDIF.
    TO introduce a date range and pull data from the database table Zlt_AZTNEW--> I wrote the BELOW code SEPARATELY,
    but after execution, the error I am getting is: Enter a valid Date (for example, 31.03.2014).
    TABLES:   ZLT_aztnew.
    TYPES:  Begin OF ty_AZTN,
             M2   TYPE Zlt_AZTNEW-M2,
             K2   TYPE Zlt_AZTNEW-K2,
             A2   TYPE Zlt_AZTNEW-A2,
             P2   TYPE Zlt_AZTNEW-P2,
             S2   TYPE Zlt_AZTNEW-S2,
             D1   TYPE Zlt_AZTNEW-D1,
             STD  TYPE Zlt_AZTNEW-STD,
             BES  TYPE Zlt_AZTNEW-BES,
           END OF ty_AZTN.
    DATA:   gv_datum  TYPE d.
    DATA:   it_aztn TYPE STANDARD TABLE OF ty_aztn with  header line.
    CALL FUNCTION 'CONVERT_DATE_TO_INTERNAL'
      EXPORTING
        date_external                  = zlt_aztnew-D1
    *   ACCEPT_INITIAL_DATE            =
    IMPORTING
       DATE_INTERNAL                  = gv_datum
    * EXCEPTIONS
    *   DATE_EXTERNAL_IS_INVALID       = 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.
           SELECT-OPTIONS: s_datum FOR gv_datum.
          INITIALIZATION.
            s_datum-low  = sy-datum.
            s_datum-high  = sy-datum.
            APPEND s_datum.
    ********** After this further code follows with "SELECT"  wherein I want to use the gv_datum as Where condition.
    SELECT   M2
                      K2
                      A2
                      P2
                      S2
                      D1
                      STD
                      BES
             FROM     ZLt_AZTNEW
             INTO     TABLE it_AZTN
             Where    D1 = gv_datum.
    Please provide me your valuable suggestion to correct any flaw in my code above.
    Looking forward for your reply.
    Best regards
    Chandan Kumar

    Dear Rama,
    Plz refer the following difference in naming conventions as compared to your suggestion:
    it_flat_file --> itab, (internal table for AZT fiel upload and split)
    ls_flat_file ---> wa_itab,
    Ztable --> Zlt_aztnew2,    (Dbase file)
    it_ztable ---> it_zlt_aztnew2, (internal table)
    ls_ztable --> wa_aztnew2,
    I wrote the following code but it is not working. Please also refer the attached screen shot of the database table : ZLT_AZTNEW2.
    Data  it_string   type stringtab.
    Data  lv_string   type string.
    DATA: file_str1 type string.
    Data: it_tab TYPE STANDARD TABLE OF file_table,
          lw_file LIKE LINE OF it_tab,
          gd_subrc TYPE i.
    TYPES: Begin of Ty_itab,
            M2  TYPE Char7,
            K2  TYPE Char3,
            A2  TYPE Char3,
            P2  TYPE Char3,
            S2  TYPE Char3,
            D1  TYPE Char8,
            STD TYPE Char8,
            BES TYPE Char80,
           END OF ty_itab.
    DATA: itab Type Standard Table of ty_itab,
          wa_itab Type ty_itab.
    DATA: it_zlt_aztnew2 type standard table of Zlt_aztnew2,
          wa_aztnew2     TYPE Zlt_aztnew2.
    SELECTION-SCREEN begin of block blk with frame title text-100.
      SELECTION-SCREEN SKIP 2.
        parameters : p_file like rlgrap-filename .
    SELECTION-SCREEN end of block blk.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      CALL METHOD cl_gui_frontend_services=>file_open_dialog
        EXPORTING
        window_title = 'Select only Text File'
        default_filename = '.azt'
        multiselection = 'X'
        CHANGING
        file_table = it_tab
        rc = gd_subrc.
      READ TABLE it_tab INTO lw_file INDEX 1.
      p_file = lw_file-FILENAME.
    Start-of-Selection.
      file_str1 = P_file.
    CALL FUNCTION 'GUI_UPLOAD'
      EXPORTING
        filename                      = file_str1
    *    filename                      = '\\10.10.1.92\Volume_1\_projekte\Zeiterfassung-SAP\test.azt'
      tables
        data_tab                      = it_string
    IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT it_string  INTO lv_string.
      Clear wa_itab.
      SPLIT lv_string AT ';' INTO  wa_itab-M2   wa_itab-k2   wa_itab-A2   wa_itab-P2  wa_itab-S2         wa_itab-D1  wa_itab-STD  wa_itab-BES.
      append wa_itab to itab.
      Write: sy-uline(120),
              / sy-vline,
                2 wa_itab-M2,
               11 sy-vline,
               13 wa_itab-k2,
               25 sy-vline,
               27 wa_itab-A2,
               32 sy-vline,
               34 wa_itab-P2,
               39 sy-vline,
               41 wa_itab-S2,
               46 sy-vline,
               48 wa_itab-D1,
               60 sy-vline,
               62 wa_itab-STD,
               72 sy-vline,
               74 wa_itab-BES,
              120 sy-vline.
    ENDLOOP.
    LOOP at itab into wa_itab.
      CLEAR wa_aztnew2.
      wa_aztnew2-D1+0(4) = wa_itab+6(4).
      wa_aztnew2-D1+4(2) = wa_itab+3(2).
      wa_aztnew2-D1+6(2) = wa_itab+0(2).
    Append wa_aztnew2 to it_zlt_aztnew2.
    ENDLOOP.
    MODIFY Zlt_aztnew2 from table it_zlt_aztnew2.
    Looking forward for your suggestiojn.
    Regards
    Chandan

  • Open Hub - Change from File to Database table

    Hello Experts;
    I want to change the Open Hub Service that we create from File to Database table.
    We are using the Delta Update. However, after I change the Open Hub, Activate the transformation and DTP, when I run it, I don't have any value in the table.
    If I run a new delta into my cube, in the table I only get the data from delta.
    Can anyone knows how to upload all the requests that I have in my cube for the first time I run the delta DTP?
    Thanks and regards;
    Ricardo

    Create a new Full DTP and execute, so that you can dump all of the current contents of the InfoCube into the table and push/pull that table to the target prior to the next delta retraction.
    Edited by: Dennis Scoville on Nov 17, 2009 9:37 AM

Maybe you are looking for