Sample Java code and detail to call RFC from Java clas developed in Eclipse

Hi All,
I am new to Java. I have downloaded Eclipse IDE  and planning to use for developing Java application to send data to SAP by calling RFC JCO Interface.
I need a sample java code/tutorial step by step to create Java class for simple example to call RFC from Java.
I have downloaded SAPJCO3 from service market place.
Kindly help me to send steps involved to configure for JCO  with my Eclipse with JCO.
Thanks in advance.
Sharma

Hi Sharma,
Please have a look at [Example: Using Generated Proxies to Call Function Modules |http://help.sap.com/saphelp_nw04/helpdata/en/b6/55e3952a902447847066a0df27b0d6/content.htm]
JCo Exceptions : http://help.sap.com/saphelp_nw70ehp1/helpdata/en/f6/daea401675752ae10000000a155106/content.htm
Hope it will helps
Regards
Arun

Similar Messages

  • Call rfc from Java Web application.

    Hi:
    I am new to SAP Java programming.
    I am developing a java web application on SAP NW SP16.
    I need to call a rfc and process the data to be displayed on a jsp page.
    I have few questions...
    1) Can I use the JCO destination created in thru wed dynpro content administrator, to connect to sap and execute the rfc/bapi?
    2) How would I create and access the model (rfc)?
    3) Are the required jar and dll(rfc32.dll ... ) files available on the server?
    Any help would be greatly appreciated.
    Thanks.

    Hi,
       See the follwoing links which contains sample code to ceate JCO and execute BAPI.
    http://help.sap.com/saphelp_nw2004s/helpdata/en/6a/14e13d8ee4535ee10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/6a/14e13d8ee4535ee10000000a114084/frameset.htm
    http://help.sap.com/saphelp_nw2004s/helpdata/en/6a/14e13d8ee4535ee10000000a114084/frameset.htm
    Kind Regards,
    S.Saravanan.

  • Call RFC from java (j2ee) /  call to j2ee from R/3

    hello
    i´ve browsed the forum for some time to find how to:
    1.) call ejb from r/3 system via rfc
    2.) call rfc enabled function modules on r/3 from within an j2ee enviroment
    but i didn´t quite get it, because i was a bit confused about all the mentionend techniques
    what i found out about
    1.) use ejb (session bean) and jndi; configure RFC-Engine Service (we use sap webas)
    2.) use jco / jca
        (or all rfc enables rfm´s are available as web service, but didn´t find anything about this)
    so my question:
    are these the preferred techniques to connect j2ee (webAS) <-> r/3; if not are there any others, maybe easier methods?
    and last but not least: are there any good online tutorials for this topic?
    thanks in advance
    franz

    Just as a short partial reply.
    The generic Java --> RFC method is JCO (it will work on older versions as well), you can think of it as a JDBC driver where R/3 is the database, it behaves very similar in many ways.
    EJB development on SAP WAS is really not any different from EJB development on any other J2EE server. The deploy tool is superb. very easy to use and the JNDI registry, etc. are standard stuff...
    ABAP to EJB calls, haven't looked at this in over a year now, but back then we did a Proof Of Concept based on information at http://help.sap.com and it did work indeed. The only thing was back then that you needed to do a few tweaks to get it to work properly.
    As mentioned above, look at the JCO examples and then you can ask more specific questions once you get stuck.
    Good Luck!
    Cheers,
    Kalle

  • Calling RFC from custom connector

    Hi,
    I am developing a custom connector for UWL to get tasks from 3rd party system.
    I need to call a RFC from backend SAP system to complete Input data for this 3rd party provider.
    I assume that I have to make an RFC call from getItems() method of connector.
    Any idea how to call a RFC from UWL custom connector code?
    Please help.
    Thanks & Regards,
    Amey

    Hello Karri,
    Yes, I am aware of two ways of calling RFCs from Java code.
    Normally, I use following approach to call RFCs from my other Portal Components (JSPDynpages): -
    IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
    IPortalComponentContext myContext = request.getComponentContext();
    IPortalComponentProfile myProfile = myContext.getProfile();
    String sapSystem = myProfile.getProperty("SystemIdentifier");
    ISystemLandscapeWrapper landscapeWrapper = (ISystemLandscapeWrapper) UMFactory.getSystemLandscapeWrappers().get(0);
    ISystemLandscapeObject systemLandscapeObject = landscapeWrapper.getSystemByAlias(sapSystem);
    IJCOClientService clientService = (IJCOClientService) PortalRuntime.
    getRuntimeResources().getService(JCO_CLIENT);
    request.getNode().putValue(LOCALE_NODE_KEY,     Locale.ENGLISH);
    IJCOClientPoolEntry poolEntry = clientService.getJCOClientPoolEntry(sapSystem,request);
    JCO.Client client = poolEntry.getJCOClient();
    client.connect();
    IRepository repository = JCO.createRepository("repository", client);
    IFunctionTemplate functionTemplate = repository.getFunctionTemplate(Z_BAPI_EMP_GBU_GET);
    JCO.Function function = new JCO.Function(functionTemplate);
    JCO.ParameterList importList = function.getImportParameterList();
    importList.setValue("US", "OBJTYP");
    importList.setValue(request.getUser().getUniqueName(), "USRID");
    client.execute(function);
    JCO.ParameterList outputList = function.getExportParameterList();
    gbuCountryBean.setGbu(outputList.getString("GBU"));
    gbuCountryBean.setCountry(outputList.getString("COUNTRYCODE"));
    gbuCountryBean.setPersArea(outputList.getString("PERS_AREA"));
    gbuCountryBean.setCompanyCode(outputList.getString("COMPANYCODE"));
    When I tried implementing same in UWL custom connector, I am not able to get instance of 'request' object.
    Any hints/ideas on this?
    Hence as an temporary alternative, I wrote following to successfully execute RFC.
    mConnection = JCO.createClient(sapclient,  sapuser,
    sappassword,  "EN", saphost, sapsysnumber);
    mConnection.connect();
    mRepository = new JCO.Repository("GetLeaveRequestFlag", mConnection );
    IFunctionTemplate ftemplate = mRepository.getFunctionTemplate(Z_BAPI_CHECK_LR_TO_APPROVE);
    myFunction = new JCO.Function(ftemplate);
    JCO.Field OBJECT_TYPE = myFunction.getImportParameterList().getField("OBJECT_TYPE");
    OBJECT_TYPE.setValue("US");
    JCO.Field USERID = myFunction.getImportParameterList().getField("USERID");
    OBJECT_TYPE.setValue(p_userID);
    mConnection.execute(myFunction);
    JCO.Field leaveRequestFlag = myFunction.getExportParameterList().getField("FLAG_LEAVE_REQUEST_RECORD");
    mConnection.disconnect();
    But only catch here is that I need to create & maintain SAP logon credentials for a particular user manually.
    It is not possible to single sign on connector user into SAP system (like its done above).
    Any thoughts on this?
    Thanks & Regards,
    Amey

  • How to call xml from java

    Hi
    I want to use xml for updating files in an existing jar . so i want to call xml from java code and then come back to java code and do the remaining work in java code, pl guide me how to do this . what APIs are helpful for this regard
    Thanks

    You can't update files in a jar. Even if you could, you wouldn't use XML for that. You don't call XML. XML is not a programming language. So, basically your entire question is misguided.

  • Calling a javascript function from java code and getting tha value in Java

    Hi,
    I would like to call a Java script function confirmRemove() from Java code upon meeting a condition..
    for example the code snippet is:
    if(true){
    // I want to call js confirmRemove() over here. And get the value of variable "answer" in this if block.
    <html>
    <head>
    <script type="text/javascript">
    function confirmRemove() {
         var answer = confirm("Are you sure you want to Delete?")
    </script>
    </head>
    <body>
    <form>...

    Hi,
    Back in 2003 I have used an Applet which contain java code and this java code was calling the java scripts ( different methods, DHTML etc..)
    There was a component developed by NetScape called JSObject I am not sure it there is other third party component other then the JSObject
    look at this article which shows how (based on JSObject)
    [http://java.sun.com/products/plugin/1.3/docs/jsobject.html|http://java.sun.com/products/plugin/1.3/docs/jsobject.html]
    Regards,
    Alan Meio
    London,UK

  • Example-- Call RFC from external Java Application

    Update: I need code example to call RFC from External Java application. Can onybody help me?                                                      
    RGDS
    RP
    hi all.
    i want to create my own log for each interface.
    i saw this blog:
    /people/michal.krawczyk2/blog/2006/09/20/xi-abap-mapping-logs--more-standard-better-visibility
    my doubt is how to catch the error that i see in SXI_MONITOR y put it in a Sub-Objetc.
    For example: in sxi_monitor i get the error for my interface NMUCustomer: "No receiver could not be found" or "Error Mapping Traformation".
    I created an Object called ZNMUCUSTOMER and a Sub-Objetc called ZERROR.
    what i must do to get the error I see in monitor and assign it to Sub-Object??
    Rgds.
    Message was edited by:
            Rodrigo Pertierra
    Message was edited by:
            Rodrigo Pertierra
    Message was edited by:
            Rodrigo Pertierra

    Hi,
    Oh, you are using ABAP mapping ......
    then use the following in ABAP mapping ..
    TRACE1,TRACE2,TRACE3.... for trace level 1,2,3......
    http://help.sap.com/saphelp_nw04/helpdata/en/ba/e18b1a0fc14f1faf884ae50cece51b/content.htm
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/5c46ab90-0201-0010-42bd-9d0302591383
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/866ce290-0201-0010-338f-b8c3553aaa0f
    Regards
    Chilla

  • Working fine with JAVA code and Error Occured while using in JSP

    Hi.....
    When initiating a BPEL process from JAVA the code is working fine and the Process is getting initiated.But while using that code in J2EE project as a java code and while calling that method Error is occuring.....
    Here by i am attaching my JAVA Code which runs as an applicateion and package which runs in Server....
    JAVA Code (Run as Application) Working Fine:
    package bo;
    import com.oracle.bpel.client.Locator;
    import com.oracle.bpel.client.NormalizedMessage;
    import com.oracle.bpel.client.delivery.IDeliveryService;
    import java.util.Map;
    import java.util.Properties;
    import oracle.xml.parser.v2.XMLElement;
    /*import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest ;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession; */
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    public class processit {
         public static void main(String args[]){
              String input = "TATA";
              String xmlInput= "<ns1:AccessDBBPELProcessRequest xmlns:ns1=\"http://xmlns.oracle.com/AccessDBBPEL\"><ns1:input>"+input+"</ns1:input></ns1:AccessDBBPELProcessRequest>";
              String xml="<ns1:BPELProcess1ProcessRequest xmlns:ns1=\"http://xmlns.oracle.com/BPELProcess1\">";
              xml=xml+"<ns1:input>"+input+"</ns1:input>";
              xml=xml+"</ns1:BPELProcess1ProcessRequest>";
              try{
              Properties props=new Properties();
              props.setProperty("orabpel.platform","ias_10g");
              props.setProperty("java.naming.factory.initial","com.evermind.server.rmi.RMIInitialContextFactory");
              props.setProperty("java.naming.provider.url","opmn:ormi://157.227.132.226:6003:home/orabpel");
              props.setProperty("java.naming.security.principal","oc4jadmin");
              props.setProperty("java.naming.security.credentials","oc4jadmin");
              props.setProperty("dedicated.rmicontext", "true");
              Locator locator = new Locator("default", "bpel", props);
              System.out.println("After creating the locator object......");
              IDeliveryService deliveryService =(IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME);
              System.out.println("Before creating the NormalizedMessage object......");
              NormalizedMessage nm = new NormalizedMessage();
              System.out.println("After creating the NormalizedMessage object.*.*.*...");
              nm.addPart("payload", xml);
              System.out.println("Before creating response object......");
              NormalizedMessage res = deliveryService.request("BPELProcess1", "process", nm);
              System.out.println("After calling the BPELProcess1 .*.*.*...");
              Map payload = res.getPayload();
              System.out.println("BPEL called");
              XMLElement xmlEl=(oracle.xml.parser.v2.XMLElement)payload.get("payload");
              String replyText=xmlEl.getText();
              System.out.println("Reply from BPEL Process>>>>>>>>>>>>> "+replyText);
              catch (Exception e) {
              System.out.println("Exception : "+e);
              e.printStackTrace();
    JSP and Java Method Used:
    JSP Code:
    ===============
    <%@ page import=" bo.callbpel" %>
    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
    <title>FEATT - I30</title>
    </head>
    <body>
    <%
    String input=request.getParameter("dnvalue");
    callbpel p=new callbpel();
    String Output=p.Initiate(input);
    out.print("The Input Given to the BPEL Process is : "+input);
    %>
    <BR><BR><BR><BR><BR><BR>
    <%
    out.print("The Reply from BPEL Process is : "+Output);
    %>
    </body>
    </html>
    Java Code:
    package bo;
    import com.oracle.bpel.client.Locator;
    import com.oracle.bpel.client.NormalizedMessage;
    import com.oracle.bpel.client.delivery.IDeliveryService;
    import java.util.Map;
    import java.util.Properties;
    import oracle.xml.parser.v2.XMLElement;
    /*import javax.servlet.RequestDispatcher;
    import javax.servlet.ServletConfig;
    import javax.servlet.ServletException;
    import javax.servlet.http.HttpServlet;
    import javax.servlet.http.HttpServletRequest ;
    import javax.servlet.http.HttpServletResponse;
    import javax.servlet.http.HttpSession; */
    //import java.util.*;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    public class callbpel {
         public String Initiate(String value){
              String replyText=null;
              String input = value;
              System.out.println(input);
              String xmlInput= "<ns1:AccessDBBPELProcessRequest xmlns:ns1=\"http://xmlns.oracle.com/AccessDBBPEL\"><ns1:input>"+input+"</ns1:input></ns1:AccessDBBPELProcessRequest>";
              String xml="<ns1:BPELProcess1ProcessRequest xmlns:ns1=\"http://xmlns.oracle.com/BPELProcess1\">";
              xml=xml+"<ns1:input>"+input+"</ns1:input>";
              xml=xml+"</ns1:BPELProcess1ProcessRequest>";
              try{
              Properties props=new Properties();
              props.setProperty("orabpel.platform","ias_10g");
              props.setProperty("java.naming.factory.initial","com.evermind.server.rmi.RMIInitialContextFactory");
              props.setProperty("java.naming.provider.url","opmn:ormi://157.227.132.226:6003:home/orabpel");
              props.setProperty("java.naming.security.principal","oc4jadmin");
              props.setProperty("java.naming.security.credentials","oc4jadmin");
              props.setProperty("dedicated.rmicontext", "true");
              Locator locator = new Locator("default", "bpel", props);
              String uniqueBpelId = com.collaxa.cube.util.GUIDGenerator.generateGUID();
              //System.out.println(uniqueBpelId);
              //java.util.Map msgProps = new HashMap();
              System.out.println("After creating the locator object......");
              IDeliveryService deliveryService =(IDeliveryService)locator.lookupService(IDeliveryService.SERVICE_NAME);
              System.out.println("Before creating the NormalizedMessage object......");
              NormalizedMessage nm = new NormalizedMessage();
              System.out.println("After creating the NormalizedMessage object.*.*.*...");
              //msgProps.put("conversationId",uniqueBpelId);
              //nm.setProperty("conversationId",uniqueBpelId);
              nm.addPart("payload", xml);
              System.out.println("Before creating response object......");
              NormalizedMessage res = deliveryService.request("BPELProcess1", "process", nm);
              System.out.println("After calling the BPELProcess1 .*.*.*...");
              Map payload = res.getPayload();
              System.out.println("BPEL called");
              XMLElement xmlEl=(oracle.xml.parser.v2.XMLElement)payload.get("payload");
              replyText=xmlEl.getText();
              System.out.println("Reply from BPEL Process>>>>>>>>>>>>> "+replyText);
              catch (Exception e) {
              System.out.println("Exception : "+e);
              e.printStackTrace();
              return replyText;
    While Creating and Object for the Class callbpel and Whilw Calling that Method
    callbpel p=new callbpel();
    String Output=p.Initiate(input);
    Its throwing an Error:
    Error Occured is:
    After creating the locator object......
    Before creating the NormalizedMessage object......
    After creating the NormalizedMessage object.*.*.*...
    Before creating response object......
    Apr 24, 2008 9:12:00 AM org.apache.catalina.core.StandardWrapperValve invoke
    SEVERE: Servlet.service() for servlet jsp threw exception
    java.lang.NoClassDefFoundError: javax/ejb/EJBException
         at com.oracle.bpel.client.util.ExceptionUtils.handleServerException(ExceptionUtils.java:76)
         at com.oracle.bpel.client.delivery.DeliveryService.getDeliveryBean(DeliveryService.java:254)
         at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:83)
         at com.oracle.bpel.client.delivery.DeliveryService.request(DeliveryService.java:53)
         at bo.callbpel.Initiate(callbpel.java:55)
         at org.apache.jsp.output_jsp._jspService(output_jsp.java:55)
         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
         at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
         at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
         at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
         at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
         at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
         at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
         at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
         at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
         at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:874)
         at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
         at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
         at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
         at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)
         at java.lang.Thread.run(Unknown Source)
    For Running JSP i am Using Eclipse 3.2.0 and apache-tomcat-5.5.25
    Please Provide me a Solution......
    Thanks in Advance.....
    Regards,
    Suresh K

    A JSP is not the same as a Java application. A Java application has package statment, import statements, try/catch block, a JSP doesn't.

  • Java code and jsp interaction

    Hi,
    How does one interact between java code and jsp page.That is, if the java code does say database connection, the web page should tell that the connection has been made,just like an application but this will work on the web server not in the console.Kindly let me know.
    As

    Just curious but where do these questions come from? A course you are taking or you are building something for a hobby?
    If you are building some small simple web-app it's probably quicker to embed code right onto your JSP page.
    There are various levels of abstracting your web-app separating display from logic from the model.
    The following are techniques from simple web-apps to more complicated ones.
    -Embedding script right into your JSP
    -Using beans
    -Using custom tags ( I think there are some standard ones now, struts seems to be a popular buzzword)
    -Including a servlet to handle your requests redirect, update bean content grab info form your database and forward to a JSP. (Read up on model 2 architecture.)
    To include as much detail as possible would be to write a book. Fortunately many have so I don't have to fit one in this tiny reply box.
    Hope that was somewhat useful.

  • Calling RFCs in Java WebDynpro

    Hello Experts,
    I'm new to WebDynpro. I'm a novice at best and have just learned the basics. I'll probably be asking a lot of questions about this soon. Here is one problem I recently encountered:
    I managed to call RFCs from R/3 using a user input and then another one by using one field retrieved from the first called RFC. Now i have to call a BAPI recursively from the data I got from the 2nd RFC that I called.
    Here is the code so far:
    public void executeBapi_Network_Getdetail_Input( )
        //@@begin executeBapi_Network_Getdetail_Input()
        //$$begin Service Controller(246259973)
        IWDMessageManager manager = wdComponentAPI.getMessageManager();
        try
          BigDecimal plannedCost = new BigDecimal(0);
           for (int i=0; i<wdContext.nodeZps_Fm_Get_Network_Num_Input().nodeNetworks().nodeEx_Networks().size(); i++) {
              wdContext.currentBapi_Network_Getdetail_InputElement().setI_Without_Network(false);
              wdContext.currentBapi_Network_Getdetail_InputElement().setI_Without_Network_Activity(true);
              wdContext.currentBapi_Network_Getdetail_InputElement().setI_Without_Relation(true);
              wdContext.currentBapi_Network_Getdetail_InputElement().setI_Without_Activity_Element(true);
              wdContext.currentBapi_Network_Getdetail_InputElement().setI_Without_Activity_Milestone(true);
              wdContext.currentBapi_Network_Getdetail_InputElement().setI_Without_Component(true);
              wdContext.currentBapi_Network_Getdetail_InputElement().setNumber(
                wdContext.nodeZps_Fm_Get_Network_Num_Input().nodeNetworks().nodeEx_Networks().getEx_NetworksElementAt(i).getAufnr());
              wdContext.currentBapi_Network_Getdetail_InputElement().modelObject().execute();
              wdContext.nodeNetworkDetails().invalidate();
              plannedCost.add(wdContext.nodeBapi_Network_Getdetail_Input().nodeNetworkDetails().nodeE_Network().getE_NetworkElementAt(i).getPlanned_Cost());
    sorry if this is totally wrong. I'm totally a newbie here.
    Hoping for your kind and helpful responses.
    Cheers,
    Alfonso

    Hi Alfonso,
    Can you please try this code:
           IWDMessageManager manager = wdComponentAPI.getMessageManager();
             try
               BigDecimal plannedCost = new BigDecimal(0);
               // Initializing a IWDNode to make code more readable and clean
               IWDNode nodeEx_Networks = wdContext.nodeZps_Fm_Get_Network_Num_Input().nodeNetworks().nodeEx_Networks();
               // I have initialized the int variable because you should never calculate the size() in for loop.
               // It is major performance hit.
               int size = nodeEx_Networks.size();
               for (int i=0; i<size; i++) {
                   wdContext.currentBapi_Network_Getdetail_InputElement().setI_Without_Network(false);
                   wdContext.currentBapi_Network_Getdetail_InputElement().setI_Without_Network_Activity(true);
                   wdContext.currentBapi_Network_Getdetail_InputElement().setI_Without_Relation(true);
                   wdContext.currentBapi_Network_Getdetail_InputElement().setI_Without_Activity_Element(true);
                   wdContext.currentBapi_Network_Getdetail_InputElement().setI_Without_Activity_Milestone(true);
                   wdContext.currentBapi_Network_Getdetail_InputElement().setI_Without_Component(true);
                   wdContext.currentBapi_Network_Getdetail_InputElement().setNumber(nodeEx_Networks.getEx_NetworksElementAt(i).getAufnr());
                   wdContext.currentBapi_Network_Getdetail_InputElement().modelObject().execute();
                   // WHY IS THIS INVALIDATE DONE.. WHICH IS THIS NODE???
                   wdContext.nodeNetworkDetails().invalidate();
                IWDNode nodeE_Network = wdContext.nodeBapi_Network_Getdetail_Input().nodeNetworkDetails().nodeE_Network();
                  int sizeNetwork_Getdetail = nodeE_Network.size();
                  for (int i = 0; i < sizeNetwork_Getdetail; i++) {
                       plannedCost.add(nodeE_Network.getE_NetworkElementAt(i).getPlanned_Cost());
                  // Now you can check the plannedCost by printing it using the manager you have initialized above.
    I hope this solves your issue. If you have any further issue please revert back.
    Thanks and Regards
    Pravesh

  • How to read XI Data type in Java code and populate as array list, using UDF

    Hi,
    How to read XI Data type in Java code and populate as array list, using UDF?
    Is there any API using which  the XI data types can be read?
    Kindly reply.
    Richa

    Input Structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:CustomerCreateResp xmlns:ns0="urn:bp:xi:up:re:cust_mdm:cmdm:pr5:100">
       <CUSTOMER>
          <item>
             <CUSTOMERNO/>
             <MDMCUSTOMER/>
             <CREATE_DATE/>
             <RETURN>
                <TYPE/>
                <MESSAGE/>
             </RETURN>
             <PT_CONTPART_RETURN>
                <item>
                   <MDM_CONTACT/>
                   <CONTACT/>
                </item>
             </PT_CONTPART_RETURN>
             <PARTNERS>
                <item>
                   <CUSTOMERNO/>
                   <PARTNER_FUNCTION/>
                   <PARTNER_NUMBER/>
                   <DEFAULT_PARTNER/>
                </item>
             </PARTNERS>
          </item>
       </CUSTOMER>
    </ns0:CustomerCreateResp>
    Output structure
    (Sample output structure.This actually needs to be mapped and generated using UDF)
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:updateCustomer xmlns:ns1="urn:xiSericeVi"><ns1:customer><ns2:ArrayList xmlns:ns2="java:sap/standard">[]</ns2:ArrayList></ns1:customer><ns1:name>2344566</ns1:name></ns1:updateCustomer>

  • Call ABAP from Java

    Can any one help me in calling an ABAP program from Java.
    The version of SAP with me is 4.7.
    Thanks in advance.
    Regards ,
    Nagaraju Donikena

    To call ABAP from Java when I tried doing it from sample code given in help I was getting the following error. Can any one help in this regard.
    Exception in thread "main" java.lang.ExceptionInInitializerError: JCO.classIniti
    alize(): Could not load middleware layer 'com.sap.mw.jco.rfc.MiddlewareRFC'
    JCO.nativeInit(): Could not initialize dynamic link library sapjcorfc [no sapjco
    rfc in java.library.path]. java.library.path
            at com.sap.mw.jco.JCO.<clinit>(JCO.java:735)
            at TestConnect.<init>(TestConnect.java:8)
            at TestConnect.main(TestConnect.java:25)

  • Calling  RFCs from Web through XI

    We have used SAP.NET connector in the past to call RFCs from ASP.NET pages from our public website. We have now decided to use XI as the enterprise integration engine going forward.I am interested to know whether anybody has used XI to call RFCs from ASP.NET webpages. I do know that the XI to SAP calls would be made through RFC adapter.Will the communication from ASP.NET page to XI  be thourgh the HTTP adapter ? or is there any other smarter way. Can somebody point me to sample code for the calls through http adapter or  a how to guide?
    cheers
    Ramesh

    Hi
    U have scenario like this ASP.NET->XI->RFC, that means u will send a value from the ASP.NET page to RFC thru XI and then this RFC will give result which will come to ASP.NET frontend.
    For this go thru this blog it will help u to understand how to communicate from ASP.NET to XI
    <b>https://www.sdn.sap.com/sdn/weblogs.sdn?blog=/pub/wlg/1442</b [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken] [original link is broken]> [original link is broken]
    Code Sample is provided in the blog.
    Hope it helps.
    Regards
    Arpit Seth

  • "ReferenceError: "myIpAddr"  is not defined, when call JavaScript from java

    Hi developers,
    My java application was trying to issue a http request via proxy auto-config. So, I did below jobs
    1. Read URL of *.pac from registry
    2. Call FindProxyForURL from java, the code is like below
                   ScriptEngineManager factory = new ScriptEngineManager();
                   ScriptEngine engine = factory.getEngineByName("JavaScript");
                   engine.eval(autoProxyScript);
                   Invocable inv = (Invocable) engine;
                   Object obj = inv.invokeFunction("FindProxyForURL",
                             "http://java.sun.com/",
                             "java.sun.com");
    However, I got "ReferenceError: "myIpAddress" is not defined
    I can not change the script on server to add a function like "myIpAddress", I am wordering why IE or mozilla can call it successfully and get proxy server, while Java failed to do that.
    I got a ugly solution by calling "pacparser" by jni. But I really hope I can get a better solution.

    A .pac file is a JavaScript, but it requires some functions to be defined in the executing context to work (i.e. you must define those).
    From the example on the Wikipedia page there's at least "shExpMatch" and "isInNet". "myIpAddress" seems to be another such candidate.

  • Call RFC from DELPHI Windows Services Program

    Hi all,
    Are there any way to call RFC from DELPHI Windows Services Program?
    Best regards.
    Munur EBCIOGLU

    Hi again Bhagat,
    1. Yes, it's included on 7.4 ABAP Stack (SAP NetWeaver 7.4 SP8 - Optimized for SAP HANA, Cloud and Mobile - Service Release 2 available now!). In a recent customer, SAP licences GW by user but there are other license model like session licensing: https://store.sap.com/sap/cp/ui/resources/store/html/SolutionDetails.html?pid=0000009470&catID=&pcntry=US&sap-language=EN&_cp_id=id-1385059687642-0
    2. You could install as an AddOn on your 7.3 system, there are many options depending on your desired infrastructure: SAP Gateway deployment options in a nutshell For example our customer have deployed Central Hub Gateway in a standalone stack ABAP to act as an standalone oData bridge between ABAP/nonAbap systems.
    3. You could deploy SAPUI5 apps in 7.x, Java Web Servers or HTTP Web Servers. You must consider your SSO scenario:
    - SSO Logon Tickets. You will need to configurate SSO Logon Tickets between SAP NW Portal & SAP NW Gateway & your backend (ECC, etc). In order to pass SAP session cookie you will need setup SAP Web Dispacther and access portal & gateway throught SAP WD with the same domain.
    - SAML2 Tickets. This scenario lets you provide portal & gateway on different domains enabling SSO. You could configure SAP NW Portal as an Identity Provider and other systems must trust SAP Portal as IdP.
    Cheers

Maybe you are looking for