Object variable not set error in SAP-VB Connect.

This is the coding part i have used for connecting SAP and VB for creating the Sales Order in SAP.
But it gives the error in the line
oheader.Value("DOC_TYPE") = Text1(0)
as Object variable or With block variable not set.
What could be the reason, pls advise me.
Dim bapictrl As Object
Dim boOrder As Object
Dim oPartner As Object
Dim oItemin As Object
Dim oheader As Object
Dim oreturn As Object
Dim oconnection As Object
Private Sub Command1_Click()
Dim x As String
oheader.Value("DOC_TYPE") = Text1(0)
oheader.Value("SALES_ORG") = Text1(1)
oheader.Value("DISTR_CHAN") = Text1(2)
oheader.Value("DIVISION") = Text1(3)
oheader.Value("PRICE_DATE") = Text1(4)
oheader.Value("PURCH_NO") = Text1(5)
oPartner.rows.Add
oPartner.Value(1, "PARTN_ROLE") = Text1(6)
oPartner.Value(1, "PARTN_NUMB") = Text1(7)
oItemin.rows.Add
oItemin.Value(1, "REQ_QTY") = Text1(8)
oItemin.Value(1, "MATERIAL") = Text1(9)
oItemin.Value(1, "COND_VALUE") = Text1(10)
boOrder.createfromdata orderheaderin:=oheader, orderitemsin:=oItemin, orderpartners:=oPartner, return:=oreturn
x = oreturn.Value("message")
If x = "" Then
MsgBox "Transactin Complete"
Else
MsgBox x
End If
End Sub
Private Sub Form_Load()
Text1(4) = Format(Now, "mm/dd/yyyy")
Set bapictrl = CreateObject("SAP.BAPI.1")
Set oconnection = bapictrl.Connection
oconnection.logon
Set boOrder = bapictrl.GetSAPObject("SalesOrder")
'Set boOrder = bapictrl.GetSAPObject("BUS2032")
Set oPartner = bapictrl.DimAs(boOrder, "CreateFromData", "orderpartners")
Set oPartner = bapictrl.DimAs(boOrder, "CreateFromData", "orderitemsin")
Set oPartner = bapictrl.DimAs(boOrder, "CreateFromData", "orderheaderin")
End Sub
Thanks in advance
Regards
Rajaram

Hi,
   This error occurred in the page where I used the file upload control. The control was working fine before. We tried installing entire PDK again and then applying the hotfix-1, but nothing worked and then I had to use an URL iview to invoke an ASP .Net application just for uploading the files.
Thanks
Swetha

