<?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 How to update user group by using BAPI ActiveX Control ? in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-user-group-by-using-bapi-activex-control/m-p/6417180#M1408699</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm new to ABAP.  I'm trying to use BAPI ActiveX Control to update all users'  group information. So I write a simple VBScript to test. Below is the code.  After running below code I found the user's group was not changed, but in the return structure it showed "User MyUserID is changed".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you help to see how to correct below code ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub ChangeUser()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim oBAPICtrl      &lt;/P&gt;&lt;P&gt;Dim oConnection      &lt;/P&gt;&lt;P&gt;Dim Logon            &lt;/P&gt;&lt;P&gt;Dim oUser &lt;/P&gt;&lt;P&gt;Dim oReturn As Object&lt;/P&gt;&lt;P&gt;Dim oGroups As Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set oBAPICtrl = CreateObject("SAP.BAPI.1")&lt;/P&gt;&lt;P&gt;Set oConnection = oBAPICtrl.Connection&lt;/P&gt;&lt;P&gt;If oConnection.Logon(0, False) &amp;lt;&amp;gt; True Then    'Logon With Dialog&lt;/P&gt;&lt;P&gt;      Set oConnection = Nothing&lt;/P&gt;&lt;P&gt;      Logon = False&lt;/P&gt;&lt;P&gt;      MsgBox "No access to R/3 System", vbOKOnly, APPID&lt;/P&gt;&lt;P&gt;Else&lt;/P&gt;&lt;P&gt;     Logon = True&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set oUser = oBAPICtrl.GetSAPObject("user", "MyUserID")&lt;/P&gt;&lt;P&gt;Set oGroups = oBAPICtrl.DimAs(oUser, "Change", "Groups")&lt;/P&gt;&lt;P&gt;oGroups.Rows.Add&lt;/P&gt;&lt;P&gt;oGroups.Value(1, 1) = "MyGroup"&lt;/P&gt;&lt;P&gt;oUser.Change  Groups = oGroups, return:=oReturn&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;oConnection.logoff&lt;/P&gt;&lt;P&gt;Set oUser = Nothing&lt;/P&gt;&lt;P&gt;Set oReturn = Nothing&lt;/P&gt;&lt;P&gt;Set oGroup = Nothing&lt;/P&gt;&lt;P&gt;Set oConnection = Nothing&lt;/P&gt;&lt;P&gt;Set oBAPICtrl = Nothing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Baoyan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 Dec 2009 07:51:40 GMT</pubDate>
    <dc:creator>former_member624416</dc:creator>
    <dc:date>2009-12-16T07:51:40Z</dc:date>
    <item>
      <title>How to update user group by using BAPI ActiveX Control ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-user-group-by-using-bapi-activex-control/m-p/6417180#M1408699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Gurus,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm new to ABAP.  I'm trying to use BAPI ActiveX Control to update all users'  group information. So I write a simple VBScript to test. Below is the code.  After running below code I found the user's group was not changed, but in the return structure it showed "User MyUserID is changed".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you help to see how to correct below code ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sub ChangeUser()&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim oBAPICtrl      &lt;/P&gt;&lt;P&gt;Dim oConnection      &lt;/P&gt;&lt;P&gt;Dim Logon            &lt;/P&gt;&lt;P&gt;Dim oUser &lt;/P&gt;&lt;P&gt;Dim oReturn As Object&lt;/P&gt;&lt;P&gt;Dim oGroups As Object&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set oBAPICtrl = CreateObject("SAP.BAPI.1")&lt;/P&gt;&lt;P&gt;Set oConnection = oBAPICtrl.Connection&lt;/P&gt;&lt;P&gt;If oConnection.Logon(0, False) &amp;lt;&amp;gt; True Then    'Logon With Dialog&lt;/P&gt;&lt;P&gt;      Set oConnection = Nothing&lt;/P&gt;&lt;P&gt;      Logon = False&lt;/P&gt;&lt;P&gt;      MsgBox "No access to R/3 System", vbOKOnly, APPID&lt;/P&gt;&lt;P&gt;Else&lt;/P&gt;&lt;P&gt;     Logon = True&lt;/P&gt;&lt;P&gt;End If&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Set oUser = oBAPICtrl.GetSAPObject("user", "MyUserID")&lt;/P&gt;&lt;P&gt;Set oGroups = oBAPICtrl.DimAs(oUser, "Change", "Groups")&lt;/P&gt;&lt;P&gt;oGroups.Rows.Add&lt;/P&gt;&lt;P&gt;oGroups.Value(1, 1) = "MyGroup"&lt;/P&gt;&lt;P&gt;oUser.Change  Groups = oGroups, return:=oReturn&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;oConnection.logoff&lt;/P&gt;&lt;P&gt;Set oUser = Nothing&lt;/P&gt;&lt;P&gt;Set oReturn = Nothing&lt;/P&gt;&lt;P&gt;Set oGroup = Nothing&lt;/P&gt;&lt;P&gt;Set oConnection = Nothing&lt;/P&gt;&lt;P&gt;Set oBAPICtrl = Nothing&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;End Sub&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Baoyan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 07:51:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-user-group-by-using-bapi-activex-control/m-p/6417180#M1408699</guid>
      <dc:creator>former_member624416</dc:creator>
      <dc:date>2009-12-16T07:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to update user group by using BAPI ActiveX Control ?</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-user-group-by-using-bapi-activex-control/m-p/6417181#M1408700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Solved problem by checking the BAPI  user.change, and found that one parameter was missed: Groupsx. This parameter indicates whether to update the corresponding data. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By adding this parameter, data update is ok now.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2009 16:34:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/how-to-update-user-group-by-using-bapi-activex-control/m-p/6417181#M1408700</guid>
      <dc:creator>former_member624416</dc:creator>
      <dc:date>2009-12-16T16:34:58Z</dc:date>
    </item>
  </channel>
</rss>

