SSIS 2008 R2 Error Handling

Greetings!
I have a Parent Package that calls several child packages that must be executed in sequence:
Parent Package A calls Child1, Child2, Child3.  Each Child package has a precedence constraint of on success.
My goal is to have the parent package stop executing if any one of the child packages fail, as well as send me an email with the error message.  I know that the Event Handler OnError will handle the send mail task, however because we are "Handling"
the error,  the parent package will continue to execute. 
Is there a way to send the email and fail the package in the event handler, or is it better to just create the send mail tasks for each child package using the ON FAILURE precedence constraint?

Hi Val01,
As Harry said, the failure of any child package will cause the parent package to fail by default. If it behaviors different in your package, it seems that you have made some modifications to the default settings. For example, the ForExecutionResult property
of a child package may be forced to Success, the System::Propagate variable of a container has been set to False. To email the error message, you can add a Send Mail Task for an OnError event handler for specific executable, and use System::ErrorDescription
variable and so on in the MessageSource property of the Send Mail Task to display the custom message.
For more information, please see:
http://sqlblog.com/blogs/rushabh_mehta/archive/2008/04/24/gracefully-handing-task-error-in-ssis-package.aspx 
http://bisherryli.com/2010/11/04/ssis-using-system-variables-in-send-mail-task/ 
Regards,
Mike Yin
TechNet Community Support

