TCP/IP Connection from ABAP

Hello everybody.
Does anybody know the way how to create TCP/IP connection from ABAP? I need to establish TCP/IP connection from Appication server to external server(not sap) to retrieve some data. I assume that it can be done using RFC calling technique, but i think that i have to register needed functionality as RFC in external server. To skip this step i need an explicit TCP/IP from abap.
Thank you for helping.
Yours sincerely,
Nguyen Hai Long.
Edited by: Long Nguyen on Jun 24, 2008 10:06 AM

Thank you all. I found an example in the internet The situation force me to overpass my laziness and to use RFC
Yours sincerely,
Nguyen Hai Long

Similar Messages

  • Setup connectivity from ABAP to Java stack

    I'm struggling to make connectivity setup from ABAP to Java stack. Objective is to call a java method published on javastack from a report/FM. Can some one guide me with some examples. Appreciate all your responses.

    Hello Yadagiri,
    I found three links that may help you
    I hope it helps!
    With regards,
    Caio Cagnani

  • Possible to monitor TCP / IP connection from MIDlet??

    Does anybody know if it's possible to monitor the TCP / IP connection on a handset from within a MIDlet?
    Could we have a MIDlet running in the background that sniffs information about a user's WAP activities?
    Will something like this be possible with Android?
    Thanks so much!
    Karim Varela

    No, you cannot do that with MIDP.
    About Android: sure you can do it there: it's open source!

  • TCP IP connection From Solaris to Window?

    Hello Friends,
                           I have SCM installed on Solaris OS,and SCM optimizer installed on WIndow OS.I need to Connect SCM Solaris to SCM window, Thought RFC type TCP/ip Connection.
    For Example  In Solaris SCM for TCP/IP-Program name is d:\apo\opt\ctm\bin\ctmsvr.exe and Host is Window SCM host name.
    i need to know whether this Connection will work or If does not work Please Give the any Solution Friends.

    Thank you all. I found an example in the internet The situation force me to overpass my laziness and to use RFC
    Yours sincerely,
    Nguyen Hai Long

  • Open more than 65k TCP/IP connections

    is it any possibility to open more than 65535 TCP/IP connections from one IP address as client? Because each connection occupied one port, I can't make more than 65k. Can be established more outgoing connections (as client) from one port to more different servers simultaneously? Thank you for any advice.

    The naive way will only let you open about 32K sockets before it fails.
    In order to get more you need to reuse the socketnumbers:
    #include <sys/socket.h>
    void BindSockToPort(int fd, int port) {
        sockaddr_in sa= {AF_INET,  port, INADDR_ANY};
        unsigned int one= 1;
        setsockopt(fd, SOL_SOCKET, SO_REUSEADDR, &one, sizeof one);
        if(bind(fd, (sockaddr*) &sa, sizeof sa)) perror("bind");
    }Then you can connect.
    From same port you must of course connect to different endpoints.
    And this has of course nothing to do with sun studio C++. But I had just solved the problem myselfes, so...

  • Error when connect from portal system (abap ) to external ssl client - sm59

    Hi I am tryign to setup a ssl connection from the abap sm59 portal system to an exteral server.. I have setup the certs that the client has given me in strust.but i m gettign the ffg error.
    sysno      60
    sid        PID
    systemid   370 (Solaris on SPARCV9 CPU)
    relno      7110
    patchlevel 0
    patchno    150
    intno      20020600
    make       multithreaded, Unicode, 64 bit, optimized
    profile    /usr/sap/PID/SYS/profile/PID_DVEBMGS60_pidevdb
    pid        3911
    [Thr 01] Thu Jun 14 08:38:48 2012
    [Thr 07] Thu Jun 14 08:39:07 2012
    [Thr 07] *** ERROR during SecudeSSL_SessionStart() from SSL_connect()==SSL_ERROR_SSL
    [Thr 07]    session uses PSE file "/usr/sap/PID/DVEBMGS60/sec/SAPSSLA.pse"
    [Thr 07] SecudeSSL_SessionStart: SSL_connect() failed
    [Thr 07]   secude_error 536871970 (0x20000422) = "SSL record with the wrong SSLPlaintext.version received"
    [Thr 07] >>            Begin of Secude-SSL Errorstack            >>
    [Thr 07] ERROR in ssl3_get_record: (536871970/0x20000422) SSL record with the wrong SSLPlaintext.version received
    [Thr 07] <<            End of Secude-SSL Errorstack
    [Thr 07]   SSL_get_state() returned 0x00002120 "SSLv3 read server hello A"
    [Thr 07]   SSL NI-sock: local=  peer=
    [Thr 07] <<- ERROR: SapSSLSessionStart(sssl_hdl=10720d530)==SSSLERR_SSL_CONNECT
    [Thr 07] *** ERROR => IcmConnInitClientSSL: SapSSLSessionStart failed (-57): SSSLERR_SSL_CONNECT {00020a7c} [icxxconn_mt.c 1957]
    When i change the sm59 connection not to use ssl. it give me a pop up screen . and asks me to enter user and password...
    He then  give me a private key file .. i.e a .pfx file but not sure how to load this in strust. I tried to convert in useign sapgenpse. but it fails with teh ffg error
    12% sapgenpse import_p12  -p /usr/sap/PID/amos/amos_client.pse /usr/sap/PID/amos/amos_client_pk.pfx
    import_p12: MISSING password for PKCS#12 file "/usr/sap/PID/amos/amos_client_pk.pfx"
    Please enter PKCS#12 encryption  password: *******
    PKCS#12/PFX file contains 1 keypair:
      1. FriendlyName = "amos.server.interface.webuser.web_int.cert"
         X.509v3 (type=Both) RSA-2048 (signed with sha1WithRsaEncryption)
         Subject="CN=AMOS WebService Interface Client, OU=IT&S MRO, O=South African Airways (Pty) Ltd, L=OR Tambo International Airport, SP=Gauteng, C=ZA"
         Issuer ="[email protected],, OU=Certificate Authority, O=South African Airways (Pty) Ltd, L=OR Tambo International Airport, SP=Gauteng, C=ZA"
    ERROR: Incomplete certification path -- NEED certificate of "[email protected],, OU=Certificate Authority, O=South African Airways (Pty) Ltd, L=OR Tambo International Airport, SP=Gauteng, C=ZA"!
    I have attached a doc of what it looks like.. appreciate any help

    There is an error in the publishing of template
    Template :"bbpsc02" is not publised in ITS.
    Go to T.code: SE80
    Publish all the templates again and check
    Check with your SAP  BASIS team for the help

  • How to connect external webservice from ABAP

    Please see code pasted below and tell me what is wrong.
    We try to connect external webservice via https. Should I install certificate is SAP for this connection? (if YES, how can I do this?)
    Should I configure something else in SAP to connect external webservice via https?
      DATA: client type ref to if_http_client,
            lv_content type String,
            lv_xml_string type string,
            lv_length type I,
            lv_response type I,
            lv_node type ref to IF_IXML_NODE,
            lv_xml_doc type ref to cl_xml_document.
    ****Create the HTTP client
    call method cl_http_client=>create_by_url
         url    = ''
         client = client
         others = 1.
        HOST               = ''
         SERVICE = '443'
        SCHEME  = '2'
       PROXY_HOST         =
       PROXY_SERVICE      =
       SCHEME             = SCHEMETYPE_HTTP
       SSL_ID             =
       SAP_USERNAME       =
       SAP_CLIENT         =
        CLIENT             = client.
       INTERNAL_ERROR     = 3
       others             = 4
    '<soapenv:Envelope xmlns:xsi=""'
    ' xmlns:xsd="" '
    'xmlns:soapenv="" xmlns:rain="">'
    '<rain:Login soapenv:encodingStyle="">'
    '<id xsi:type="xsd:string">B03EB34F02</id>'
    '<password xsi:type="xsd:string">Akquinet99</password>'
    '<appId xsi:type="xsd:string">test</appId>'
    '<appInstId xsi:type="xsd:string">test</appInstId>'
    '<custom xsi:type="xsd:string">test</custom>'
    INTO lv_content.
    CALL METHOD client->request->set_header_field
          name  = '~request_method'
          value = 'POST'.
        NAME  = '~request_uri'
        VALUE = '/raina/1.0/KrdAPI.asmx?'.
      CALL METHOD client->request->set_header_field
          name  = 'Content-Type'
          value = 'text/xml; charset=utf-8'.
      call method client->request->set_header_field
          name  = 'SOAPAction'
          value = 'Login'.
      lv_length = STRLEN( lv_content ).
      call method client->request->set_cdata
          data   = lv_content
          offset = 0
          length = lv_length.
    ****Make the call
      client->send( ).
    ****Receive the Response Object
      call method client->receive
          http_communication_failure = 1
          http_invalid_state         = 2
          http_processing_failed     = 3
          others                     = 4.
    *****Get the response content
      client->response->GET_STATUS( IMPORTING CODE = lv_response ).
      lv_xml_string = client->response->get_cdata( ).

    HI ,
            Error in accessing External Web Service
    Calling a secured external web service from ABAP
    Edited by: A kumar on Aug 21, 2008 11:58 AM

  • Connection to MySQL from ABAP

    How to configure any connection from SAP to MySQL, I want to use result in ABAP.
    I heard about legacy JDBC to MySQL but which transaction is for this ? and what I need? Netveawer and somehitng more?
    Edited by: Kosmo on Oct 20, 2009 10:43 AM

    It isn't possible

  • Outgoing TCP connections from VM have very low firewall state idle timeout -- how do you adjust?

    When I create a TCP connection from a VM to the internet, if I'm idle for more than a few minutes (say a SSH session), the TCP flow is torn down by some AZURE networking element in between.
    Incoming connections from the internet in don't seem to be affected.
    I assume this is an Azure firewall timeout somewhere.
    Is there any way to raise this?

    Thanks for posting here.
    Here are some suggestions:
    [1] - You can make sure the TCP connection is not idle. To keep your TCP connection active you can keeping sending some data before 60 seconds passes. This could be done via chunked transfer encoding; send something or you can just send blank lines to keep
    the connection active.
    [2] - If you are using WCF based application please have a look at below link:
    [3] - If you are using TCP Sockets then you can also try ServicePointManager.SetTcpKeepAlive(true, 30000, 30000) might be used to do this. TCP Keep-Alive packets will keep the connection from your client to the load balancer open during a long-running HTTP
    request. For example if you’re using .NET WebRequest objects in your client you would set ServicePointManager.SetTcpKeepAlive(…) appropriately.
    Reference -
    Hope this helps you.
    Girish Prajwal


    Dear all.
    How can I connect to COM objects/methods from abap?
    Could give me link to example.

    Yes this method raises and exception with this message
    Message ID:          FDT_CORE
    Message number:      085
    DO_IM_DATETIME is not in the context
    The method SET_VALUE corresponds to IF_FDT_CONTEXT. This is the method's calls
          lv_name = 'DO_IM_DATETIME'.
              o_context->set_value( iv_name =  lv_name
                                    ia_value = lv_element_tzone ).
            CATCH cx_fdt INTO lx_fdt.
              RAISE incorrect_parameter.
    I reactivate the aplication, the function, the expression and the data objects.
    But the method is still giving this exception.
    I have only this exception when I try to set up this two parameters:
    DO_IM_DATETIM of type Timepoint
    DO_IM_LANGU which is binding to the element type LANGU
    But in my BRFPlus Function Context I do have this two parameters.
    Thanks !

  • Q: TCP Connections from an Applet

    is it possible to build a tcp socket connection on a specified port on the webserver with an unsigned applet?
    as example: the applet is stored on the webserver, port 80.
    somebody calls the applet with a webbrowser, and another connection, maybe port 7777, is build back to the webserver?
    I just have to know if it is possible.
    thanks for information


  • Error while calling java program from ABAP

    Hi Experts,
    We are trying for RFC inbound scenario.
    We followed the below blog
    We are working with SAP JCO 3.0.2
    We are getting the error : 'STFC_CONNECTION' could not be found in the server repository.
    After I run the Java server program if I execute the RFC destination directly from SM 59 it is showing successful messages.
    If I stop the java program then this RFC is failing. Based on this we concluded that RFC to Java connection is working fine.
    But as mentioned in blog if we call the RFC Destination from ABAP program it is giving the below error,
    'STFC_CONNECTION' could not be found in the server repository.
    If we test the RFC destination using RFC_TRUSTED_CHECK standard FM we are getting the below error.
    'RFCPING' could not be found in the server repository.
    We create the RFC destination of Type : TCP/IP as exactly mention in the blog.
    Please help us in resolving this issue.

    Using the RFC connection,we can establish a link between Java and SAP.
    Afterwards,hope we can call Java program from ABAP.
    Below is the sample piece of code to establish RFC connection(link) between Java and SAP.
    DATA: RFCDEST like rfcdes-rfcdest VALUE 'NONE'.
    DATA: RFC_MESS(128).
    RFCDEST = 'JCOSERVER01'. "corresponds to the destination name defined in the SM59
        WRITE: / 'Call STFC_CONNECTION         SY-SUBRC = ', SY-SUBRC.
        WRITE: / RFC_MESS.

  • Create EJB and call it from ABAP

    Hi all,
    I have written a stand-alone-Java application, which should be converted into a web application, which has no gui.
    This application should be triggered by a abap-program.
    Following questions, do I have to write a servlet and a ejb or is it possible to call the ejb directly from the abap-program?
    What do I have to do make an outbound call from abap?
    Thank you for your support.
    Kind regards, Patrick.

    You can call the EJB directly from Abap. XI uses this functionality extensively.
    Follow these steps:
    1)  Deply the bean on the java stack.
    2)  You now need to setup a RFC destination in the JCO RFC Provider service in the j2ee visual adminstrator. Point the Repository section to the application server you want to run the Abap reort on. When you do this the j2ee engine will register itself as a possible RFC destination on this application server.You can choose your own program id...
    3) You then need to goto tran sm59 on the app server where the Abap report is going to run and setup a connection of tcp type to the j2ee machine. Specify the same program id you used in step in the technical settings.
    4) Then just use the bean name when you do the rfc call in the abap report.
    Hope this helps if U have not done it yet.

  • Calling Java API from ABAP using JCo

    I need to call Java API from ABAP & BSP also. For this I have got useful information related to JCo from following blog:
    But, I am facing one problem. On executing Java program (recommended by Gregor Wolf) from command line I get following error message:
    Server JCOSERVER01 changed state from [ STOPPED ] to [ STARTED ]
    Exception in server JCOSERVER01:$Exception: (129) JCO_ERROR_SERVER_STARTUP: Server startup failed at Thu Apr 26 13:46:32 IST 2007.
    This is caused by either a) erroneous server settings, b) the backend system has
    been shutdown, c) network problems. Will try next startup in 1 seconds.
    Connect to SAP gateway failed
    Connect_PM  TPNAME=JCOSERVER01, GWHOST=gateway, GWSERV=3300
    LOCATION    CPIC (TCP/IP) on local host
    ERROR       hostname 'gateway' unknown
    TIME        Thu Apr 26 13:46:32 2007
    RELEASE     640
    COMPONENT   NI (network interface)
    VERSION     37
    RC          -2
    MODULE      ninti.c
    LINE        336
    DETAIL      NiPGetHostByName2: hostname 'gateway' not found
    SYSTEM CALL gethostbyname_r
    COUNTER     1.
    Can anyone please help me out. Do I need to do any setting?
    I'll surely reward points.
    Thanks & Regards,
    Nilesh Kumar

    Hi Nilesh,
    From the error i think that the error is with the hostname.
    Please enter the the Application Server IP/Hostname.
    If you are loggin to SAP System "XX1" from SAP GUI. Then click the change Item tab and see Application server name/IP let say "XX2" for hostname or "xx.xx.xx.xx" for IP.
    Replace <i>srv[0] = new Server("gateway","sapgw00","JCOSERVER01",repository);</i>
    with <i>srv[0] = new Server("XX2","sapgw00","JCOSERVER01",repository);</i>
    If App Server is IP then replace with
    <i>srv[0] = new Server("xx.xx.xx.xx","sapgw00","JCOSERVER01",repository);</i>
    Let me know if it is throwing any error.

  • Call Java Program from ABAP Program

    Dear all,
    In our scenario, we need to let ABAP call services provided by a standalone Java program. From online help I found some overview introduction and I'd make the called program a registered program in a RFC with type "T" (TCP/IP Connection). Can anybody give some concrete documentation? A step-by-step guide would be greatly appreciated.
    Best Regards

    check this thread
    Re: Calling Java API from ABAP using JCo

Maybe you are looking for

  • How to use logger to send any output instead of the console?

    How to use logger to send any output instead of the console?

  • Why do I keep getting new pins sent to me?

    I downloaded the Messages app on my wife's phone and it keeps sending new pins and saying it failed the security. What do we need to do?

  • PC will not remove 3 programs in XP Home Edition

    Presario will not remove 3 programs. School House Rock, Search for the Secret Keys, and Disney Pixar 1st Grade Print. Can anyone assist? Thanks  Running XP Home Edition

  • Magenta color cast problem on canon 7d raw files

    when i import canon raw files (cr2) into lightroom 3, i get a magenta color cast over the whole image. the thumbnail image looks fine, but when lightroom opens up the image, it get's a magenta color cast over the whole thing. i shot raw+jpeg mode too

  • Change Apple User id

    I need to change mt Apple user id. In order to use a secondary email, I preliminary deleted it from the secondary email list. I tried to change the current user id, but the system pointed out that I cannot save it because it recognized it as a second