<?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: JCO adding role to user with BAPI_USER_ACTGROUPS_ASSIGN in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/jco-adding-role-to-user-with-bapi-user-actgroups-assign/m-p/7694322#M1577281</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Read tables with RFC_READ_TABLE----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;   Dim i, j As Integer&lt;/P&gt;&lt;P&gt;  '-Get repository instance----&lt;/P&gt;&lt;HR originaltext="------------------------------------------" /&gt;&lt;P&gt;    Dim repos As JCoRepository&lt;/P&gt;&lt;P&gt;    Set repos = dest.getRepository()&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  '-Define function----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------" /&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    Dim func As JCoFunction&lt;/P&gt;&lt;P&gt;    Set func = repos.getFunction("RFC_READ_TABLE")&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;  '-Set arguments for function----&lt;/P&gt;&lt;HR originaltext="---------------------------------------" /&gt;&lt;P&gt;    func.getImportParameterList().setValue("QUERY_TABLE", "SFLIGHT")&lt;/P&gt;&lt;P&gt;    func.getImportParameterList().setValue("DELIMITER", "~")&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;  '-Execute function----&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------" /&gt;&lt;P&gt;    com#sap#conn#jco#JCoContext.begin(dest)&lt;/P&gt;&lt;P&gt;      func.execute(dest)&lt;/P&gt;&lt;P&gt;    com#sap#conn#jco#JCoContext.end(dest)&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;  '-Get field names----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------" /&gt;&lt;P&gt;    Dim fields As JCoTable&lt;/P&gt;&lt;P&gt;    Set fields = func.getTableParameterList().getTable("FIELDS")&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;    Dim fcnt As Integer&lt;/P&gt;&lt;P&gt;    fcnt = fields.getNumRows() - 1&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;    '-Set field names as header in the grid----&lt;/P&gt;&lt;HR originaltext="--------------------------" /&gt;&lt;P&gt;      For i = 0 To fcnt&lt;/P&gt;&lt;P&gt;        fields.setRow(i)&lt;/P&gt;&lt;P&gt;        Form1.Grid.Header(i) = fields.getString("FIELDNAME")&lt;/P&gt;&lt;P&gt;        Form1.Grid.Refresh&lt;/P&gt;&lt;P&gt;      Next&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;  '-Get table content----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------" /&gt;&lt;P&gt;    Dim table As JCoTable&lt;/P&gt;&lt;P&gt;    Set table = func.getTableParameterList().getTable("DATA")&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;    Dim cnt As Integer&lt;/P&gt;&lt;P&gt;    cnt = table.getNumRows()&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;    Dim felder(0 To fcnt) As String&lt;/P&gt;&lt;P&gt;    '-Set table in the grid----&lt;/P&gt;&lt;HR originaltext="------------------------------------------" /&gt;&lt;P&gt;      For i = 0 To cnt - 1&lt;/P&gt;&lt;P&gt;        table.setRow(i)&lt;/P&gt;&lt;P&gt;        felder = table.getString("WA").split("~")   &lt;/P&gt;&lt;P&gt;        For j = 0 To fcnt - 1&lt;/P&gt;&lt;P&gt;          Form1.Grid.TextMatrix(i, j) = felder(j)&lt;/P&gt;&lt;P&gt;        Next&lt;/P&gt;&lt;P&gt;      Next&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.vogella.de/articles/SAPJCo/article.html" target="test_blank"&gt;http://www.vogella.de/articles/SAPJCo/article.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Check there are some links available. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madhu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 12 Feb 2011 05:47:24 GMT</pubDate>
    <dc:creator>madhu_vadlamani</dc:creator>
    <dc:date>2011-02-12T05:47:24Z</dc:date>
    <item>
      <title>JCO adding role to user with BAPI_USER_ACTGROUPS_ASSIGN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/jco-adding-role-to-user-with-bapi-user-actgroups-assign/m-p/7694320#M1577279</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using JCo to create a user and then add a role to that new user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm guessing I can use BAPI_USER_ACTGROUPS_ASSIGN to do the role assignment part.  But I'm not sure how this works.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have something like this:&lt;/P&gt;&lt;P&gt;JCoFunction roleAssign = connect.getFunction("BAPI_USER_ACTGROUPS_ASSIGN");&lt;/P&gt;&lt;P&gt;JCoParameterList user_info = roleAssign.getImportParameterList();&lt;/P&gt;&lt;P&gt;roleAssign.getImportParameterList().setValue( "USERNAME", "user1");&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can see that PARAMETERS 'INPUT' only takes 1 value for USERNAME, so how do I pass in the ACTIVITYGROUPS table like the documentation seem to suggest?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Feb 2011 01:53:43 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/jco-adding-role-to-user-with-bapi-user-actgroups-assign/m-p/7694320#M1577279</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-08T01:53:43Z</dc:date>
    </item>
    <item>
      <title>Re: JCO adding role to user with BAPI_USER_ACTGROUPS_ASSIGN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/jco-adding-role-to-user-with-bapi-user-actgroups-assign/m-p/7694321#M1577280</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;anyone?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 11 Feb 2011 23:13:33 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/jco-adding-role-to-user-with-bapi-user-actgroups-assign/m-p/7694321#M1577280</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-11T23:13:33Z</dc:date>
    </item>
    <item>
      <title>Re: JCO adding role to user with BAPI_USER_ACTGROUPS_ASSIGN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/jco-adding-role-to-user-with-bapi-user-actgroups-assign/m-p/7694322#M1577281</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Read tables with RFC_READ_TABLE----&lt;/P&gt;&lt;HR originaltext="------------------------------------" /&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;   Dim i, j As Integer&lt;/P&gt;&lt;P&gt;  '-Get repository instance----&lt;/P&gt;&lt;HR originaltext="------------------------------------------" /&gt;&lt;P&gt;    Dim repos As JCoRepository&lt;/P&gt;&lt;P&gt;    Set repos = dest.getRepository()&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;P&gt;  '-Define function----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------" /&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;    Dim func As JCoFunction&lt;/P&gt;&lt;P&gt;    Set func = repos.getFunction("RFC_READ_TABLE")&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;  '-Set arguments for function----&lt;/P&gt;&lt;HR originaltext="---------------------------------------" /&gt;&lt;P&gt;    func.getImportParameterList().setValue("QUERY_TABLE", "SFLIGHT")&lt;/P&gt;&lt;P&gt;    func.getImportParameterList().setValue("DELIMITER", "~")&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;  '-Execute function----&lt;/P&gt;&lt;HR originaltext="-------------------------------------------------" /&gt;&lt;P&gt;    com#sap#conn#jco#JCoContext.begin(dest)&lt;/P&gt;&lt;P&gt;      func.execute(dest)&lt;/P&gt;&lt;P&gt;    com#sap#conn#jco#JCoContext.end(dest)&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;  '-Get field names----&lt;/P&gt;&lt;HR originaltext="--------------------------------------------------" /&gt;&lt;P&gt;    Dim fields As JCoTable&lt;/P&gt;&lt;P&gt;    Set fields = func.getTableParameterList().getTable("FIELDS")&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;    Dim fcnt As Integer&lt;/P&gt;&lt;P&gt;    fcnt = fields.getNumRows() - 1&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;    '-Set field names as header in the grid----&lt;/P&gt;&lt;HR originaltext="--------------------------" /&gt;&lt;P&gt;      For i = 0 To fcnt&lt;/P&gt;&lt;P&gt;        fields.setRow(i)&lt;/P&gt;&lt;P&gt;        Form1.Grid.Header(i) = fields.getString("FIELDNAME")&lt;/P&gt;&lt;P&gt;        Form1.Grid.Refresh&lt;/P&gt;&lt;P&gt;      Next&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;  '-Get table content----&lt;/P&gt;&lt;HR originaltext="------------------------------------------------" /&gt;&lt;P&gt;    Dim table As JCoTable&lt;/P&gt;&lt;P&gt;    Set table = func.getTableParameterList().getTable("DATA")&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;    Dim cnt As Integer&lt;/P&gt;&lt;P&gt;    cnt = table.getNumRows()&lt;/P&gt;&lt;P&gt;   &lt;/P&gt;&lt;P&gt;    Dim felder(0 To fcnt) As String&lt;/P&gt;&lt;P&gt;    '-Set table in the grid----&lt;/P&gt;&lt;HR originaltext="------------------------------------------" /&gt;&lt;P&gt;      For i = 0 To cnt - 1&lt;/P&gt;&lt;P&gt;        table.setRow(i)&lt;/P&gt;&lt;P&gt;        felder = table.getString("WA").split("~")   &lt;/P&gt;&lt;P&gt;        For j = 0 To fcnt - 1&lt;/P&gt;&lt;P&gt;          Form1.Grid.TextMatrix(i, j) = felder(j)&lt;/P&gt;&lt;P&gt;        Next&lt;/P&gt;&lt;P&gt;      Next&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.vogella.de/articles/SAPJCo/article.html" target="test_blank"&gt;http://www.vogella.de/articles/SAPJCo/article.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Check there are some links available. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Madhu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 12 Feb 2011 05:47:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/jco-adding-role-to-user-with-bapi-user-actgroups-assign/m-p/7694322#M1577281</guid>
      <dc:creator>madhu_vadlamani</dc:creator>
      <dc:date>2011-02-12T05:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: JCO adding role to user with BAPI_USER_ACTGROUPS_ASSIGN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/jco-adding-role-to-user-with-bapi-user-actgroups-assign/m-p/7694323#M1577282</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry but I'm not sure why reading in some fileds in the SFLIGHT table would help me solve my problem?  I'm asking about how to use JCo to add a role to my user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The link you provided is what got me started.  It doesn't contain the answer to my question either.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Feb 2011 19:33:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/jco-adding-role-to-user-with-bapi-user-actgroups-assign/m-p/7694323#M1577282</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-14T19:33:48Z</dc:date>
    </item>
    <item>
      <title>Re: JCO adding role to user with BAPI_USER_ACTGROUPS_ASSIGN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/jco-adding-role-to-user-with-bapi-user-actgroups-assign/m-p/7694324#M1577283</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt; Sorry but I'm not sure why reading in some fileds in the SFLIGHT table would help me solve my problem?  I'm asking about how to use JCo to add a role to my user.&lt;/P&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;P&gt;&amp;gt; The link you provided is what got me started.  It doesn't contain the answer to my question either.&lt;/P&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;He has provided a sample code for another RFC call RFC_READ_TABLE which has got a table parameter 'FIELDS' just like your BAPI BAPI_USER_ACTGROUPS_ASSIGN has got a table parameter ACTIVITYGROUPS.. I presume, He has shown how it must be filled for a sample RFC and you can probably use that as a basis... I assume that you are familiar with jco tables and know how to fill those tables.. If not check out the links below, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ACTIVITY groups table has following fields AGR_NAME , FROM_DAT and TO_DAT which must be filled.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also you can google and see if there are sample code for filling in the JCO table and calling a BAPI (i saw a example for BAPI_MATERIAL_GETLIST)&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.google.com/search?q=jco" target="test_blank"&gt;http://www.google.com/search?q=jco&lt;/A&gt;&lt;EM&gt;table&lt;/EM&gt;example&amp;amp;hl=en&amp;amp;source=hp&amp;amp;aq=f&amp;amp;aqi=&amp;amp;aql=&amp;amp;oq=&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SAP help, &lt;/P&gt;&lt;P&gt;&lt;A href="http://help.sap.com/saphelp_nw04/helpdata/en/d2/561106b8b3bc449f890cddfdc8d3e2/frameset.htm" target="test_blank"&gt;http://help.sap.com/saphelp_nw04/helpdata/en/d2/561106b8b3bc449f890cddfdc8d3e2/frameset.htm&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Feb 2011 20:24:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/jco-adding-role-to-user-with-bapi-user-actgroups-assign/m-p/7694324#M1577283</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-14T20:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: JCO adding role to user with BAPI_USER_ACTGROUPS_ASSIGN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/jco-adding-role-to-user-with-bapi-user-actgroups-assign/m-p/7694325#M1577284</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks Kris, the explanation you gave helped me understand it more.&lt;/P&gt;&lt;P&gt;The problem was that after using:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;getImportParameterList().setValue( "USERNAME", myUser)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;to set the user name, I have to use: &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;getTableParameterList().getTable("ACTIVITYGROUPS").appendRow() 
getTableParameterList().getTable("ACTIVITYGROUPS").setValue("AGR_NAME", myRole)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;to set the user role.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I was trying to do something like:&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;getImportParameterList().getStructure("ACTIVITYGROUPS")&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and that obviously did not work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Feb 2011 22:53:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/jco-adding-role-to-user-with-bapi-user-actgroups-assign/m-p/7694325#M1577284</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-14T22:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: JCO adding role to user with BAPI_USER_ACTGROUPS_ASSIGN</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/jco-adding-role-to-user-with-bapi-user-actgroups-assign/m-p/7694326#M1577285</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are welcome...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Feb 2011 23:07:25 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/jco-adding-role-to-user-with-bapi-user-actgroups-assign/m-p/7694326#M1577285</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2011-02-14T23:07:25Z</dc:date>
    </item>
  </channel>
</rss>

