Problem importing RFC/IDOC

Hi All,
While importing RFC/IDOC, there are 3 steps
1. Logon
2. Choose Objects
3. Execute imports
After giving the reqd info in logon, I can go to the next step, but here when I click on RFC or IDOC, I am not able to see the RFCs or IDOCS, IR is not responding, the screen goes blank and I have to close the application(IR).
Any help is appreciated.
Thanks,
Jai Shankar

>>wasn't it 3 that felt like 15 ?
No i guess it is a 15 actually.
>>do you have many Zidoc - ZRFC ?
Yes. This is a IDES system I am connectin to. So lot of them.
Thanks,
Jai Shankar

Similar Messages

  • Error importing RFC / idoc despite following note 769356

    We have been experiencing a number of problems where we cannot import RFC / idocs in the integration repository.  The BASIS team have followed note 769356 and originally this solved the problem but meant that we reverted back to old screens in the Integration Builder and some German texts in the Integration Repository.
    Current patch version is Support Stack 4
    To get to this point the following steps were followed:
    Undeployed com.sap.xi.repository
    Deployed the install version of com.sap.xi.repository.
    In order to correct the problems with the incorrect screens etc.. The following steps were carried out:
    Undeployed com.sap.xi.repository
    Deployed the Support Stack 4 version of XITOOLS (includes com.sap.xi.repository)
    Applied Support Stack 5 for the Abap kernel
    Applied SAPXIAFC04P_1-20000272 and SAPXITOOL04P_1-20000274 via SDM
    This fixed all of the problems with German texts etc.. but now we cannot import RFC / idocs again.  In the Java Web Start Log (attached) we still get the error message
    mentioned in note 769356.  We have deleted the Web Start Cache on the client hosts (several restarts of the machine and deletions of the cache).  The BASIS guys are going to undeploy and redeploy the repository again but failing that we are running out of ideas.
    Does anyone have any suggestions?
    Here is the entry in the log file:
    java.lang.AbstractMethodError: com.sap.aii.ibrep.sbeans.upload.UploadServiceRemote_Stub.openSAPSource(Lcom/sap/aii/utilxi/misc/r3Connect/SAPConnectionData;Lcom/sap/aii/utilxi/misc/r3Connect/SAPLoginData;Lcom/sap/aii/ib/bom/gen/VersionContext;)Lcom/sap/aii/ibrep/sbeans/upload/SourceID;at com.sap.aii.ibrep.clsif.upload.RemoteUploadClient$ConnectionImpl.connectBean(RemoteUploadClient.java:107)at com.sap.aii.ibrep.clsif.upload.RemoteUploadClient$ConnectionImpl.<init>(RemoteUploadClient.java:91)at com.sap.aii.ibrep.clsif.upload.RemoteUploadClient.getSAPUploadConnection(RemoteUploadClient.java:66)at com.sap.aii.ibrep.gui.tools.r3import.wizard.SAPLogonPage.connect(SAPLogonPage.java:94)at com.sap.aii.ibrep.gui.tools.r3import.wizard.R3ImportWizard$LoginTask.run(R3ImportWizard.java:456)at com.sap.aii.utilxi.misc.thread.ThreadPool$ThreadPoolThread.run(ThreadPool.java:321)

    Dan,
    you are almost there!
    If you religiously follow note 769356, you should not have this problem.
    Just do the following as the note suggests:
    - From SDM, undeploy only the com.sap.xi.repository
    - Unzip SAPXITOOL04P_1-20000274.SCA.zip 
    - The file ExchangeRepository.sda will be one of the extracted files
    - Only import the ExchangeRepository.sda.  Do not import the entire ZIP package.
    - Restart the J2EE engine.
    - Delete Webstart Cache
    - From the XI admin page:
    http://XIhost:50000/rep/support/admin/status.html
    Re-Initialize the Jars for resigning.
    - Wait for 5 minutes for the jar signing to finish. Sometimes, the jar signing gets interrupted, you have to let it finish.
    The above steps worked for me.
    thanks,
    Manish

  • Import RFC/IDOC error

    Hi all,
    I am following "How to...push data in to BW from XI."
    In the 5th step in the document it is given
    Choose "Import RFC/IDOC" in the context menu of "Imported Objects" and enter your user data to logon to the BW system.
    Select the function module /BIO/Q16ASENDXMLDATATOBW_RFC
    Press "continue"
    Press "Start"
    But when I do this I am getting a java nullpointer exception error com.sap.aii.ibrep.sbeans.upload.remoteuploadexception:jsva.lang.nullpointerexception
    I am using jre1.4.2_10 and java web start version 1.4.2
    Please help me in resolving this issue.
    Regards,
    Aanand

    Hi Anand,
            Can you pls make sure that no other users have this same RFC imported into your XI integration builder and is waiting to get their change list activated. In that case also we get the error in importing...
    check these links also.
    Error importing RFC / idoc despite following note 769356
    Cheers
    JK

  • Problem: Import an IDoc from R/3

    Hi,
    I have some problems to import a simple IDoc...
    In a 1st times, connection to R/3 is ok and I can select some idocs among the list, but after some clicks, I have the following error messages:
    1. <i>Problems to reach R3 System</i>
    2. <i>Connection to server lost. System is logging you on again automatically Once logged on, repeat the action</i>
    [NDLR: this one of XI]
    3. <i>Problems to reach R3 System</i>
    Anybody can help me?
    P.S : It's not my 1st Idoc import and between the last times and this one(3 months ago), there were mainly two changes: upgrading of XI from SP09 to SP11 and adding a domain name for each server objects (R/3 and XI).
    Regards.
    Mickael Huchet
    Message was edited by: Mickael Huchet

    Hi,
    Did you check "Pre-requisites" section in this link:
    http://help.sap.com/saphelp_nw04/helpdata/en/2b/a48f3c685bc358e10000000a11405a/frameset.htm
    I think the connection from IB to the server is timing too soon for some reason. Contact your BASIS team about this problem. Also check whether there are any network issues.
    Regards,
    Sridhar

  • Can not modify/import RFC/IDoc

    After I import design object to IR, I can't import IDoc from SAP system.
    there I can not change system, client, information.
    Why?

    hi
    Just double click on the software component and check whether the radio button Import of RFCS and IDOCs interfaces from SAP systems Permitted. Then you give R3 applicaiton server name and the system number as 00 and give your userid and password.
    You can also get your R3 applicaiton server name from the SAP logon pad. Open SAP Logon pad select the R3 system which you want to connect and click on Change Item. There your application server name is given. So cross check once again whether this one and the one you are giving are the same. Then proceed further. It should work.
    Note: reward points if solution found helpfull
    Regards
    Chandrakanth.k

  • Problem importing idoc to XI integration repository

    I have deleoped a custom IDOC and released in SAP/R3. Next I have imported it to XI using transaction IDX2 without problems.
    However, when I try to import the metadata to the integration repository, I can't find it in the list of available IDOcs. I have tried to refresh the catches, and even restartet the XI server, but i doesn't help.
    Any suggestions ?

    Hi Henrik,
                    See if these threads help :
    importing IDOC in XI for interface mapping
    IDOC in IDX2 is not visible in while importing into XI Design Component.
    Settings in XI side to receive IDOC  from  application server
    Check this link to know minimum authorizations required for a user to import RFC/Idocs.
    http://help.sap.com/saphelp_nw04/helpdata/en/2b/a48f3c685bc358e10000000a11405a/content.htm

  • Problem with import of IDOC fromSAP 3.1i to PI 7.0

    Hi ,
    I have an IDOC as ZXYZ.ORDERS01 in SAP R/3 3.1i System, I am unable to import the IDOC in PI7.0
    Let me know the process to import that idoc.
    ( I am Doing IDOC to File and file to IDOC Scenario )
    Regards,
    Edited by: TomShey on Sep 22, 2010 6:27 PM

    Hi,
    We also had same problem of unable to import IDOC structures automatically from SAP 3.1I to XI/PI, as the support of this feature as mentioned by SAP starts from version >= 4.0.
    Please find the prerequisite as mentioned in help.sap.com
    Prerequisites
    The SAP system from which you want to import the RFCs or IDocs must contain function modules for calling metadata. You can import RFCs and IDocs from SAP Release 4.0 and higher. The table below gives an overview of the required support packages:
    (http://help.sap.com/saphelp_nw04/helpdata/en/14/80243b4a66ae0ce10000000a11402f/frameset.htm)
    So as per my experience, I could identify three options after indepth investigation.
    1. Recreate the IDOC structures in another SAP system which is of latest version >= 4.0 may be IDES, and then import the structure in IR for further developments. This is the option we are using for our developments now.
    2. Get WSDL of the IDOC structure by creating manually the structure using XML Enterprise edition using the complete syntax or xpath and import as external definitions and use it in mapping.
    3. Re-create the IDOC structure in XI system itself and try to use it.
    Let me know if this helped you.
    Regards,
    Bindu

  • Imported RFC with problem in converting to XML

    Hello,
    another nice issue:
    I have an aRFC with this import parameter from ABAP:
    data: p_data type tab512 occurs 0.
    Call function.......
    Tables
    DATA = p_data
    This is the XML source from the mapping test in Int.Rep.
    <?xml version="1.0" encoding="UTF-8"?>
    <ns:Z_BI_SEND_DATA_512 xmlns:ns="urn:sap-com:document:sap:rfc:functions">
      <SYSID_HOME>AAA</SYSID_HOME>
      <TARGETSYS>BBB</TARGETSYS>
      <DATA>
        <item>test1</item>
        <item>test2</item>
        <item>test3</item>
      </DATA>
    </ns:Z_BI_SEND_DATA_512>
    This is the payload from SXMB_MONI:
    <?xml version="1.0" encoding="UTF-8" ?>
    - <rfc:Z_BI_SEND_DATA_512 xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
      <SYSID_HOME>AAA</SYSID_HOME>
      <TARGETSYS>BBB</TARGETSYS>
    - <DATA>
    - <item>
      <WA>test1</WA>
      </item>
    - <item>
      <WA>test2</WA>
      </item>
    - <item>
      <WA>test3</WA>
      </item>
      </DATA>
      </rfc:Z_BI_SEND_DATA_512>
    Looks like there is a difference (imported RFC in mapping does not show the work area WA)(so: mapping requires
    <DATA>
        <item>test1</item>
    but RFC generates
    - <DATA>
    - <item>
      <WA>test1</WA>
    which hinders the mapping from moving the item lines into the destination file because in mapping the WA area cannot be linked as it is not recognized in mapping.
    Any ideas are welcome!
    Regards
    Dirk

    Hi everyone
    My problem is related to Dirk's one in that I am using an RFC to send XML data from CRM to XI.
    I am trying to send the following string:
    <TEST>GREG</TEST>
    However on XI the payload looks like this:
    <xml version="1.0" encoding="UTF-8"?>
    <rfc:_-MARS_-CPE_IMPORT_CRM_CATALOG xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
    <IV_CATALOG>&#60;TEST&#62;GREG&#60;/TEST&#62;</IV_CATALOG></rfc:_-MARS_-CPE_IMPORT_CRM_CATALOG>
    As you can see < is converted into &#60;
    Where and how do I specify that the content of the parameter must not be interpreted?
    Thanks
    Greg

  • Problem in Importing RFC from ECQ to XIQ

    Hi.....
    I have a problem in importing the RFC from ECC Quality Server to PI Quality Server.......
    When I fill the fields like
    Application Server......
    System Number.....
    UserName
    Password.....
    I am getting a screen Problem.....in which error information is given....
    One of the error is UserName(XXXX) cannot have access to aii.sap......
    Please help me.....
    Thanks,
    Sudheer

    Hi Sudheer,
    Kindly check the user having all authorizations which you are try to importing the RFC's from ECQ to XIQ, check with your basis team and try to provide the required authorizations for that particular user.
    Then you can able to import RFC's and do the design by activating the objects.
    Regards
    Venkat Rao .G

  • Problems with sending IDOC via RFC from Unicode to NonUnic

    Hello
    I have following problem, sending an IDOC via RFC from Unicode to Non Unicode System. IDoc is not sent with error: codepage of receiver system cant determined. receiver destination was: Message no. B1999
    I have tried different options in sm59, but it didnt help.
    Any ideas? The recipient system is rather old, version 4.0

    hey,
    I had a similar experience. I was interfacing between 4.6 (RFC), PI and ECC 6.0 (ABAP Proxy). When data was passed from ECC to 4.6, RFC received them incorrectly. So i had to send trimmed strings from ECC and receive them as strings in RFC (esp for CURR and QUAN fields). Also the receiver communication channel in PI (between PI and  RFC) had to be set as Non unicode. This helped a bit. But still I am getting 2 issues, truncation of values and some additional digits !! But the above changes resolved unwanted characters problem like "<" and "#". You can find a related post in my id. Hope this info helps..

  • Importing RFC from 4.5B problem

    Every one,
    I am trying import RFC from 4.5B, I have given all the correct details.
    It is giving an error "Problems to reach R/3 System" and connection to XI server is lost and I have to log-in again.
    Reg,
    -Naveen.
    Message was edited by: naveen chitluri
    Message was edited by: naveen chitluri

    Hello,
    Can any one please help me on this?
    -Naveen.

  • Problem while importing RFC function module in XI. Please Help!

    Hi Experts,
               When I try to import RFC function module in XI I get the following error:
                 **Ready for import**
    Import started...
    YCOP_VALIDATE_GR:
      + com.sap.aii.ibrep.sbeans.upload.RemoteUploadException: connection closed without message (CM_NO_DATA_RECEIVED)
    Import failed with 1 error
    Any idea why is this error? How to resolve this?
    Thanks
    Gopal

    Hi
       The problem still persists.
       This is what I have done:
        1. My FM is RFC enabled. In the "Attribute" tab of the FM I have selected "Remote-enabled module" and "Start immed".
    2.Activated and tested the FM.
    3.Released the FM. In se37, Function Module -> Release ->Release. 
    4.Tried to import this FM in XI under "RFC". Get the same error.
    I have some questions:
    1. After releasing the FM do I have to activate it?
    2. In release there is "Internal Release" Do I have to use that?
    3.Do I have to do "Internal Release" first then "Release"?
    4.The FM i am trying to import makes a call to another FM. Both the FMs are in the same system. Both are remote enabled. The second FM updates data in custom table. the first FM which I am importing validates the data and then calls the second FM for update. Do I have to import both FMs?
    Please help me!
    Thanks
    Gopal

  • Problem in mapping xml data with imported RFC parameters

    I am currently working on a senario in which a flat file is generated by an RFID server and placed in FTP server.
    The flat file is picked up from the FTP server using XI and the contents are mapped to the corresponding imported RFC parameters.
    The content of the file which is in text format is successfully converted in XML at the XI side.
    File contains records of 2 fields Functional location and RFID equipment number . In the R/3 side these fields
    are used as Functional location and equipment number of PM module .
    The structure of the FTP message is as follows
    <ns:RFID_MSG_TYPE xmlns:ns="urn://sisl:rfiddemo">
    <RecordSet>
      <Row>
       <FL1>"f1</FL1>
       <FL2>01</FL2>
       <FL3>01</FL3>
       <RFID_NUM>I001"</RFID_NUM>
      </Row>
    </RecordSet>
    </ns:RFID_MSG_TYPE>
    After the mapping program which maps the above structure to the imported RFC is executed the following payload document is generated
    <ns:ZRFID_EQUIP xmlns:ns="urn:sap-com:document:sap:rfc:functions">
    <RECORDS>
      <item>
       <FLOC>f1-01-01</FLOC>
       <RFID_NO>I001</RFID_NO>
      </item>
    </RECORDS>
    </ns:ZRFID_EQUIP>
    The size of FLOC is 30 of type string and RFID_NO is also a string with size 18.
    When the data is brought in R/3 both the fields FLOC and RFID_NO gets mapped in FLOC which is of type char30.

    Hi Naveen,
    In sxmb_moni the content transmitted to the adapter(RFC)is as follows
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns:ZRFID_EQUIP xmlns:ns="urn:sap-com:document:sap:rfc:functions">
    - <RECORDS>
    - <item>
      <FLOC>f1-01-01</FLOC>
      <RFID_NO>I006</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-02</FLOC>
      <RFID_NO>I002</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-03</FLOC>
      <RFID_NO>I003</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-04</FLOC>
      <RFID_NO>I004</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-05</FLOC>
      <RFID_NO>I005</RFID_NO>
      </item>
    - <item>
      <FLOC>f1-01-06</FLOC>
      <RFID_NO>I001</RFID_NO>
      </item>
      </RECORDS>
      </ns:ZRFID_EQUIP>
    At r/3 side the field floc and rfid_no gets mapped to floc which is of char30
    eg floc=f1-01-01I006
       rfid_no=

  • Importing RFC from R/3 3.1i PI 7.0

    Hi,
    The scenario is picking a file from third party FTP sever and posting an Idoc into SAP R/3 3.1i using PI 7.0. In between we call an RFC from R/3 3.1i from PI 7.0 for converting values. The problem here is, where we tried to import RFC from R/3 3.1i into PI 7.0, its is not allowing to import.It says unauthorized access, even though i had permissions to do that.
    1:) Is this a compatible issue?
    2:) Can we import RFC from 3.1i into Pi 7.0? Then why i am not able to?
    3:) Is there any other way to use that function module in mapping?

    Hello
    1:) Is this a compatible issue?
    - yes
    2:) Can we import RFC from 3.1i into Pi 7.0? Then why i am not able to?
    - No, this is not supported. The import of RFCs and IDocs is supported from SAP Release 4.0 and higher.
    3:) Is there any other way to use that function module in mapping?
    - If the RFC is not too complex, just created the objects in the ESR. Or import from a system which is > 4.0.
    Check the KBA #1535964 How to import an IDoc/RFC into the ESR, for further details.
    Regards
    Mark

  • Problem in receving IDOCS

    I have a problem receving an IDOC. I checked the SM58 Xn and it says " Error when opening RFC connection "
    So I reprocessed the IDOC by transaction WE19 and then BD87 where SAP says it has sent the IDOC and staus is set to 03.
    However I again checked SM58 this time it says " RfcAbort : Cannot lock transaction " ........
    any idea or pointers as what the problem is or might be?
    Below is the RFC Server code which i am using......it is the sample code that comes along with the  sapjco.jar
    Thanks a lot
    package milestone.ups;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.util.Hashtable;
    import java.util.Map;
    import java.util.Properties;
    import com.sap.conn.jco.JCoException;
    import com.sap.conn.jco.JCoFunction;
    import com.sap.conn.jco.ext.DestinationDataProvider;
    import com.sap.conn.jco.ext.ServerDataProvider;
    import com.sap.conn.jco.server.DefaultServerHandlerFactory;
    import com.sap.conn.jco.server.JCoServer;
    import com.sap.conn.jco.server.JCoServerContext;
    import com.sap.conn.jco.server.JCoServerContextInfo;
    import com.sap.conn.jco.server.JCoServerErrorListener;
    import com.sap.conn.jco.server.JCoServerExceptionListener;
    import com.sap.conn.jco.server.JCoServerFactory;
    import com.sap.conn.jco.server.JCoServerFunctionHandler;
    import com.sap.conn.jco.server.JCoServerState;
    import com.sap.conn.jco.server.JCoServerStateChangedListener;
    import com.sap.conn.jco.server.JCoServerTIDHandler;
    public class StepByStepServer
        static String SERVER_NAME1 = "SERVER";
        static String DESTINATION_NAME1 = "ABAP_AS_WITHOUT_POOL";
        static String DESTINATION_NAME2 = "ABAP_AS_WITH_POOL";
        static MyTIDHandler myTIDHandler = null;
        static
            Properties connectProperties = new Properties();
            connectProperties.setProperty(DestinationDataProvider.JCO_ASHOST, " PRIVATE_IP ");
            connectProperties.setProperty(DestinationDataProvider.JCO_SYSNR, "01");
            connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, "001");
            connectProperties.setProperty(DestinationDataProvider.JCO_USER, " usr");
            connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, "pwd ");
            connectProperties.setProperty(DestinationDataProvider.JCO_LANG, "en");
            createDataFile(DESTINATION_NAME1, "jcoDestination", connectProperties);
            connectProperties.setProperty(DestinationDataProvider.JCO_POOL_CAPACITY, "3");
            connectProperties.setProperty(DestinationDataProvider.JCO_PEAK_LIMIT, "10");
            createDataFile(DESTINATION_NAME2, "jcoDestination", connectProperties);
            Properties servertProperties = new Properties();
            servertProperties.setProperty(ServerDataProvider.JCO_GWHOST, " PRIVATE_IP ");
            servertProperties.setProperty(ServerDataProvider.JCO_GWSERV, "sapgw01");
            servertProperties.setProperty(ServerDataProvider.JCO_PROGID, "JCO_SERVER");
            servertProperties.setProperty(ServerDataProvider.JCO_REP_DEST, "ABAP_AS_WITH_POOL");
            servertProperties.setProperty(ServerDataProvider.JCO_CONNECTION_COUNT, "2");
            createDataFile(SERVER_NAME1, "jcoServer", servertProperties);
        static void createDataFile(String name, String suffix, Properties properties)
            File cfg = new File(name + "." + suffix);
            if(!cfg.exists())
                try
                    FileOutputStream fos = new FileOutputStream(cfg, false);
                    properties.store(fos, "for tests only !");
                    fos.close();
                catch(Exception e)
                    throw new RuntimeException("Unable to create the destination file " + cfg.getName(), e);
        static class StfcConnectionHandler implements JCoServerFunctionHandler
            public void handleRequest(JCoServerContext serverCtx, JCoFunction function)
                System.out.println("----
                System.out.println("call              : " + function.getName());
                System.out.println("ConnectionId      : " + serverCtx.getConnectionID());
                System.out.println("SessionId         : " + serverCtx.getSessionID());
                System.out.println("TID               : " + serverCtx.getTID());
                System.out.println("repository name   : " + serverCtx.getRepository().getName());
                System.out.println("is in transaction : " + serverCtx.isInTransaction());
                System.out.println("is stateful       : " + serverCtx.isStatefulSession());
                System.out.println("----
                System.out.println("gwhost: " + serverCtx.getServer().getGatewayHost());
                System.out.println("gwserv: " + serverCtx.getServer().getGatewayService());
                System.out.println("progid: " + serverCtx.getServer().getProgramID());
                System.out.println("----
                System.out.println("attributes  : ");
                System.out.println(serverCtx.getConnectionAttributes().toString());
                System.out.println("----
                System.out.println("CPIC conversation ID: " + serverCtx.getConnectionAttributes().getCPICConversationID());
                System.out.println("----
                System.out.println("req text: " + function.getImportParameterList().getString("REQUTEXT"));
                function.getExportParameterList().setValue("ECHOTEXT", function.getImportParameterList().getString("REQUTEXT"));
                function.getExportParameterList().setValue("RESPTEXT", "Hello World");
                // In sample 3 (tRFC Server) we also set the status to executed:
                if(myTIDHandler != null)
                    myTIDHandler.execute(serverCtx);
        static class MyThrowableListener implements JCoServerErrorListener, JCoServerExceptionListener
            public void serverErrorOccurred(JCoServer jcoServer, String connectionId, JCoServerContextInfo serverCtx, Error error)
                System.out.println(">>> Error occured on " + jcoServer.getProgramID() + " connection " + connectionId);
                error.printStackTrace();
            public void serverExceptionOccurred(JCoServer jcoServer, String connectionId, JCoServerContextInfo serverCtx, Exception error)
                System.out.println(">>> Error occured on " + jcoServer.getProgramID() + " connection " + connectionId);
                error.printStackTrace();
        static class MyStateChangedListener implements JCoServerStateChangedListener
            public void serverStateChangeOccurred(JCoServer server, JCoServerState oldState, JCoServerState newState)
                // Defined states are: STARTED, DEAD, ALIVE, STOPPED;
                // see JCoServerState class for details.
                // Details for connections managed by a server instance
                // are available via JCoServerMonitor
                System.out.println("Server state changed from " + oldState.toString() + " to " + newState.toString() + " on server with program id "
                        + server.getProgramID());
        static void step2SimpleServer()
            JCoServer server;
            try
                server = JCoServerFactory.getServer(SERVER_NAME1);
            catch(JCoException ex)
                throw new RuntimeException("Unable to create the server " + SERVER_NAME1 + ", because of " + ex.getMessage(), ex);
            JCoServerFunctionHandler stfcConnectionHandler = new StfcConnectionHandler();
            DefaultServerHandlerFactory.FunctionHandlerFactory factory = new DefaultServerHandlerFactory.FunctionHandlerFactory();
            factory.registerHandler("STFC_CONNECTION", stfcConnectionHandler);
            server.setCallHandlerFactory(factory);
            // additionally to step 1
            MyThrowableListener eListener = new MyThrowableListener();
            server.addServerErrorListener(eListener);
            server.addServerExceptionListener(eListener);
            MyStateChangedListener slistener = new MyStateChangedListener();
            server.addServerStateChangedListener(slistener);
            server.start();
            System.out.println("The program can be stoped using <ctrl>+<c>");
        static class MyTIDHandler implements JCoServerTIDHandler
            Map<String, TIDState> availableTIDs = new Hashtable<String, TIDState>();
            public boolean checkTID(JCoServerContext serverCtx, String tid)
                // This example uses a Hashtable to store status information. But usually
                // you would use a database. If the DB is down, throw a RuntimeException at
                // this point. JCo will then abort the tRFC and the R/3 backend will try
                // again later.
                System.out.println("TID Handler: checkTID for " + tid);
                TIDState state = availableTIDs.get(tid);
                if(state == null)
                    availableTIDs.put(tid, TIDState.CREATED);
                    return true;
                if(state == TIDState.CREATED || state == TIDState.ROLLED_BACK)
                    return true;
                return false;
                // "true" means that JCo will now execute the transaction, "false" means
                // that we have already executed this transaction previously, so JCo will
                // skip the handleRequest() step and will immediately return an OK code to R/3.
            public void commit(JCoServerContext serverCtx, String tid)
                System.out.println("TID Handler: commit for " + tid);
                // react on commit e.g. commit on the database
                // if necessary throw a RuntimeException, if the commit was not
                // possible
                availableTIDs.put(tid, TIDState.COMMITTED);
            public void rollback(JCoServerContext serverCtx, String tid)
                System.out.println("TID Handler: rollback for " + tid);
                availableTIDs.put(tid, TIDState.ROLLED_BACK);
                // react on rollback e.g. rollback on the database
            public void confirmTID(JCoServerContext serverCtx, String tid)
                System.out.println("TID Handler: confirmTID for " + tid);
                try
                    // clean up the resources
                // catch(Throwable t) {} //partner wont react on an exception at
                // this point
                finally
                    availableTIDs.remove(tid);
            public void execute(JCoServerContext serverCtx)
                String tid = serverCtx.getTID();
                if(tid != null)
                    System.out.println("TID Handler: execute for " + tid);
                    availableTIDs.put(tid, TIDState.EXECUTED);
            private enum TIDState
                CREATED, EXECUTED, COMMITTED, ROLLED_BACK, CONFIRMED;
        public static void main(String[] a)
            // step1SimpleServer();
            step2SimpleServer();
            // step3SimpleTRfcServer();

    thx sameer.
    I am sending IDOCs when delivery is created i.e through transaction VL01N /VL02N.
    I dont know for some reason i dont have mw ppackage in my sapjco.jar. I got from the sap market place.
    I modified the code to handle IDOC request as u sugguested. I have put system.out in the code to check whether handler is being invovked? But it didnt when I run the code.
    I tried to reprocess the IDOC through we19....but they failed(as shown in sm58).
    Here is the modified code....
    package milestone.ups;
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.OutputStreamWriter;
    import java.util.Hashtable;
    import java.util.Map;
    import java.util.Properties;
    import com.sap.conn.idoc.IDocDocumentList;
    import com.sap.conn.idoc.IDocXMLProcessor;
    import com.sap.conn.idoc.jco.JCoIDoc;
    import com.sap.conn.idoc.jco.JCoIDocHandler;
    import com.sap.conn.idoc.jco.JCoIDocHandlerFactory;
    import com.sap.conn.idoc.jco.JCoIDocServerContext;
    import com.sap.conn.jco.JCoException;
    import com.sap.conn.jco.ext.DestinationDataProvider;
    import com.sap.conn.jco.ext.ServerDataProvider;
    import com.sap.conn.jco.server.JCoServer;
    import com.sap.conn.jco.server.JCoServerContext;
    import com.sap.conn.jco.server.JCoServerContextInfo;
    import com.sap.conn.jco.server.JCoServerErrorListener;
    import com.sap.conn.jco.server.JCoServerExceptionListener;
    import com.sap.conn.jco.server.JCoServerState;
    import com.sap.conn.jco.server.JCoServerStateChangedListener;
    import com.sap.conn.jco.server.JCoServerTIDHandler;
    import com.sap.conn.idoc.jco.*;
    public class StepByStepServer
        static String SERVER_NAME1 = "SERVER";
        static String DESTINATION_NAME1 = "ABAP_AS_WITHOUT_POOL";
        static String DESTINATION_NAME2 = "ABAP_AS_WITH_POOL";
        static MyTIDHandler myTIDHandler = null;
        static
            Properties connectProperties = new Properties();
            connectProperties.setProperty(DestinationDataProvider.JCO_ASHOST, "172.31.64.74");
            connectProperties.setProperty(DestinationDataProvider.JCO_SYSNR, "01");
            connectProperties.setProperty(DestinationDataProvider.JCO_CLIENT, "001");
            connectProperties.setProperty(DestinationDataProvider.JCO_USER, "US9904");
            connectProperties.setProperty(DestinationDataProvider.JCO_PASSWD, "us9904");
            connectProperties.setProperty(DestinationDataProvider.JCO_LANG, "en");
            createDataFile(DESTINATION_NAME1, "jcoDestination", connectProperties);
            connectProperties.setProperty(DestinationDataProvider.JCO_POOL_CAPACITY, "3");
            connectProperties.setProperty(DestinationDataProvider.JCO_PEAK_LIMIT, "10");
            createDataFile(DESTINATION_NAME2, "jcoDestination", connectProperties);
            Properties servertProperties = new Properties();
            servertProperties.setProperty(ServerDataProvider.JCO_GWHOST, "172.31.64.74");
            servertProperties.setProperty(ServerDataProvider.JCO_GWSERV, "sapgw01");
            servertProperties.setProperty(ServerDataProvider.JCO_PROGID, "JCO_SERVER");
            servertProperties.setProperty(ServerDataProvider.JCO_REP_DEST, "ABAP_AS_WITH_POOL");
            servertProperties.setProperty(ServerDataProvider.JCO_CONNECTION_COUNT, "2");
            createDataFile(SERVER_NAME1, "jcoServer", servertProperties);
        static void createDataFile(String name, String suffix, Properties properties)
            File cfg = new File(name + "." + suffix);
            if(!cfg.exists())
                try
                    FileOutputStream fos = new FileOutputStream(cfg, false);
                    properties.store(fos, "for tests only !");
                    fos.close();
                catch(Exception e)
                    throw new RuntimeException("Unable to create the destination file " + cfg.getName(), e);
        static class MyIDocHandler implements JCoIDocHandler
            public void handleRequest(JCoServerContext serverCtx, IDocDocumentList idocList)
                 System.out.println("IN Handler");   - THIS DIDNT PRINT on the CONSOLE             FileOutputStream fos=null;
                OutputStreamWriter osw=null;
                  try
                       IDocXMLProcessor xmlProcessor =
                            JCoIDoc.getIDocFactory().getIDocXMLProcessor();
                    fos=new FileOutputStream(serverCtx.getTID()+"_idoc.xml");
                    osw=new OutputStreamWriter(fos, "UTF8");
                       xmlProcessor.render(idocList, osw,
                                 IDocXMLProcessor.RENDER_WITH_TABS_AND_CRLF);               
                       osw.flush();
                  catch (Throwable thr)
                       thr.printStackTrace();
                finally
                    try
                        if (osw!=null)
                            osw.close();
                        if (fos!=null)
                            fos.close();
                    catch (IOException e)
                        e.printStackTrace();
        static class MyIDocHandlerFactory implements JCoIDocHandlerFactory
             private JCoIDocHandler handler = new MyIDocHandler();
             public JCoIDocHandler getIDocHandler(JCoIDocServerContext serverCtx)
                  System.out.println("Handler Object created and invoked");
                  return handler;
        static class MyThrowableListener implements JCoServerErrorListener, JCoServerExceptionListener
            public void serverErrorOccurred(JCoServer jcoServer, String connectionId, JCoServerContextInfo serverCtx, Error error)
                System.out.println(">>> Error occured on " + jcoServer.getProgramID() + " connection " + connectionId);
                error.printStackTrace();
            public void serverExceptionOccurred(JCoServer jcoServer, String connectionId, JCoServerContextInfo serverCtx, Exception error)
                System.out.println(">>> Error occured on " + jcoServer.getProgramID() + " connection " + connectionId);
                error.printStackTrace();
        static class MyStateChangedListener implements JCoServerStateChangedListener
            public void serverStateChangeOccurred(JCoServer server, JCoServerState oldState, JCoServerState newState)
                // Defined states are: STARTED, DEAD, ALIVE, STOPPED;
                // see JCoServerState class for details.
                // Details for connections managed by a server instance
                // are available via JCoServerMonitor
                System.out.println("Server state changed from " + oldState.toString() + " to " + newState.toString() + " on server with program id "
                        + server.getProgramID());
        static void step2SimpleServer()
             JCoIDocServer server;
            try
                server = JCoIDoc.getServer(SERVER_NAME1);
            catch(JCoException ex)
                throw new RuntimeException("Unable to create the server " + SERVER_NAME1 + ", because of " + ex.getMessage(), ex);
            //JCoServerFunctionHandler stfcConnectionHandler = new StfcConnectionHandler();
            server.setIDocHandlerFactory(new MyIDocHandlerFactory());
            //factory.registerHandler("STFC_CONNECTION", stfcConnectionHandler);
            // additionally to step 1
            MyThrowableListener eListener = new MyThrowableListener();
            server.addServerErrorListener(eListener);
            server.addServerExceptionListener(eListener);
            MyStateChangedListener slistener = new MyStateChangedListener();
            server.addServerStateChangedListener(slistener);
            server.start();
            System.out.println("Server Started");
            System.out.println("The program can be stoped using <ctrl>+<c>");
        static class MyTIDHandler implements JCoServerTIDHandler
            Map<String, TIDState> availableTIDs = new Hashtable<String, TIDState>();
            public boolean checkTID(JCoServerContext serverCtx, String tid)
                // This example uses a Hashtable to store status information. But usually
                // you would use a database. If the DB is down, throw a RuntimeException at
                // this point. JCo will then abort the tRFC and the R/3 backend will try
                // again later.
                System.out.println("TID Handler: checkTID for " + tid);
                TIDState state = availableTIDs.get(tid);
                if(state == null)
                    availableTIDs.put(tid, TIDState.CREATED);
                    return true;
                if(state == TIDState.CREATED || state == TIDState.ROLLED_BACK)
                    return true;
                return false;
                // "true" means that JCo will now execute the transaction, "false" means
                // that we have already executed this transaction previously, so JCo will
                // skip the handleRequest() step and will immediately return an OK code to R/3.
            public void commit(JCoServerContext serverCtx, String tid)
                System.out.println("TID Handler: commit for " + tid);
                // react on commit e.g. commit on the database
                // if necessary throw a RuntimeException, if the commit was not
                // possible
                availableTIDs.put(tid, TIDState.COMMITTED);
            public void rollback(JCoServerContext serverCtx, String tid)
                System.out.println("TID Handler: rollback for " + tid);
                availableTIDs.put(tid, TIDState.ROLLED_BACK);
                // react on rollback e.g. rollback on the database
            public void confirmTID(JCoServerContext serverCtx, String tid)
                System.out.println("TID Handler: confirmTID for " + tid);
                try
                    // clean up the resources
                // catch(Throwable t) {} //partner wont react on an exception at
                // this point
                finally
                    availableTIDs.remove(tid);
            public void execute(JCoServerContext serverCtx)
                String tid = serverCtx.getTID();
                if(tid != null)
                    System.out.println("TID Handler: execute for " + tid);
                    availableTIDs.put(tid, TIDState.EXECUTED);
            private enum TIDState
                CREATED, EXECUTED, COMMITTED, ROLLED_BACK, CONFIRMED;
        public static void main(String[] a)
            // step1SimpleServer();
            step2SimpleServer();
            // step3SimpleTRfcServer();

Maybe you are looking for

  • How can I use multiple network connections concurrently?

    I'm using a Macbook, connected to a corporate network via Ethernet and to a private ADSL connection via Airport. What I want to be able to do is use the Airport connection for specific apps (Firefox, Safari, RDP etc) and the Ethernet connection for a

  • Accessing Soap header in webservices

    Hi, My webservice needs to read a soap header "locale" and do some processing based on this soap header. I understand the concept of handlers..but anywhere I see examples, the handler handles it and returns the data back. My requirement is that once

  • Output to line printer (132 x 66)

    I need to print statement to a Line Printer (such as Epson LQ-1600K) on preprinted form. Should I use character mode? I've tried to setup a character mode report as described in Daily BI Views (except output chr(14) to printer) The layout of printout

  • List Of Values Switcher doesn't work fine here

    Hello, I tried a new List Of Values Switcher feature, in jdev11g R, and i tried andrejusb's example( http://andrejusb.blogspot.com/2008/10/multiple-lovs-per-attribute-in.html ), but it doesn't work Is that a bug?? Thanks

  • Create Activity using BAPI_PROJECT_MAINTAIN !!!

    All, I have been working to create the PD, WBS Elements, Networks & Activities using the FM BAPI_PROJECT_MAINTAIN. I am able to create the PD, WBS Elements & Networks. Now when I am trying to create the Activities, I am unable to find what OBJECTKEY