Database is not Opening. Errors are coming due to Copy Mismatch of Log file

Hello Friends,
I did some mistakes and deleted all log files after closing SAP QAS System.
I was trying to Resizing the Redo Log files, as per as SNOTE 309526.
All control files are consistent. Only due to Log File mismatch, Database is not Opening.
Here, is the error.
ERROR at line 1:
ORA-00322: log 14 of thread 1 is not current copy
ORA-00312: online log 14 thread 1: '/oracle/RQ1/mirrlogB/log_g14m2.dbf'
ORA-00322: log 14 of thread 1 is not current copy
ORA-00312: online log 14 thread 1: '/oracle/RQ1/origlogB/log_g14m1.dbf'
In working condition, Previously the file was with this name log_g11m1.dbf......
I had replaced all the files, which i had backedup ,before deleting those Log files. But, still this kind of error is coming.
I tried to "reset log", but it failed.
SQL> alter database open resetlogs;
alter database open resetlogs
ERROR at line 1:
ORA-01139: RESETLOGS option only valid after an incomplete database recovery
I did all the activities after Closing SAP System.
I want your Quick help, as its critical for me.
Regards
Bhavik Shroff
Edited by: Bhavik G. Shroff on Nov 8, 2008 3:49 PM

Hello Bhavik,
with your given information (the query from above and the posted ORA-errors) - unfortunately i have to say .. you are almost lost, i really advise you to get professional support on your system for that.  Let me explain why.
The information from the query
SQL> SELECT * FROM V$LOG;
GROUP#    THREAD#  SEQUENCE#      BYTES    MEMBERS ARC STATUS           FIRST_CHANGE# FIRST_TIM
    11          1      22292  104857600          2 NO  INVALIDATED      156909413     08-NOV-08
    13          1          0  104857600          2 YES UNUSED           0             08-NOV-08
    14          1      22291   20971520          2 YES ACTIVE           156909138     08-NOV-08
SQL> SELECT * FROM V$LOGFILE;
GROUP# STATUS  TYPE    MEMBER
11         ONLINE  /oracle/RQ1/origlogA/log_g11_m1.dbf
11         ONLINE  /oracle/RQ1/mirrlogA/log_g11_m2.dbf
13         ONLINE  /oracle/RQ1/origlogA/log_g13_m1.dbf
13         ONLINE  /oracle/RQ1/mirrlogA/log_g13_m2.dbf
14         ONLINE  /oracle/RQ1/origlogB/log_g14m1.dbf
14         ONLINE  /oracle/RQ1/mirrlogB/log_g14m2.dbf
and the ORA-00322 error:
ORA-00322: log 14 of thread 1 is not current copy
ORA-00312: online log 14 thread 1: '/oracle/RQ1/mirrlogB/log_g14m2.dbf'
ORA-00322: log 14 of thread 1 is not current copy
As you can see your online redo log group 14 has the status ACTIVE, that means that this online redolog files are needed for a crash recovery (not all needed data was already flushed to the data files), but the files from the online redo log group 14 are lost (deleted accidentally). But you have really luck that this online redologfile is already archived (see query ARC = YES) so you must have a archivelog file with the sequence number 22291.
The problem in your case is that the recover is performed through the online redolog files (normally done by a complete recovery), but the online redolog files are already deleted. To fix this issue you have to restore an older backup and make a recover trough the archive log files (including the sequence 22291 which was already archived) and not through the online redolog groups.
At this point this is the only way to get a running database again (but maybe with data lost).
The other serious problem is the redolog group 11, it seems like this group was the CURRENT redolog (take a look at the sequence and the SCNs) and you will lose this data.
I can imagine that the database was not shutdown clearly at the moment of the redolog file deletion - the most indications are pointing to this.
Sorry that i have no better news for you.. please get professional support who can execute the necessary steps for you.
Regards
Stefan

