NWDS Webas Java to Abap JCO call

Hi,
I have WebAS Java + ABAP Stack 6.40.
For development I use SAP NetWeaver Developer Studio Version: 2.0.23
I would like to call RFM from Java.
Can I call RFC from Java using the JAVA <-> ABAP RFC destinations,
or do I have to log on to ABAP explicitely using like the following:
          JCO.createClient(
                  "CLIENT",
                  "USER",
                  "PASSWORD",
                  "LANGUAGE",
                  "SERVER",
                  "SYSTEM",
                  "GROUP");
Thanks
Matthias

You might benefit by reading the JCO pdf delivered with the jco download from sapservice.com....(free)....
Usually it is easier to define the structure and the function interface as an SAP function even if there is no body (abap to java). This means that the JCO will read correctly all the metainformation about the function. You then call the function as an RFC specifying the host...
Have fun...
In your case I would read carefully the example (getting the company code info etc...)
It shows how to manipulate the table returned by ABAP...

Similar Messages

  • Web Dynpro for ABAP, service calls.

    Hi guys,
    I can't find a way to do a so called "reimport" (not the correct word to use I know!) when I change a function module in ABAP. See in Java, if we change importing or exporting parameters we can reimport the model to pick up changes, but this isnt the case in WDP ABAP. Can anyone please tell me how I can do this in ABAP? I had to delete the context in the component and view controller to prevent the service call wizard from renaming my context nodes as *_1 or *_2 etc. This is quite a headache! Also the method I had defined to execute the function module has to be renamed too, unless I delete it 1st ofcourse! Is there a way to overwrite and replace my existing nodes in the context?
    Any help is appreciated.
    Thanks in advanced.
    Kunal.

    How comes nobody replied to this post?
    Does that mean its impossible to do a Java type reimport in ABAP if the function module changes?

  • Web Service to ABAP Proxy, Calling RFC from ABAP Proxy

    can any body send me the notes or Step by step process of Webserice of calling RFC using ABAP proxy, I am new to XI. send me detail process of this perticular scenarios

    Hope this helps
    /people/siva.maranani/blog/2005/05/23/communication-between-sap-system-webservice-using-proxies
    also refer to
    /people/shabarish.vijayakumar/blog/2006/03/23/rfc--xi--webservice--a-complete-walkthrough-part-1
    /people/shabarish.vijayakumar/blog/2006/03/28/rfc--xi--webservice--a-complete-walkthrough-part-2
    Rgds,
    Kumar
    Message was edited by:
            Kumar

  • JCO call from ABAP to Java

    Hi to all,
    I'm trying to perform a JCO call from an abap function module to a java server program. I've built a java application that extends JCO.Server library, but I'm not able to register my Program to SAP R/3 in order to be called from the abap Function module. when I run my java application directly on XI Server, I receive this error:
    "Could not load middleware layer com.???.MiddlewareJRfc".
    Can anyone help me, please?
    Thanks!

    Hi Denis,
    Import the model In NWDS for ABAP for RFC.
    Please check here [Accessing ABAP Functions using the Adaptive RFC Model |http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a00f7103-6790-2a10-ac9c-fcac7c5b18a3?quicklink=index&overridelayout=true]
    [Web Dynpro Model: Backend Access|http://www.sdn.sap.com/irj/sdn/nw-wdjava?rid=/webcontent/uuid/403e6bf5-426e-2910-b0a8-a95548724af9#section10 [original link is broken]]
    Also check here /docs/DOC-8661#section10 [original link is broken]
    Hope it helps,
    Redards,
    Arun

  • Error when calling Java Web Services from ABAP.

    Hello experts:
        In my project, I will call Java Web Services with ABAP coding. With WSDL, I generated a proxy class and created a HTTP connection (t-code: SM59) and a logical port (t-code:lpconfig) for this proxy class. But when running, I would receive the folllowing errors:
       SOAP:1.023 SRT: Processing error in Internet Communication Framework: ("ICF Error when receiving the response: HTTP COMMUNICATION FAILURE")
       If I used HTTPS, there is no problem.
    Regards
    Bob

    Hi Bob,
    It might be the possibility that your java web server is configured to listen only on HTTPS.
    If your HTTPS is working fine, then first check with your JAVA server for HTTP connectivity, then try it calling through ABAP.
    Regards,
    Piyush

  • Call webdynpro java Web Service from ABAP

    Hello,
    This is regarding calling portal web service from ABAP.
    1. created web service in NWDS and deployed it to portal server
    2. created abap proxy to call this web service from abap SE80 transaction
    3. created logical portal for the above proxy  LPCONFIG transaction
    this is working perfectly. the web service is getting called from abap and funcitonality is working
    but my doubt is we have no where given the login password for portal server in the abap system
    then how come it works without login password
    if i run this web service directly from portal in wsnavigator, then portal login is required.
    If we want to incorporate authentication then how to do that ?
    thankyou,
    B

    When you are testing the application in SE80.
    Is it ot asking for the user id password.
    I created a similar service and for me its asking for user id and password.
    Go to SM59 and there look for a RFC destination of type HTTP Connection to External Serv. usually will be named as
    SAP_PROXY_ESR.
    for this connection check the logon and security tab.
    may be some user id and password is given there. means hardcoded.
    thanks
    sarbjeet singh

  • BI setup: WebAS ABAP Setting - Java to ABAP communication problem

    Hello,
    i've got a problem during intallation of BI in Netweaver 2004s. The Diagnostics & Support Desktop Tool reports errors in WebAS ABAP Settings. These errors are:
    - "Web Template Validation failed due Java to ABAP communication problem (return code:ERSBOLAP018)"  with the suggested solution "Check Connector Connection of System Object in Portal System Landscape". What does it mean?
    - "Call ABAP->Java for function RSWR_RFC_SERVICE_TEST failed for destination <destination>" and "Call ABAP->Java for function RSRD_MAP_TO_PORTAL_USERS failed for destination <destination>" with suggested solution "Check the data of the destination in transaction SM59. Check that the target host is running and has registered a program id in the gateway." Run of transaction SM59 returns no errors.
    Further i've take a look in the log 'dev_jrfc.trc' and there i found the errors:
    - Exception thrown by application running in JCo Server
    java.lang.RuntimeException: Bean RSRD_MAP_TO_PORTAL_USERS not found on host <host>
    - Exception thrown by application running in JCo Server
    java.lang.RuntimeException: Bean RSWR_RFC_SERVICE_TEST not found on host  <host>
    - Exception thrown by application running in JCo Server
    java.lang.RuntimeException: Bean RSWR_PREEXECUTION_PROXY not found on host  <host>
    Can these errors be the cause of the WebAS ABAP Setting error displayed in the Diagnostics & Support Desktop Tool? How they can be solved?
    Thanks for your help,
    Martin

    Hello Chetan,
    thanks for your response. Maybe i've described my problem not clear enough. There is no problem of installation and usage of support & dektop tool, but of installation of BI. The support & dektop tool indicates the errors described above with no other hints. My questions is, if anybody knows, what is the cause of the errors and what i must do, to install BI correctly.
    Cheers,
    Martin

  • How to call "compensation profile" iView in ECM from Web Dynpro for ABAP

    Hi Experts,
    I developed a compensation planning iView using web dynpro for ABAP using floor plan manager in ECM. I need to call the iView "compensation profile" but I don't know how to pass parameter to it, how to trigger it from my application. Is there anyone used to do this before?
    Thanks!
    - Anthony -

    I have to develop my own iView to replicate Java iView.

  • Call Java in ABAP?

    Hi,
    When I want to call a function module in Java I use JCO. Is there also a way to "call Java code" in ABAP?
    Bye,
    Chris

    /people/gregor.wolf3/blog/2004/08/26/setup-and-test-sap-java-connector-outbound-connection
    http://help.sap.com/saphelp_erp2005/helpdata/en/6f/1bd5c6a85b11d6b28500508b5d5211/frameset.htm
    Regards,
    Rich Heilman

  • How to handle JCO.AbapException on JCO call in ABAP

    Hello Forum,
    I am implementing an JCO Server scenario.
    I use dynamic repositories like Example7.java from the JCO documentation.
    Example7 throws an JCO.AbapException if anything went wrong, e.g. the function is not implemented. My coding is like:
         protected void handleRequest(JCO.Function function) throws AbapException {
              try {
                // Process incoming requests
              } catch (Exception e) {
                log.error(this.getProgID() + ": error handling request " + function.getName(), e);
                throw new AbapException(function.getName(), e.getMessage());
    How to react on this AbapException?
    The examples in SAP Help documentation only catch
    SYSTEM_FAILURE and COMMUNICATION_FAILURE.
    I implemented the JCO call as well like following.
    CALL FUNCTION 'MY_JCO_FUNCTION_MODULE'
        DESTINATION JCO_DEST
        <...>
        EXCEPTIONS
          SYSTEM_FAILURE        = 1  MESSAGE RFC_MESS
          COMMUNICATION_FAILURE = 2  MESSAGE RFC_MESS.
    But these two are only thrown and caught when something with communication went completely wrong, e.g. RFC not found.
    When the exception in the JCO server occured and JCO.AbapException was thrown I always get an ABAP short dump, i.e. the exception was not handled.
    Additionaly, the exception is named like the JCO function called and the message text which was submitted to JCO.AbapException is not displayed. I think that means that the AbapException was not recognized at all?
    The JCO API doc says:
    Creates an exception with the specified key. This constructor is normally used in the server's handleRequest() methods to throw an exception which is part of the function interface definition. In such a case the SAP system will not raise a system exception. If however the specified key is not a defined exception for the currently processed function module the SAP will raise a system exception.
    But whether I define an exception in the function interface definition named like the module (thererfor new AbapException(function.getName(), <...>)) or not, it always dumps. I understand the exception that a system exception is raised when the exception is not defined? But this is not been handled with above ABAP code as well.
    What is wrong here? Could anyone post an example please how the exception has to be handled?
    Please note that I do not define static repositories but have the remote function defined on in the ABAP server to be used by dynamic repository (like the STFC_CONNECTION test rfc). Am I right that the exception should be defined in that RFC remote definition?
    Thanks,
    Carsten

    Dear everybody,
    Finally I solved this old problem
    I am a novice in JCO and played a little with the problem and found an old reference to the difference between J2EEAbapException and AbapException classes. I modified my program and it works! ABAP caller gets the correct exception, not system_failure! The details:
    1. modify beanname.java source
         import com.sap.mw.jco.JCO;
         import com.sap.mw.jco.JCO.J2EEAbapException;
         public interface ... extends EJBObject {
        public void processFunction(JCO.Function function) throws RemoteException, J2EEAbapException;
    2. modify beannamebean.java source
        import com.sap.mw.jco.JCO.J2EEAbapException;
         public void processFunction(JCO.Function function) throws J2EEAbapException {
         throw new JCO.J2EEAbapException("NODATA");
    3. modify beannamelocal.java source
          import com.sap.mw.jco.JCO;
         import com.sap.mw.jco.JCO.J2EEAbapException;
              public void processFunction(JCO.Function function) throws J2EEAbapException;
    I hope it helps for somebody else too!
    Imre

  • Call java from ABAP

    JCo connectivity is used to call RFCs from Java. can i call Java from abap?
    thanks in advance.....
    regards,
    Sundararamaprasad

    Hi Sundar ,
             This link will surely give u an idea about calling java fro ABAP using Jco.
    http://www.thespot4sap.com/Articles/SAP_Netweaver_Java_Connector.asp
    regards,
    aravindh.

  • Call a web service in ABAP - how to do LPCONFIG?

    I have searched through OSS, SAP help and SDN - and I see the answer if I call a web service from Java - but I cannot find the answer if I call a web service through normal ABAP in R/3.
    I apologize if I am asking the same question again or if it is already there and I am just overlooking it.
    I am creating a client proxy in R/3 to call an outside web service through ABAP.
    I create the client proxy in our test system using SE80.
    I create a logical port using LPCONFIG to point at the test web service on the other system.
    I code the ABAP program - and everything works great.
    I transport the client proxy - and I transport the LPCONFIG information.
    Now I get into production - when I do transaction LPCONFIG to change the URL of the web service to be their production web service URL instead of their test web service URL - it asks for the system to be opened.
    Like it wants to create a transport. The basis people would have to open the system to be modified.  Which at least in our shop is not something we do.
    Here is the error:
      Message no. TK430
      The system administrator has set your logon client to the 'not modifiable' status.
      Client-specific objects can not be changed in this client.
      Contact the system administrator.
      For more information, see the SAP Library under Change and Transport System.
    For an ABAP program in R/3 using a client proxy - how do I call a test service in our test r/3 system and a production web service in production R/3 system without changing my ABAP code?
    Should this be done through LPCONFIG?
    Or what am I missing?
    Thanks for your help.
    Scott Overmeyer

    Hi Scott,
    Please refer to following URL
    http://help.sap.com/saphelp_nw04/helpdata/en/16/285d32996b25428dc2eedf2b0eadd8/content.htm
    I think you are using the second of the following 3 approaches mentioned in above documentation and so credential configuration is not available at run-time.
    Please check if this is helpful to you. If you have already looked at this then please ignore this message.
    There are three ways of configuring the call address of the Web service:
    ●     As HTTP destination: Select an RFC destination of type G (HTTP connection to an external server) or type H (HTTP connection to the SAP System) from transaction SM59. The HTTP destination approves the configuration of the logon procedure, encryption, and state management. This is the preferred access procedure.
    ●     As URL: The URL of the Web service is written to the corresponding input field when you create the logical port. The disadvantage of this procedure is that, with the exception of the URL, no other parameters for logging on, encryption, or state management can be configured. This is possible only for Web services that do not require a logon procedure, encryption, or state management.
    ●     As local path prefix: This access procedure is only intended for accessing your own system. Here you call the default RFC destination NONE to address your own server. The specified local path prefix is used to identify the called Web service.
    Regards,
    Vandana.

  • How to Call Java from ABAP

    Hi all,
    I have installed JCO & created the RFC in SAP. i have used below code to test my RFC connection & it's working fine.
    But In the below report, where to call the JAVA Program & what code i should use to call java code .
    Actually my ABAP requirement is to download a file. Then i need to call JAVA program, inside ABAP, to encrypt the downloaded file. Here, Java program is used to encrypt the file. Now question is, how to call the Java program inside the ABAP code.  Please advice with the code sample. Thanks a lot.
    REPORT  z_jco_test.
    PARAMETERS: requtext LIKE sy-lisel.
    DATA: echotext LIKE sy-lisel,
          resptext LIKE sy-lisel,
          rfctest TYPE TABLE OF rfctest,
          wa_rfctest TYPE rfctest.
    wa_rfctest-rfcdata1 = requtext.
    wa_rfctest-rfcdata2 = 'Hello World'.
    APPEND wa_rfctest TO rfctest.
    CALL FUNCTION 'RFC_PING'
      DESTINATION 'JCO'.
    CALL FUNCTION 'STFC_CONNECTION'
      DESTINATION 'JCO'
      EXPORTING
        requtext = requtext
      IMPORTING
        echotext = echotext
        resptext = resptext
      TABLES
        rfctest  = rfctest.
    WRITE: 'Echo Text: ', echotext.
    WRITE: 'Response Text: ', resptext.
    LOOP AT rfctest INTO wa_rfctest.
      WRITE: / 'rfcdata1: ', wa_rfctest-rfcdata1.
      WRITE: / 'rfcdata2: ', wa_rfctest-rfcdata2.
    ENDLOOP.

    Hi,
    You might accomplish your goal using external operating system commands.
    1) Define in SM69 an external command, letu2019s say ZJAVA. This command will execute a script on the operating system, letu2019s call it calljava.sh.
    2) In script calljava.sh you just call java, passing some parameters. For example, java $1 $2 $3 $4 $5 $6 $7
    3) In your ABAP program you call the ZJAVA external command and pass parameters to it. Of course, one of the parameters must be your Java program name.
      CALL FUNCTION 'SXPG_COMMAND_EXECUTE'
        EXPORTING
          commandname                   = l_command
          additional_parameters         = l_param
          trace                         = 'X'
        IMPORTING
          status                        = l_status
          exitcode                      = l_exitcode
        TABLES
          exec_protocol                 = l_exec_protocol_itab
        EXCEPTIONS
          no_permission                 = 1u2026

  • WEB DYNPRO FOR ABAP OR BSP OR WD FOR JAVA ?

    Hello Friends,
    We have some bussiness reports, and we have to replace the standard GUI with web; for web dynpro of java, I think we have to first put the business code of reports to some kind of RFC and then call the rfc and etc....
    is there something more straight in web dnypro for abap or if we use BSP ( i know bsp uses only object oriented , so if report has non-object functionaity, it will not be supported in bsp ) ? right
    Regards,

    Hello, Shah,
    I believe you have in fact four alternatives:
    1. WDJ: there must be BAPIs (RFC) in order to communicate with your backend server.
    2. WDA: More straightforward, it allows you to use ABAP Objects, and don't need RFCs.
    3. BSP: In my opinion, less powerfull than WDA, but it allows much more customization (such as adding javascript to your HTML, and so on).
    4. Visual Composer: If you have the RFCs, this can be very easy to implement.
    Anyway, it all depends on the complexity of your reports and the services you have at hand. If you have RFCs, you can use any of the four; if you don't, you have to choose between 2 and 3.
    Regards,
    Andre

  • How to change WebAs Java URL with which it is called

    hi all,
    I am trying to activate the standard web templated for integration between BI 7.0 and EP 7.0 to execute the BEx report in Web.
    I am getting the following error:
    <b>The URL for ABAP customising table RSPOR_T_PORTAL : http://eimreymdd0.eimskip.net:50000 is not compatible with the URL  with which you call the WebAS Java : http://eimreymdd0:50000</b>
    Now, I want to change the URL of WebAS Java with which it is called.I want to change http://eimreymdd0:50000  to http://eimreymdd0.eimskip.net:50000
    How can I change this ? I want to know the location through which I can change this URL.
    Thanks in advance for your suggestion.
    Best Regards,
    Yogesh

    Hi Yogesh,
    I think you need to change you DNS server mapping.
    You can also try to change to virtual hosts property in the UME
    i.e.
    http://<host name>:<portnumber>/nwa
    Under System Management --> Configuration
    you'll find the virtual hosts.
    Regards,
    Prashil

Maybe you are looking for

  • My external hard drive change to read only

    I have been backing up my vids, pics, etc on my Seagate HDD for the past 2 months with my Macbook Air. All of a suddenly my external HD changed permissions to read only. I understand that this has been a hot topic for some time but I have not found t

  • Box in 3 letters with ease

    Hi, I'd like to use CSS to box in a certain repetitive 3 letter code on a site. - without it becoming a static graphic. Can you advise how best I should do this? I am thinking it may need to be a custom class. So, really, it would not need positionin

  • Handling Right & Left Click Events in ALV Grid

    Hi Friends, Please give me the idea how to handle Right & Left mouse Click Events in ALV Grid. My requirement is that when i click on the grid i need to pop up a message. Eagerly waiting for your replies Thanks Satish

  • Itunes programme won't even load up!

    I've had itunes on my computer for a couple of years now, haven't bothered uploading new model, has worked fine. Then all of a sudden the programme wouldn't open- said "Folder "itunes" cannot be found or created and is required. Default location is "

  • How do I get help if neither the database nor the Community Support forum helps with my problem?

    I have been having a problem with downloads stopping for several minutes every 30 minutes plus at the same time I cannot load or refresh any websites for as long as the seizure lasts. while at the same time torrent downloads continue without a hitch.