Similar Messages

  • Object variable not set (Error 91) in Input Enabled query

    Hello,
    I'm having the following issue.  I have created an input enabled query and included it in a planning workbook.  Every time I open the workbook or query, and I got to an input enabled cell, I get the error below:
    Object variable not set (Error 91)
    This client has not used planning workbooks before.  The system is on 7.10 SP10 for Bex Analyzer and SAP Gui 7.10 Patch Level 13. 
    I'm not finding any relevant so far in SDN.  Any help anyone can provide is greatly appreciated.
    Thanks,
    Senthil

    Hello,
    Just wanted to let you all know that this issue has been resolved after updating my SAP Gui to 7.2 Patch Level 4 (Patch Level 5 was causing some other issues so I decided to stay at Level 4).
    Thanks,
    Senthil

  • Object reference not set error in SAP.Portal.Framework.Core.PortalWorkerReq

    Hi,
      I am using .Net PDK 1.0. I am often getting the error
    [NullReferenceException: Object reference not set to an instance of an object.]
       SAP.Portal.Framework.Core.PortalWorkerRequest.ReadEntityBody(Byte[] buffer, Int32 size) +119
       System.Web.HttpRequest.GetEntireRawContent() +327
       System.Web.HttpRequest.GetMultipartContent() +57
       System.Web.HttpRequest.FillInFormCollection() +244
       System.Web.HttpRequest.get_Form() +50
       System.Web.UI.Page.GetCollectionBasedOnMethod() +70
       System.Web.UI.Page.DeterminePostBackMode() +128
       System.Web.UI.Page.ProcessRequestMain() +63
    It is very errartic, sometimes the page gets loaded and at times I get this error. Could someone please tell me what causes this error?
    Thanks
    Swetha

    Hi,
       This error occurred in the page where I used the file upload control. The control was working fine before. We tried installing entire PDK again and then applying the hotfix-1, but nothing worked and then I had to use an URL iview to invoke an ASP .Net application just for uploading the files.
    Thanks
    Swetha

  • Object variable or With block variable not set error message

    When processing the Rate application I get a "Object variable or With block variable not set error message" What is causing this error and how do I fix it?

    Hi Brian,
    I'm afraid that in some ways this reply won't be very helpful though it may help you save some time. 
    The error message you describe is a very generic one thrown by Microsoft .NET (the programming platform that SAP is written with, see the link at the bottom of this message) and not being 'handled' by SAP. 
    This means from a SAP perspective that any one of many unrelated things may be causing the error and that it gives you virtually no help in tracking the problem down in SAP.
    We've plagued by this message quite a bit, my advice is to look for clues at to what may be happening elsewhere, e.g. try:
    1. The windows event viewer, if you are in a multi-server environment then check the event log on all machines.
    2. The SQL Server event log (this can be found in Management Studio - Management - SQL Server Logs assuming you're using SQL Server 2005)
    3. IIS logs, usually these are text files in the following location -
    HTTP.SYS Error Log - %windir%\System32\LogFiles\HTTPERR
    IIS Website Log - %windir%\System32\LogFiles\W3SVC#
    It is dull work trawling through all these places looking for error events with a timestamp similar to the time your error was encountered, but by doing this we've been able to troubleshoot some issues that otherwise would have taken us ages to rectify via trial and error.
    Sorry that there is no definitive answer, but if itu2019s of any help there's many more of us out there who this error message causes trouble for.
    Regards,
    Iain
    Microsoft "Object variable or With block variable not set" error message link:
    http://support.microsoft.com/kb/316478

  • "Object Variable or With Block Variable not set" Error on Adobe Presenter 8 Ribbon on PPT 2010/2007

    Returning back from Adobe training at KEDRIYA VIDYALAYA no 1  Jalhalli Bangalore when I started Powerpoint to use Adobe Presenter 8  I am getting : "Object Variable or With Block Variable not set " error on clicking any of the menu features of the Presenter Ribbon. My Config are :
    i)             WINDOWS XP SP 3
    ii)            POWERPOINT 2007 / 2010 ( for both same error is coming)
    iii)           MS XML Library 4.0 installed.
    iv)           Adobe Presenter 8
    I am using all liscenced copies of softwares.
    Hardware specs are also as per Minimum Adobe standards.
    I Have tried a lot removing Data Execution Prevention Mode , but all in vain the problem still exists
    Why is this happening. Please help.
    Kamal K Gupta
    PGT Comp. SC.
    KV No. 2 Srivijaya nagar

    This is not really a "Downloading, Installing, Setting Up" question; you may get better help if you ask in the Presenter forum.

  • Object variable or With block variable not set (Error 91)

    I am not a developer, however i have to help to run a VB program.
    when using a local administrator to run this program there will be error :
    Object variable or With block variable not set (Error 91)
    however using a DOMAIN Administrator to run without problem.
    any idea

    Do you have the source code? The error itself is a nullreference error. It means the code is trying to use some object to access a property of method of that object, but the object is currently null so it fails. The fact that it runs different when you run
    as a domain admin versus local admin could mean that it does something via a network location or resource, and when running as a domain admin, it has access to that resource and succeeds, but the local admin doesn't have access to the needed resource, and
    the code doesn't check to see if the object is null before using it. If you don't have the source code, then it will be difficult to fix, other than giving the local admin the ability to access whatever it is the program is looking to access.
    Matt Kleinwaks - MSMVP MSDN Forums Moderator - www.zerosandtheone.com

  • Importing existing worksheet yields "Object variable or With Block variable not set" error

    There is not much more to say.  I try to import the worksheet, but it gives that error.  I do not see anywhere I can enter VAB either.  FYI, I am working with SharePoint 2007 but there was no forum for that.

    Hi SAP collegues,
    At my site, BPC Excel created this problem too "Object Variable or With Block Variable not set" .
    It turned out that this is symptom of a a dys-functioning BPC COM Plug-in in XL2007 or XL2010!
    This is a consequence that your Excel recently crashed while using BPC. And it relates to an Excel Add-in becoming disabled when the applications crashes.  Please check the following.
    Note before doing the following, close all other open Excel and BPC sessions.
    Within Excel go to File à Options
    Select the Add-Ins option on the left
    Select the <<COM Add-ins >> option in the Manage drop down, and click Go
    Make sure that the Planning and Consolidation option is selected.  If not, mark this box and click OK.
    If you do not see anything listed, return to the Add-in screen and select the Disabled Items option, and see if Planning and Consolidation is listed there.
    Let me know if you have any queries,
    Kind Regards,
    robert ten bosch

  • "Object variable or With block variable not set" error

    I have Presenter 6.2 installed into PowerPoint 2007 on a XP
    operating system. I have successfully used this product a couple of
    months ago.
    Evidently now I am getting an Adobe Presenter error prompt
    that says "Object variable or With block variable not set" for
    every feature I click on in PP.
    I have reinstalled Presenter to see if that would fix it. It
    did not. I uninstalled/deleted it from my PC and then installed a
    fresh copy. I still get the same issue prompt.
    Has anyone experienced this and if so got any suggestions on
    how to fix it?

    I am having the same problem, and I have since I installed this  add-in a month ago, honestly I am wondering why people use this  product.  Others around me are not having this issue so I don't know  what is going on.
    I have called Adobe 3 times,
    I  tried uninstalling and re-installing Presenter - no luck
    I tried  disabling and enabling the add-in - no luck
    I updated to version  7.0.5, http://www.adobe.com/support/downloads/product.jsp?product=153&platform=Windows   (make sure you install 7.0.1, then 7.0.2, then 7.0.5 in this order)  still  had problems - but I did just find this post from 2009, and I am going  to try starting a new presentation (updates would not help a current  PP), which really is not great because I have a 60 slide class at this  time.
    http://forums.adobe.com/message/2332717#2332717
    Give  it a try and let me know if it works or if you find a solution!

  • Variable not set (error 91)/Error during import (error 102)/execut bat file

    We are on BO 11.5.0.0 and using the COM SDK with Visual Basic to run multiple reports (sometimes multiple flavors of the same report) through a bat file.
    If we run the reports single-threaded through the bat file, the reports run fine.  However, if multiple versions of the bat file start at approximately the same time, we get one of two errors:
    91 Object variable or With block variable not set
    102 Error during import document -
    Here's the part of the code with the problem:
    Dim BOapp As busobj.Application
    Dim receiveDoc As busobj.Document
    Set BOapp = New busobj.Application
    BOapp.Interactive = False
    BOapp.Logon strUser, strPass, strFromSystem, "Enterprise", False, False
    BOapp.Visible = False
    Set receiveDoc = BOapp.Documents.OpenFromEnterprise(strFromRep, strFromFolder, boFolder)
    receiveDoc.SaveAs (strDocumentPath & strFromRep & ".REP")
    Values for the following variables are passed in from the bat file:
    strUser
    strPass
    strFromSystem
    strFromRep
    strFromFolder
    strDocumentPath
    If it fails on the OpenFromEnterprise statement, we get the 102 error.
    If it fails on the SaveAs statement, we get the 91 error.
    Running it through debug hasn't helped, since we are running only one report.
    Any thoughts on what could be going wrong?
    Thanks in advance

    I have tried this running the VB code on my desktop (outside of the bat file) and nothing out of the ordinary occurs.  The VB code runs fine with only one occurrence.
    I had seen on other posts "ThisDocument" and didn't know if it would be applicable in this situation.  I also wasn't sure how it should be used based on the rest of my code.  Would "ThisDocument" make a difference?
    Thanks again

  • Object Reference Not Set error using CrystalReportViewer

    I have a web application in which I am attempting to use the CrystalReportViewer.  Using Visual Studio 2008, I was able to get the viewer to run and display reports just fine.  But since I moved to Visual Studio 2010, I've been unable to get it working again.  I reinstalled Crystal Reports for Visual Studio 2010 and the x64 runtime.  I created a test aspx page with just the following content:
    using CrystalDecisions.Web;
    public partial class Test : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)
             CrystalReportViewer Viewer = new CrystalReportViewer();
            Viewer.ID = "viewer";
            ph.Controls.Add( Viewer );
    When I load the page, I get this exception:
    NullReferenceException: Object reference not set to an instance of an object.
       CrystalDecisions.Web.ViewerGlobal.get_IsNetscape6Up() +88
       CrystalDecisions.Web.CrystalReportViewer.Render(HtmlTextWriter output) +83
    This is a server-side exception, so I'm pretty sure that my browser has nothing to do with it, but I've tried this in both Chrome and IE8.
    Do I have a screwy install?  Or is there something I'm neglecting to do to configure the ReportViewer that's new in 2010?
    Thanks for your help,
    -Steve

    I figured it out.
    I had already tried adding a new aspx page as David suggested before, and that did not work.  So this time I made a whole new "ASP.NET Crystal Reports Web Site" project in my solution, which was nice enough to make a default aspx page with a built in crystal report viewer tied to a new report .rpt file in the project.  And believe it or not, it worked flawlessly.
    The use of CrystalReportViewer was different but relatively equivalent in both cases.  So then I started analyzing the differences between this new project's web.config and mine.  After some painstaking troubleshooting, I determined the problem: someone on my team had added some new content to the web.config, which included these lines:
    <system.webServer>
      <modules>
        <remove name="Detector" />
        <add name="Detector" type="FiftyOne.Foundation.Mobile.Detection.DetectorModule, FiftyOne.Foundation"/>
      </modules>
    </system.webServer>
    I'm assuming that Crystal also uses a module called "Detector" in get_IsNetscape6Up(), and that this code was overriding that module.
    It's still not working quite right, but at least I'm past this error and on to the next one.
    I appreciate the help, Don and David!
    Thanks,
    -Steve

  • Error: Object variable or with variable not set while accessing

    Hi Friends,
    I am facing 'object variable or with variable not set' Error while opening BPC Excel.
    I have done, In Excel 2007, go to Excel Option -> Add-Ins -> Manage: COM Add-ins and Go...
    You look "BPC COM" disable and need enable again.
    But I am getting same Error message again and again. Please help me...
    I did BPC uninstall & install but still error massage poping
    Thank you in Advance

    Hi Kumar,
    I doubt if you are following the below steps. Please confirm. Thanks
    1. Open your normal Excel.
    2. Check for Planning and Consolidation tab on the top ribbon.
    3. I assume this wouldn't be available for you.
    4. If this is not present, open the Excel Options
    5. Click on Add-Ins and check the Active Application Add-ins
    6. Is Planning and consolidation present in it?
    7. If not, select "Disabled Add-ins" in the drop down below besides "Manage".
    8. Click "GO"
    9. Select the Planning and Consolidation add-in from disabled add-ins and "Enable" it.
    10. Check once again if this add-in is prersent in "Active" add-ins .
    11. Now close and re-open excel
    12. The Tab should be present now (Planning and Consolidation)
    Regards,
    Sanjeev

  • Object Variable or With block Variable not set-not fr Excel, from BPC Admin

    Hello everyone,
    Object Variable or With block Variable not set-not from Excel but from BPC Admin. 
    I searched the form and all posting/solutions talk about this error appearing from Excel. In my case it happens for BPC Admin - when I try to maintain dimension members.  I tried uninstalling and re-installing BPC client few times, processed all dimensions and tried pretty much all solutions posted here. Nothing worked (in BPC Admin). If anybody who came across this issue and solved it,
    can you please post the solution?
    Thanks
    Pals

    Hello Everyone,
       Thanks for all your possible solutions.  Here is the solution in case if you come across,
    "Object Variable or With block Variable not set" error from BPC Admin (not from Excel).
    Did some analysis with Basis administrator and found that there was an installation of MS Office 2010 component (not the full version. not sure how it got there since I do not have MS Office 2010) along with MS Office 2007. So,
    I un-installed MS Office 2010 component, MS Office 2007 and Planning and Consolidation client.
    Re-booted the laptop.
    Installed MS Office 2007 first. Re-booted.
    Installed Planning and Consolidation client. Re-booted.
    Started Planning and Consolidation Admin client. Clicked on Maintain Dimension members for a dimension. Dimension members displayed without any errors.
    Tried update, insert and delete of dimension members, worked fine.
    Thanks again All.
    -Pals

  • Error: Object variable or With block variable not set.

    Hi,
    when i try to fill the control tables and browse for the target period in HFM (sys 9.3.1) i get the error: Error: Object variable or With block variable not set.
    When browsing for the target value in the location for the value no problem occurs.
    Anybody a clue?

    Hi SAP collegues,
    At my site, BPC Excel created this problem too "Object Variable or With Block Variable not set" .
    It turned out that this is symptom of a a dys-functioning BPC COM Plug-in in XL2007 or XL2010!
    This is a consequence that your Excel recently crashed while using BPC. And it relates to an Excel Add-in becoming disabled when the applications crashes.  Please check the following.
    Note before doing the following, close all other open Excel and BPC sessions.
    Within Excel go to File à Options
    Select the Add-Ins option on the left
    Select the <<COM Add-ins >> option in the Manage drop down, and click Go
    Make sure that the Planning and Consolidation option is selected.  If not, mark this box and click OK.
    If you do not see anything listed, return to the Add-in screen and select the Disabled Items option, and see if Planning and Consolidation is listed there.
    Let me know if you have any queries,
    Kind Regards,
    robert ten bosch

  • Error: Object variable or with variable not set while accessing BPC Excel

    Hi,
    I am working on BPC NW 7.5. When I am trying to access BPC for Excel I am getting the below error.
    'object variable or with variable not set'
    When I click on BPC for Excel it ask for the credentials, after entering it we encounter this error.
    Any idea why is this happening?
    Regards,
    Priyanka Singh

    Hi Renne,
    Could you share me the solution to resolve the issue?
    I am getting an error "object variable or with block variable not set" while trying to submit data through an Input schedule.
    I am working on SAP BPC 7.0 NW and using MS Excel 2003.
    I can log in to BPC Admin and excel with my user id and password.
    Only when i am trying to click esubmit --> send and refresh schedules i am getting this error.
    I checked my security profile and i have the submit data task in my task profile.
    Following couple existing SDN postings i tried to check the ADD-INs of the excel on my system. However it looks like the steps listed in the existing SDN posts are for MS EXCEL 2007.
    Please suggest me how do i resolve this issue. Please note I am working on SAP BPC 7.0 NW and using MS Excel 2003.
    Regards,
    Jagat

  • Code 91 - Caused Error: (Object variable or With block variable not set)

    Hi,
    We are using FDM 9.3.1. We have enabled batch processing.
    We are having following process being followed
    - Batch Loader script will pull the data from dwh table for each entity, scenario, year and period
    - Batch processing is set to serial and processlevel set to Up-To-Check
    - We had following five files created for Location - EMAFF100
    i. 1_EMAFF100_ACT_May-2011_RR.txt
    ii. 1_EMAFF100_ACT_Jun-2011_RR.txt
    iii. 1_EMAFF100_ACT_Jul-2011_RR.txt
    iv. 1_EMAFF100_ACT_Aug-2011_RR.txt
    v. 1_EMAFF100_ACT_Sep-2011_RR.txt
    Batch loader process completed the processing for May - 2011, Jul - 2011, Aug-2011, Sep-2011.
    But for Jun 2011 it has given the following error in the 'tbatchinformation' table and failed at import stage.
    40751.6239236111 1_EMAFF100_ACT_JUN-2011_RR.TXT 2 2 91-Object variable or With block variable not set
    When we checked the view error log from tool menu we found following
    ** Begin FDM Runtime Error Log Entry [2011-07-27-14:58:29] **
    ERROR:
    Code......................................... 91
    Description.................................. File [1_EMAFF100_ACT_Jun-2011_RR.txt] Caused Error: (Object variable or With block variable not set)
    Procedure.................................... clsBatchLoader.mFileCollectionProcess
    Component.................................... upsWBatchLoaderDM
    Version...................................... 931
    Thread....................................... 5600
    IDENTIFICATION:
    User......................................... ncreighton
    Computer Name................................ HYAPSDEV1
    App Name..................................... EMATTEST
    Client App................................... WebClient
    CONNECTION:
    Provider..................................... ORAOLEDB.ORACLE
    Data Server..................................
    Database Name................................ hydev_serv
    Trusted Connect.............................. False
    Connect Status.. Connection Open
    GLOBALS:
    Location..................................... EMAFF100
    Location ID.................................. 762
    Location Seg................................. 16
    Category..................................... ACT
    Category ID.................................. 13
    Period....................................... Jun - 2011
    Period ID.................................... 30/06/2011
    POV Local.................................... False
    Language..................................... 1033
    User Level................................... 1
    All Partitions............................... False
    Is Auditor................................... False
    We then re submitted data for Jun period and saw batch process got successfully completed and June data got imported successfully and also rest other processes got through.
    Can any one provide exact cause for this error? As we have automated the data load from DWH to FDM And then to HFM. Hence when such error comes it disturbs lot of processing there on. Appreciate your early response.
    Thanks in advance.

    Hi SAP collegues,
    At my site, BPC Excel created this problem too "Object Variable or With Block Variable not set" .
    It turned out that this is symptom of a a dys-functioning BPC COM Plug-in in XL2007 or XL2010!
    This is a consequence that your Excel recently crashed while using BPC. And it relates to an Excel Add-in becoming disabled when the applications crashes.  Please check the following.
    Note before doing the following, close all other open Excel and BPC sessions.
    Within Excel go to File à Options
    Select the Add-Ins option on the left
    Select the <<COM Add-ins >> option in the Manage drop down, and click Go
    Make sure that the Planning and Consolidation option is selected.  If not, mark this box and click OK.
    If you do not see anything listed, return to the Add-in screen and select the Disabled Items option, and see if Planning and Consolidation is listed there.
    Let me know if you have any queries,
    Kind Regards,
    robert ten bosch

Maybe you are looking for

  • No Data to display in Application failure report for a specific Application

    Hi , For a specific application,Application failure report showing no data to display but for the same application other reports shows value. Application failure reports seems to work fine for some other application except few.Need to know the root c

  • Using static variable in orchestration for each message

    Once a file is dropped to our Biztalk server I am capturing data from each message. However, I need to assign a batchID for this file that I will write to the database along with the data. How do I build my orchestration so that the code I'm using to

  • ITunes Software Update Does Not Work

    In iTunes v 10.5.3.3 I click on Help, Check For Updates.  iTunes responds with "A new version of iTunes (10.6) is available.  Would you like to download it now?".  I click on "Download iTunes". The "Apple Software Update" Dialog Box appears but iTune

  • Multiple subreports within a single main report?

    I'm a newbie to BI Publisher, but have used Crystal Reports quite a lot. I have a requirement which essentially consists of a set of 7 similar and closely related reports, each using a different SQL Select statement and printing different columns; th

  • Problems with flash reader, flash reader

    problems with flash reader, flash reader