Licecache table missing Table MATRIXINDE does not exist in the database wit

Hello,
We recently done a system copy of our APO system, everything went well. in case of Livecache there are 2 problem
1) when we do the integration for LCA/LDA/LCA while we mentione the Livecache server it is not taking the host name , it is only picking the IP address of the livecache server. If we tried host name, it times out.
2) once we give the IP address as livecache server  we can start the live cache server. Bure there is only two tables in it
when we run
transaction Livecache Check (/SAPAPO/OM03) we get the erro i.e.Table MATRIXINDE does not exist in the database with ID LCA
runtime error DBIF_RSQL_TABLE_UNKNOWN
When we look into the tables there are only 2 tables in it
AAPSYSNAME
LCA_WARNINGS
when I compare with other system...it is missing a lots of other tables..
We did re-initialized the livecache.
Appreciate your help in this

Hello Sudhir,
1) Did you create the SAP ticket where this issue is reported?
2) It's good to know more details about the APO version, liveCache/LCA versions on your
    source & target systems.
    What note or document did you follow to do a system copy of our APO system?
3) Please pay attention to the recommendations in the SAP notes:::
         877203     Post steps after the Homogenous liveCache copy usi u2026
         886103    System Landscape Copy for SAP SCM
Thank you and best regards, Natalia Khlopina