Similar Messages

  • Error while sending mail using script task in ssis 2008

    Hi,
        i am trying to send mail using ssis 2008 script task.for my requirement i am not able to use send mail task.
    code i have used is
    declared read only variables system::packagename
     Dim PACKAGE As String
            PACKAGE = Dts.Variables("System::PackageName").Value.ToString()
            Dim myHtmlMessage As MailMessage
            Dim mySmtpClient As SmtpClient
            myHtmlMessage = New MailMessage("[email protected]", "[email protected]", "PACKAGE STATUS", PACKAGE + "WAS FAILED")
         mySmtpClient = New SmtpClient("smtp.gmail.com")
            mySmtpClient.Credentials = New NetworkCredential("[email protected]", "mypassword")
            mySmtpClient.EnableSsl = True
            mySmtpClient.Port = 587
            mySmtpClient.Send(myHtmlMessage)
    error i am getting is
    Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1
    Authentication Required. Learn more at
       at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
       at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
       at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       at ST_c121e07caaa94c21bb1355d4f753112f.vbproj.ScriptMain.Main()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
       at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
       at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()
    can any one tell me where i am going wrong

    also getting error as follows
    Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.5.1
    Authentication Required. Learn more at
       at System.Net.Mail.MailCommand.CheckResponse(SmtpStatusCode statusCode, String response)
       at System.Net.Mail.MailCommand.Send(SmtpConnection conn, Byte[] command, String from)
       at System.Net.Mail.SmtpTransport.SendMail(MailAddress sender, MailAddressCollection recipients, String deliveryNotify, SmtpFailedRecipientException& exception)
       at System.Net.Mail.SmtpClient.Send(MailMessage message)
       at ST_c121e07caaa94c21bb1355d4f753112f.vbproj.ScriptMain.Main()
       --- End of inner exception stack trace ---
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)
       at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)
       at Microsoft.SqlServer.Dts.Tasks.ScriptTask.VSTATaskScriptingEngine.ExecuteScript()

  • Error Handling in the SQL Trigger 2008 R2

    Hi ,
    I need some guidance in setting up error handling process in the table  trigger. I have created a trigger on source database table and it load data to target table whenever there are any changes in last update date of source database ( given code below).
    Problem : sometime I am getting error message ( like unique Index , data length mismatch etc) and my trigger don’t work and rollback the entire transaction.  
    Requirement : If there is an error with the insertion, I would like to move that error-inducing record into an error table  .  Any guidance much appreciate.  thanks!
    /****** Object:  Trigger Defination     ******/
    USE [MPSAIntegration]
    GO
    SET
    ANSI_NULLS ON
    GO
    SET
    QUOTED_IDENTIFIER ON
    GO
    /*Description:    Trigger to insert Asset details into Siebel Table*/
    ALTER
    TRIGGER [dbo].[trg_INS_INTO_CX_PRODPROF_STG]
    ON  [MPSAIntegration].[dbo].[CustomerProductLines]
    AFTER INSERT,UPDATE
    AS
    /****** Get the current Timestamp,Max of SR_NUM from Target table and LastRun time from dbo.TIME ******/
    DECLARE @currtime
    DATETIME,
    @SR_NUM
    INT,
    @Last_Run
    DATETIME
    SELECT @currtime
    = (SELECT
    CURRENT_TIMESTAMP)
    SELECT @SR_NUM
    = (select
    max(Sr_Num)
    from dbo.SerialNum
    WHERE Entity='PROD')
    SELECT @Last_Run
    = (SELECT LastRun
    from [MPSAIntegration].[dbo].[TIME]
    where ENTITY =
    'PROD')
    BEGIN
    SET
    NOCOUNT ON;
    SET
    XACT_ABORT ON;
    /***** Update dbo.SerialNum Table *****/
    UPDATE dbo.SerialNum
    SET Sr_Num = @SR_NUM+1
    where Entity='PROD';
    /***** Insert into [dbo].[CX_PRODPROF_STG] table *****/
    INSERT
    INTO [ntscrmdbdev].[SiebelDB].[dbo].[CX_PRODPROF_STG]
    ([ROW_ID]
    ,[CREATED]
    ,[CREATED_BY]
    ,[LAST_UPD]
    ,[LAST_UPD_BY]
    ,[MODIFICATION_NUM]
    ,[CONFLICT_ID]
    ,[LOAD_STATUS]
    ,[SR_NUM]
    ,[INFO_CAPTURE_DATE]
    ,[ADDRESS_NAME]
    ,[CUSTOMER_CODE]
    ,[DESCRIPTION]
    ,[PRODUCT]
    ,[SERVER_NAME]
    ,[STATUS]
    ,[CANCEL_DATE],
          [SEQUENCE_ID])
    SELECT
    CAST(CUSTOMERCODE
    AS NVARCHAR(8))+CAST(@SR_NUM
    AS NVARCHAR(7))
    ,Current_Timestamp
    ,'dbo'
    ,Current_Timestamp
    ,Current_User
    ,0
    ,'N'
    ,'Not Processed'
    ,CAST(@SR_NUM
    AS NVARCHAR(15))
    ,InfoCaptureDate
    ,(SELECT CUST.CUSTOMERNAME
    FROM CUSTOMERS CUST where CUST.CustomerCode
    = I.CustomerCode)
    ,CustomerCode
    ,ProductLine
    ,ProductLine
    ,ServerName
    ,'ACTIVE'
    ,TerminationDate
    ,1
    FROM INSERTED I
    /****** Update the LastRun in dbo.TIME ******/
    UPDATE [MPSAIntegration].[dbo].[TIME]
    SET LastRun
    = @currtime
    WHERE ENTITY
    = 'PROD';
    END

    The first choice is stored procedure. Trigger should be last resort.
    Related links:
    http://stackoverflow.com/questions/884334/tsql-try-catch-transaction-in-trigger
    http://www.sqlservercentral.com/Forums/Topic1499938-3077-1.aspx
    http://www.sommarskog.se/error-handling-I.html
    http://www.codemag.com/Article/0305111
    Kalman Toth Database & OLAP Architect
    SQL Server 2014 Database Design
    New Book / Kindle: Beginner Database Design & SQL Programming Using Microsoft SQL Server 2014

  • JSF error handling when the bean is not correctly loaded

    Hi,
    I am doing some error handling in JSF and I want to do it in an elegant way. I have the following scenario for error handling.
    When the bean is initialized I load the bean with values from DAO which give SQL Exceptions.
    Since the bean is not loaded I properly I have to send the user to an error page showing the error message why I am sending the user to this page.
    I can do it by [ FacesContext.getCurrentInstance.redirect("/error.jsf") ] doing so I will loose all the FacesMessages that are added by the exceptions.
    Instead I want to use the [ FacesContext.getCurrentInstance.dispatch("url") ] which will allow the transfer of the user but I get the following
    16:59:39,341 WARN [lifecycle] executePhase(RESTORE_VIEW 1,com.sun.faces.context.FacesContextImpl@8537f9) threw exception
    java.lang.ClassCastException: javax.faces.component.UIViewRoot
    and the method that I am calling is
    public static void programErrorEnd() {
    logger.info("in the prgmErrorEnd mehod");
    //intializing the contex object
    FacesContext ctx = FacesContext.getCurrentInstance();
    try {
    //ready to dispatch the url.
    //ctx.getExternalContext().redirect("app/error/prgmerror.jsf");
    ctx.getExternalContext().dispatch("error/prgmerror.jsf");
    } catch (IOException e) {
    //TODO what to do when there is an error at this stage.
    finally {
    ctx.responseComplete();
    }Thanks and Regarding
    Edited by: sgatl2 on Aug 28, 2008 2:32 PM
    Edited by: sgatl2 on Aug 28, 2008 2:45 PM

    Just let it throw the exception and define an error-page entry in the web.xml which catches the specified exception (or a superclass of it or a HTTP status code) and displays the error.jsf page accordingly.

  • SQL Logging not working in SSIS 2008

    Hello,
    I have packages created in SSIS 2008 and I am trying to enable logging in them. I specified a SQL Server provider and gave it a working SQL Server DB connection as the configuration. I chose to log all the events from the Details tab, then I executed the package. It ran without errors, but no logging occured. Actually neither the logging table, nor the stored procedure that should perform the loggign were created. These exact steps used to work with SSIS 2005 and they'd generate the table, stored proc and start storing logging information. For testing, I also added to the same package logging options a text logging and a SQL Profiler log providers. These were created successfully and have logs entered in them. I tried different DB connections on different servers, but still the table and sp are not even getting created. Any ideas?
    Best Regards,
    Ketara

    Had the same problem. When I read the documentation Microsoft explicitly states that you must use an OLEDB provider for SQL Server logging. I checked, and mine was the "SQL Server Native Client" rather than the "Microsoft OLE DB Provider for
    SQL Server". When I switched out the driver, it worked. 
    The log table is under System Tables called: dbo.sysssislog
    The stored procedure that populates the table is under System Stored Procedures called: dbo.sp_ssis_addlogentry

  • How to perform Error Handling in this Bdc Code

    Hi,
    I had created this BDC for the tcode MB1B and i want to know how to perform the ERROR HANDLING in it ..
    Plzz provide me guidelines for doing it . here's d code:-
    report ZBDC_MB1B
           no standard page heading line-size 255.
    include bdcrecx1.
    data: begin of record OCCURS 0,
          WERKS_001(004),     "Plant
          MATNR_002(018),     "ItemId
          ERFMG_003(013),     "Quantity in Unit of Entry
          ERFME_004(003),     "Unit of Entry
          LGORT_005(004),     "Storage Location
          CHARG_006(010),     "BatchId
          KDAUF_007(010),     "Sales Order Number
          KDPOS_008(006),     "Item Number in Sales Order
          end of record.
    PARAMETERS : P_FILNAM LIKE RLGRAP-FILENAME.
      initialization.
      CTUMODE = 'A'.
      CUPDATE = 'A'.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FILNAM.
      CALL FUNCTION 'WS_FILENAME_GET'
       EXPORTING
         MASK                   = ',. '
         MODE                   = 'O'
         IMPORTING
         FILENAME                 = P_FILNAM
       EXCEPTIONS
         INV_WINSYS             = 1
         NO_BATCH               = 2
         SELECTION_CANCEL       = 3
         SELECTION_ERROR        = 4
         OTHERS                 = 5
      IF SY-SUBRC <> 0.
            MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
    start-of-selection.
    CALL FUNCTION 'WS_UPLOAD'
       EXPORTING
         FILENAME                      = P_FILNAM
         FILETYPE                      = 'DAT'
        TABLES
          DATA_TAB                     = RECORD
       EXCEPTIONS
         CONVERSION_ERROR              = 1
         FILE_OPEN_ERROR               = 2
         FILE_READ_ERROR               = 3
         INVALID_TYPE                  = 4
         NO_BATCH                      = 5
         UNKNOWN_ERROR                 = 6
         INVALID_TABLE_WIDTH           = 7
         GUI_REFUSE_FILETRANSFER       = 8
         CUSTOMER_ERROR                = 9
         NO_AUTHORITY                  = 10
         OTHERS                        = 11
    IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    LOOP AT RECORD.
      BEGIN OF SCREEN 1
    perform bdc_dynpro      using 'SAPMM07M' '0400'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'RM07M-SOBKZ'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    *perform bdc_field       using 'MKPF-BLDAT'
                                 '22.12.2008'.
    *perform bdc_field       using 'MKPF-BUDAT'
                                 '22.12.2008'.
    perform bdc_field       using 'RM07M-BWARTWA'
                                  '411'.
    perform bdc_field       using 'RM07M-SOBKZ'
                                  'E'.
    perform bdc_field       using 'RM07M-WERKS'
                                  RECORD-WERKS_001.             "Plant
    perform bdc_field       using 'XFULL'
                                  'X'.
    perform bdc_field       using 'RM07M-WVERS2'
                                  'X'.
      BEGIN OF SCREEN 2
    perform bdc_dynpro      using 'SAPMM07M' '0421'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSEG-CHARG(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '/00'.
    perform bdc_field       using 'MSEG-MATNR(01)'
                                  RECORD-MATNR_002.             "ITEMID
    perform bdc_field       using 'MSEG-ERFMG(01)'
                                  RECORD-ERFMG_003.             "QTY.
    perform bdc_field       using 'MSEG-ERFME(01)'
                                  RECORD-ERFME_004.             "UOM
    perform bdc_field       using 'MSEG-LGORT(01)'
                                  RECORD-LGORT_005.             "ST.LOC
    perform bdc_field       using 'MSEG-CHARG(01)'
                                  RECORD-CHARG_006.             "BATCHID
    perform bdc_field       using 'MSEGK-MAT_KDAUF'
                                  RECORD-KDAUF_007.             "S.O.
    perform bdc_field       using 'MSEGK-MAT_KDPOS'
                                  RECORD-KDPOS_008.             "S.O.LINE ITEM
    perform bdc_field       using 'DKACB-FMORE'
                                  'X'.
      BEGIN OF SCREEN 3
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_field       using 'DKACB-FMORE'
                                  'X'.
    perform bdc_dynpro      using 'SAPLKACB' '0002'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=ENTE'.
    perform bdc_dynpro      using 'SAPMM07M' '0421'.
    perform bdc_field       using 'BDC_CURSOR'
                                  'MSEG-ERFMG(01)'.
    perform bdc_field       using 'BDC_OKCODE'
                                  '=BU'.
    perform bdc_field       using 'DKACB-FMORE'
                                  'X'.
      BEGIN OF SCREEN 4
    perform bdc_dynpro      using   'SAPLKACB' '0002'.
    perform bdc_field       using      'BDC_OKCODE'
                                                '=ENTE'.
    perform bdc_transaction using 'MB1B'.
    ENDLOOP.

    hi,
    check this code in bold letters.
    INCLUDE BDCRECX1.
    TABLES : MARC.
    TYPES : BEGIN OF TY_UPLOAD,
            MATNR TYPE MARA-MATNR,
            WERKS TYPE MARC-WERKS,
            STEUC TYPE MARC-STEUC,
            END OF TY_UPLOAD.
    TYPES : BEGIN OF TY_MARC,
            MATNR TYPE MARA-MATNR,
            WERKS TYPE MARC-WERKS,
            END OF TY_MARC.
    TYPES : BEGIN OF TY_MTART,
            MATNR TYPE MARA-MATNR,
            MTART TYPE MARA-MTART,
            END OF TY_MTART.
    DATA : T_MARC TYPE STANDARD TABLE OF TY_MARC,
         : T_UPLOAD TYPE STANDARD TABLE OF TY_UPLOAD,
         : T_BASIC TYPE STANDARD TABLE OF TY_UPLOAD,
         : T_SALES TYPE STANDARD TABLE OF TY_UPLOAD,
         : T_ERROR TYPE STANDARD TABLE OF TY_UPLOAD.
    DATA : IT_BDCDATA LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
           IT_BDCDATA_VIEW LIKE BDCDATA OCCURS 0 WITH HEADER LINE,
           IT_DATA(3200) OCCURS 0 WITH HEADER LINE,
           IT_FIELD(3200) OCCURS 0 WITH HEADER LINE,
           IT_BDCMSG TYPE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA GI_MSG LIKE BDCMSGCOLL OCCURS 0 WITH HEADER LINE.
    DATA : CHAR1(500),
          CHAR2(500),
          CHAR3 TYPE STRING,
          V_SELECTION TYPE STRING.  " For View Selection
    DATA : W_MARC TYPE TY_MARC,
           WA_UPLOAD TYPE TY_UPLOAD,
           WA_BASIC TYPE TY_UPLOAD,
           WA_SALES TYPE TY_UPLOAD,
           WA_ERROR TYPE TY_UPLOAD,
           WA_MTART TYPE TY_MTART.
    DATA : VAR TYPE N,
           VAR1 TYPE STRING.
    SELECTION-SCREEN : BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.   "SELECTION SCREEN
    PARAMETERS: P_FNAM LIKE RLGRAP-FILENAME.
    PARAMETERS: P_BAS LIKE RLGRAP-FILENAME.
    PARAMETERS: P_SAL LIKE RLGRAP-FILENAME.
    PARAMETERS: P_ERR LIKE RLGRAP-FILENAME.
    SELECTION-SCREEN : END OF BLOCK B1.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_FNAM.
      PERFORM SEARCH USING P_FNAM.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_BAS.
      PERFORM SEARCH USING P_BAS.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_SAL.
      PERFORM SEARCH USING P_SAL.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR P_ERR.
      PERFORM SEARCH USING P_ERR.
    *&      Form  SEARCH
          text
         -->PFNAME     text
    FORM SEARCH USING PFNAME.
      CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
        EXPORTING
          STATIC    = 'X'
        CHANGING
          FILE_NAME = PFNAME.
    ENDFORM.                    "SEARCH
    START-OF-SELECTION.
      PERFORM UPLOAD_PROCESS USING P_FNAM.
      PERFORM OPEN_GROUP.
      PERFORM PROCESS.
      PERFORM CLOSE_GROUP.
      IF NOT T_BASIC[] IS INITIAL.
        PERFORM DOWNLOAD TABLES T_BASIC[] USING P_BAS .
      ENDIF.
      IF NOT T_SALES[] IS INITIAL.
        PERFORM DOWNLOAD TABLES T_SALES[] USING P_SAL .
      ENDIF.
      IF NOT T_ERROR[] IS INITIAL.
        PERFORM DOWNLOAD TABLES T_ERROR[] USING P_ERR.
      ENDIF.
    *&      Form  PROCESS
          text
    FORM PROCESS.
      LOOP AT T_UPLOAD INTO WA_UPLOAD.
        PERFORM CONV_ROUTINE  USING WA_UPLOAD-MATNR
                            CHANGING WA_UPLOAD-MATNR.
        SELECT COUNT(*) FROM MARA WHERE MATNR = WA_UPLOAD-MATNR.
        IF SY-SUBRC NE 0.
          MOVE-CORRESPONDING  WA_UPLOAD TO WA_BASIC.
          APPEND WA_BASIC TO T_BASIC.
          CLEAR WA_BASIC.
          CONTINUE.
        ENDIF.
        SELECT COUNT(*) FROM MARC WHERE MATNR = WA_UPLOAD-MATNR
                                        AND WERKS = WA_UPLOAD-WERKS
                                        AND PSTAT LIKE '%V%'.
        IF SY-SUBRC NE 0.
          MOVE-CORRESPONDING  WA_UPLOAD TO WA_SALES.
          APPEND WA_SALES TO T_SALES.
          CLEAR WA_SALES.
          CONTINUE.
        ENDIF.
        CLEAR : WA_MTART.
        SELECT SINGLE MATNR MTART FROM MARA INTO WA_MTART WHERE MATNR = WA_UPLOAD-MATNR.
        PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '0060'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RMMG1-MATNR'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=AUSW'.
        PERFORM BDC_FIELD       USING 'RMMG1-MATNR'
                                      WA_UPLOAD-MATNR.
        CALL FUNCTION 'MATERIAL_BTCI_SELECTION_NEW'     " Function module
        EXPORTING
          MATERIAL                  = WA_UPLOAD-MATNR  " Material number
          MATERIALART               = WA_MTART-MTART          " Material Type
          SELECTION                 = 'V'              "
          TCODE                     = 'MM02'           " Tcode where view's are called.
        TABLES
          BTCI_D0070                = IT_BDCDATA_VIEW
        EXCEPTIONS
          MATERIAL_NOT_FOUND        = 1
          MATERIAL_NUMBER_MISSING   = 2
          MATERIAL_TYPE_MISSING     = 3
          MATERIAL_TYPE_NOT_FOUND   = 4
          NO_ACTIVE_DYNPRO_SELECTED = 5
          NO_AUTHORITY              = 6
          OTHERS                    = 7.
        READ TABLE IT_BDCDATA_VIEW WITH KEY FVAL  = 'X'.
        IF SY-SUBRC = 0.
          V_SELECTION = IT_BDCDATA_VIEW-FNAM.
        ELSE.
          CONTINUE.
        ENDIF.
        VAR = IT_BDCDATA_VIEW-FNAM+17(2).
        VAR = VAR + 3.
        CONCATENATE 'MSICHTAUSW-KZSEL(' '0' VAR ')' INTO VAR1.
        PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '0070'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'MSICHTAUSW-DYTXT(06)'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=ENTR'.
        PERFORM BDC_FIELD       USING VAR1
                                       'X'.
        CLEAR VAR.
        CLEAR VAR1.
       PERFORM BDC_FIELD       USING 'MSICHTAUSW-KZSEL(06)'
                                     'X'.
        PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '0080'.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'RMMG1-VKORG'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=ENTR'.
        PERFORM BDC_FIELD       USING 'RMMG1-WERKS'
                                      WA_UPLOAD-WERKS.
        PERFORM BDC_DYNPRO      USING 'SAPLMGMM' '4004'.
        PERFORM BDC_FIELD       USING 'BDC_OKCODE'
                                      '=BU'.
       PERFORM BDC_FIELD       USING 'MAKT-MAKTX'
                                     'MTI_ESE_HALB_01'.
        PERFORM BDC_FIELD       USING 'MARC-STEUC'
                                      WA_UPLOAD-STEUC.
        PERFORM BDC_FIELD       USING 'BDC_CURSOR'
                                      'MARC-HERKR'.
        PERFORM BDC_FIELD       USING 'MARC-HERKL'
                                      'IN'.
        PERFORM BDC_FIELD       USING 'MARC-HERKR'
                                      'MAH'.
        PERFORM BDC_TRANSACTION USING 'MM02'.
    move the error record into seperate internal table nad down load it ****
        IF MESSTAB-MSGTYP = 'E'.
          MOVE-CORRESPONDING WA_UPLOAD TO WA_ERROR.
          APPEND WA_ERROR TO T_ERROR.
          CLEAR WA_ERROR.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "PROCESS
    *&      Form  UPLOAD_PROCESS
          text
         -->PFNAME     text
    FORM UPLOAD_PROCESS USING PFNAME.
      DATA : PFNAME1 TYPE STRING.
      PFNAME1 = PFNAME.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          FILENAME            = PFNAME1
          FILETYPE            = 'ASC'
          HAS_FIELD_SEPARATOR = 'X'
        TABLES
          DATA_TAB            = T_UPLOAD[].
      IF SY-SUBRC <> 0.
      ENDIF.
    ENDFORM.                    "UPLOAD_PROCESS
    *&      Form  CONV_ROUTINE
          text
         -->P_INPUT    text
         -->P_OUTPUT   text
    FORM CONV_ROUTINE   USING    P_INPUT
                     CHANGING P_OUTPUT.
      CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
        EXPORTING
          INPUT  = P_INPUT
        IMPORTING
          OUTPUT = P_OUTPUT.
    ENDFORM.                    "CONV_ROUTINE
    *&      Form  DOWNLOAD
          text
         -->GI_FINAL   text
         -->PFNAME     text
    FORM DOWNLOAD TABLES
                  GI_FINAL
                         USING  PFNAME .
      DATA : FNAME TYPE STRING.
      FNAME = PFNAME.
      CALL FUNCTION 'GUI_DOWNLOAD'
        EXPORTING
          FILENAME                        = FNAME
          FILETYPE                        = 'DAT'
         WRITE_FIELD_SEPARATOR           = 'x'
            HEADER                          = '00'
          IMPORTING
            FILELENGTH                      =
        TABLES
          DATA_TAB                        =  GI_FINAL[]
          FIELDNAMES                      = GI_FIELDNAMES[]
      IF SY-SUBRC = 0.
        MESSAGE 'FILE DOWNLOADED SUCCESSFULLY' TYPE 'I'.
      ENDIF.
    ENDFORM.                    " DOWNLOAD
    Regards
    Siva Prasad

  • Error-handling in PKGBUILDs is far from perfect

    Hi, PKGBUILDs should die on failure, rather than just continue regardless of errors. Here's a little rant:
    Why is it acceptable for ./configure to fail? Or make install to fail? Or the installation of just about any file? They could fail for lots of reasons, such as expecting a non-existent directory to exist, just being badly-written, or disk corruption, or running out of disk space. I see this lack of error-handling both in official packages and in the AUR.
    Failing on an error is a fundamental part of programming, and BASH makes a mockery of it. And then Linux developers seem to get brainwashed by BASH into believing that mixing important and non-important errors together, then just ignoring all the errors, is an acceptable programming practice. It's not - it's a comedy of errors (excuse the pun).
    SourceMage handles this problem by having one huge command constructed with && at the end of each line, so at least will fail on error.
    Gentoo is using its custom die command more often these days (|| die), but my proposal is in limbo, presumably because "SpanKY" overrules every other dev (little bit of Gentoo politics there ).
    The current practice of make || return 1 is correct, but || return 1 should be used far more often - example  (notice the looped use of install, and the annoyance of having to check $? after the loop). "More often" includes make install even if it's on the final line, both for consistency, and so it is not forgotten to be added when further lines are added to the end (e.g. to install the license/documentation files).
    I'll place this on flyspray after a bit of feedback.
    Edit: I'll distro-hop instead.
    Last edited by brebs (2008-04-21 13:55:33)

    I'm as guilty as anyone in this.  However, I always use it on the initial "configure" and "make install" lines where there is a lot of output.  I tend to miss it when installing individual files at the end (e.g. Licences, icons...) because I can see if they failed from the output.

  • Mapping and Error handling in Seeburger Adapters ?

    Hi,
    1.   In B2B integration part of PI.Whats the way of doing mapping in XI mapping editor and error handling in the mapping ?
    2. Do you think SEEBURGER BIC mapping designer is must for developing maps ? cant we develop same maps in XI mapping editor?
    Thanks and regards,
    Ram.
    Edited by: Ramakrishna kopparaju on Sep 30, 2008 12:27 PM

    Whats the way of doing mapping using seeburger adapters
    The standard mappings are part of Seeburger Suite and if any additional mapping has to be accommodated, then custom mapping could be developed in Seeburger BIC Mapper tool. This has to deployed on adapter engine then. The other mapping is the normal XI mapping (message, java, xsl) which could be performed based on business logic.
    error handling in the mapping ?
    The easiest way is to raise Alert based on the errors in mapping.
    Regards,
    Prateek

  • Error Handling for Background/Update Tasks (Transfer Order creation) - How?

    Hi,
    I have a standard process for creating a Transfer Order and 2 user-exits that I have implemented.
    The user exits are used to transfer information during Transfer Order creation.
    However, the user-exits also check data in table TVARV and other. As such, error handling needs to be implemented, since the T.O. might or might not go through, depending on data validation and related.
    However, the user-exits are implemented during creation, which is an update task that runs in the background. This makes it impossible to output any information or error messages.
    What else can be done in regards to outputting a message, since the user will need to see some sort of message that the process failed, that the T.O. didnu2019t confirm?  Can an SAP inbox message be created and how?
    Please help.
    Thank You,
    John

    Hi,
         Please check the following link for all the function modules and user exits on TOs.
    http://help.sap.com/saphelp_erp2005/helpdata/EN/c6/f83a294afa11d182b90000e829fbfe/content.htm
    Reward points if it was helpful.
    Regards
    Abhishek
    Edited by: Abhishek Raj on May 29, 2008 10:20 AM

  • Microsoft.SqlServer.ManagedDTS not recognized in SSIS 2008

    I recently got a new computer at work and when I open a script task in an SSIS project I get the following error:
    Error 4 Reference required to assembly 'Microsoft.SqlServer.ManagedDTS, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91' containing the type 'Microsoft.SqlServer.Dts.Runtime.Variables'. Add one to your project.
    I never got this error before with my previous machine. i surely don't need to add a reference in every script task do I?
    Thanks,
    Rich

    Rich,
    You open a project in VS 2010 perhaps and SSIS 2008 is not installed.
    By the way here I found a blog post about the error that covers it very well offering fixes:
    http://blogs.msdn.com/b/jason_howell/archive/2010/08/18/visual-studio-2010-solution-build-process-give-a-warning-about-indirect-dependency-on-the-net-framework-assembly-due-to-ssis-references.aspx
    Arthur My Blog

  • Client ABAP proxy error handling. Please help!

    Hi Experts,
       I have following scenario:
       SAP ECC (ABAP Client Proxy) -> PI(XI)-->(SOAP) Third party web service System
       This is Asynchronous.
       What will happen when ABAP client Proxy in ECC sends data to PI but PI is down?
       Will the message be queued in ECC? Can the queued message be processed automatically when PI is UP later?
       Please help.
    Thanks & Regards
    Gopal

    Hello Gopal,
    Correct, it should be an automatic entry into the queue!
    refer below for a detailed understanding!
    /people/arulraja.ma/blog/2006/08/18/xi-reliable-messaging-150-eoio-in-abap-proxies     XI: Reliable Messaging u2013 EOIO in ABAP Proxies
    /people/krishna.moorthyp/blog/2005/12/23/monitoring-for-processed-xml-messages-in-abap-proxy     Monitoring for Processed XML messages in ABAP Proxy
    Weblog to send Response from RFC to File in Asyn Mode Using Proxy [original link is broken]     Weblog to send Response from RFC to File in Asyn Mode Using Proxy
    /people/michal.krawczyk2/blog/2009/06/20/pixi-abap-proxies-say-goodbye-to-executeasynchronous-method     PI/XI: ABAP Proxies say goodbye to Execute_Asynchronous method
    /people/krishnakumar.ramamoorthy3/blog/2008/11/02/error-handling-framework-for-abap-proxies--part-1     Error handling framework for ABAP proxies - Part 1
    /people/krishnakumar.ramamoorthy3/blog/2008/12/19/error-handling-framework-for-abap-proxies--part-2     Error handling framework for ABAP proxies - Part 2
    Regards,
    Jilan

  • SSIS 2008 - Sending file with dynamic name using FTP task

    Hi  - Thanks for taking a look -  (I'm very new to SSIS.)
    I'm trying to create an SSIS 2008 package that does the following:
    1) Execute a stored procedure on SQL.
    2) Download the results as a CSV file to a 'local' location.  The file name is set using a variable ("User::LocalFilePath") dynamically based on the current time:
    @[User::LocalFilePath] + "GreatReportName_" + "_" +(DT_STR,4,1252) DatePart("yyyy",getdate()) + Right("0" + (DT_STR,4,1252) DatePart("m",getdate()),2) + "_" + Right("0"
    + (DT_STR,4,1252) DatePart("d",getdate()),2) + "_" + Right("0" + (DT_STR,4,1252) DatePart("hh",getdate()),2) +  "_" + Right("0" + (DT_STR,4,1252) DatePart("mi",getdate()),2)
    + "_" +  Right("0" + (DT_STR,4,1252) DatePart("ss",getdate()),2) + ".csv"
    3) Transfer the CSV file to an FTP site.
    4) Delete the CSV file from the 'local' location.
    I've been able to do steps 1 and 2 so far.  However when trying the move the newly created file to the FTP site I get the error:
    "Error: 0xC002917C at Send to FTP, FTP Task: The variable "User::LocalFilePath" doesn't contain file path(s)."
    (When I set the "IsLocalPathVariable" to "False" and use a file previously created the file is correctly transferred to the FTP site.  This proves that the FTP details are correct and that the "RemotePathVariabe" is working
    correctly.)
    I have set the variable ("User::LocalFilePath") to "EvaluateAsExpression" in the variable properties.
    Can anyone help?
    Many Thanks,
    UnoT

    Hi Vaibhav,
    Thanks for your response.  I set the "DelayValidation" to "True".  However
    that didn't make any difference.
    I added in all the breakpoints, but it didn't give any results (I may be doing this incorrectly?):
    Any other suggestions?
    Thanks,
    UnoT

  • Please suggest how can we verify file format using SSIS 2008 .

    We have ragged files placed in directory which need to be loaded into DB. Before loading we need to validate the file format before loading.
    The file schema is as follows.
    01 XREF_RCD.
    05 XR_JOB PIC X(4).
    05 XR_PHASE PIC X(2).
    05 XR_DATE PIC X(6).
    05 XR_ST_CHECK_NO PIC S9(8)
    05 XR_END_CHECK_NO PIC S9(8)
    05 XR_ST_SERIAL PIC S9(8)
    05 XR_END_SERIAL PIC S9(8)
    05 XR_AMOUNT PIC S9(7)V99
    05 XR_ISSUE_DATE PIC X(6).
    05 XR_CONTENT_FLAG PIC X.
    05 XR_XREF_CARD_PROCESSED PIC X.
    Could you please suggest how can we validate using SSIS 2008  and
    invalid value in header (alpha character for numeric field), more than 20% of records with errors, format is not correct also need to validated.

    Before we load the data we need to verify  invalid value in header (alpha character for numeric field),
    more than 20% of records with errors,
    format is not correct (values starting or ending in wrong position),  if the above validation pass then only the data can be loaded.  please suggest how can we achieve in SSIS .  The FileFormat and filedata is available below.  
    please find the file contents.
    49530110050230088937300889393008893730088939000036714100506
    54000110050230089190300894103008919030089410000066614100506
    73880110050230090564300907593009056430090759000104503100506
    73880110050230090564300907593009056430090759000104503100506
    45980110050230088829300888793008882930088879000033453100506
    58160110050230089820300898263008982030089826000058278100506
    41680110050130088623300886413008862330088641000035877100506
    41680110050241683471416834714168347141683471000000949100505
    82900110050230093642300936633009364230093663000069407100506
    54520110050230089411300894193008941130089419000048629100506
    83580110050230093664300936683009366430093668000083136100506
    56320110050230089556300895613008955630089561000073072100506
    74160110050230090760300907983009076030090798000099724100506
    57920110050230089562300895823008956230089582000079256100506
    45950110050230088649300888283008864930088828000185937100506
    81770110050230092335300928073009233530092807000118370100506
    70760110050230089827300899233008982730089923000083451100506
    74200110050230090799300908493009079930090849000047305100506
    84450110050230093699300937153009369930093715000076723100506
    83930110050230093669300936983009366930093698000043699100506
    75120110050230091002300910043009100230091004000034908100506
    10100110050230088620300886223008862030088622000194662100506
    79600110050230091402300914093009140230091409000119741100506
    58110110050230089583300897633008958330089763000140539100506
    58117710050230089764300897643008976430089764000047663100506
    52460110050230088940300891893008894030089189000097617100506
    48820110050230088928300889343008892830088934000142420100506
    48824110050230088935300889363008893530088936000144862100506
    82810110050230093510300936413009351030093641000156790100506
    76090110050230091060300911413009106030091141000111451100506
    74210110050230090850300909943009085030090994000130955100506
    75760110050230091030300910323009103030091032000075843100506
    File Layout
     XR_JOB PIC X(4).
     XR_PHASE PIC X(2).
     XR_DATE PIC X(6).
     XR_ST_CHECK_NO PIC S9(8) 
    XR_END_CHECK_NO PIC S9(8) 
    XR_ST_SERIAL PIC S9(8)
    XR_END_SERIAL PIC S9(8) 
    XR_AMOUNT PIC S9(7)V99 
    XR_ISSUE_DATE PIC X(6).
     XR_CONTENT_FLAG PIC X.
     XR_XREF_CARD_PROCESSED PIC X

  • Connection Manager Issue in SSIS 2008 version

    Hello Team,
    I'm facing weird issue in SSIS 2008 version. In one SSIS package, whenever I open the connection manager and point the DEV server abd test the connection it is working. When I open again, it is throwing the below error eventhough I have access to the database.
    "Test connection failed because of an error in initializing provider. Login failed for user"
    It's with Windows Authentication.
    Additional Details:
    Package configuration is disabled.
    Connection manager has expression which is gettiing the details from variables that has DEV server details.

    Are the variables having static values? or is the values getting passed through a parameter?
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to take control back from service error handler in osb

    I am using osb to send data to multiple services at the same time.since x query is a procedural language if any single operation fails the flow goes to service error handler which calls a BPEL webservice and logs the error in a database but the control doesnt comes back to my code I have tried everything including RESUME,REPLY operations but all in vain similarly i cannot use service callout call to my business service because its not allowing to select my BPEL wsdl operation

    If your statement "the control doesnt comes back to my code" means you expect that your xquery will continue in processing than your expectations are just too high. :-)
    Resume action is supposed to resume the next action in the message flow. It means the action that follows the action which caused an error.

Maybe you are looking for