How to create User Portal in OID programmatically in JSP

Hi.
I want to create User Portal programmatically in JSP (if posible) or have to use procedure.
I check with package wwsec_api, it just have 'function
add_portal_user', but it say we must have "the user must already exist in OID before this function is called."
So, i checked for 'how to create User in OID'. What i got (in metalink)just methods that 'Create manually Portal Users in to OID' by LDAP or PL/SQL coding (with list of user in flat files).
What i want to do is, How to create User POrtal in OID by JSP? What are the procedure/table/method involved?
Do anybody have any samples?..
Thanks.

I had to write my own because I could not find one anywhere. Here is an addUser() method that seems to work pretty well.
import oracle.ldap.util.jndi.ConnectionUtil;
import javax.naming.directory.*;
import javax.naming.*;
public class LdapUser
public LdapUser(){}
public void addUser(String pUsername, String pPassword, String pFirstName, String pLastName, String pEmail)
try
InitialDirContext ctx = ConnectionUtil.getDefaultDirCtx("host", "port", "orcladmin", "pwd");
BasicAttributes attrs = new BasicAttributes();
BasicAttribute oc = new BasicAttribute("objectclass");
oc.add("top");
oc.add("person");
oc.add("inetOrgPerson");
oc.add("organizationalPerson");
oc.add("orclUser");
oc.add("orclUserV2");
attrs.put(oc);
BasicAttribute gn = new BasicAttribute("givenName", pFirstName);
attrs.put(gn);
BasicAttribute sn = new BasicAttribute("sn", pLastName);
attrs.put(sn);
BasicAttribute cn = new BasicAttribute("mail", pEmail);
attrs.put(cn);
BasicAttribute pwd = new BasicAttribute("userpassword", pPassword);
attrs.put(pwd);
// Etcetera, etcetera...
ctx.createSubcontext("cn="+pUsername+",cn=users,dc=whatever,dc=com", attrs);
ctx.close();
System.out.println("Success!!");
catch (NameAlreadyBoundException nabe)
System.out.println("Username is already in use. Please choose another.");
catch (NamingException ne)
System.out.println("NamingException: " + ne);
catch (Exception e)
System.out.println("User account was not created.");
}

