Issue in Registered Server Program RFC in ERP

Hello Experts,
I need suggestion on one problem we are facing.
From ERP we have 3 application which uses Synchronous message call to PI system from where the call is sent to a mainframe system and returned.
All these 3 applications uses a registered server program XXX_TCP_YY RFC call to connect to PI system.
In this RFC XXX_TCP_YY the gateway host is mentioned as ERP system and there is a communication channel in PI where this RFC details are maintained.
After upgrading our ERP 6.0 to EHP 5 we are continuously getting issues with message flow to PI or call to PI is failing and this RFC is taking long time or sometime timing out.
In such cases since it production i go a restart the channel in PI and this RFC start working fine.
But i am not sure how to resolve this issue.
Can you please provide some pointer in which direction i should investigate this problem.
Regards
Ajay Sandal

Hi Ajay,
Can you check the PI Communication polling interval and whether this restart needed on all the apps or just CI?
In addition to polling interval please check the SeeBurger services from /nwa and see if the needed on are active.
Before restarting the channel, clear the cache using full mode too.
Check this forum link: all Communication Channels stopped or startet when restart of the SAP-PI
Regards,
Ashutosh
Edited by: Ashutosh.Pandey on Jan 11, 2012 9:21 PM

Similar Messages

  • Creating RFC dest'n for Registered Server Program

    Hi,
    I want to create a create a RFC destination for RFC Sender adapter. I am consulting this weblog:
              /people/michal.krawczyk2/blog/2005/03/29/configuring-the-sender-rfc-adapter--step-by-step
    However, i dont know what will be the Program ID and GatewayHost.... Please let me know how they are configured?
    Regards,
    Arpil

    Program id can be any name thats unique and given while u select registered server program in sm 59 (while u create rfc destination of type TCP/IP)also its case sensitive, and should be same in both the RFC destination and your RFC adapter.
    and gateway host has to be ur own application system not of XI ,(as specified in Michals blog) .
    TCODE : SMGW -> Goto-> Parameters -> Display
    Regards,
    Pratibha

  • Registered Server Program not being registered?

    Hi,
    first of all, I'm an ABAPer, not a Basis guy, so i apologize if i'm not giving all the info required to solve this issue.
    We have a program that's scheduled to run every morning at 4am. This program calls an RFC to XI and sends data to an external SQL database.
    it seems that EVERY Sunday, after full backups, the initial run of this program fails. If it fails, the job is run up to 3 more times. Almost 100% of the time, one of the successive runs works.
    And when I say a successive run works, I mean a duplicate job that's been kicked off, literally less than 1 minute later, will run fine.
    Also, the job will sporadically fail during the week on its first run, yet successive runs will work.
    it seems to me that there is a problem registering the program that my ABAP program calls.
    any ideas on what I ask my basis/XI team to check for?
    points will be awarded.
    thanks,
    rp.

    here's what we could find
    M Thu Sep  6 04:04:38 2007
    M
    M  *****************************************************************************
    M  *
    M  *  LOCATION    SAP-Gateway on host hrxxx.valero.com / sapgw45
    M  *  ERROR       program RFC2XMBSERVICE_HR2XIP not registered    <--------  error here!
    M  *
    M  *  TIME        Thu Sep  6 04:04:38 2007
    M  *  RELEASE     700
    M  *  COMPONENT   SAP-Gateway
    M  *  VERSION     2
    M  *  RC          679
    M  *  MODULE      gwr3cpic.c
    M  *  LINE        1694
    M  *  DETAIL      TP RFC2XMBSERVICE_HR2XIP not registered
    M  *  COUNTER     239
    M  *
    M  *****************************************************************************
    M
    A  RFC 1485  CONVID 80501535
    A   * CMRC=2 DATA=0 STATUS=0 SAPRC=679 ThSAPOCMINIT
    A  RFC> ABAP Programm: ZHRO_FLEX_ONLINE (Transaction: )
    A  RFC> User: SAPHR (Client: 120)
    A  RFC> Destination: RFC2XMBSERVICE_HR2XIP (handle: 1, , )
    A  *** ERROR => RFC ======> CPIC-CALL: 'ThSAPOCMINIT'
    Transaction program not registered
    [abrfcio.c    8065]
    We don't understand why this program fails to register itself a few times per week.

  • Bizarre RDP Issue with opening remote program with Visual ERP

    So I have two VM's one running SQL server with an ERP program called Visual that has several components and an RDP server that end users log into. We are running windows 2012R2 on both. Everyday around 5:30 the VMFG program for visual stops working until I reboot the RDP server, people already in are fine but anyone trying to open it get the below error. It basically says it can't open the file on the SQL server anymore, yet if I can open the UNC path from the RDP and click on the executable(still crashes with same error), it runs fine locally on the SQL server and other parts of Visual Kios/Time and attendance work fine. I tried removing the anti-virus, checking backups, checking for scheduled tasks, checking event viewer logs, performance monitor, etc and can't seem to figure out this oddity. Any ideas would be greatly appreciated....
    This topic first appeared in the Spiceworks Community

    Hi,
    As this happens with him specific from MRD MAC check whether he is taking RDP with IP address or hostname. Also try to uncheck the Option "Bypass RD Gateway for local address" under RDSH configuration and verify the result. 
    Also for more detail he can collect log from MAC side by following path.
    Microsoft Remote Desktop>About Microsoft Remote Desktop>Send log via email
    Hope it helps!
    Thanks.
    Dharmesh Solanki
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected]

  • Error 'Program not registered' while testing RFC - SRM to MDM / TCP/IP conn

    Hello All,
    While testing RFC connection in SRM, we are getting this error. This connection between SRM to MDM. Any inputs will be highly appreciated.
    Error Details LOCATION: SAP-Gateway on host <hostname> / sapgw<instance no>
    our server OS : windows 2008 server
    We are getting error while doing connection test in SRM.
    This is sm59 connection (TCP/IP ) connection.
    Connection Type: T / RFC destination Name: MDM_API_CATALOG
    Registered server program: hostname.MDS
    I checked smgw transaction ..Logged on clients...Program id is not showing. Any hint will be helpful.
    I Checked this MDM setup also.
    MDS setup
    In mdm server go to folder F:\usr\sap\DM1\MDS00\config
    Open MDM.ini file in notepad
    Add the below 2 entries.
    SAP RFC Gateways= GWHOST=XXXX.hostnamexxx.xxx GWSERV=sapgw00
    Trusted SAP Systems= XXD
    This will enable gateway connection between SRM and MDM and will enable trusted connection.
    For trusted connections to work, we created a service user called SRM_MDM_API with SAP_ALL in SRM  and also created the same user in MDM with Default role.
    Error message:
    Logon  Connection Error
    Error Details    Error when opening an RFC connection
    Error Details    ERROR: program XXXXXXXXPRD.MDS not registered
    Error Details    LOCATION: SAP-Gateway on host XXXXXXXXprd.xx.xxxxxxhostname.xxx / sapgw00
    Error Details    DETAIL: TP XXXXXXXXPRD.MDS not registered
    Error Details    COMPONENT: SAP-Gateway
    Error Details    COUNTER: 77326
    Error Details    MODULE: gwr3cpic.c
    Error Details    LINE: 1778
    Error Details    RETURN CODE: 679
    Error Details    SUBRC: 0
    Error Details    RELEASE: 700
    Error Details    TIME:
    Error Details    VERSION: 2
    Procedure Tried
    1)  This procedure is for Linux OS - Similarly we tried in Windows OS ( If any procedure is wrong also, Please correct us)
    To register the program login into the OS level as sudo su u2013 <sid>adm and execute the following command.
    rfcexec u2013g<program id> -a<gateway host name> -x<gateway service>
    rfcexec is the server program name, the <program id> can be obtained from SM59, it is case sensitive and should match with the entry in SM59. The <gateway host name> and <gateway service> can be obtained from the transaction SMGW. When this command is executed it goes to a hanging loop.
    The connection will fail once this command is terminated or the user executing this command logs off
    2)
    To avoid this, instead of using the above mentioned command an entry should be made in the file saprfc.ini
    To do this, execute the following command
    sudo su u2013 <sid>adm
    rfcexec u2013D<destination name>
    <destination name> is the RFC destination name in SM59
    In order to do above step 2,  we could not find saprfc.ini in windows 2008 server. Please let us know path where it will be usually?
    3) Already checked the notes sapnote_0000684841
    I know that it is generic error..This is happening to specific one of system only.
    Thanks
    Edited by: saptest2011 on May 20, 2011 5:36 PM

    Hello SM,
    Thanks for your quick reply.
    Thanks for sharing link for document ie Configure the MDM Administration_cockpit. It is helpful. I read that document.
    But still issue remain there.
    The same RFC connection works between SRM sandbox to MDM sandbox.
    Only issue with SRM Prod to MDM Prod (newly built system)
    difference between MDM Prod and MDM sandbox.
    MDM Prod runs: Windows server 2008 OS
    MDM Sandbox runs: Windows server 2003 OS
    Landscape: PI7.1, MDM 7.1 and SRM 5.5, SRM-MDM Catalog 3.0
    Even i did os01 tcode ping test using host name (specific IP address) from SRM prod to MDM prod, it is fine.
    Thanks a lot for your help.
    I checked these notes also
    Note 353597 - Registering a server program
    Note 44844 - No connection to registered RFC program
    Note: in smgw tcode in SRM system, the required program id is not showing in logged on clients
    Thanks
    Edited by: saptest2011 on May 23, 2011 5:00 PM
    Edited by: saptest2011 on May 23, 2011 5:39 PM

  • Calling JCO RFC Server program from JCO RFC client

    Hi,
    I have an RFC registered server program which implements JCO.Server.  It seems to be working fine, when called from SAP.
    For testing purposes, I was trying to write a JCO client program which would take the place of the SAP client.
    This program opens a connection to the RFC server and executes a function e.g.
    JCO.Client client = JCO.createClient("xx.yy.com", "sapgw35", "MYPROGID");
    client.connect();
    client.execute(function);
    The RFC server program receives the call fine, when I test with a simple function which has no table parameters.  However when I tried a more complex function with table parameters, I get an serverExceptionOccurred from the RFC server program:
    com.sap.mw.jco.JCO$Exception: (104) RFC_ERROR_SYSTEM_FAILURE: connection closed without message (CM_NO_DATA_RECEIVED)
        at com.sap.mw.jco.rfc.MiddlewareRFC$Server.nativeListen(Native Method)
        at com.sap.mw.jco.rfc.MiddlewareRFC$Server.listen(MiddlewareRFC.java:1368)
        at com.sap.mw.jco.JCO$Server.listen(JCO.java:6805)
    I have tried to initialize the repositories in both server and client programs correctly, so that the function is in the cached function list and the table structures in the cached structures list before the function is invoked.  But I am not sure if there is still something I am missing, so any ideas would be welcome.
    Thanks,
    Richard

    JCO example 5 is a very good one for server side programming.
    try the example,somethings you 'd better make clear.
    1) JCO.server
    2) repositories--data mapping
    3) parameters: export import,table...
    further topic:
    1) JCO pool
    2) tRFC,qRFC
    After you have success in Client side programming,try example 5.
    Regards

  • Error 'Program not registered' while testing RFC connection PI_RFC

    Hi Basis Experts
    I am having problems while testing an RFC connection PI_RFC in one of our PI quality system.
    Here is the Error log
    Logon Connection Error
    Error when opening an RFC connection
    ERROR: program PI_RFC not registered
    LOCATION: SAP-Gateway on host bp1xeuaa202 / sapgw01
    DETAIL: TP PI_RFC not registered
    Details COMPONENT: SAP-Gateway
    COUNTER: 15866
    MODULE: gwr3cpic.c
    Details RETURN CODE: 679
    We tried restarting the JCO-RFC provider service in VA,also tried restarting the Gateway service, tried registering the RFC using below command
    rfcexec u2013g PI_RFC -a bp1xeuaa202 -x sapgw01
    rfcexec u2013D PI_RFC
    the command didnt gave any output also in SMGW tcode we didnt get the entry(PI_RFC) under system type as registered server.
    Also we tried changing the Gateway hostname and service name in SM59.
    Still we are facing the same issue, can anyone please help us in resolving this issue.
    Regards
    Syed

    Hi,
    It seems to like problem with your program is not registered.  As suggested by spantaleoni, you can go through.
    Here Program Id  must be case sensitive.  Once again check with your program Id.
    And, you have to register your program id in Visual Administrator.
    Goto  Visual Administrator:
    In that Select Cluster>Server>Services-->JCo RFC Provider
    Then enter the Program Id and gw host & service.
    Hope this helps to you.
    Regards,
    P.Rajesh

  • Error 'Program not registered' while testing RFC

    Hi
    I have created a RFC with type T. When I am testing the same through SM59, I am getting error:
    Logon     Connection Error
    Error Details     Error when opening an RFC connection
    Error Details     ERROR: program <program name>not registered
    Error Details     LOCATION: SAP-Gateway on host xxxxxx / sapgw01
    Error Details     DETAIL: TP <program name> not registered
    Error Details     COMPONENT: SAP-Gateway
    Error Details     COUNTER: 6268
    Error Details     MODULE: gwr3cpic.c
    Error Details     LINE: 1694
    Error Details     RETURN CODE: 679
    Error Details     SUBRC: 0
    Error Details     RELEASE: 700
    Error Details     TIME: Tue Jan 27 00:56:55 2009
    Error Details     VERSION: 2
    Can anybody help me in this?
    Thanks in advance

    Something helpful related to this
    The program in the above error should be registered in the gateway for this connection test to complete successfully. The server program rfcexec is responsible for its registration on the gateway.
    To register the program login into the OS level as sudo su - <sid>adm and execute the following command.
    rfcexec u2013g<program id> -a<gateway host name> -x<gateway service>
    rfcexec is the server program name, the <program id> can be obtained from SM59, it is case sensitive and should match with the entry in SM59. The <gateway host name> and <gateway service> can be obtained from the transaction SMGW. When this command is executed it goes to a hanging loop.
    The connection will fail once this command is terminated or the user executing this command logs off
    To avoid this, instead of using the above mentioned command an entry should be made in the file saprfc.ini
    To do this, execute the following command
    sudo su - <sid>adm
    rfcexec u2013D<destination name>
    <destination name> is the RFC destination name in SM59
    So now we are done with registering the server program, but how do we check it is registered, once a server program is registered it is displayed in the Logged on clients in SMGW.
    In transaction SMGW choose GOTO-> Logged on clients. There should be an entry for the server program in the screen that is displayed with system type Registered_TP (which indicates that the program is registered)

  • Issue in registering program id to SAP gateway using JCO

    Hi All,
    In our java application we are registering a program id to SAP gateway so that we can listen the data sent from R/3 systems.
    I need some basic information about the gateway registeration. I have following queries :-
    1. If I register a program id, till what time this registeration remains in the R/3 system.
    2. Is there any way to do the permanent registeration.
    3. In our scenario we have clustered java server which is set up on a clustered OS. That means one java server is on one hardware machine and other java server is on another machine. Once we register a program id from one of the java server ,it
    gets registered with that particular machine IP address. Now if one of the java server gets down ,other java server should start listening to SAP system. But this is not happening because our other java server is on another machine whose IP address is different and is not registered with SAP system.Is there any way to deal with this situation. One thing we could think of is to register all the machines permanently with SAP system. So that whichever machine gets down communication will not break.All the machines will remain registered in the R/3. But I am not sure how to do that.
    Can anyone help me here.
    Thanks and Regards,
    Reena

    1.) The registration remains active until you unregister it, or until the SAP gateway recognizes that the connection has been interrupted somehow. If there are multiple registrations of the same programID, this is valid for each single one. So one could say, that a programID's registration is valid as long as at least one registration is still valid.
    2.) There is no such thing. What do you mean with permanent registration?
    3.) You already gave the answer by yourself. Just register all RFC servers from all nodes simultaneously. The RFC requests will be dispatched to any of the nodes all the time. If one server node gets down, the connections to this particular server will be interrupted and it won't receive any RFC requests any longer.
    And you don't know how to do that? Just start the RFC servers on all server nodes and they will register at the SAP gateway. I don't understand this question.

  • Registered Program - RFC

    Quick question....
    When I create a TCP/IP type RFC with 'Registered Program', how does the RFC find the target server where this service is running. I see this information from 'System Information --> Target System'. But, can someone explain me where RFC is picking this information from? Say for example if under 'System Information --> Target System', I see '(extern)' under SYSTEM and 'abc123' under System ID and 'x.x.x.x' under IP address. If I want to change the IP address to 'y.y.y.y', what do I have to do?
    Thank you.

    Hi,
    The rfc which you created in the java system using NWA or visual admin will be used as registerd server program in the abap system. In the rfc also you provide the gateway server and the port.
    Regards,
    Vamshi.

  • How to modify a code of a RFC Server Program

    Hello,
    In order to connect a BI System to a new ECC System, I need to modify a RFC Server Program.
    Please can you tell how can I modify this program?
    Thanks

    I think you are trying to run both server and client
    on one machine!!!
    It is impossible, your server is blocking the port to
    send packets, so you must run client on another
    computer!!!It's not impossible to run a client and server on the same machine just for testing or as a demo. Just have the server listen on one port and the client use a different port.
    No need to use 2 seperate computers. I've done it one computer before without a problem.
    Nick

  • About the communication issues in the client-server program

    About the communication issues in the client-server program
    Hi, I have some questions about the communication issues in a java project, which is basically the client and server architecture. In brief, the client, written in java, can be deployed anywhere, and in the following part, assume it is in the LAN (Local Area Network) which is connnected to the internet through the firewall and/or proxy, and the server, written in
    java too, simply provides the listening service on a port in a remote machine. And assume the server is connected to the internet directly so that the scenario can be simple to focus on the core questions.
    My questions are as follows:
    1 About the relationship between the communication port and protocol
    Generally, protocols at the application level like HTTP, FTP have their own default port, e.g., HTTP is corresponding to 80,
    FTP is to 25. But it is NOT necessary for the web server to provide the HTTP listening service at port 80, right? E.g, Tomcat provides the HTTP listening service at 8080. So it means the default relationship between the application protocl and their port is some routine, which is not necessary to follow, right?
    2 Assume a LAN connected to the internet through a proxy, which only allows HTTP protocol, then questions are:
    2.1 Does the proxy recognize the HTTP request from the client by the port number (carried in the request string)? For example, when the server provides the HTTP listening service at 80, then the request from the client will include the port number 80, then the proxy will parse such info and decide if or not the request can be out.
    2.2 Does the proxy recognize the HTTP request from the client by protocol (carried in the request string)? For example, the protocol used in the communicatin should be included in the request, then the proxy can parse it to make the decision.
    3 In java programm, if using the HTTP protcol, then on the client: the corresponding API is java.net.URLConnection, right?
    If using the TCP protocol directly, then on the client:the corresponding API is java.net.Socket, right? In both cases, the server side use the same API, java.net.ServerSocket?
    Is it correct to say that the communication by Socket is faster than URLConnection?
    4 Take MSN messenger for example, which protocol does it use? Since proxy configure is only the possible option, so I guess generally the TCP protocol is used directly so that the better perfomrance can be achieved, right?
    5 Given 3 computers within the same LAN, can the client, proxy, server environment above be correctly simulated? If so, can
    you recommend me some typical proxy program so that I can install it to configure such an enviroment to perform some test?
    6 I guess there should be some software to find out which port number a given program/process is going through to connect to
    the remote machine, and which port number a given program/process is listening on? Also, what protocl is used in the given
    communication.
    7 Finally, regarding each of the above questions, it will be highly appreciated that if you can recommed some references,
    tutorials, books etc. In summary, what I care about is how to enable the java client behind the proxy and firewall to
    communicate with the remote server without problems, so if you know some good tutorials plz let me know and thx in advance!
    Finally, thanks for your attention so such long questions =).

    FTP is to 25. But it is NOT necessary for the web
    server to provide the HTTP listening service at port
    80, right? E.g, Tomcat provides the HTTP listening
    service at 8080. So it means the default relationship
    between the application protocl and their port is
    some routine, which is not necessary to follow,
    right?Not sure what you're saying here.
    There must be a server listening on some port. The client must know what port that is. If you open the connection using the Socket class, you'll explicitly specify the port. If you use some higher level class like URLConnection or something in the commons Net package, there's probably a default port that will be used if you don't explicitly specify another.
    There's no way for the client to know that the HTTP request will go to port 80 instead of port 8080. If you think the the client contacts the server without explicitly naming a port, and then asks the server "get me your HTTP server", and the port is determined from that, you're mistaken.
    Not sure if you're thinking that, but it sounded like you might be.
    2 Assume a LAN connected to the internet through
    a proxy, which only allows HTTP protocol, then
    questions are:
    2.1 Does the proxy recognize the HTTP request
    from the client by the port number (carried in the
    request string)? For example, when the server
    provides the HTTP listening service at 80, then the
    request from the client will include the port number
    80, then the proxy will parse such info and decide if
    or not the request can be out. I'm not sure, but I think most proxies and firewalls are configured by ports. I thought I'd heard of more sophisticated, higher-level ones that could understand the content to some degree, but I don't know anything about those.
    3 In java programm, if using the HTTP protcol,
    then on the client: the corresponding API is
    java.net.URLConnection, right?That's one way.
    You might want to look into this:
    http://jakarta.apache.org/commons/httpclient/
    If using the TCP protocol directly, then on the
    client:the corresponding API is java.net.Socket,
    right? In both cases, the server side use the same
    API, java.net.ServerSocket? A Java client will user Socket, and a Java server will use ServerSocket and Socket.
    Is it correct to say that the communication by Socket
    is faster than URLConnection?Probably not.

  • JCo server programming, properties and connection settings

    Greetings, SAP professionals.
    The reason I come to this forum is that I'm hoping to gain some insights into the use of the SAP Java Connector (JCo). I am a developer who was tasked with making a new component for a systems integration application. As is typical of integration software, our app can link together various different systems using a variety of protocols, as well as providing the means to apply business logic on messages passed from one location to another. We already have a connector acting as an SAP client which was implemented using JCo. Now, we were asked to develop a new component: a server capable of accepting RFCs from a remote SAP system acting as client. The server is to be created using the JCo classes, so basically an extension of JCo.Server, with some logic for creating function templates from configuration files.
    However, while I'm understanding the structure of the Java API, it's not entirely clear to me just what the classes do. I've found the JavaDoc for JCo to be mostly descriptive of the interface of classes and methods, but not really explaining what these achieve, or how. So I'm hoping to be set straight, as I fear I'm kind of misunderstanding the functionality of JCo... Being mainly an integrations developer, I unfortunately often have to settle for gaining a superficial knowledge of a variety of systems to quickly interface with them, so I don't have any prior knowledge of SAP but still need to be able to implement something with JCo without too much delay.
    The most important question I have is this: when a JCO.Server implementation is started, does it act as a fully standalone component capable of receiving calls, or does it merely act as a sort of listener for some main SAP system? I'm not talking about a reliability on the two .dll files (or .so for Linux) that are required for the use of JCo, I just wish to know if the JCo package is entirely self-sufficient for server functionality or if it is intended to be linked to some SAP system.
    A second problem I have is that the parameters passed to various constructors aren't clear to me... I'm not familiar with SAP terminology, nor have I worked with any client apps that make use of an SAP system.
    The meaning of client strings, gwhost, gwservice, ashost, system IDs and program IDs mostly elude me, especially when it comes to knowing what client parameters must match what server parameters.
    In order to familiarize myself with the classes, I've tried playing around with them a bit trying to create a small test app that first starts a JCO.Server instance, then tries to make a remote function call to it with a JCO.Client (within the same class, for simplicity and debugging purposes). I was wondering if this actually makes sense... Would a JCo client be capable of connecting to a JCo server, all running purely in Java, or is that nonsense?
    To eliminate some common troubleshooting options, I'll quicly describe the steps I've taken:
    Both librfc32.dll and sapjcorfc.dll were placed in the Windows system32 folder. Maybe only librfd32 needs to be placed there, but I copied both anyway to make sure.
    The directory containing the jar file and both dll files is included in my environment path variable.
    I've added a line to the C:\Windows\system32\drivers\etc\services file as follows:
    sapgw00          3300/tcp                           #SAP System Gateway Port
    I've opened port 3300 in my Windows firewall. In fact, I also tested with the firewall completely turned off.
    However, I do not manage to get my test class to work. I've tried ports 3300, 3200 and 3600. I've tried various permutations of the client and server properties. I've tried removing the line from the services file, which would prompt the client to state upon connecting that the service "sapgw00" is unknown. When I add it back in, the error changes to "partner not reached", so it is definitely picking something up.
    The server itself starts just fine, but connecting through a client doesn't work. My class source code is posted below. Maybe what I'm trying to do doesn't make any sense, but at the moment it's my best guess.
    I realize this is a pretty long post and the class, while not exactly big, also implies a bit of reading of its own. But if anyone could give me any answers that are new to me, I'd be hugely grateful. Right now I'm kind of stuck, and just setting up the service and letting our customer test on it is a somewhat slow approach that can't match developing and testing on one and the same host.
    Preliminary thanks to everyone who took the effort to read this.
    //Start of code
    import java.util.Properties;
    import com.sap.mw.jco.IFunctionTemplate;
    import com.sap.mw.jco.IMetaData;
    import com.sap.mw.jco.IRepository;
    import com.sap.mw.jco.JCO;
    public class Test {
         public static void main(String[] args) {
              Test test = new Test();
              ServerThread serverThread = test.new ServerThread();
              serverThread.start();
              while(!serverThread.isReady) {
                   try {
                        Thread.sleep(5000);
                   } catch(final InterruptedException i) {
                        System.out.println("Rudely awakened");
              try {
    //               JCO.Function func = getSampleFunction(test, "STAY");
    //               serverThread.server.handleRequest(func);
    //               System.out.println(func.getExportParameterList().toXML());
    //               func = getSampleFunction(test, "STOP");
    //               serverThread.server.handleRequest(func);
    //               System.out.println(func.getExportParameterList().toXML());
                   final Properties clientProps = getClientProps();
                   JCO.Client client = JCO.createClient(clientProps);
                   client.connect();
                   IRepository rep = JCO.createRepository("1", client);
                   IFunctionTemplate templ = rep.getFunctionTemplate("TEST_FUNC");
                   JCO.Function function = templ.getFunction();
                   function.getImportParameterList().setValue("STAY", "FIELD1");
                   client.execute(function);
                   JCO.Function function2 = templ.getFunction();
                   function2.getImportParameterList().setValue("STOP", "FIELD1");
                   client.execute(function2);
              } catch(final Exception e) {
                   e.printStackTrace(System.out);
                   serverThread.requestStop();
                   while(serverThread.isAlive) {
                        try {
                             Thread.sleep(5000);
                        } catch(final InterruptedException i) {
                             System.out.println("Rudely awakened");
              } finally {
         private static Properties getClientProps() {
              final Properties props = new Properties();
              props.setProperty("jco.client.client", "100");
              props.setProperty("jco.client.user", "");
              props.setProperty("jco.client.passwd", "");
              props.setProperty("jco.client.lang", "");
              props.setProperty("jco.client.sysnr", "00");
              props.setProperty("jco.client.ashost", "/H/localhost/S/sapgw00");
              props.setProperty("jco.client.gwhost", "localhost");
              props.setProperty("jco.client.gwserv", "sapgw00");
              return props;
         public class ServerThread extends Thread {
              public void run() {
                   isAlive = true;
                   IRepository repos = new TestRepository("testrep");
                   repos.addFunctionInterfaceToCache(getFunctionInterface());
                   server = new TestServer(repos);
                   server.start();
                   System.out.println("Server successfully started");
                   isReady = true;
                   while(!stop) {
                        try {
                             Thread.sleep(1000);
                        } catch(final InterruptedException i) {
                             System.out.println("Wouldn't let me sleep...");
                        stop = server.stopRequested;
                   server.stop();
                   isAlive = false;
                   System.out.println("Server successfully stopped");
              public void requestStop() {
                   server.requestStop();
              public TestServer server;
              public boolean isReady = false;
              public boolean isAlive = false;
         public class TestServer extends JCO.Server {
              public TestServer(IRepository rep) {
                   super("localhost", "sapgw00", "PROGID", rep);
              public void handleRequest(JCO.Function fct) {
                   try {
                        JCO.ParameterList importParams = fct.getImportParameterList();
                        final String importXML = importParams.toXML();
                        System.out.println("XML representation of import parameters: ");
                        System.out.println(importXML);
                        final String input = importParams.getString("FIELD1");
                        System.out.println("FIELD1 value: " + input);
                        JCO.ParameterList exportParams = fct.getExportParameterList();
                        if(input.equals("STOP")) {
                             exportParams.getField("FIELD2").setValue("OK");
                             stopRequested = true;
                   catch(JCO.AbapException ex) {
                        throw ex;
                   catch(Throwable t) {
                        throw new JCO.AbapException("SYSTEM_FAILURE", t.getMessage());
              public boolean checkAuthorization(String functionName, int authorMode, String partner, byte[] key) {
                   System.out.println(functionName + " " + partner);
                   return true;
              public void requestStop() {
                   stopRequested = true;
              public boolean stopRequested = false;
         public class TestRepository extends JCO.BasicRepository implements IRepository {
              public TestRepository(String name) {
                   super(name);
         public static IMetaData getFunctionInterface() {
              JCO.MetaData metaData = new JCO.MetaData("TEST_FUNC");
              metaData.addInfo("FIELD1", IMetaData.TYPE_STRING, 4);
              metaData.setFlags(0, IMetaData.IMPORT_PARAMETER);
              metaData.addInfo("FIELDX", IMetaData.TYPE_STRING, 8);
              metaData.setFlags(1, IMetaData.IMPORT_PARAMETER & IMetaData.OPTIONAL_PARAMETER);
              metaData.addInfo("FIELD2", IMetaData.TYPE_STRING, 2);
              metaData.setFlags(2, IMetaData.EXPORT_PARAMETER);
              return metaData;
         public static JCO.Function getSampleFunction(Test test, String s) {
              TestRepository testRep = test.new TestRepository("testrepository");
              testRep.addFunctionInterfaceToCache(getFunctionInterface());
              JCO.Function func = testRep.getFunctionTemplate("TEST_FUNC").getFunction();
              func.getImportParameterList().setValue(s, "FIELD1");
              return func;
         private static boolean stop = false;

    If I understood you correctly, you want to provide a "service" that can be called from SAP. To provide this service you've chosen to implement an (external) RFC server program via JCo. One common method for RFC server programs is to register in SAP on the gateway - you do this by supplying the three parameters
    <ol>
    <li><b>jco.server.gwhost</b> -  SAP gateway host on which the server should be registered (so this would be the server name or IP address of the SAP gateway; localhost is only correct, if your RFC server program runs on the same server as the SAP gateway)</li>
    <li><b>jco.server.gwserv</b>  - Gateway service, i.e. the port on which a registration can be done</li>
    <li><b>jco.server.progid</b> - Program ID under which your RFC server program can be reached (free, made-up case sensitive name, that should represent the service your RFC server is providing)</li>
    </ol>
    So essentially you're creating a listener, that is registered in SAP and waits for any invocations. Within SAP they will define a <i>RFC destination</i>, which basically represents a TCP/IP connection pointing to the SAP gateway where you registered with the given program ID. If you want more details, check the SAP help pages for <a target="_blank" href="http://help.sap.com/saphelp_nw04/helpdata/en/22/04262b488911d189490000e829fbbd/content.htm">RFC destinations</a> (you're looking for destination type <b>T</b>, see explanations <a target="_blank" href="http://help.sap.com/saphelp_nw04/helpdata/en/22/042652488911d189490000e829fbbd/content.htm">here</a>).
    Usually gateway host and service (port) are given to you by the SAP basis folks and you tell them which program ID you're using. They will then enter those parameters in an RFC destination of type <b>T</b> in SAP. So no need for any of the client parameters you've mentioned. Although, I'd like to repeat, it's usually handy to also have SAP logon parameters maintained on your RFC server program, so that you can utilize the repository data from SAP (might be irrelevant in your case).
    Hope this clarifies it a bit...

  • How to register a program in Gateway

    Hi,
    In my daily monitoring schedule I have found in that all teleFAX mails are in failed status( SOST) error number 816. On further analysis I have found that the RFC for the FAX server ( SAPCONNECT_FAXSERVER ) is not working,it gives that the programxxxx.sapgate is not registered.
    Please let us know where we have to registered this program or any hint
    Thanks
    Jituda

    Hi,
    The registration is done from your Fax server software. Read the Fax server software documentation...
    Regards,
    Olivier

  • How to register a program in satgateway?

    Hello colleagues,
    I am trying to test a remote function call.
    steps to error:
    1) sm59--> ACTIONPAD_TCPIP_J2EE
    2)Press "Conenction test " button .
    Now i got the below error:
    Logon     Connection Error
    Error Details     Error when opening an RFC connection (CPIC-CALL: 'ThSAPOCMINIT' : cmRc=2 thRc=67
    Error Details     ERROR: program BTM_RTMF_NOTIFICATION not registered
    Error Details     LOCATION: SAP-Gateway on host vaci<sid>.wdf.sap.corp / sapgw00
    Error Details     DETAIL: TP BTM_RTMF_NOTIFICATION not registered
    Error Details     COMPONENT: SAP-Gateway
    Error Details     COUNTER: 20664
    Error Details     MODULE: gwr3cpic.c
    Error Details     LINE: 1693
    Error Details     RETURN CODE: 679
    Error Details     SUBRC: 0
    Error Details     RELEASE: 711
    Error Details     TIME: Mon Dec 13 10:16:21 2010
    Error Details     VERSION: 2
    In smgw i have checked the registered programs through the goto->logged clients
    In the registered programs the above mentioned program is not registered. This is the reason for the error.
    Solution i have tried:
    Tried to register the current program using the below command
    -->  ./rfcexec -a BTM_RTMF_NOTIFICATION -g vaci<sid> -x sapgw00
    ./rfcexec: Command not found.
    In the system i have seacrhed throughly as rfcexec file is not existed.
    but nearly one year back i have tried this same command and executed it.
    Now it is not working.. could you please provide solution to register the program in sapgateway.
    Thanks and Regards,
    Siva

    Hi,
    If BTM_RTMF_NOTIFICATION is an RFC server program, you don't have to use rfcexec.exe.
    rfcexec.exe is an RFC server standard SAP exemple program. It may be used to start scripts on a distant server but it is usually a bad solution because the registration is lost after each restart of the SAP backend system.
    If the RFC Server program is not able to re register automatically in cas of a SAP beckend restart, one possible solution is to install a SAP standalone Gateway on the external server and to register the RFC server program on the standalone gateway.
    You, then, define the RFC destination to use the standalone gateway.
    Regards,
    Olivier

Maybe you are looking for