Exception Handling for OPEN DATA SET and CLOSE DATA SET

Hi ppl,
Can you please let me know what are the exceptions that can be handled for open, read, transfer and close data set ?
Many Thanks.

HI,
try this way....
  DO.
    TRY.
    READ DATASET filename INTO datatab.
      CATCH cx_sy_conversion_codepage cx_sy_codepage_converter_init
            cx_sy_file_authority cx_sy_file_io cx_sy_file_open .
    ENDTRY.
READ DATASET filename INTO datatab.
End of changes CHRK941728
    IF sy-subrc NE 0.
      EXIT.
    ELSE.
      APPEND datatab.
    ENDIF.
  ENDDO.

Similar Messages

  • Is there a keyboard shortcut in OS 10.6 for "open folder window" and "close folder window"?

    Is there a keyboard shortcut in OS 10.6 for "open folder window" and "close folder window"?  I have a hand condition at the moment that makes it painful to mouse the cursor over to the arrow and click it (for instance, in the sidebars for Finder or iTunes) to open or close a folder.  If anyone knows a keyboard shortcut for this, I'd really appreciate it--thanks!

    OS X keyboard shortcuts

  • Exception handling for all the insert statements in the proc

    CREATE PROCEDURE TEST (
    @IncrStartDate DATE
    ,@IncrEndDate DATE
    ,@SourceRowCount INT OUTPUT
    ,@TargetRowCount INT OUTPUT
    ,@ErrorNumber INT OUTPUT
    ,@ErrorMessage VARCHAR(4000) OUTPUT
    ,@InsertCase INT --INSERT CASE INPUT
    WITH
    EXEC AS CALLER AS
    BEGIN --Main Begin
    SET NOCOUNT ON
    BEGIN TRY
    DECLARE @SuccessNumber INT = 0
    ,@SuccessMessage VARCHAR(100) = 'SUCCESS'
    ,@BenchMarkLoadFlag CHAR(1)
    ,@BenchmarkFlow INT
    ,@MonthYearStart DATE
    ,@MonthYearEnd DATE
    ,@StartDate DATE
    ,@EndDate DATE
    /* Setting the default values of output parameters to 0.*/
    SET @SourceRowCount = 0
    SET @TargetRowCount = 0
    /*Setting the Start and end date for looping */
    SET @MonthYearStart = @IncrStartDate;
    SET @MonthYearEnd = @IncrEndDate;
    /* Setting the @InsertCase will ensure case wise insertion as this sp will load data in different tables
    @InsertCase =0 means data will be inserted in the target TAB1
    @InsertCase =1 means data will be inserted in the target TAB2
    @InsertCase =2 means data will be inserted in the target TAB3
    @InsertCase =3 means data will be inserted in the target TAB4
    @InsertCase =4 means data will be inserted in the target TAB5
    @InsertCase =5 means data will be inserted in the target TAB6
    if @InsertCase =0
    WHILE (@MonthYearStart <= @MonthYearEnd)
    BEGIN
    SET @StartDate = @MonthYearStart;
    SET @EndDate = @MonthYearEnd;
    /* Delete from target where date range given from input parameter*/
    DELETE FROM TAB1
    WHERE [MONTH] BETWEEN MONTH(@StartDate) AND MONTH(@EndDate)
    AND [YEAR] BETWEEN year(@StartDate) and year(@EndDate)
    /*Insert data in target-TAB1 */
    BEGIN TRANSACTION
    INSERT INTO TAB1
    A,B,C
    SELECT
    A,BC
    FROM XYZ
    COMMIT TRANSACTION
    SET @MonthYearStart = DATEADD(MONTH, 1, @MonthYearStart)
    SELECT @TargetRowCount = @TargetRowCount + @@ROWCOUNT;
    END -- End of whileloop
    END TRY
    BEGIN CATCH
    IF @@TRANCOUNT>0
    ROLLBACK TRANSACTION
    SELECT @ErrorNumber = ERROR_NUMBER() ,@ErrorMessage = ERROR_MESSAGE();
    END CATCH
    END--End of Main Begin
    I have the above proc inserting data based on parameters  where in @InsertCase  is used for case wise execution.
     I have written the whole proc with exception handling using try catch block.
    I have just added one insert statement here for 1 case  now I need to add further insert  cases
    INSERT INTO TAB4
                    A,B,C
    SELECT
                                    A,BC
    FROM XYZ
    INSERT INTO TAB3
                    A,B,C
    SELECT
                                    A,BC
    FROM XYZ
    INSERT INTO TAB2
                    A,B,C
    SELECT
                                    A,BC
    FROM XYZ
    I will be using following to insert further insert statements 
    if @InsertCase =1 
    I just needed to know where will be my next insert statement should be fitting int his code so that i cover exception handling for all the code
    Mudassar

    Hi Erland & Mudassar, I have attempted to recreate Mudassar's original problem..here is my TABLE script;
    USE [MSDNTSQL]
    GO
    /****** Object: Table [dbo].[TAB1] Script Date: 2/5/2014 7:47:48 AM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE TABLE [dbo].[TAB1](
    [COL1] [nvarchar](1) NULL,
    [COL2] [nvarchar](1) NULL,
    [COL3] [nvarchar](1) NULL,
    [START_MONTH] [int] NULL,
    [END_MONTH] [int] NULL,
    [START_YEAR] [int] NULL,
    [END_YEAR] [int] NULL
    ) ON [PRIMARY]
    GO
    Then here is a CREATE script for the SPROC..;
    USE [MSDNTSQL]
    GO
    /****** Object: StoredProcedure [dbo].[TryCatchTransactions1] Script Date: 2/5/2014 7:51:33 AM ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    CREATE PROCEDURE [dbo].[TryCatchTransactions1] (
    @IncrStartDate DATE
    ,@IncrEndDate DATE
    ,@SourceRowCount INT OUTPUT
    ,@TargetRowCount INT OUTPUT
    ,@ErrorNumber INT OUTPUT
    ,@ErrorMessage VARCHAR(4000) OUTPUT
    ,@InsertCase INT --INSERT CASE INPUT
    WITH
    EXEC AS CALLER AS
    BEGIN --Main Begin
    SET NOCOUNT ON
    BEGIN TRY
    DECLARE @SuccessNumber INT = 0
    ,@SuccessMessage VARCHAR(100) = 'SUCCESS'
    ,@BenchMarkLoadFlag CHAR(1)
    ,@BenchmarkFlow INT
    ,@MonthYearStart DATE
    ,@MonthYearEnd DATE
    ,@StartDate DATE
    ,@EndDate DATE
    /* Setting the default values of output parameters to 0.*/
    SET @SourceRowCount = 0
    SET @TargetRowCount = 0
    /*Setting the Start and end date for looping */
    SET @MonthYearStart = @IncrStartDate;
    SET @MonthYearEnd = @IncrEndDate;
    /* Setting the @InsertCase will ensure case wise insertion as this sp will load data in different tables
    @InsertCase =0 means data will be inserted in the target TAB1
    @InsertCase =1 means data will be inserted in the target TAB2
    @InsertCase =2 means data will be inserted in the target TAB3
    @InsertCase =3 means data will be inserted in the target TAB4
    @InsertCase =4 means data will be inserted in the target TAB5
    @InsertCase =5 means data will be inserted in the target TAB6
    IF @InsertCase =0
    WHILE (@MonthYearStart <= @MonthYearEnd)
    BEGIN
    SET @StartDate = @MonthYearStart;
    SET @EndDate = @MonthYearEnd;
    /* Delete from target where date range given from input parameter*/
    DELETE FROM TAB1
    WHERE START_MONTH BETWEEN MONTH(@StartDate) AND MONTH(@EndDate)
    AND START_YEAR BETWEEN year(@StartDate) and YEAR(@EndDate)
    /*Insert data in target-TAB1 */
    BEGIN TRANSACTION
    INSERT INTO TAB1 (COL1,COL2,COL3)
    VALUES ('Z','X','Y')
    SELECT COL1, COL2, COL3
    FROM TAB1
    COMMIT TRANSACTION
    SET @MonthYearStart = DATEADD(MONTH, 1, @MonthYearStart)
    SELECT @TargetRowCount = @TargetRowCount + @@ROWCOUNT;
    END -- End of whileloop
    END TRY
    BEGIN CATCH
    IF @@TRANCOUNT > 0
    ROLLBACK TRANSACTION
    SELECT @ErrorNumber = ERROR_NUMBER() ,@ErrorMessage = ERROR_MESSAGE();
    END CATCH
    PRINT @SUCCESSMESSAGE
    END--End of Main Begin
    GO
    I am just trying to help --danny rosales
    UML, then code

  • Exception handling for ProjectService methods in a new 2006 DI API

    Normally for other objects the Add() method returns error code and calling the GetLastError you get the description.
    AddProject(Project) method of ProjectService returns ProjectParams object.
    So the question is where to get the error code or what is the correct exception handling for that new methods in 2006 SDK.
    Thanks for any help.
    Tomas

    Hi all,
    I have a sceranio :
    I created the text field, text box, com bobox .etc, on new form or exist form.
    When I want to bind data into UDO, i use "DataBind.setBound"
    ex:"oEdit.DataBind.SetBound(True, "@SM_OMOR", "U_Room")"
    Can i bind the data to exist table on B1?
    ex: oEdit.DataBind.setBound(True, "OHEM", "firstName")
    Plz guid !
    Rgds !

  • Can TestStand open, read, write and close binary files?

    From a TestStand sequence, I need to open, read, write and close binary files. Does TestStand support this capability?

    Christine -
    In the past I have used the C/C++ Adapter to call directly into the CVI RTE functions. The CVI functions I have used are OpenFile, WriteFile and CloseFile. The functions are exported from the DLL as CVI_OpenFile, CVI_WriteFile, and CVI_CloseFile. I just had to make sure that on termination of the sequence, that the integer handle was properly released by calling the close function.
    If you are using LabVIEW, you could call directly into the low level VIs to do a similar set of operations.
    Scott Richardson (NI)
    Scott Richardson
    National Instruments

  • How to open an URL and close the URL window, using adobe javascript

    Hi,
      Is it possible to open an URL and close the URL back again(without allowing the user to perform any other operation)? I was able to acheive the opening of the URL, using the app.launchURL("address". true); - But here it lauches in new window, and how do i close the window using the javascript. Is it possible?
    Thanks.

    Hi all
    In addition to what Bobby W - Adobe TS added, you might find
    the following useful as a bypass or workaround to the pesky prompt.
    var pw=window.parent;pw.opener=window.self;window.open("
    http://www.adobe.com");
    pw.close();
    I think this will only work for IE browsers. Actually, I
    think the whole window.close() only works for IE, but could be
    wrong about that.
    Cheers... Rick

  • Exception Handling for many bean objects of a container class in a JSP page

    Hello,
    I have on container bean class. In this container class, there are several others class objects and the getter methods to get these objects out to the JSP pages.
    I have one JSP page which will use different objects in the container class object through the getter methods of the container class.
    My question is how to implement the exception handler for all the objects in the container so that the JSP page can handle all exceptions if occurrs in any object in the container?
    Please give me some suggestions. Thanks
    Tu

    Thanks for your reply.
    Since the container is the accessor class, I have no other super class for this container class, I think I will try the try catch block in the getter methods.

  • 2007A: Exception handling for new ProjectService methods

    Normally for other objects the Add() method returns error code and calling the GetLastError you get the description.
    AddProject(Project) method of ProjectService returns ProjectParams object.
    So the question is where to get the error code or what is the correct exception handling for that new methods in 2006 SDK.
    Thanks for any help.
    Tomas

    Hi Thomas,
    For DI API services there is no return code as for the basic objects methods like Add, Update,...
    The only way is then to put try/catch blocks in your code and identify the error message with the Exception.Message property (same mechanism as we have for the UI API). No way to filter them by return code.
    Regards
    Trinidad.

  • New Report for Opens Sales order and P.O from Plant and S.Loc

    Dear Gurus
    We have repory requiement for Open sales order and P.O to deliver from particular plant and S.Loc.
    If you have already developed this kiond of report help me inthis case.
    Thanks
    ramki

    closed

  • May I use Exception Handling for validation ?

    Hello All,
    Can any one know about that may i use exception handling for validation in my report program.
    Please if its possible then give me some Example...
    Thanks.

    Hi Niraj,
    Exception is not at all raised or handled in the given example.
    There are so many document available in the SCN regarding OO ABAP you can read that.
    As far as validation of a field ( Selection screen ) of course we can do that but I don't see any advantage more over it will make your code unnecessarily complex.
    Regards
    Bikas

  • TS1717 I can't open my purchased films or view films in store and a note comes up that iTunes has stopped working. It checks for solutions, is unsuccessful and closes iTunes. I have reloaded iTunes but get the same. Any ideas?

    I can't open my purchased films or view trailers in store. A note comes up to say iTunes has stopped working. It searches for a solution, is unsuccessful and closes the programme. I have uninstalled all programmes and reloaded but I get the same result. Any ideas?

    Let's try the following user tip with that one:
    iTunes for Windows 10.7.0.21: "iTunes has stopped working" error messages when playing videos, video podcasts, movies and TV shows

  • Posting keys for Open Vendor/Custor and GL accounts during data migration

    Dear experts,
    May I know what are the posting keys to be used for Open Debit Vendor Line item, Open Credit Vendor line item, Open Debit Customer line item, Open Credit Custtomer line item, Open Debit GL line item and Open Credit GL Line item?
    Thank you.

    Dear,
    SAP has provided standard posting keys. Please go to OB41 , there you will find posting keys with their descriptions.
    Regards

  • Exception Handling for inserts

    Hi,
    My requirement is to populate a table with values got by selecting columns from various table on join conditions. It works fine if all the rows inserted are unique. However if the row to be inserted is duplicate, it violates the uniqueness constraint.
    I want an exception wherein if select query returns 100 rows, of which 80 are already there in the table to be populated, it should just insert the 20 records.
    Below is the SP i wrote for the same. However, as soon as it meets exception condition, it just prints the condition and exits, without processing the rest of the records. Please look at the SP below and suggest a solution.
    create or replace
    PROCEDURE PP_CMC_TEST AS
    cursor c1 is
    (select cdu.subscription_id,max(cdu.account_id),max(s.subscription_versn_start_date),
    max(s.service_plan_id),max(sbp.billing_period_id),sysdate-1
    ,cdu.device_name, cdu.resource_id,sum(cdu.usage),max(cdu.unit_of_measurement)
    from
    subscriptions s, subscription_billing_period sbp, consolidated_daily_usage cdu
    where s.version_end_date is null and
    sysdate-1 between sbp.start_date and sbp.end_date and
    cdu.usage_date between sbp.start_date and sbp.end_date
    and s.subscription_id = cdu.subscription_id
    and sbp.subscription_id = cdu.subscription_id
    and sbp.subscription_id = s.subscription_id
    and s.subscription_versn_start_date=sbp.subscription_versn_start_date
    group by cdu.subscription_id,cdu.device_name, cdu.resource_id);
    a number;
    b number;
    c date;
    d number;
    e number;
    f date;
    g varchar2 (255);
    h number;
    i number;
    j varchar2(60);
    BEGIN
      OPEN c1;
        LOOP
            FETCH c1 INTO a,b,c,d,e,f,g,h,i,j;
             EXIT WHEN c1%NOTFOUND;
    insert into cmc_test
    (subscription_id,account_id,subscription_versn_start_date,service_plan_id,billing_period_id,curr_date,
    device_name,resource_id,usage,unit_of_measurement) values
    (a,b,c,d,e,f,g,h,i,j);
        END LOOP; 
                                 EXCEPTION
        WHEN DUP_VAL_ON_INDEX
          THEN
          DBMS_OUTPUT.PUT_LINE('DUPLICATE RECORD FOUND');
          commit;
        CLOSE c1; 
    END PP_CMC_TEST;Edited by: BluShadow on 07-Feb-2012 09:03
    added {noformat}{noformat} tags (for what it was worth).  Please read {message:id=9360002} and learn to do this yourself in future.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Using SQL you would create an error table and modify the INSERT to log the errors. See the 'Inserting Into a Table with Error Logging' section of http://docs.oracle.com/cd/B19306_01/server.102/b14200/statements_9014.htm. Note this approach will not work if you are using direct path loads since the log table won't be used.
    If you are going to use PL/SQL for this then what you want is to use BULK COLLECT and then a FORALL with a SAVE EXCEPTIONS clause.
    >
    A. BULK COLLECT INTO plsqlTable LIMIT 5000 - These are your new records you want to INSERT
    B. FORALL ... SAVE EXCEPTIONS - This is the INSERT query to insert the new records
    C. Use a bulk exception handler. Any record in the FORALL that causes an exception will have it's index put into the bulk exception array. In the bulk exception handler you can loop through the array and access the records that caused the error using the index into the plsqlTable and do any error logging you need to do.
    >
    The bulk exception array will have the plsql table index of the row that caused the error. You can index into the plsql table (see Step A above) to access the record and then log it, INSERT it into a duplicates table or whatever you want.
    The important thing is that the records that do not have errors will still get processed. Similar result to what will happen if you use SQL and an error table.

  • Error handling for master data with direct update

    Hi guys,
    For master data with flexible update, error handling can be defined in InfoPackege, and if the load is performed via PSA there are several options - clear so far. But what about direct update...
    But my specific question is: If an erroneous record (e.g invalid characters) occur in a master data load using direct update, this will set the request to red. But what does this mean in terms of what happens to the other records of the request (which are correct) are they written to the master data tables, so that they can be present once the masterdata is activated, or are nothing written to masterdata tables if a single record is erroneous???
    Many thanks,
    / Christian

    Hi Christian -
    Difference between flexible upload & Direct upload is that direct upload does not have Update Rules, direct upload will have PSA as usual & you can do testing in PSA.
    second part when you load master data - if error occurs all the records for that request no will be status error so activation will not have any impact on it i.e. no new records from failed load will be available.
    hope it helps
    regards
    Vikash

  • Exception Handling for Array Binding

    Hi
    1)
    I am using a Stored Procedure.
    I am using array binding and if i am sending an array of count 10 to be inserted in a table and only 9 got inserted,i deliberatly inserted one errorneous record in array, the count returned by ExecuteNonQuery() is 10.Why ?
    How can i come to know exact number of rows inserted in table, how can i use Output variables, because the array bind count is 10 so if i add an output parameter it gives error ArrayBind count is wrong....
    2)
    Is it possible to roll back all the inserts if error occurs in any of the insert by Oracle engine.What it does is it inserts all correct records and leaves the errorneous record and doesn't even throw any exception or any message.
    Answer - This can be achieved by using OracleTransaction and don't use Exception handling in procedure otherwise there wont be any exception thrown by procedure which is necessary to detect if an error occured during insert.If you use exception handling OracleEngine will insert correct rows and leave errorneous record and return count of inserted + non inserted records which is wrong.
    Please help.
    Message was edited by:
    user556446
    Message was edited by:
    user556446

    You'll need to encapsulate your validation within it's own block as described below:
    -- this will die on the first exception
    declare
      TYPE T_BADDATA_TEST IS TABLE OF VARCHAR2(1000) INDEX BY binary_integer ;
      tbt T_BADDATA_TEST ;
      aBadTypeFound exception ;
    begin
       tbt(0) := 'a';
       tbt(1) := 'b';
       tbt(2) := 'c';
        for idx in tbt.first..tbt.last loop
          if tbt(idx) =  'b' then
              raise aBadTypeFound ;     
          else
              dbms_output.put_line(tbt(idx));     
          end if  ;
        end loop ;
    end ;--encapsulate the exception area in a begin/end block to handle the exception but continue on
    declare
      TYPE T_BADDATA_TEST IS TABLE OF VARCHAR2(1000) INDEX BY binary_integer ;
      tbt T_BADDATA_TEST ;
      aBadTypeFound exception ;
    begin
       tbt(0) := 'a';
       tbt(1) := 'b';
       tbt(2) := 'c';
        for idx in tbt.first..tbt.last loop
          BEGIN
          if tbt(idx) =  'b' then
              raise aBadTypeFound ;     
          else
              dbms_output.put_line(tbt(idx));     
          end if  ;
          EXCEPTION
            WHEN aBadTypeFound THEN
                dbms_output.put_line(tbt(idx) || ' is bad data');       
            WHEN OTHERS THEN
                dbms_output.put_line('exception');       
          END ;
        end loop ;
    end ;
    output:
    a
    b is bad data
    c
    ***/