Similar Messages

  • How to create user groups in SAP

    Hello Gurus,
    Can anyone let me know how to create user groups in SAP-HR Module and who will be creating  the user groups.
    plz provide me the steps.

    Hi Stephanie,
    IMG --> Personnel Mgmt --> Personnel Administration --> Basic Setting s --> Maintain User Parameters
    Please refer the below links:
    http://scn.sap.com/thread/1653026
    http://scn.sap.com/thread/1682721
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10eab7af-0e54-2c10-28a5-87b47adbe1a5?QuickLink=index&overridelayout=true&44478681629499
    Thanks,
    Madhav.

  • How to create user function in Data Functions in Query Designer?

    Could someone tell me how to create user function in Data Functions in Query Designer?
    I mean function like "NDIV0" in Data Functions.
    SAP BW 3.x.
    Query Designer (SAP BW 3.x)

    Hi check the following URL, it gives how to add in Formulas in formula Builder, not in DataFunctions.
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f095592f-42f7-2a10-6ab1-c836a559b48f
    Thanks
    Reddy

  • How to create user in local datasource when UME is already switched to LDAP

    HI,
    Info : I have portal ( NW 700),  recently i switched the datasource of portal to LDAP from local datasource.
    issue: if i create user in portal it get created in LDAP, i want create few users in Local datasource.
    how to create user in local datasource when UME is already switched to LDAP?
    one solution is change the ume back to local datasource > create user > then switch back to LDAP.
    do you know any other sol?
    Regards
    Shridhar Gowda

    Please let me know the Datasource file name .. i.e. the .xml filename.
    try to analyze this name and see whether you get a solution or post it here.
    Reward points if helpful -

  • How to create user defined button in alv report

    how to create user defined button in alv report
    thnks in advance.

    Hi,
    U can define it the the PF-STATUS ( Menu for ALV ).
    For that u have to define it in the EVENTCAT.
    form z_eventcat  using    p_i_eventcat type slis_t_event.
      data: i_event type slis_alv_event.
      call function 'REUSE_ALV_EVENTS_GET'
        exporting
          i_list_type     = 0
        importing
          et_events       = p_i_eventcat
        exceptions
          list_type_wrong = 1
          others          = 2.
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
      clear i_event.
      read table p_i_eventcat with key name = slis_ev_top_of_page into
      i_event.
      if sy-subrc = 0.
        move 'TOP_OF_PAGE' to i_event-form.
        append i_event to p_i_eventcat.
      endif.
      read table p_i_eventcat with key name = slis_ev_pf_status_set into i_event.
      if sy-subrc = 0.
        move 'SET_PF_STATUS' to i_event-form.
        append i_event to p_i_eventcat.
      endif.
      clear i_event.
      read table p_i_eventcat into i_event with key name = slis_ev_user_command .
      if sy-subrc = 0.
        move 'USER_COMMAND' to i_event-form.
        append i_event to p_i_eventcat.
      endif.
    And in the DISPLAY
    call function 'REUSE_ALV_GRID_DISPLAY'
       exporting
         i_callback_program                = v_progname
         i_callback_pf_status_set          = 'SET_PF_STATUS'
         i_callback_user_command           = 'USER_COMMAND'
         i_callback_top_of_page            = 'TOP_OF_PAGE'
         i_grid_title                      = v_gridtitle
         i_save                            = 'A'
         is_layout                         = i_layout
         it_fieldcat                       = i_fieldcat[]
         it_sort                           = i_sortinfo
         it_events                         = i_eventcat
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
        tables
          t_outtab                          = it_final
       exceptions
         program_error                     = 1
         others                            = 2
      if sy-subrc <> 0.
        message id sy-msgid type sy-msgty number sy-msgno
                with sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      endif.
    *MENU SETTINGS.
    form set_pf_status using rt_extab type slis_t_extab.
      set pf-status 'ALV_MENU'.
    endform.                    "SET_PF_STATUS
    endform.                    " Z_EVENTCAT
    Now double click on ALV MENU nad u can create a button in the application bar.
    Regards,
    Pritha.

  • How to create User and Database in different Table spaces

    How to create User and Database in different Table spaces using oracle 10g
    Regards
    daya

    I am sorry but your question does not seem to make much sense.
    Can you please rephrase your question?

  • How to create User Defined Variables in Procurement Contract 12.1.3

    Hi,
    We are using Procurement Contract 12.1.3. As per our business requirement while creating contract template we need to use many variables which are not available in 'System Defined' variable list. Please guide us with some samples (step by step) how to create the 'User defined' variables.
    Regards,
    Prabhu

    Hi Prabhu,
    Did you get the setps how to create user defined variables in Procurement contracts? if so please share me the setp by step flow.
    Prakash

  • How to create user defined transactioncode in bw

    hi,
    How to create user defined transactioncode in bw.My user want this
    regards,
    Abhishek

    hi 
    by using the t code SE93 u can create.
    after that it will ask u for what ur going create
    1.Program and screen
    2.Program and selection screen
    3.method of class
    4.transaction with variant
    5.transaction with parameter
    here u have to select appropriate option based on ur requirement
    and enter the options as per ur needs save and activate

  • How to create user defined functions in xi.

    how to create user defined functions in xi.
    can anyone give info with screen shots.

    Hi,
    Please follow the  steps mentioned in below link
    http://help.sap.com/saphelp_nw04/helpdata/en/f8/2857cbc374da48993c8eb7d3c8c87a/frameset.htm
    also refer below links to know more about UDF
    udf
    Thanks
    Swarup
    Edited by: Swarup Sawant on Mar 3, 2008 3:59 PM

  • How to create user defined metrics for SQL Server target?

    The customer is not able to create a user defined metrics for SQL Server target.
    This is very important for him to use this product.
    He is asking how to create user defined metrics?
    I sent him Note 304952.1 How to Create a User-Defined SQL Metric in EM 10g Grid Control
    But it would work for an Oracle DB, but his target is SQL Server DB
    Not able to find the "User-Defined Metrics" link from Database home page.
    How to create user defined metrics for SQL Server target?

    http://download-uk.oracle.com/docs/cd/B14099_19/manage.1012/b16241/Monitoring.htm

  • How to create user editable Crystal Report with dynamic dataset

    What I would like to achieve:
    A program loads a report in runtime updates list of database fields (possibly includes sample data), open report in "Crystal Reports 2011" (or 2008) where user customizes report and saves it. Later on the program loads the report, fills actualized data and displays it in .net report viewer.
    What I do:
    CrReport = New CrystalDecisions.CrystalReports.Engine.ReportDocument
    CrReport.Load(TemplateFilename)
    Dim Results As DataTable
    DataTable is filled from a database
    CrReport.SetDataSource(mResults)
    CrReport.SaveAs(NewReportPath, True)
    The NewReportPath is opened in the default program.
    What are the problems
    The report is open in preview mode (not in design).
    When the field is added to the report the designer asks for XML datasource on preview.

    The short answer is that it is not possible. I broke the question to other two: How to save a report that it opens without preview? and How to create user editable Crystal Report with dynamic dataset, where it is possible to find details. Key answer is Re: How to create an editable previewable report?

  • How to create User Exits in ECC 6

    Hi Experts,
    good day, i'm looking for any notes or learning materials on how to create User Exits in ECC 6. please send me the links.
    thanks you for your usual support.

    Hello,
    For information on Exits, check these links
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sapgenie.com/abap/code/abap26.htm
    http://www.sap-img.com/abap/what-is-user-exits.htm
    http://wiki.ittoolbox.com/index.php/HOWTO:Implement_a_screen_exit_to_a_standard_SAP_transaction
    http://www.easymarketplace.de/userexit.php
    http://www.sap-img.com/abap/a-short-tutorial-on-user-exits.htm
    http://www.sappoint.com/abap/userexit.pdfUser-Exit
    Any Basics u wana know abt Enhancements.,.,go through the link.,
    http://help.sap.com/saphelp_nw04/helpdata/en/c8/1975cc43b111d1896f0000e8322d00/frameset.htm
    Thanks,
    Swati

  • How to create user's in Middleware

    Hi All,
    How to create user's in Middleware(J2EE stack).When we create user's in ABAP stack it has to reflect that user in J2EE stack also. In old version of mobile using WebConsole there was an option by running that program able to see created user's in ABAP stack in WebConsole too. What I mean to say how can get user's synchoronization in between ABAP stack and J2EE stack. Is there any link to know better Administration of J2EE stack. Please let me know
    Thanks in advance.
    Regards,
    Ameer Baba.

    hi Ameer,
    You arent able to see the ABAP users on your Java stack simply due to the fact that the User management Engine of Java stack is not properly configured to connect to a particular client of ABAP stack.
    Please check this link for more information
    http://help.sap.com/saphelp_nw2004s/helpdata/en/45/1bbdccc7850064e10000000a1553f7/content.htm
    If you are still unable to solve the problem please address it in UME forums so that you get a speedy resolution
    regards
    sunil

  • How to create users on JDI

    Hi
    How to create users on JDI... how to access JDI....
    I want to create users, groups in JDI
    Please help me....
    Thanks & Regards
    Ravi Shankar B

    Hi
    What is the difference b/w Inactive, active and Local DCs...
    In inactive and active DCs i am not getting any thing... why?
    and i need to know how to do the following configuration.....
    Creating Users
    The following shows you how to create various users. Developer and Admin are just placeholders for actual people. CMSadm, on the other hand, is the user name recommended by SAP for the CMS user used by the CMS to access the DTR, CBS, and SLD.
    .1Choose Create User.
    .2Create the users Developer, Admin, and CMSadm, in this order.
    Assigning Users to Groups
    .1 Choose Groups.
    The Groups screen appears.
    .2 In the Groups field, select the JDI.Developers role and choose Assign Users to ...
    The Assign User(s) screen appears.
    For more information, see the installation manual of SAP NetWeaver Development Infrastructure.
    .3 Choose Add User ...
    The Search for User screen appears.
    .4 Enter the user ID Developer and choose Search.
    The Search Result(s) screen appears.
    .5 In the list, select the Developer user and choose Select.
    On the Assign User(s) screen, you see a list of all users that have the JDI.Developers role. Developer has now also been included in the list.
    .6 In the same way, assign the JDI.Administrators role to the users Admin and CMSadm.
    If the SLD is installed on a separate J2EE Engine, you must also create the users Developer and CMSadm in this Engine as well.
    Thanks & Reagards
    Ravi Shankar B
    Message was edited by: RaviShankar B

  • How to create the Portal Service in Portal 7.3,

    Dear Experts,
    how to create the Portal Service in Portal 7.3, as we create in Portal 7.0 by creating the Portal Project in that we create Portal Service and we can start and stop in Portal Service configuration in System Administration
    Thanks,
    Sagar Pande

    Hi Sagar,
    Procedure
      1.  Open the SAP NetWeaver Administrator by either of the following methods:
           a. Use the URL to your AS Java (hostname:port) to access the AS Java home page and use the link to SAP NetWeaver Administrator.
           b. Alternatively, add nwa to the AS Java URL to access SAP NetWeaver Administrator directly. (hostname:port/nwa).
      2  Go to   Operations Management   Systems   and click the Start & Stop link.
        The Start & Stop: Java EE Instances window opens.
      3  Click the Java EE Application bar and select the relevant application in the Application List.
        The Portal Services pane displays the services associated with the selected application.
      4  Use the buttons Start Service or Stop Service.
    Refer to Portal 7.3 help
    http://help.sap.com/saphelp_nw73/helpdata/en/f6/ac978061ac4b24a87a1f821313c4fe/frameset.htm
    Br,
    Venky

Maybe you are looking for

  • Driver for a second display

    I have an AOC brand monitor and the proper DVI connections to add it as a second display, however it doesn't work as plug and play and the AOC website only has windows drivers and says to contact Apple tech support for an appropriate plug and play dr

  • Program monitor freezes and goes black but I can still hear the audio

    Hi just recently I've noticed after a few playbacks the program monitor goes black, the sequence plays out with audio, I just can't see the image. Timeline is mixed with prores, mts But haven't had this issue occur since updating. THanks I7 3970 gtx

  • Cancel new order

    Hi, I placed an order incorrectly. I have already spoken to someone on the phone to cancel, but the order still shows as "processing" in my account. How quickly can I cancel the order to place another one? Thanks

  • What do I need for Oracle Http Server with mod_plsql on Linux 64bit?

    I am trying to get the OHS onto a linux box but I am not quite sure I am installing the correct thing!! I currently have a windows box running the 10g Application server but everything seems to have changed since then and there seems to be several di

  • QUICK ACCESS TOOLBAR WONT WORK

    I am not able to scroll thru the commands with FM7.2p158 in Windows 7 Pro. You can see the button go in, it just does not make the toolbar scroll to the next line of tools? please help. Any way to get around this? is/are there some other tool to get