Calling an AS400 RPG program to create users on AS400

Hi,
our customer has a custom application on AS400.
To create users for this application, the customer uses a RPG program that both creates the AS400 user, populates the application custom tables, and do other stuff needed for the user definition.
Now,
Is it possible to use the IDM OS400 adapter to invoke the RPG program?
Or ... which is the best way to create a custom adapter to fulfill this task?
Regards!

Hi, We also need to call RPG from ABAP via RFC. We have installed the RFC SDK on A/S400 and tried call ABAP RFC from RPG, but still don't know how to make RPG program callable from ABAP
Any advice!
Many thanks
Tim

Similar Messages

  • Program to create users

    Is there any program in SAP , where i can customise to create users.
    Like when i enter a number 123 it should create a user called abc123 wiht a default role
    Thanks in Advance

    Hello Balaji,
    You can find it on your own.
    Go to transaction SE93 and provide the transaction name & click on display button. it will show the corresponding program
    eg: Transaction: SU01
    Program name : SAPMSUU0
    Screen number: 0000
    Considerable ABAP knowledge is required for customizing standard programs.
    Open the ABAP program eg: SAPMSUU0 in ABAP editor (SE38) and choose copy program from the menu. Give your new Zprogram name, Then do the modifications in your newly created Zprogram.
    NB: A transaction may consist of several screens & Programs (includes etc..)
    Regards,
    Ammey Kesarkar
    <i>'Award points for useful info'</i>

  • Program to Create Users in Multiple Clients at Once

    Hello experts.
    We have a multi-client architecture and I have to frequently create users in many of them at once.
    Is there a fast way or does anybody have ABAP code to create users in multiple clients by while also an existing users Roles?
    We have a program to copy the users, but I still have to go into every system and assign roles.  This is very tedious, so I would appreciate any help.

    Hello Valhalla,
    Try this way:
    BAPI_USER_CREATE1 is remote enabled so you can create RFC destination for the all the system
    you want to create users.
    Load all the rfc destination in one table.
    Load all the users need to be created in one table.
    Loop at rfc_dest_tab.
        loop at users_tab.
             CALL FUNCTION 'BAPI_USER_CREATE1' DESTINATION rfc_dest_tab-RFC_DESTINATION
      EXPORTING
        USERNAME         =  users_tab-USERNAME
      NAME_IN          =
        LOGONDATA        =
        PASSWORD         =
      DEFAULTS         =
        ADDRESS          =
      COMPANY          =
      SNC              =
      REF_USER         =
      ALIAS            =
      EX_ADDRESS       =
      UCLASS           =
    TABLES
      PARAMETER        =
      RETURN           =
      ADDTEL           =
      ADDFAX           =
      ADDTTX           =
      ADDTLX           =
      ADDSMTP          =
      ADDRML           =
      ADDX400          =
      ADDRFC           =
      ADDPRT           =
      ADDSSF           =
      ADDURI           =
      ADDPAG           =
      ADDCOMREM        =
      GROUPS           =
      PARAMETER1       =
      EXTIDHEAD        =
      EXTIDPART        =         .
    ENDLOOP.
    ENDLOOP.
    This will create required user in remote SAP systems.
    Hope this solves your issue!
    Thanks,
    Augustin.
    Edited by: Augustarian on Aug 22, 2009 11:52 AM
    Edited by: Augustarian on Aug 22, 2009 11:52 AM

  • Write a program to create users in FileRealm

    I am trying to create several hundred users in the default file realm and would be interested if anyone has a solution to this problem.

    Hi Greg,
    I've never tried what you want, but I noticed a post where someone was doing something very similar to what you want, and may help you..
    Check out
    http://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.security&item=6093&utag=
    Cheers,
    Joe Jerry

  • OS command syntax to run RPG program (FTP Adapter)

    Hi All,
    I try to run RPG program from File Adapter OS command, I do not know correct OS syntax.
    RPG program will create sales order in JD, PI and JD is on IBM i5 OS.
    I am able to run OS command like "mkdir" but i do not know correct syntax to run RPG program.
    I try few OS command but doesn't work like:
    CALL PGM(Library Name/Program Name) PARM(xx,yyy,zzz)
    CALL Library Name.Progran Name(param)
    With regards
    Sunil

    Hi,
    Please check with the link:
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/morewiththeFileAdapter
    Hope it will throw some light to your solution.
    Thanks.
    Regards,
    Vineetha.

  • User Exit to call program to create IDocs.

    Hi All,
    For any creation/changes of material master using MM01/MM02 (after save ) one of the user exit will trigger.
    From the user exit, I have to call the custom program to create MATMAS IDOCs.
    if any failures in changes/creation of material master. It has to roll back eveything created by program.
    Please let me know how to achieve this with out calling an event.
    Thanks - Vinay

    There are a number of standard methods to automatically create the IDOC.  You can activate the change pointers and depending on need, use BD64 to create a distribution model, and create the necessary WE20 setups to create the outbound IDOC.
    If you have to process the IDOC using custom logic, you can define that as well - although it's not clear why you need a custom generating program.  You can insert code into one of the IDOC user-exits to manipulate the content if needed.  Also, don't overlook the pre-delivered stuff from SAP that provides filtering out of segments and the like.
    There are a few good SAP PRess books about doing ALE distribution -- if this is an unfamiliar area, it's worth the cost to buy one -- if you spend any time around IDOCS, you'll appreciate it.

  • Calling RPG program from Java

    Hi All,
    I'm somwhat new to Java (coming from an AS400 background) and I'm stuck with what I think is a fairly simple problem. But I've been looking at this for so long, I'm probably missing something really simple and I hope someone can help me with this.
    I've created a bean that needs to call an RPG program on the AS400. I've looked at code throughout this site to compare and it looks the same. My problem is I'm getting an error when I try to run it.
    "com.ibm.db2.jdbc.app.DB2SQLException2: [IBM][JDBC Driver][14012] The index for the parameter is not valid."
    Here's my code:
    CallableStatement stpCall ;
    String sql = "CALL LIB.CHECKLOGIN ( ?, ?, ? )" ;
    try {
    Connection connection = null;
    connection = ivDataSource.getConnection();
    stpCall = connection.prepareCall( sql ) ;
    stpCall.setString( 1, ivUserID ) ;
    stpCall.setString( 2, ivPassword ) ;
    stpCall.registerOutParameter( 3, Types.INTEGER ) ;
    stpCall.execute() ;
    } catch (Exception e) {
    System.out.println(e);
    I've tried it a couple different ways and still get the same error. So if anybody can let me know what I'm missing or what I'm doing wrong I would greatly appreciate it. Thanks.

    Thanks jedilowe.
    Here's the code I'm trying to run:
    CallableStatement stpCall ;
         String sql = "CALL CHECKLOGIN ( ?, ?, ? )" ;
         Connection connection = null;
         connection = ivDataSource.getConnection();
    try {
    stpCall = connection.prepareCall( sql ) ;
    stpCall.setString( 1, ivUserID ) ;
    stpCall.setString( 2, ivPassword ) ;
    stpCall.registerOutParameter( 3, Types.INTEGER ) ;
    stpCall.execute() ;
    ivError = stpCall.getString(3) ;
    } catch (Exception e) {
    e.printStackTrace();
    I'm looking through the stderr log now. Most of if looks like a foreign language, but do you have an idea of what to look for? Anything specific? Here's a few lines from the log:
    com.ibm.db2.jdbc.app.DB2SQLException2: [IBM][JDBC Driver][14012] The index for the parameter is not valid.
    java/lang/Throwable.<init>(Ljava/lang/String;)V+4 (Throwable.java:94)
    java/sql/SQLException.<init>(Ljava/lang/String;Ljava/lang/String;I)V+1 (SQLException.java:43)
    com/ibm/db2/jdbc/app/DB2SQLException2.<init>(Ljava/lang/String;Ljava/lang/String;I[B)V+1 (DB2SQLException2.java:281)
          com/ibm/db2/jdbc/app/DB2SQLException2.generateException(Ljava/lang/String;Ljava/lang/String;[Ljava/lang/Object;Ljava/lang/String;I[B)Lcom/ibm/db2/jdbc/app/DB2SQLException2;+19 (DB2SQLException2.java:260)
          com/ibm/db2/jdbc/app/DB2PreparedStatement.beforeSetXXX(I)I+86
    Can anyone decifer this mess and based on the code above, tell me what the heck is wrong with the code!!! I've been fighting this for almost a week now. Thanks for all your help.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    

  • Program for creating a model is locked by User

    Hi Guys,
    We have created a process chain to create the Integration Model and to activate the Integration Model using this prg RIMODGEN. So, This prg we have created variants for different location wise. This process chain contains 13 processes For each location, which is running in parallel. Some time we are getting the error message " Program for creating a model is locked by User
    Regards

    Dear  Pullaiah,
    Locking happens if there is any overlap of models or duplicate  scheduling of jobs with same variant.                                                                               
    See include LCIFIF01                                                                               
    CALL FUNCTION 'ENQUEUE_ECIF_IMOD'                                    
      EXPORTING                                                          
        mode_cif_imod  = 'E'                                             
        modelname      = i_modid                                         
        logsys         = i_logsys                                        
        apoapp         = i_appl                                          
      EXCEPTIONS                                                         
        foreign_lock   = 1                                               
        system_failure = 2                                               
        OTHERS         = 3.                                                                               
    So this means for you, you get the lockentry if the modelname, logsys and apoapp is the same. So please check again your variants if there is one with the same integrationmodels.            
    This can be the only reason we you get here this entry in your joblog.
    Regards,
    Tibor

  • RFC - Calling Function Module in a local Windows Program (.exe) on user PC

    Hi Gurus !
    Has anyone ever tried to call a local program on the user side through RFC ? Actually, this programme should allow the use of function module from ABAP programs.
    Indeed we want to use some device locally installed, here a device to pay using Credit Cards.
    However, we've almost successfully filled our requirements if the destination RFC is activated as a Registered Program. But a user B tries to access device of a user A if the code and destination are the same. So we need to create as many RFC destination as users.
    So, we'd like the frontGUI to call the local EXE. This EXE would be coded in VB btw. But we can't figure out how to set the program to register on SM59, using "Start on Front-End Station" option.
    Has anyone any clue on how the program should look like ?
    Thx in advance,
    N H

    Hi MxG,
    I guess we're close to the solution.
    So, using the .Net Connector, and declaring inside our program the Host and Server Class, we've managed to use it, as a registered Server Program. Actually our Registered Program is a Windows Service running on the local computer that the RFC Function Module refers to.
    While testing this it's appeared that user B was trying to use device on User A, event thought devices and services were installed on both computers.
    I guess there's something we're misunderstanding or missing when we try to convert our solution to a Front-End solution. The program is obviously incomplete, something is missing. But I can't find any example or start-up for that program. Even in SAPHelp, there's only something saying that "you can do your own program for front-end and RFC"...   :/
    Well, I've just realized I've reformulated my issue, but since it's confusing for me, it's actually not easy to describe and make sure it's understandable !
    Regards,
    N H

  • Is there any other way to achieve per user call forward restriction other than to create multiple voice policies?

    Hello,
    We mentioned the environment details below:
    Environment
    In our PBX environment, currently a user can forward calls to any local (within a region) internal extension. But for external PSTN call forwarding, a user needs to send a request and be approved by their manager. And the forwarding restriction
    is applied such that user is only allowed to forward to that particular PSTN number - to prevent toll fraud.
    Moving forward to Lync, using voice policy's call forwarding and simultaneous ring PSTN usages, I can set it to allow forward and simultaneous ring to custom PSTN usage and a custom route that will only send calls to these pre-approved
    external numbers.
    Outcome
    But in such a scenario,
     sSince all the custom external allowed numbers will have to be put into a single Route match table, User A will be able to successfully
    set up call forward to User B's number. (if they come to know about it somehow, that is)
    rü 
    Route matching list will be very long due to the number of users per hubsite that has call forwarding enabled.
    Questions
    Is there any other way to achieve per user call forward restriction other than to create multiple voice policies ? MSPL may be ?  
    2. Is there a limit in the number of entries you can have on the Route pattern matching regex expression ?
    Please advise. MANY THANKS.

    1) I think multiple policies may be your best bet, though it's not a fun one to manage, I agree.  MSPL could do it, but it would be more complex to maintain in the end.  Even gateways have limitations on routes.
    2) I'm not aware of a limit, though I'm not saying there's isn't one.  But if you hit it, you could move to a second usage/route combo.
    I'd suggest building out some PowerShell usage/route creation/organization script for this so it's not something that would need to be maintained within the GUI.
    Please remember, if you see a post that helped you please click "Vote As Helpful" and if it answered your question please click "Mark As Answer".
    SWC Unified Communications
    This forum post is based upon my personal experience and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

  • User Exit that will allow the SAP program to create DN, but not create IDO

    Hi all,
    The requirement is when we select 1 PO in VL10g transaction and click the u201CBackgroundu201D button, the user exit will allow the SAP program to create Delivery Number, but not create IDOC for the Delivery Number to send it to warehouse system.  Also the created Delivery Number must be in changeable mode in ECC system .I need to find any exit to make the DN table field LIKP-VLSTK not to be u201CBu201D (distributed).  The B will make DN not changeable in ECC system which is hard coded value in standard program. so the DN should be changeable.
    Please suggest me the User Exit name which serves my purpose.
    Thanks in advance
    Latha.

    Welcome to SCN!
    Here is some code that will allow you to find exits and BADIS on your own:
    [Code To Find BAdi|https://wiki.sdn.sap.com/wiki/display/ABAP/CodeToFind+BAdi]
    Rob

  • Creating a screen in report program and calling that screen in program.

    Hi,
    I have a report program and I want to give output in different screen.
    can any one tell me how to create a screen in executable program and calling that screen in program in END-OF-SELECTION for displaying results.
    Thanks a lot.
    Kiran

    Hi,
      Open your program in SE80. Right click on your program. Click CREATE->Screen menu. This will allow you to create screen for the program. 
    In the End-of-selection event call the screen using the  commands CALL SCREEN or LEAVE TO SCREEN or SET SCREEN.
    CALL SCREEN
    http://help.sap.com/saphelp_47x200/helpdata/en/9f/dba4e635c111d1829f0000e829fbfe/content.htm
    LEAVE SCREEN/SET SCREEN
    http://help.sap.com/saphelp_47x200/helpdata/en/9f/dbab3635c111d1829f0000e829fbfe/content.htm
    Regards,
    Vara

  • Calling Create User Workflow

    Hi all,
    Is it possible that the Create User workflow can be called from another user defined workflow?
    If possible then how it can be called and what are the arguments that we have to pass it so that using this the user can be created.
    Thanks

    You need to create a user view, modify the attributes you want and then check in the user view. This will spawn the create process with the view you just manipulated.
    Something like this:
    <Activity id='0' name='Create View'>
    <Comments>Initialize a new view.</Comments>
    <Action id='0' application='com.waveset.session.WorkflowServices'>
    <Argument name='op' value='createView'/>
    <Argument name='type' value='User'/>
    <Argument name='id' value='accountId'/>
    <Return from='view' to='user'/>
    </Action>
    <Transition to='activity1'/>
    <WorkflowEditor x='156' y='88'/>
    </Activity>
    <Activity id='1' name='activity1'>
    <Action id='0'>
    <expression>
    <block/>
    </expression>
    </Action>
    <Transition to='Checkin View'/>
    <WorkflowEditor x='265' y='82'/>
    </Activity>
    <Activity id='2' name='Checkin View'>
    <Comments>Commit an updated view.</Comments>
    <Action id='0' application='com.waveset.session.WorkflowServices'>
    <Argument name='op' value='checkinView'/>
    <Argument name='view' value='$(user)'/>
    </Action>
    </Activity>

  • Calling RPG program from SAP running on windows platform.

    Hi
    We want to call a RPG program used for sending and receiving data to SAP System.  Our sap system running on windows platform and RPG program run iseries V5R3
    How can we do this?
    We red the redbook http://www.redbooks.ibm.com/redbooks/pdfs/sg244672.pdf. We thought it only mention about sap and externel system is as/400 and it is not related with our issue but we are not sure.
    We are waiting for an urgent suggestion.
    Best Regards...

    Hi, We also need to call RPG from ABAP via RFC. We have installed the RFC SDK on A/S400 and tried call ABAP RFC from RPG, but still don't know how to make RPG program callable from ABAP
    Any advice!
    Many thanks
    Tim

  • Please help how to get return array from rpg program on java code?

    Hi
    I have created a rpg program that returns 2 parameter 1 is the id and another one is list of array, when I called this program I passed two programparameter from my java code (see the code below) but when i checked what value would be return it is returned only first value of array. how will i get all array values ?
    please suggest me regarding this issues I amn't so much aware on java & AS400.
    try
    ProgramParameter[] parmList = new ProgramParameter[2];
    AS400Text p1 = new AS400Text(10);
    AS400Text p2 = new AS400Text(30);
    try
    parmList[0] = new ProgramParameter(10);
    parmList[1] = new ProgramParameter(30);
    parmList[0].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[1].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[0].setInputData(p1.toBytes("Pune"));
    parmList[1].setInputData(p2.toBytes(" "));
    catch(Exception ex)
    ProgramCall pgm = new ProgramCall(o);
    pgm.setProgram("/QSYS.LIB/XXX/XXX.PGM",parmList);
    if (pgm.run())
    byte s[] = parmList[1].getOutputData(); // HERE I got only first value of returning array.
    parmList[1].getOutputDataLength();
    //String sts = ((String) (new AS400Text(10,o).toBytes(s[0])));
    else
    AS400Message[] messageList = pgm.getMessageList();
    for (int msg = 0; msg < messageList.length; msg++) {
    catch(Exception ex)
    AS400Message[] messageList = null;
    finally
    o.disconnectAllServices();
    Reply With Quote

    Try this :
    try
    ProgramParameter[] parmList = new ProgramParameter[2];
    AS400Text p1 = new AS400Text(10);
    AS400Text p2 = new AS400Text(30);
    AS400Array arrP2 = new AS400Array(p2, 4);
    try
    parmList[0] = new ProgramParameter(10);
    parmList[1] = new ProgramParameter(30);
    parmList[0].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[1].setParameterType(ProgramParameter.PASS_BY_REFEREN CE);
    parmList[0].setInputData(p1.toBytes("Pune"));
    parmList[1].setInputData(arrP2.toBytes({"","","",""}));
    catch(Exception ex)
    ProgramCall pgm = new ProgramCall(o);
    pgm.setProgram("/QSYS.LIB/XXX/XXX.PGM",parmList);
    if (pgm.run())
         Object[] objArr =  (Object [])arrP2.toObject( parmList[1].getOutputData() );
         for(int i =0; i<objArr.length;i++){
                System.out.println( " SKU " + i +" : " + objArr.toString());
    else
    AS400Message[] messageList = pgm.getMessageList();
    for (int msg = 0; msg < messageList.length; msg++) {
    catch(Exception ex)
    AS400Message[] messageList = null;
    finally
    o.disconnectAllServices();

Maybe you are looking for

  • T440p Fingerprin​t power-on is not working

    Hi , i just recieved my new T440p ,  Fingerprint @ power-on is not working although all config. is done typically in lenovo fingerprint manager pro & fingerprint security settings in the BIOS , i start my laptop it goes through windows normal startup

  • Problem While Saving the editable ALV GRID

    Dear Experts, I have a scenario in which i am display the ALV(using class) with some data in the custom container of module pool screen in the non-editable mode.Also i have save and edit buttons.If i click the edit button i have written the code to e

  • Itunes won't play one of the song i have purchased in an album and all the rest of the song play

    I recently purchased David Guetta Nothing But the Beat ultimate and have found all the song but one play. The song I am having problems playing is Metropolis it appears to be asking for authorize it, which puzzles me as i have purchased the music fro

  • Pop up warning message while creating PO

    Hi, How to give a Genral or a POP up Warning Message while creating and checking a PO in ME21n and ME22n. Even i tried in changing the local setting in the menu bar, but it doesnt work. Help and suggestions will be much appreciated. Thanks & Regards.

  • An error occurred calling 'LogResult​s' in 'ITSDBLog' of 'DBLog 1.0 Type Library'

    HI, I'm getting this run-time error: Details: An error occurred calling 'LogResults' in 'ITSDBLog' of 'DBLog 1.0 Type Library' An error occurred executing a statement. Schema: ATE_database_multiplePC. Statement: STEP_RESULT. Unknown variable or prope