Maybe you are looking for

  • Resource details are not getting displayed in gantt chart -- R12 instance

    Hi All, we are working on a scenarior in R12 instance. when we run a resource constraint plan and navigate to Gantt chart the complete application is getting hanged and it is not Displaying any resource details. Before 2 days we were able to view the

  • Transfer current music to new ipod

    I think I know the answer to this but don't want to lose all my efforts. If I plug in my new ipod into my computer, it will automatically load all my music and playlists to this new ipod. If this is not the case, how do you accomplish this without me

  • Purchasing a Mac Pro

    Sorry, but I was not sure where exactly to post this but I wanted to know if there was another site or place I can visit where I can purchase a Mac Pro rather than getting it from the Apple Store. There are a few things that I dont want that the Appl

  • Could not see Java tab on Apache Tomcat 5.5.20 Properties in CCM

    Hi, After uninstalling and reinstalling BusinessObjects Edge 3.1, I can no longer see Java tab on Apache Tomcat 5.5.20 Properties in Central Configuration Manager (CCM). I can only see 2 tabs namely Properties and Dependency. Therefore, I could not s

  • DATA Export not success

    Hi, Below is the script I am using to export...the problem is that it is generating the log file but not generating the txt file in the same path. I tried with the database->Rightclick->export->filename......it is showing succeeded but not generating