Similar Messages

  • Upgrade to APEX 4.2.3 apexins_con.sql gets: catconInit: database is not open Unexpected error encountered in catconInit; exiting

    Upgrade to APEX 4.2.3 apexins_con.sql gets Unexpected error encountered in catconInit; exiting
    I am attempting to install/upgrade apex 4.2.3 under Oracle12c in a Multi-Tenant configuration.
    Here are the environmental details
    Windows 7 64 bit
    Apex 4.2.3
    ORCL: CDB$ROOT
    PDBORCL: PDB$SEED
    Here is the current states of the pluggable databases
    SQL> SELECT NAME,OPEN_MODE,TOTAL_SIZE/1024/1024/1024 FROM V$PDBS;
    NAME                           OPEN_MODE  TOTAL_SIZE/1024/1024/1024
    PDB$SEED                       READ ONLY                 .263671875
    PDBORCL                        READ WRITE                .366210938
    SQL>
    This is the command that I am using to re-install/upgrade APEX:
    # remove 4.2.2 installation
    cd M:\apex_4.2.3\apex_4.2.3_en\apex
    sqlplus /@ORCL as sysdba
    @apxremov.sql   <<  this was successful
    quit
    Install 4.2.3 installation
    sqlplus /@ORCL as sysdba
    @apexins_con.sql i10wrk SYSAUX SYSAUX TEMP /i/  << this failed
    The APEX  installation fails immediately with the following message:
    catconInit: database is not open
    Unexpected error encountered in catconInit; exiting
    I cannot determine which database is not open.  Both my CDB$ROOT and PDBORCL are reported as open (READ WRITE Mode).
    Here is my Container database
    SQL>  SELECT SYS_CONTEXT ('USERENV', 'CON_NAME') FROM DUAL;
    SYS_CONTEXT('USERENV','CON_NAME')
    CDB$ROOT
    SQL> select instance_name,status from v$instance;
    INSTANCE_NAME    STATUS
    orcl             OPEN
    SQL>
    Here is the associated Pluggable Database
    sqlplus /@PDBORCL as sysdba
    SQL> select instance_name,status from v$instance;
    INSTANCE_NAME    STATUS
    orcl             OPEN
    SQL> ALTER PLUGGABLE DATABASE PDBORCL OPEN;
    ALTER PLUGGABLE DATABASE PDBORCL OPEN
    ERROR at line 1:
    ORA-65019: pluggable database PDBORCL already open
    I am confused…. Which database is not open?
    The PDB$SEED is open in (READ ONLY) mode, but that is simply the template database.  I don't think that ever needs to be open in (Read Write) mode.

    sbing52,
    I cannot vouch for the specific error that is being returned by catcon.pl, but I would try the following in your situation.
    1. It seems you connect to CDB$ROOT and ran apxremov.sql. This only removed the common APEX option from CDB$ROOT. Your PDB is now in an inconsistent state, since APEX is no longer in the root. I would reconnect to CDB$ROOT and run apxremov_con.sql, make sure you use the one from the 4.2.3 distribution. The one in the ORACLE home will not work.
    2. I would then re-run apexins_con.sql connect to CDB$ROOT. Also, you need to pass the proper parameters. Why are you passing i10wrk? You should be invoking it like:
    @apexins_con.sql SYSAUX SYSAUX TEMP /i/
    Regards,
    Jason

  • SQL Server not Starting Up - Could not open error log file system error = 5(Access is denied.)

    Hi guys,
     I am working on issue with SQL Server 2008 R2 .. we rebooted the server and after that all SQL services is not coming up. below is the error from eventlog...
    SQL Server running under NetworkService account and has full control on this files..
    from Config Manager ....
    The request failed or the service did not respond in a timely fashion....
    From Event log..
    initerrlog: Could not open error log file 'C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log\ERRORLOG'. Operating system error = 5(Access is denied.).
    Any idea or workaround..?
    Thanks..
    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

    Finally I found solution and was able to bring back online the SQL Services...
    I had a very similar issue with the following error (event log):
    Description:
    The SQL Server (MSSQLSERVER) service terminated with service-specific error 17058 (0x42A2).
    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
    Event Type:      Error
    Event Source:      MSSQLSERVER
    Event Category:      (2)
    Event ID:      17058
    Date:            19/05/2012
    Time:            10:20:14
    User:            N/A
    Computer:      NSQLXX
    Description:
    initerrlog: Could not open error log file 'C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\ERRORLOG'.
    Operating system error = 5(error not found).
    In this case the ERRORLOG file had been marked as read only. This was following a scheduled automated boot.  -This
    was culprit
    MSSQL wouldn't not start until this file had been changed.
    http://www.experts-exchange.com/Database/MS-SQL-Server/Q_23951723.html
    Thanks everyone for your kind replies and time...
    Please Mark As Answer if it is helpful. \\Aim To Inspire Rather to Teach

  • Adobe Reader will not open, error O:104

    Adobe Reader will not open, error O:104

    That looks like a perfectly good PDF, but since it's trying to open in Microsoft Word, that means your file association for .pdf files is incorrect.  You should change it to point to Adobe Reader instead of Word.
    If you are on Windows, see http://windows.microsoft.com/en-us/windows/change-file-open-program#1TC=windows-7

  • Database does not open when starting NT service

    Database does not open automatically when starting NT service. It can be opened manually only, through the one of administrative utilities. Can this problem occur due to small SGA size? (in my case - 32 Mb)
    OS: Windows NT SP6
    Database: 8.1.6
    Ilya.

    sounds more like your permissions aren't set correctly on the services startup menu. you could also have a post-job to run after the server restarts - using oradim you can start the service and the db all at once.

  • My Microsoft Word is not opening - error 1712

    my Microsoft Word is not opening - error 1712 - Mac OSX version 10.6.8 - processor 2GHz Intel Core 2 Duo - Memory 2 GB667 MHzDDR2 SDRAM
    my memory is been nearly used up, I have withdrawn 2 GB of archives so that I can continue using my machine, as I am down in Brasil and yet could not find more memory, so I have asked a friend of mine who lives in London to buy me 5 GB more. But as I have done that, once I tried to open an archive, it didn't do so, & I got the 1712 message - I thought of re-iniciating the PC, but I just have a big work document down at the dock, which I cannot loose. I am afraid that if I re-start the Pc I wil loose the document. So I need a way to get the document out of the dock to a file, before I re-start my machine.

    Following thread could help you resolve the issue.
    Word is not opening error -1712 ,can anyone help please

  • AUTOMATIC CLEARING FOR RECEIPTS실행시 PERIOD NOT OPEN ERROR

    제품 : FIN_AR
    작성날짜 : 2004-05-19
    AUTOMATIC CLEARING FOR RECEIPTS실행시 PERIOD NOT OPEN ERROR
    ========================================================
    Problem Description
    AR에서 Receipt이 "Remitted" 상태임에도
    "Automatic Clearing for Receipts"프로그램 실행시 아래와 같은
    Error가 발생하면서 처리되지 않음
    ARZACS module: Automatic Clearing for Receipts
    MSG MSG-01000: DEBUG: Before_Report_Procs.Check_GL_Date.
    MSG MSG-05000: DEBUG: GL_Date not within open period.
    ERR REP-1401: 'beforereport': Fatal PL/SQL error occurred.
    ORA-00000: normal, successful completion
    Solution Description
    Period가 open되어 있지 않아 발생하는 것으로,아래의 실제 Test과정을
    참조.
    Automatic Clearing Test step.
    1. Trx 입력
    GL_DATE 09-JAN-2004
    2. Receipt입력
    GL_DATE 09-JAN-2004
    Maturity DATE 15-JAN-2004
    (Payment Method는 Clearance Method가 "by Automatic Clearing"을 가진
    Receipt Class를 입력)
    3. Remittance 실행
    Receipts -> Remittances 에서 Auto Create
    4. Clearing실행
    Receipts -> Clear/Risk Eliminate에서
    "Automatic Clearing for Receipts" 실행
    Parameter중 Clear Date 11-JAN-2004로 입력
    5. 해당 Receipt이 Clearing안됨.
    6. 다시 Clearing실행
    "Automatic Clearing for Receipts" 실행시
    Parameter중 Clear Date 16-JAN-2004로 입력
    7. 해당 Receipt이 Clearing됨.
    위의 Test결과에서 알 수 있듯이,
    Clear Date는 Maturity Date보다 이후여야 함을 알 수 있다.
    또한, Maturity Date가 같은 Period내가 아닌 그 다음 Period, 예를들어 2월15일이라고
    해도 Clear Date를 2월 15일 이후로 입력해야만 해당 Receipt이 Clearing되었다.

    hi,
    pl go to OB52 and open the FI posting period for account type S.
    you will find either 1000 or 0001 as the field status variant for which you can select the acccoutn type S. You need to know what is the field status variant for your comp code. You find out by going to OBY6 ( Comp code global settings ).
    at OB52 you can maintain this way.
    1000 S zzzzzzzzz 1 2008 12  2008 13 2008 16 2008.
    regards
    sadhu kishore

  • Could not open error log file ''. Operating system error = 5(failed to retrieve text for this error. Reason: 15105).

    Hello
    When I try to start the SQl server service i get the following error:
    Event id 17058
    Could not open error log file ''. Operating system error = 5(failed to retrieve text for this error. Reason: 15105).
    As a test I have made sure the errorlog file ,and the entire drive it is, has everyone full control permissions, but to no avail. Does anyone have any ideas to resolve this issue?
    Thank you

    Hi,
    Try running:
    SELECT SERVERPROPERTY('ErrorLogFileName')
    Then verify that the account being used to run the SQL Server service account has access to the path output above.  If possible, you could try logging onto the server with the same account used to run SQL Server then navigate to the errorlog folder.
    Thanks,
    Andrew Bainbridge
    SQL Server DBA
    Please click "Propose As Answer" if a post solves your problem, or "Vote As Helpful" if a post has been useful to you

  • Database does not open automatically

    I installed the Oracle 8i 8.1.6 on xp pro and created an repository, But when ever i start my system the database instace does started but database does not open,
    it says oracle not available and i have to open the database manually at sql prompt.
    How can i make the database to open automatically?
    Thanks in anticipation.

    Check your Services in Control Panel. Click on the "Logon" Tab for the Oracle Service and make sure that "This Account" is selected and not "Local Account". When you choose "This Account", you should type in the Administrator username/pwd. who can start the service.
    Magesh.

  • Hello,i have updated to the new 11,and now i tunes will not open,error pops up,says Data Execution Prevention,and other error we can not complete ur i tune request,unknown error 4002,i have uninstalled and reinstalled ,has been not help.

    hello,i have updated to the new 11,and now i tunes will not open,error pops up,says Data Execution Prevention,and other error we can not complete ur i tune request,unknown error 4002,i have uninstalled and reinstalled ,has been no help.

    - Try restoring on another computer.
    -  Make an appointment at the Genius Bar of an Apple store.
    Apple Retail Store - Genius Bar

  • Iphoto not opening. error message sent to Apple automatically but no reaction so far. has anyone a similar problem?

    iphoto not opening. error message sent to Apple automatically but no reaction so far. has anyone a similar problem?
    All screen sabvers using Iphoto dossier stopped working and meade me aware of a problem with iphoto (from ilife 11).
    I reinstalled ilife 11, but it was not successful.
    Anyone got a good tip on this?
    Thanks, Michael

    I've been having the exact same problem. It started 4-5 days ago
    This is the error message i've been getting:-
    Process:         iPhoto [509]
    Path:            /Applications/iPhoto.app/Contents/MacOS/iPhoto
    Identifier:      com.apple.iPhoto
    Version:         9.2.1 (9.2.1)
    Build Info:      iPhotoProject-628000000000000~3
    Code Type:       X86 (Native)
    Parent Process:  launchd [167]
    Date/Time:       2011-11-16 21:55:44.487 +0530
    OS Version:      Mac OS X 10.7.2 (11C74)
    Report Version:  9
    Interval Since Last Report:          186902 sec
    Crashes Since Last Report:           9
    Per-App Crashes Since Last Report:   7
    Anonymous UUID:                      4A4FE4E1-35CB-46CA-962E-309E30C781D3
    Crashed Thread:  0
    Exception Type:  EXC_BREAKPOINT (SIGTRAP)
    Exception Codes: 0x0000000000000002, 0x0000000000000000
    Application Specific Information:
    dyld: launch, loading dependent libraries
    Dyld Error Message:
      Library not loaded: /Library/Frameworks/iLifeFaceRecognition.framework/Versions/A/iLifeFaceRecognit ion
      Referenced from: /Applications/iPhoto.app/Contents/MacOS/iPhoto
      Reason: image not found
    Binary Images:
        0x1000 -   0xd1afeb  com.apple.iPhoto (9.2.1 - 9.2.1) <68601E93-E4CF-3B4C-AFFD-4781A92DD58B> /Applications/iPhoto.app/Contents/MacOS/iPhoto
      0xe83000 -   0xf63fe7  org.python.python (2.6.7 - 2.6.7) <61DBA92A-C39A-3A52-86F2-59CF9D310CB4> /System/Library/Frameworks/Python.framework/Versions/2.6/Python
      0xfae000 -  0x114effb  com.apple.geode (1.5 - 151.51) <28D29759-F356-3608-B9CF-3031F3299B1B> /Applications/iPhoto.app/Contents/Frameworks/Geode.framework/Versions/A/Geode
    0x11ee000 -  0x11f0fff  com.apple.iLifePhotoStreamConfiguration (2.2 - 2.2) <4FA61CE9-1718-3E07-9896-0023A2A49699> /Applications/iPhoto.app/Contents/Frameworks/iLifePhotoStreamConfiguration.fram ework/Versions/A/iLifePhotoStreamConfiguration
    0x11f6000 -  0x1205fff  com.apple.iLifeAssetManagement (2.0 - 2.33) <8346DE35-5F86-3338-9913-B035B3EE5435> /Applications/iPhoto.app/Contents/Frameworks/iLifeAssetManagement.framework/Ver sions/A/iLifeAssetManagement
    0x1212000 -  0x123affb  com.apple.iPhoto.Tessera (1.1 - 60.10) <7BA9184E-0A00-3083-8322-772ECBDD30C9> /Applications/iPhoto.app/Contents/Frameworks/Tessera.framework/Versions/A/Tesse ra
    0x124b000 -  0x1272ffb  com.apple.iPhoto.Tellus (1.3 - 60.10) <4AABB0BC-AC97-3EE4-BF0F-D8499DDB57C0> /Applications/iPhoto.app/Contents/Frameworks/Tellus.framework/Versions/A/Tellus
    0x1287000 -  0x1291fff  com.apple.iphoto.AccountConfigurationPlugin (1.2 - 1.2) <3B68F126-D783-3F86-AF04-A0F6A459BE67> /Applications/iPhoto.app/Contents/Frameworks/AccountConfigurationPlugin.framewo rk/Versions/A/AccountConfigurationPlugin
    0x8fea2000 - 0x8fed49c7  dyld (195.5 - ???) <134323A7-49DC-3A9D-ACFD-32FAD0FD6BA2> /usr/lib/dyld
    Model: MacBookPro4,1, BootROM MBP41.00C1.B03, 2 processors, Intel Core 2 Duo, 2.5 GHz, 2 GB, SMC 1.27f3
    Graphics: NVIDIA GeForce 8600M GT, GeForce 8600M GT, PCIe, 512 MB
    Memory Module: BANK 0/DIMM0, 1 GB, DDR2 SDRAM, 667 MHz, 0xCE00000000000000, 0x4D342037305432393533455A332D43453620
    Memory Module: BANK 1/DIMM1, 1 GB, DDR2 SDRAM, 667 MHz, 0xCE00000000000000, 0x4D342037305432393533455A332D43453620
    AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x8C), Broadcom BCM43xx 1.0 (5.10.131.36.11)
    Bluetooth: Version 4.0.1f4, 2 service, 11 devices, 1 incoming serial ports
    Network Service: Ethernet, Ethernet, en0
    Serial ATA Device: Hitachi HTS542525K9SA00, 250.06 GB
    Parallel ATA Device: HL-DT-ST DVDRW  GSA-S10N
    USB Device: Built-in iSight, apple_vendor_id, 0x8502, 0xfd400000 / 2
    USB Device: Apple Internal Keyboard / Trackpad, apple_vendor_id, 0x0230, 0x5d200000 / 3
    USB Device: IR Receiver, apple_vendor_id, 0x8242, 0x5d100000 / 2
    USB Device: BRCM2046 Hub, 0x0a5c  (Broadcom Corp.), 0x4500, 0x1a100000 / 2
    USB Device: Bluetooth USB Host Controller, apple_vendor_id, 0x820f, 0x1a110000 / 5            "
    help would be much appreciated.
    Regards,
    Thimayya

  • Just replaced my hard drive on my Mac book pro. Photoshop will not open error 150:30

    Just replaced my hard drive on my Mac book pro. Photoshop will not open error 150:30

    This is more of a Photoshop question than a Mac question. I typed the error into Google and there seems to be multiple threads about it in the Adobe forums. Here is one:
    Photoshop Error 150:30

  • BDC_INSERT, session not opened Error

    Hi,
    I have a BDC program to Add, Update and Delete a customer. If I do either Add, Update or Delete it is working fine. But if I have ADD and Update And Delete or any two of those it is giving me BDC_INSERT session not opened error. I have BDC_OPEN_GROUP, BDC_CLOSE_GROUP and BDC_INSERT.
    Can someone please help me to resolve this error.
    Thanks,
    veni.
        when 'UPDATE'.
          DESCRIBE TABLE itab_output LINES lv_cnt.
          DO lv_cnt TIMES.
            lv_index = sy-index + 3.
            READ LINE lv_index FIELD VALUE chk.
            IF chk = 'X'.
              READ TABLE itab_output INTO wa_index INDEX sy-index.
              IF sy-subrc EQ 0.
                wa_index-index = sy-index.
                APPEND wa_index TO itab_output2.
                CLEAR wa_index.
              ENDIF.
            ENDIF.
            CLEAR chk.
          ENDDO.
          set pf-status 'NORM1'.
          LOOP at itab_output2.
            IF itab_output2-transpzone = 'ADDITION'.
              MOVE itab_output2-name        TO wa1-name.
              MOVE itab_output2-name_2      TO wa1-name_2.
              MOVE itab_output2-name_3      TO wa1-name_3.
              MOVE itab_output2-name_4      TO wa1-name_4.
              MOVE itab_output2-city        TO wa1-city .
              MOVE itab_output2-city_no     TO wa1-city_no.
              MOVE itab_output2-postl_cod1  TO wa1-postl_cod1.
              MOVE itab_output2-transpzone  TO wa1-transpzone.
              MOVE itab_output2-street      TO wa1-street.
              MOVE itab_output2-str_suppl1  TO wa1-str_suppl1.
              MOVE itab_output2-country     TO wa1-country.
              MOVE itab_output2-extens_1    TO wa1-extens_1.
              PERFORM FORMAT_STORENO.
              APPEND wa1 TO itab_output3.
              CLEAR: wa1.
            ELSEIF itab_output2-transpzone = 'CHANGE'.
              MOVE itab_output2-name        TO wa1-name.
              MOVE itab_output2-name_2      TO wa1-name_2.
              MOVE itab_output2-name_3      TO wa1-name_3.
              MOVE itab_output2-name_4      TO wa1-name_4.
              MOVE itab_output2-city        TO wa1-city .
              MOVE itab_output2-city_no     TO wa1-city_no.
              MOVE itab_output2-postl_cod1  TO wa1-postl_cod1.
              MOVE itab_output2-transpzone  TO wa1-transpzone.
              MOVE itab_output2-street      TO wa1-street.
              MOVE itab_output2-str_suppl1  TO wa1-str_suppl1.
              MOVE itab_output2-country     TO wa1-country.
              MOVE itab_output2-extens_1    TO wa1-extens_1.
              PERFORM FORMAT_STORENO.
              APPEND wa1 TO itab_output4.
              CLEAR: wa1.
            ELSEIF itab_output2-transpzone = 'DELETE'.
              MOVE itab_output2-name        TO wa1-name.
              MOVE itab_output2-name_2      TO wa1-name_2.
              MOVE itab_output2-name_3      TO wa1-name_3.
              MOVE itab_output2-name_4      TO wa1-name_4.
              MOVE itab_output2-city        TO wa1-city .
              MOVE itab_output2-city_no     TO wa1-city_no.
              MOVE itab_output2-postl_cod1  TO wa1-postl_cod1.
              MOVE itab_output2-transpzone  TO wa1-transpzone.
              MOVE itab_output2-street      TO wa1-street.
              MOVE itab_output2-str_suppl1  TO wa1-str_suppl1.
              MOVE itab_output2-country     TO wa1-country.
              MOVE itab_output2-extens_1    TO wa1-extens_1.
              PERFORM FORMAT_STORENO.
              APPEND wa1 TO itab_output5.
              CLEAR: wa1.
            endif.
          endloop.
          clear chk.
          refresh itab_output2.
          DESCRIBE TABLE itab_output3 LINES lv_cnt.
          if lv_cnt <> 0.
            perform add_shipto.
          endif.
          clear lv_cnt.
          DESCRIBE TABLE itab_output4 LINES lv_cnt.
          if lv_cnt <> 0.
            perform change_shipto.
          endif.
          clear lv_cnt.
          DESCRIBE TABLE itab_output5 LINES lv_cnt.
          if lv_cnt <> 0.
            perform delete_shipto.
          endif.
          clear lv_cnt.
      endcase.
    FORM FORMAT_STORENO.
      IF itab_output2-storeno >= 1 AND itab_output2-storeno <= 9.
        CONCATENATE '1012'
                    '00000'
                    itab_output2-storeno
                    INTO wa1-storeno.
      ELSEIF itab_output2-storeno > 9 AND itab_output2-storeno < 100.
        CONCATENATE '1012'
                    '0000'
                    itab_output2-storeno
                    INTO wa1-storeno.
      ELSEIF itab_output2-storeno > 99 AND itab_output2-storeno < 1000.
        CONCATENATE '1012'
                    '000'
                    itab_output2-storeno
                    INTO wa1-storeno.
      ELSEIF itab_output2-storeno > 999 AND itab_output2-storeno < 10000.
        CONCATENATE '1012'
                    '00'
                    itab_output2-storeno
                    INTO wa1-storeno.
      ENDIF.
    ENDFORM.                    " FORMAT_STORENO
    FORM add_shipto.
      loop at itab_output3.
        MOVE '1012'                TO WA_EDPAR-KUNNR.
        MOVE 'WE'                  TO WA_EDPAR-PARVW.
        MOVE itab_output3-name_4   TO WA_EDPAR-EXPNR.
        MOVE itab_output3-storeno  TO WA_EDPAR-INPNR.
        INSERT INTO EDPAR VALUES WA_EDPAR.
        CLEAR WA_EDPAR.
      endloop.
      IF gd_open <> gc_true.
        m_grpid = 'ADD_SHIPTO'.
        PERFORM open_bdc_session.
      ENDIF.
      LOOP AT itab_output3 INTO wa1.
        lv_lzone = wa1-postl_cod1(3).
        perform bdc_dynpro      using 'SAPMF02D' '0107'.
        perform bdc_field       using 'BDC_CURSOR' 'RF02D-KTOKD'.
       // BDC to add customer
        PERFORM bdc_transaction USING gc_tcode2.
        m_count = m_count + 1.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: /01 'Batch job created successfully',
               /01 'Number of new records added', m_count.
      ENDIF.
      clear m_count.
      IF gd_open = gc_true.
        PERFORM close_bdc_session.
      ENDIF.
    ENDFORM.                    " add_shipto
    FORM change_shipto.
      loop at itab_output4.
        UPDATE EDPAR SET   expnr = itab_output4-name_4
                     WHERE kunnr = '0000001012'   AND
                           inpnr = itab_output4-storeno.
      endloop.
      IF gd_open <> gc_true.
        m_grpid = 'CHANGE_SHIPTO'.
        PERFORM open_bdc_session.
      ENDIF.
      LOOP AT itab_output4 INTO wa1.
        lv_lzone = wa1-postl_cod1(3).
        perform bdc_dynpro      using 'SAPMF02D' '0108'.
        perform bdc_field       using 'BDC_CURSOR' 'RF02D-D0125'.
       // BDC to change customer
        PERFORM bdc_transaction USING gc_tcode1.
        m_count = m_count + 1.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: /01 'Batch job created successfully',
               /01 'Number of records changed', m_count.
      ENDIF.
      clear m_count.
      IF gd_open = gc_true.
        PERFORM close_bdc_session.
      ENDIF.
    ENDFORM.                    " change_shipto
    FORM delete_shipto.
      loop at itab_output5.
        DELETE FROM EDPAR
                     WHERE kunnr = '0000001012'   AND
                           expnr = itab_output5-name_4 AND
                           inpnr = itab_output5-storeno.
      endloop.
      IF gd_open <> gc_true.
        m_grpid = 'DELETE_SHIPTO'.
        PERFORM open_bdc_session.
      ENDIF.
      LOOP AT itab_output5 INTO wa1.
        perform bdc_dynpro      using 'SAPMF02D' '0507'.
        perform bdc_field       using 'BDC_CURSOR' 'RF02D-SPART'.
        perform bdc_field       using 'BDC_OKCODE' '/00'.
        perform bdc_field       using 'RF02D-KUNNR' wa1-storeno.
        perform bdc_field       using 'RF02D-VKORG' '300'.
        perform bdc_field       using 'RF02D-VTWEG' '20'.
        perform bdc_field       using 'RF02D-SPART' '01'.
        perform bdc_dynpro      using 'SAPMF02D' '0520'.
        perform bdc_field       using 'BDC_CURSOR' 'KNA1-LOEVM'.
        perform bdc_field       using 'BDC_OKCODE' '=UPDA'.
        perform bdc_field       using 'KNA1-LOEVM' 'X'.
        PERFORM bdc_transaction USING gc_tcode3.
        m_count = m_count + 1.
      ENDLOOP.
      IF sy-subrc = 0.
        WRITE: /01 'Batch job created successfully',
               /01 'Number of records deleted', m_count.
      ENDIF.
      clear m_count.
      IF gd_open = gc_true.
        PERFORM close_bdc_session.
      ENDIF.
    ENDFORM.                    " delete_shipto
    FORM open_bdc_session.
      CALL FUNCTION 'BDC_OPEN_GROUP'
           EXPORTING
                client = sy-mandt
                group  = m_grpid
                keep   = 'X'
                user   = sy-uname.
      IF sy-subrc <> 0.
        MESSAGE e208(00) WITH 'Session open error'.
      ELSE.
        gd_open = gc_true.
      ENDIF.
    ENDFORM.                    " open_bdc_session
    FORM close_bdc_session.
      IF gd_open = gc_true.
        CALL FUNCTION 'BDC_CLOSE_GROUP'
             EXPORTING
                  client = sy-mandt
                  group  = m_grpid
                  keep   = 'X'
                  user   = sy-uname.
      ENDIF.
    ENDFORM.                    " close_bdc_session
    FORM bdc_dynpro USING    p_program
                             p_screen.
      CLEAR: itab_bdcdata.
      itab_bdcdata-program  = p_program.
      itab_bdcdata-dynpro   = p_screen.
      itab_bdcdata-dynbegin = gc_true.
      APPEND itab_bdcdata.
    ENDFORM.                    " bdc_dynpro
    FORM bdc_field USING    p_fieldname
                            p_value.
      CLEAR itab_bdcdata.
      itab_bdcdata-fnam = p_fieldname.
      itab_bdcdata-fval = p_value.
      APPEND itab_bdcdata.
    ENDFORM.                    " BDC_FIELD
    FORM bdc_transaction USING    p_tcode.
      CALL FUNCTION 'BDC_INSERT'
           EXPORTING
                tcode     = p_tcode
           TABLES
                dynprotab = itab_bdcdata.
      REFRESH itab_bdcdata.
      CLEAR: itab_bdcdata.
    ENDFORM.                    " bdc_transaction

    Thank you Rob.
    I just added this in BDC_CLOSE_GROUP, and it worked.
      IF sy-subrc = 0.
        gd_open = ' '.
      ENDIF.
    In BDC_OPEN_GROUP if gd_open = ' ', then only it opens a new session.
    Thanks,
    Veni.
    Edited by: veni reddy on Feb 8, 2008 8:52 PM

  • In the absolutely new 5S the gyroscope does not work, error are stable three degrees, calibration is hindered

    in the absolutely new 5S the gyroscope does not work, error are stable three degrees, calibration is hindered

    Also, I probably should have added that I am with Vodafone, and I'm currently using the Blackberry Curve 3G (9300) on the version 5 software. I also have no access to the Internet, which is telling me I have no signal. I have full 3G signal, so there is no issue whatsoever with my signal. I don't use the BBM on the phone, so I'm not sure if the issue is affecting that also, but I assume it would.

  • When I click on the tab with a + on it, located next to the active tab a new page does not open. If I click on "New Tab" in the File menu a new tab does not ope

    When I click on the tab with a + on it, located next to the active tab a new page does not open. If I click on "New Tab" in the File menu a new tab does not open.

    Hi jcatx2013, we don't really have enough information on your system to make specific suggestions...
    Could you test in Firefox's Safe Mode? That's a standard diagnostic tool to bypass interference by extensions (and some custom settings). More info: [[Troubleshoot Firefox issues using Safe Mode]].
    You can restart Firefox in Safe Mode using
    Help > Restart with Add-ons Disabled
    In the dialog, click "Start in Safe Mode" (''not'' Reset)
    Any difference?

