<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Object variable not set error in SAP-VB Connect. in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/object-variable-not-set-error-in-sap-vb-connect/m-p/3324899#M796457</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hope someone can help with this... I have discovered that systems with SAP GUI 7.2 installed properly recognize oHeader.Value("DOC_TYPE")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, my system, with SAPGUI 7.4 installed does not!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would still like to used named object references, but if they're unreliable, where can we turn?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Jul 2015 17:56:24 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2015-07-01T17:56:24Z</dc:date>
    <item>
      <title>Object variable not set error in SAP-VB Connect.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/object-variable-not-set-error-in-sap-vb-connect/m-p/3324898#M796456</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This is the coding part i have used for connecting SAP and VB for creating the Sales Order in SAP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But it gives the error in the line &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;oheader.Value("DOC_TYPE") = Text1(0)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;as Object variable or With block variable not set.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What could be the reason, pls advise me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim bapictrl As Object&lt;/P&gt;&lt;P&gt;Dim boOrder As Object&lt;/P&gt;&lt;P&gt;Dim oPartner As Object&lt;/P&gt;&lt;P&gt;Dim oItemin As Object&lt;/P&gt;&lt;P&gt;Dim oheader As Object&lt;/P&gt;&lt;P&gt;Dim oreturn As Object&lt;/P&gt;&lt;P&gt;Dim oconnection As Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Private Sub Command1_Click()&lt;/P&gt;&lt;P&gt;Dim x As String&lt;/P&gt;&lt;P&gt;oheader.Value("DOC_TYPE") = Text1(0)&lt;/P&gt;&lt;P&gt;oheader.Value("SALES_ORG") = Text1(1)&lt;/P&gt;&lt;P&gt;oheader.Value("DISTR_CHAN") = Text1(2)&lt;/P&gt;&lt;P&gt;oheader.Value("DIVISION") = Text1(3)&lt;/P&gt;&lt;P&gt;oheader.Value("PRICE_DATE") = Text1(4)&lt;/P&gt;&lt;P&gt;oheader.Value("PURCH_NO") = Text1(5)&lt;/P&gt;&lt;P&gt;oPartner.rows.Add&lt;/P&gt;&lt;P&gt;oPartner.Value(1, "PARTN_ROLE") = Text1(6)&lt;/P&gt;&lt;P&gt;oPartner.Value(1, "PARTN_NUMB") = Text1(7)&lt;/P&gt;&lt;P&gt;oItemin.rows.Add&lt;/P&gt;&lt;P&gt;oItemin.Value(1, "REQ_QTY") = Text1(8)&lt;/P&gt;&lt;P&gt;oItemin.Value(1, "MATERIAL") = Text1(9)&lt;/P&gt;&lt;P&gt;oItemin.Value(1, "COND_VALUE") = Text1(10)&lt;/P&gt;&lt;P&gt;boOrder.createfromdata orderheaderin:=oheader, orderitemsin:=oItemin, orderpartners:=oPartner, return:=oreturn&lt;/P&gt;&lt;P&gt;x = oreturn.Value("message")&lt;/P&gt;&lt;P&gt;If x = "" Then&lt;/P&gt;&lt;P&gt;MsgBox "Transactin Complete"&lt;/P&gt;&lt;P&gt;Else&lt;/P&gt;&lt;P&gt;MsgBox x&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Private Sub Form_Load()&lt;/P&gt;&lt;P&gt;Text1(4) = Format(Now, "mm/dd/yyyy")&lt;/P&gt;&lt;P&gt;Set bapictrl = CreateObject("SAP.BAPI.1")&lt;/P&gt;&lt;P&gt;Set oconnection = bapictrl.Connection&lt;/P&gt;&lt;P&gt;oconnection.logon&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set boOrder = bapictrl.GetSAPObject("SalesOrder")&lt;/P&gt;&lt;P&gt;'Set boOrder = bapictrl.GetSAPObject("BUS2032")&lt;/P&gt;&lt;P&gt;Set oPartner = bapictrl.DimAs(boOrder, "CreateFromData", "orderpartners")&lt;/P&gt;&lt;P&gt;Set oPartner = bapictrl.DimAs(boOrder, "CreateFromData", "orderitemsin")&lt;/P&gt;&lt;P&gt;Set oPartner = bapictrl.DimAs(boOrder, "CreateFromData", "orderheaderin")&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Rajaram&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jan 2008 09:14:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/object-variable-not-set-error-in-sap-vb-connect/m-p/3324898#M796456</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-30T09:14:46Z</dc:date>
    </item>
    <item>
      <title>Re: Object variable not set error in SAP-VB Connect.</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/object-variable-not-set-error-in-sap-vb-connect/m-p/3324899#M796457</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I hope someone can help with this... I have discovered that systems with SAP GUI 7.2 installed properly recognize oHeader.Value("DOC_TYPE")&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But, my system, with SAPGUI 7.4 installed does not!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I would still like to used named object references, but if they're unreliable, where can we turn?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Jul 2015 17:56:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/object-variable-not-set-error-in-sap-vb-connect/m-p/3324899#M796457</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2015-07-01T17:56:24Z</dc:date>
    </item>
  </channel>
</rss>

