Skip to Content

Bug with answer file access for VBA API RunPackage

I am working with EPM SP27 patch 2 and trying to implement RunPackage API to pass answer prompt to DM package. Everything correctly but I am unable to delete answer file after RunPackage execution.

    epmDM.RunPackage epmDMPackage, strAnswerFileName
    Kill strAnswerFileName

The file strAnswerFileName is still open after RunPackage execution!

After decompile of EPM code in ILSpy I can see the reason:

Public Sub RunPackage(package As IADMPackage, filename As String)
    Try
        SAPModuleNameInspectorBehavior.ModuleOverride = "DataManager"
        If package Is Nothing Then
            Throw New InvalidArgException(String.Format(Resources.ExceptionParameterIsNull, "package"))
        End If
        package.CheckParameters()
        If filename Is Nothing Then
            Throw New InvalidArgException(String.Format(Resources.ExceptionParameterIsNull, "filename"))
        End If
        If filename.Trim() = "" Then
            Throw New InvalidArgException(String.Format(Resources.ExceptionPropertyOfObjectIsAnEmptyString, MyBase.[GetType]().ToString(), "filename"))
        End If
        Try
            Dim fi As System.IO.FileInfo = New System.IO.FileInfo(filename)
            If Not fi.Exists Then
                Throw New InvalidArgException("File doesn't exists")
            End If
            Dim fs As System.IO.FileStream = fi.OpenRead()
            Dim sr As System.IO.StreamReader = New System.IO.StreamReader(fs)
            Dim content As String = sr.ReadToEnd()
            ...

But I don't see sr.Close until the end of procedure

Looks like bug!

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Aug 31 at 06:35 PM

    Even with introduction of DataManagerAdvancedRunPackage in EPM SP 29 Patch 01 it's still not possible to delete answer file immediately after package run. Same lock.

    Add comment
    10|10000 characters needed characters exceeded

  • Sep 21 at 11:25 PM

    Bug is STILL there as of 2.6.100.78647

    Add comment
    10|10000 characters needed characters exceeded