Maybe you are looking for

  • Z77A-GD65 power issue/bad system board?

    Looking for advice. I am afraid its a bad board, but some symptoms point at power which also makes no sense. This is what the WHOLE system should look like. MSI Z77A-GD65 system board Intel 3770K 3.5Ghz Anted Kuhler H20 620 G.Skills RipJaws 16GB 1600

  • Impossible problem with iPod Photo

    Ok, so here's the kick: I joined this forum because I cannot find a solution to this problem whatsoever. I have an iPod Photo that has been sitting in a drawer for about 2 years. I just got a new car stereo and I wanted to fix my old iPod instead of

  • My website works in IE but not firefox

    this is my web page: http://www.andrew-leonard.co.uk/Mallorca/mallorca%20ferns.htm It usess css to define layers and javascript to show and hide the layers. It uses a dhtml menu system by Milonic to execute the javascript This is part of the code for

  • Multi value parameter issue.

    We are facing some issue in SSRS report, whilst running SSRS report  it shows as blank in the multi value parameter field when the <all> option is selected(character will be more than 20000). (Report server: MS windows server 2003 and 32 bit(GIRMSA3)

  • A part of an image frame is on other page as well, it is misplacing while creating PDF for print

    I am working on a design in which there is an image frame box with outline & shadow. This box is continuing from one page to other page as well. (80% on one page & 20% on the other) When I am previrewing it in InDesign Booklet SE, it's showing perfec