Similar Messages

  • DBIF_RSQL_TABLE_UNKNOWN Table AUSPN_V1 does not exist in the database with ID R/3

    Hi All,
    We are encountering numerous short dumps in our system caused by Table AUSPN_V1 does not exist in the database with ID R/3.
    Can anyone advise how to solve the issue? Please find below portion of the short dumps.
    Category               ABAP Programming Error
    Runtime Errors         DBIF_RSQL_TABLE_UNKNOWN
    ABAP Program           SAPLCLVF
    Application Component  CA-CL-CL
    Date and Time          11.06.2014 12:08:28
    Short text
         A table is unknown or does not exist.
    What happened?
         Error in the ABAP Application Program
         The current ABAP program "SAPLCLVF" had to be terminated because it has
         come across a statement that unfortunately cannot be executed.
    What can you do?
         Note down which actions and inputs caused the error.
         To process the problem further, contact you SAP system
         administrator.
         Using Transaction ST22 for ABAP Dump Analysis, you can look
         at and manage termination messages, and you can also
         keep them for a long time.
    Error analysis
         A table is referred to in an SAP Open SQL statement that either does not
          exist or is unknown to the ABAP Data Dictionary.
         The table involved is "AUSPN_V1" or another table accessed in the statement.
    Source Code Extract
    Line  SourceCde
      104     if dupl = kreuz.
      105       insert auspc_v2 client specified from table auspcv2
      106                              accepting duplicate keys.
      107     else.
      108       insert auspc_v2 client specified from table auspcv2.
      109       if syst-subrc ne 0.
      110         message a585 with tabausp.
      111       endif.
      112     endif.
      113     refresh auspcv2.
      114   endif.
      115   read table auspcv3 index 1.
      116   if syst-subrc = 0.
      117     if dupl = kreuz.
      118       insert auspc_v3 client specified from table auspcv3
      119                              accepting duplicate keys.
      120     else.
      121       insert auspc_v3 client specified from table auspcv3.
      122       if syst-subrc ne 0.
      123         message a585 with tabausp.
      124       endif.
      125     endif.
      126     refresh auspcv3.
      127   endif.
      128   read table auspnv1 index 1.
      129   if syst-subrc = 0.
      130     if dupl = kreuz.
      131       insert auspn_v1 client specified from table auspnv1
      132                              accepting duplicate keys.
      133     else.
    >>>>>       insert auspn_v1 client specified from table auspnv1.
      135       if syst-subrc ne 0.
      136         message a585 with tabausp.
      137       endif.
      138     endif.
      139     refresh auspnv1.
      140   endif.
      141   read table auspnv2 index 1.
      142   if syst-subrc = 0.
      143     if dupl = kreuz.
      144       insert auspn_v2 client specified from table auspnv2
      145                              accepting duplicate keys.
      146     else.
      147       insert auspn_v2 client specified from table auspnv2.
      148       if syst-subrc ne 0.
      149         message a585 with tabausp.
      150       endif.
      151     endif.
      152     refresh auspnv2.
      153   endif.

    Hello
    Please check on transaction SE11 if this table exists and if it is active.
    Also, it may be a database issue. What is your database?
    BR
    Caetano

  • Table /xyz/abc does not exist in the database

    Hi experienced developers,
    I created two transparent tables in customer name space in development system, transport to quality together with program using the tables, everything fine, no errors, no warnings.
    Then transported to production. No errors, no warnings. Detailed protocol shows tables have been activated, no errors or warnings.
    First try to use the program gives a dump.
    line 1191:
    ""/xyz/abc" is not defined in the ABAP Dictionary as a table, p"
    "rojection view, or database view."
    Double-click on the table in program code gives a popup information message
    Table/xyz/abc does not exist in the
    database
    After acknowleding the popup, the usual dictionary entry is shown, table is active. Utilities -> database object -> Display leads to an empty screen
    Fields of /xyz/abc  
    Fld name Position Data Type Length Decimals Not null Default
      Indexes for /xyz/abcI
    Utilities -> runtime object -> Display shows  the table name followed by message
    There is no active runtime object for ...
    prededed by big icon exclamation mark.
    We created a new transport with exactly the same result.
    Basis people have no idea.
    The only thing special (but OK I think) is that the tables have key fields only.
    Database is Oracle 11.2.0.2.0, SAP ECC 6.0
    SAP_ABA     701     0008     SAPKA70108     Cross-Application Component
    SAP_BASIS     701     0008     SAPKB70108     SAP Basis Component
    PI_BASIS     701     0008     SAPK-70108INPIBASIS     Basis Plug-In
    ST-PI     2008_1_700     0005     SAPKITLRD5     SAP Solution Tools Plug-In
    SAP_BS_FND     701     0009     SAPK-70109INSAPBSFND     SAP Business Suite Foundation
    SAP_BW     701     0008     SAPKW70108     SAP Business Warehouse
    SAP_AP     700     0022     SAPKNA7022     SAP Application Platform
    WEBCUIF     700     0009     SAPK-70009INWEBCUIF     SAP WEBCUIF 700
    Yes I know, this is a DDIC forum question but I hope for more (experienced) readers here.
    Thank you all for any hint leading to a solution.
    Best regards
    Clemens Li

    Hi,
    thank you for the comments although it does not help.
    Here is the excerpt from productive system  import protocol (original table names replaced as customer requirement)
    *** Activate objects at level 1
    Too low cost (2.100) for parallel processing. Minimum: 6.000
    * Synchronous execution, no parallel processing *
    Activate table /xyz/abcd1
    Table /xyz/abcd1 was activated successfully
    Activate table /xyz/abcd2
    Table /xyz/abcd2 was activated successfully
    Synchronous processing: 4 sec., 2 objects, 2.100 costs
          Object Activation
    End phase  001 ***********************************************************
    Start phase 002 **********************************************************
          Statistics on Activated and Deleted Objects
    Number of objects to be activated............:  2
    Objects not activated........................:  0
    Activated objects with errors in dependencies:  0
    Objects activated with warning...............:  0
    Successfully activated objects...............:  2
    Number of objects to be deleted..............:  0
    Objects not successfully deleted.............:  0
    Successfully deleted objects.................:  0
    Tables/views with DROP/CREATE................:  0
    No. of them marked for DROP/CREATE: 0
    Not marked for DROP/CREATE: 0
    Number of nametabs to be deleted.............:  0
    Successfully deleted nametabs................:  0
    Nametabs that were not successfully deleted..:  0
          Statistics on Activated and Deleted Objects
    End phase  002 ***********************************************************
    =========================================================================
    Mass Activation
    =========================================================================
    Process..................: ENNIPROD_10
    Return code..............: 0
    Phase 001..................: 00:00:04 (Object Activation)
    Phase 002..................: < 1 sec. (Statistics on Activated and ...)
    Program runtime..........: 00:00:05
    Date, time...............: 08.03.2012, 16:30:43
    Program end==============================================================
    ABAP Dictionary: Activation
    End date and time : 20120308163043
    Ended with return code:  ===> 0 <===
    Actually, I don' understand it.
    Regards,
    Clemens

  • Table ZCHECKPICK does not exist in the database

    Hi!
       I have a table "ZCHECKPICK" no "MANDT - Client".
       Then I inserted a field "MANDT - Client"  and executed SE14 to "Active and adjust database".
        The table is now "does not exist in the database" but the struture is ok.
      What do i do to get the table in DataBase again?
    <Priority normalized in subject line>
    Edited by: Vinod Kumar on Sep 13, 2011 9:32 AM

    Dear Clayton,
    you can try a few things
    1) generate/activate the table prior to call SE14.
    2) after confirming that the table is well generated, go to SE14 and choose "Delete Database Table"
    3) then, still on SE14, click on "Activate and Adjust database"
    [http://imageshack.us/photo/my-images/607/20110913010743.jpg/]
    That should fix it.
    Kind Regards
    /Ricardo Quintas

  • Table Z does not exist in the database

    Hi,
    I have created a Z table and modified the DataType from NUMC to DEC and transported to Quality server
    and it is giving an information error that (Table Z does not exist in the database) then once again
    i modified the DataType from DEC to NUMC and transported to Quality server  then still it is giving an information error that
    (Table Z does not exist in the database) please help me out in this issue.
    Thanks in advance.

    Hi Jayanthumer,
    Have you Activated (Ctrl + F3) the Table in SE11 before transporting to Quality server ?
    Try to activate (Ctrl + F3) the table in SE11 of your Quality server...
    It may not be imported properly into Quality server...
    Ask to BASIS person about errors/warnings while importing to Quality Server..
    Also activate all dataelement and domains.... make sure all things are active...
    Once you activate it then it will create the table in database... till then there will be no table in database...
    Hope it will solve your problem..
    Thanks & Regards
    ilesh 24x7
    ilesh Nandaniya

  • View-does not exist on the database

    Hi Experts,
       Our Data Source/Extract Structure (R/3) is based on a view.
    There is an Issue with the View/DAta Source
    If i go to SE11>view Name> Display then i am getting
       'View ZART_ATTRS is not in the database' and then the next screen is the view definition
    This is a database view which is defined in the ABAP/4 Dictionary but does not exist on the database. No data can be read for this reason
    If i go to RSO2 and enter data source name and select display...
    Then it will display data source status as 'Saved' how can i activate it
    and i go to RSA6 select my Z data source which is based on the above view....context menu display data source/Check data source...when i get error
    'Only Tables and views are permitted for extraction'
    How can i overcome it

    Hi,
    As your view is existing in ABAP DICTIONARY , you need to take help of your DBA to get this created in the underlying database. This can be created using Database utility se14 transaction code. But it is good to have your DBA involved so that you have proper table space allocated to it.
    Hope this helps..
    Regards
    Manga(Assign points if it helps)

  • Error: SNAP_ADT does not exist in the database - manual check required

    Hello Friends,
    We are  performing an upgrade+migration to HDB using the DMO option(Oracle to HANA).
    We are getting below error in the phase MAIN_SHDCRE/SUBMOD_SHDDBCLONE/DBCLONE!
    Also find the output of SE11 & SE14 attached.
    SE14->
    Please help us with the manual check.
    Regards
    Sury

    Hi Sury,
    In regards to the error below:
    1EETGCLN Error: SNAP_ADT does not exist in the database -> manual check
    required
    1EETGCLN SNAP_ADT
    1EETGCLN Table does not exist
    Could you please try to activate the following tables via SE11?
    -  SNAP_ADT
    Once they are activated, Could you please repeat the phase and update the result?
    Thanks and Regards,
    James Wong
    Follow us:
    SAP System Upgrade & Update Troubleshooting Wiki Space.
    SAP Product Support Twitter  ( Hashtag: #NWUPGRADE)

  • Component 0DAT (version A) does not exist in the database

    Dear experts
    i got this error.
    Component 0DAT (version A) does not exist in the database
    http://static.flickr.com/20/71394172_655d295b7f_o.jpg
    A SAP expert recommended
    "Use BC to activate the variable 0DAT from InfoObject 0CALDAY."
    but i can't find 0DAT.
    http://static.flickr.com/35/71390830_1049df5c3a_o.jpg
    my system is
    http://static.flickr.com/35/71390831_c837af0b47_o.jpg
    Thanks in advance
    David.kang
    Message was edited by: David Kang
    Message was edited by: David Kang

    Mentor Eugene,
    I guess the issues are related to "Sneak Preview version".
    well, instead of creating new 0DAT,
    i edited  the RSZGLOBV table with 0DAT that i created before.
    http://static.flickr.com/20/71437761_de16ddee16_o.jpg
    http://static.flickr.com/34/71437760_5236824cc2_o.jpg
    so two rows were changed. (from 6 to 4 ). 
    http://static.flickr.com/34/71437762_ed172b5577_o.jpg
    <b> What do you think it is okay ? </b>
    Finally, i can get rid of " Component 0DAT (version A) does not exist in the database " message.
    therefore i expect everything goes well.
    but ..
    "Information No texts were maintained in language E for variable 0DAT " comes up.
    Refer to the screenshot ( http://static.flickr.com/35/71439173_5c996d2111_o.jpg )
    [Query Designer screenshot ]
    http://static.flickr.com/34/71440191_b2a96a2ac4_o.jpg
    [Material Number Master Data ]
    http://static.flickr.com/34/71440190_a827c571ae_o.jpg
    [Original Data file ]
    http://safariexamples.informit.com/0201703661/IO_MAT_TEXT.csv
    http://safariexamples.informit.com/0201703661/IO_MAT_ATTR.csv
    mentor Eugene! thanks a lot.
    with kind regards
    David

  • Delivery 100000093 does not exist in the database or in the archive

    Hi
    I have created delivery and the delivery number also given, but i am getting error like Delivery 100000093 does not exist in the database or in the archive
      the details are not in LIPS LIKP tables delivery numbers also not there.
    Please tell me where was the wrong?
    thanks

    Hi Sarveswara ,
    Please check assigned Number range to your Delivery Document whether complete range has been utilized.
    Cheers !!!
    Imzo
    PLEASE DONT CLOSE THE THREAD WITH FUNNY CHARACTER

  • This query does not exist in the database in the system

    I have created a query, but when I run it, I receive this error:
    You have attempted to open query 0DAT from the Query Designer.
    However, this query does not exist in the database in the system to which you have made a connection.
    Thanks
    Joseilton

    dear Joseilton,
    the variable 0DAT ist not in active version in your system.
    Use BC to activate the variable 0DAT from InfoObject 0CALDAY.
    or
    you have to create it in your system. therefor change the namespye to SAP-namespace (starting with 0). Open one Query in your system via RRMX and select CalenderDay to create a new variable.
    name:                0DAT
    descrition:          current calender day
    processed by:        SAP EXIT
    Characteristic:      Calender Day
    variable represents: Single Value
    best regards
    imberaureus

  • "Delivery 80001021 does not exist in the database or in the archive"

    hi,
              i am creating delivery document and save the delivery but while I'm checking the delivery doc no the system is showing following error "Delivery 80001021 does not exist in the database or in the archive"
    please help  
    thanks
    amit

    Amit,
    This problem is due to a program error. Talk to your devloper in order to solve it.
    I copy & paste the below text or solution from OSS 993005. Check that for complete info.
    Reason and Prerequisites
    The problem is caused by a program error.
    Solution
    Implement the attached correction instructions.
    After you confirm error message VL 559 "Delivery &1 does not exist in the database or in the archive", the system branches to either
    the inbound delivery (DISPLAY) that was displayed or changed beforehand, or
    the inbound delivery that has just been saved (also in display mode).
    If no delivery was saved before you switched to 'Other inbound delivery', the original transaction is started again (for example: VL31N).
    Regards,
    Sats.

  • SE14 Status-UPGRADE-Table does not exist in the database

    Folks,
    I have created a ztable with SPRAS and few Char fields and generated a table maintenance generator.In the Dev it is working fine but when I moved the TR to Q TR ended up with errrors "Generation of Programs and Screens".When I check in Q in SE11 I am able to see the table but with an error message "Table doesn't exist in the database".
    SE14 Status for this table is getting shown as UPGRADE in Q.
    Can anyone here throw some light on what exactly this status UPGRADE means and how it gets set in SE14.
    In DEV,I had checked the DATABASE OBJECT>>CHECK>DISPLAY and RUNTIME OBJECT>>CHECK>>DISPLAY and it is showing Database object is consistent but where as the same in Q is showing "Table is not created in the Database".
    K.Kiran.

    Hi.
    Is Q system is newly copied? Also please check the transport order of the table creation request. Also check whether pwd of the DB user is locked?
    Regards,
    Vimal

  • Index mentioned in AWR Report does not exist in the database

    Hi,
    I have a situation where the index object mentioned in the AWR Report is not present in the database. The object has not been dropped, is not present in the recyclebin either. The object name is mentioned as PK1_IDX in the report. The object with the name PK_IDX is present in the database. Any ideas?
    Thanks
    Charles

    Xtreme wrote:
    Hi,
    Please let me add additional information.
    The AWR Report section Segments by Physical Reads shows that a particular index object shown up in report as PK1_IDX has 72% of physical reads.
    But the index object PK1_IDX is not present in the database
    The index object with the name PK_IDX is present in the database.
    SQL> select object_name,object_type,last_ddl_time from dba_objects where object_name like '%PK_IDX%';
    OBJECT_NAME OBJECT_TYPE LAST_DDL_
    PK_IDX 09-DEC-08
    Does oracle create indexes at runtime with a names as PK1_IDX during execution?No, not a thing that I know of. As I said, can you trace the query ans see if its truly using that said index?
    Aman....

  • SRM MDM, Error, "Table with Code 'null' does not exist in repository"

    Hi experts,
    We has SRM MDM scenario, while doing OCI settings, we are able to connect with MDM repository but getting follwoing error message in portal, "java.lang.IllegalArgumentException: Table with Code 'null' does not exist in the repository 'Repository' or is one of the system table (e.g. Workflows) that is not exposed in repository schema" 
    Can You please suggest,
    Thanks and Regards,
    Munish

    Hi everyone,
    Sudhanshu and Anshuk:- Thanks for your response, let me try and explain the real scenario in details:-
    We have deployed the SRM-MDM Catalog Search UI in Portal.
    We tried accessing the http://<Portal Host>:<Portal Port>/SRM-MDM/SRM_MDM
    Then we got a screen (Search UI App screen), where in we have provided the MDM Server name, then the MDM Server Password, then presses the Connect button, then below this, it displayed the Repository name created in the MDM. We have selected the Repository, then provided the Credentials of a User (Name: T_CORP) in MDM which has "Catalog Manager", and the "UI Configuration Manager" Roles. Please note that these Role names were created by us in MDM. Is it the right procedure or do we have any standard Roles delivered by SAP in MDM to map? If any standard Roles are available, where we need to check these.
    Once the Credentials of MDM User is provided, and then selected the "Login" button.
    Then we are getting the below error.
    "java.lang.IllegalArgumentException: Table with Code 'null' does not exist in the repository 'Repository' or is one of the system table (e.g. Workflows) that is not exposed in repository schema"
    Please clarify; we are not configuring any values in iViews. Where we need to do this, I mean name of the iView, and what values do we need provide generally? We are just running the Search UI App application; I don't think it is an iView, because the URL shows the Application name details, etc...
    Please guide us, how to fix this Error.
    Thanks and Regards,
    Munish

  • Cannot drop the table because it does not exist in the system catalog. Transaction context in use by another session

    Hi Every one,
    An error has occurred during report processing. (rsProcessingAborted)
    Get Online Help
    Query execution failed for data set 'NonFinTran'. (rsErrorExecutingCommand)
    Get Online Help
    Cannot drop the table '#NonFinTran', because it does not exist in the system catalog. Cannot drop the table '#MultipleNonFinTran',
    because it does not exist in the system catalog. Transaction context in use by another session.
    NOTE: NonFinTran &
    MultipleNonFinTran are
    the Temp table in my storedPoc.
    Please any help me to solve this issue. 
    Thanks & Regards,
    Anil Kumar
    Anil Kumar

    Hi Harsh,
     Below is my Stored Proc
    SELECT @ServerName=datasource from master.dbo.sysservers WHERE catalog='Voyager'    
     SELECT @ServerName3=datasource from master.dbo.sysservers WHERE catalog='AuditLog'    
     SELECT @ServerName2=datasource from master.dbo.sysservers WHERE catalog='Portal'    
     IF @ServerName IS NOT NULL SET @ServerName='[' + @ServerName + '].' ELSE SET @ServerName=''    
     IF @ServerName3 IS NOT NULL SET @ServerName3='[' + @ServerName3 + '].' ELSE SET @ServerName3=''    
     IF @ServerName2 IS NOT NULL SET @ServerName2='[' + @ServerName2 + '].' ELSE SET @ServerName2=''    
     IF Exists(Select * From tempdb.dbo.SysObjects Where Name Like '#NonFinTran%')     
      DROP TABLE #NonFinTran    
     IF Exists(Select * From tempdb.dbo.SysObjects Where Name Like '#MultipleNonFinTran%')     
      DROP TABLE #MultipleNonFinTran    
     CREATE TABLE #NonFinTran (FirstName VARCHAR(40), TaxId VARCHAR(40), TrxID VARCHAR(40), Status VARCHAR(255), Field1 VARCHAR(255), Field2 VARCHAR(255),    
       Field3 VARCHAR(255), Field4 VARCHAR(255), Field5 VARCHAR(255), Field6 VARCHAR(255), DateTime DATETIME,     
       BranchID CHAR(3), BankID CHAR(1), FromAccountID VARCHAR(255), FromAccountType VARCHAR(255))    
     CREATE TABLE #MultipleNonFinTran (FirstName VARCHAR(40), TaxId VARCHAR(40), TrxID VARCHAR(40), Status VARCHAR(255), Field1 VARCHAR(255), Field2 VARCHAR(255),    
       Field3 VARCHAR(255), Field4 VARCHAR(255), Field5 VARCHAR(255), Field6 VARCHAR(255), DateTime DATETIME,     
       BranchID CHAR(3), BankID CHAR(1), FromAccountID VARCHAR(255), FromAccountType VARCHAR(255))     
    INSERT #NonFinTran    
     EXEC('SELECT FirstName, TaxID,     
      TrxID, Status, TrxField1, TrxField2, TrxField3, TrxField4, TrxField5, TrxField6, DateTime, '''', '''', '''', ''''    
     FROM ' + @ServerName3 + 'AuditLog.dbo.CCAuditLogEntryView AS Audit, ' + @ServerName + 'Voyager.dbo.CCUser AS CCUser    
     WHERE CCUser.UserID = Audit.UserID     
      AND Audit.Succeeded = 1     
      AND Audit.TrxID IN (''ChangeBillPayDefaultAccountEdit'',''ChangeExpiryUserPassword'',''ChangePasswordEdit'',    
       ''ChangeUserPassword'',''ManageAddressMaint'',''ManageContactMaint'',''ManageSecretQuestionAnswerEdit'',    
       ''ManageTransLimitMaint'',''OtherBankAccountMaintAdd'',''OtherBankAccountMaintDelete'',''OtherBankAccountMaintEdit'',    
       ''WithinAmBankAccountMaintAdd'',''WithinAmBankAccountMaintDelete'',''WithinAmBankAccountMaintEdit'',    
       ''SetAccountMaskPreferenceAudit'',''ChangeLoginIdAudit'')     
      AND DATEDIFF(DAY, CONVERT(DATETIME, CONVERT(VARCHAR(10), ''' + @StartDate + '''), 103), Audit.DateTime) >= 0     
      AND DATEDIFF(DAY, CONVERT(DATETIME, CONVERT(VARCHAR(10), ''' + @EndDate + '''), 103), Audit.DateTime) <= 0 ')    
     INSERT #MultipleNonFinTran    
     EXEC('SELECT DISTINCT FirstName, TaxID,     
      TrxID, Status, TrxField1, TrxField2, TrxField3, TrxField4, TrxField5, TrxField6, Audit.DateTime as AuditDateTime,    
    (SELECT DISTINCT SUBSTRING(A.BranchCode,3,3)  FROM ' + @ServerName + 'AuditLog.dbo.CCAuditLogEntryView X INNER JOIN ' + @ServerName + 'Voyager.dbo.CCuser U
    ON X.UserId = U.UserId INNER JOIN ' + @ServerName + 'Voyager.dbo.AMHZ_CustomerProfile P ON P.EnrolId = U.TAXID 
    INNER JOIN ' + @ServerName + 'Voyager.dbo.AMHZ_AccountListing A ON A.CIFNO = P.CIFNO
    WHERE X.UserId = Audit.UserId AND A.AccountNo = SUBSTRING(Audit.TrxField1,11,16) AND P.CIFNO = A.CIFNO
    AND (SUBSTRING(A.BranchCode,3,3) <> NULL OR SUBSTRING(A.BranchCode,3,3) <> '''')
    AND CHARINDEX(''AccountID='', Audit.TrxField1, 1) > 0),
      SUBSTRING(TrxField1,14,1), CASE WHEN CHARINDEX(''AccountID='', TrxField1, 1) > 0 THEN     
      SUBSTRING(TrxField1,11,16) ELSE '''' END, CASE WHEN CHARINDEX(''AccountType='', TrxField2, 1) > 0 THEN SUBSTRING(TrxField2,13,3) ELSE '''' END    
     FROM ' + @ServerName3 + 'AuditLog.dbo.CCAuditLogEntryView AS Audit, ' + @ServerName + 'Voyager.dbo.CCUser AS CCUser    
     WHERE CCUser.UserID = Audit.UserID     
      AND Audit.Succeeded = 1     
      AND Audit.TrxID IN (''SetAccountAttributesAudit'',''SetAccountFriendlyNameAudit'',    
      ''AccountProfileMaintULDelete'',''AccountProfileMaintLHAAdd'',''AccountProfileMaintLSCAdd'')
      AND DATEDIFF(DAY, CONVERT(DATETIME, CONVERT(VARCHAR(10), ''' + @StartDate + '''), 103), Audit.DateTime) >= 0     
      AND DATEDIFF(DAY, CONVERT(DATETIME, CONVERT(VARCHAR(10), ''' + @EndDate + '''), 103), Audit.DateTime) <= 0 ')  
      SET @stmt = '    
     SELECT * FROM    
     SELECT BranchName,
     CASE WHEN SUBSTRING(FromAccountID,1,6) IN (''519901'',''559409'')  THEN ''DC''  
    ELSE       
     CASE FromAccountType WHEN ''01'' THEN ''SA '' WHEN ''02'' THEN ''CA '' WHEN ''03'' THEN ''FD ''     
        WHEN ''SA'' THEN ''SA '' WHEN ''CA'' THEN ''CA '' WHEN ''FD'' THEN ''FD '' ELSE FromAccountType + '' ''    
     END 
     END +     
    case when Len(FromAccountID) =16 Then  
       CASE FromAccountType WHEN ''VC'' THEN   
       SUBSTRING(FromAccountID,1,6)+''******''+SUBSTRING(FromAccountID,13,4)      
    WHEN ''MC'' THEN SUBSTRING(FromAccountID,1,6)+''******''+SUBSTRING(FromAccountID,13,4)  END  
         when Len(FromAccountID) =15 Then 
    CASE FromAccountType WHEN ''VC'' THEN   
       SUBSTRING(FromAccountID,1,6)+''******''+SUBSTRING(FromAccountID,13,3)      
    WHEN ''MC'' THEN SUBSTRING(FromAccountID,1,6)+''******''+SUBSTRING(FromAccountID,13,3)  END  
         ELSE FromAccountID   
    ENd  
     AS FromAcctNo,    
     CASE TrxId  
     WHEN ''AccountProfileMaintLHAAdd'' THEN ''Link Account/Card''    
     WHEN ''AccountProfileMaintLSCAdd'' THEN ''Link Account/Card''    
     WHEN ''APMFamilyFirstAdd'' THEN ''Link Family First Account''    
     WHEN ''AccountProfileMaintULDelete'' THEN ''Unlink Account/Card''    
     WHEN ''BalInqFD'' THEN CASE  WHEN Field3 IN (''APMLink=SUCCESS'') THEN ''APMLink Success'' ELSE ''Fixed Deposit Balance Inquiry'' END  
     WHEN ''BalInqCASA'' THEN CASE  WHEN Field3 IN (''APMLink=SUCCESS'') THEN ''APMLink Success'' ELSE
         CASE WHEN FromAccountType IN (''SA'',''01'') THEN ''Savings Account Balance Inquiry'' 
        ELSE ''Current Account Balance Inquiry'' 
       END 
      END    
     WHEN ''StopCheck'' THEN ''Stop Cheque Request''    
     WHEN ''CheckReorder'' THEN ''Order Your Cheque''    
     WHEN ''CheckInquiry'' THEN ''Cheque Inquiry''    
     WHEN ''TransHistFD'' THEN ''Fixed Deposit Transaction History''    
     WHEN ''TransHistCASA'' THEN    
      CASE WHEN FromAccountType IN (''SA'',''01'') THEN ''Savings Account Transaction History'' ELSE ''Current Account Transaction History'' END    
     WHEN ''StmtInqCC'' THEN    
      CASE WHEN FromAccountType IN (''DR'',''03'') THEN ''Debit Card Statement Inquiry'' ELSE ''Credit Card Statement Inquiry'' END    
     WHEN ''StmtInqDA'' THEN    
      CASE WHEN FromAccountType IN (''SA'',''01'') THEN ''Savings Account Statement Inquiry'' ELSE ''Current Account Statement Inquiry'' END    
     WHEN ''StmtReq'' THEN ''Printed Statement Request''    
     WHEN ''StmtInqIAMSTAR'' THEN ''E-AMSTAR Statement Inquiry''    
     WHEN ''Repayment/Transfer Inquiry'' THEN ''Repayment/Transfer Inquiry''    
     WHEN ''Account Inquiry'' THEN ''Account Inquiry''    
     WHEN ''Payment Inquiry'' THEN ''Payment Inquiry''    
     END AS TransType,    
     FirstName AS CustomerName,    
     TaxId, CONVERT(VARCHAR, DateTime, 103) AS Date, CONVERT(VARCHAR, DateTime, 108) AS Time    
     FROM #NonFinTran, ' + @ServerName3 + 'Portal.dbo.TB_Branch AS TB_Branch    
     WHERE     
     BranchId = TB_Branch.BranchCode     
     AND (TB_Branch.InstCode IN (''00001'', ''00003'',''001'',''002''))    
     AND (FromAccountType IN (''SA'', ''CA'', ''FD'', ''01'', ''02'', ''03'')))'    
    EXEC (@stmt)
    IF Exists(Select * From tempdb.dbo.SysObjects Where Name Like '#NonFinTran%')     
     DROP TABLE #NonFinTran    
     IF Exists(Select * From tempdb.dbo.SysObjects Where Name Like '#MultipleNonFinTran%')     
      DROP TABLE #MultipleNonFinTran    
    Anil Kumar

Maybe you are looking for