RFC call in a Webdynpro Java help?

Hi all,
I need used in my webdynpro Java a FM that I created in R3. Exactly I need load in a combo box  the results of my function module.
I do it this but not works correctly. I think thats my code is not correctly..Anybody can help me?
public void inicializarPrimerAprobadorTarea( )  {
    //@@begin inicializarPrimerAprobadorTarea()
   //Creamos variable para transformar el login en nombre
   String nombre;
   IModifiableSimpleValueSet valueSet = wdContext.nodeCONTAINER().getNodeInfo().getAttribute("AGENT_APPROVAL").getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
    // Obtenemos la primera tarea asociada al los aprobadores
    PP4Model2 pp4model2 = new PP4Model2();
    Z_Hsp_Wf_Gbs_Apro_Pva_Input rfcPrimerAprob = new Z_Hsp_Wf_Gbs_Apro_Pva_Input(pp4model2);
    //wdContext.nodeZ_Hsp_Wf_Gbs_Apro_Pva_Output().bind(rfcPrimerAprob);
    try {
rfcPrimerAprob.execute();
  wdContext.nodeOutput_1().invalidate();
  if(rfcPrimerAprob.getOutput().getEx_Subrc()!= 0){
   msgmgr.reportException(rfcPrimerAprob.getOutput().getEx_Mensaje());
  }else{ 
   for( int i=0;i<wdContext.nodeLt_Tabla_Pva().size();i++){
    //Transformamos el login en nombre
    nombre = getNombreUsuario(wdContext.nodeLt_Tabla_Pva().getLt_Tabla_PvaElementAt(i).getApprover_Id());
    //Imprimimos mensajes para ver si está correcto.
    msgmgr.reportSuccess(nombre);
    //Metemos el valor en la variable del container.
    valueSet.put(wdContext.nodeLt_Tabla_Pva().getLt_Tabla_PvaElementAt(i).getApprover_Id(),wdContext.nodeLt_Tabla_Pva().getLt_Tabla_PvaElementAt(i).getApprover_Id());  }
}catch (Exception e) {
   msgmgr.reportException("Error. "+e.getMessage());          
    //@@end
Any body knows the main steps from call correctly to my FM?
Regards,
C. Castillo

Thank you very much, now my method works correctly:
//@@begin inicializarPrimerAprobadorTarea()
   //Variable para transformar el login en nombre
   String nombre;
   IModifiableSimpleValueSet valueSet = wdContext.nodeCONTAINER().getNodeInfo().getAttribute("AGENT_APPROVAL").getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
   // Obtenemos la primera tarea asociada al los aprobadores mediante la función de PPA Z_Hsp_Wf_Gbs_Apro_Pva
   PP4Model2 pp4model2 = new PP4Model2();
   Z_Hsp_Wf_Gbs_Apro_Pva_Input rfcPrimerAprob = new Z_Hsp_Wf_Gbs_Apro_Pva_Input(pp4model2);
   try {
    rfcPrimerAprob.execute();
    wdContext.nodeOutput_1().invalidate();
    if(rfcPrimerAprob.getOutput().getEx_Subrc()!= 0){
     msgmgr.reportException(rfcPrimerAprob.getOutput().getEx_Mensaje());
    }else{ 
     if (rfcPrimerAprob.getOutput().getLt_Tabla_Pva().size()== 0){
      msgmgr.reportException("No existen primeros aprobadores responsables para esta tarea, por favor póngase en contacto con el Administrador de la aplicación");
     }else{
      for(int i=0;i<rfcPrimerAprob.getOutput().getLt_Tabla_Pva().size();i++){
       //Transformamos el login en nombre
       nombre = getNombreUsuario(rfcPrimerAprob.getOutput().getLt_Tabla_Pva().get(i).getApprover_Id());
       if(formInfo.getValue().equals("Inicio")|| formInfo.getValue().equals("Modif")){
        if (nombre.equals(rfcPrimerAprob.getOutput().getLt_Tabla_Pva().get(i).getApprover_Id())){
         msgmgr.reportException("El login: "+rfcPrimerAprob.getOutput().getLt_Tabla_Pva().get(i).getApprover_Id()+"es eliminado de los valores del primer aprobador por no existir en SAP Portal");
        }else{
         //Metemos el valor en la variable del container.
         valueSet.put(rfcPrimerAprob.getOutput().getLt_Tabla_Pva().get(i).getApprover_Id(),nombre); 
   }catch (Exception e) {
    msgmgr.reportException("Error. "+e.getMessage());          
    //@@end
If anybody can be improve please let me know,
Regards all,
C. Castillo

Similar Messages

  • SRM  RFC Model Error in Webdynpro JAVA

    Hi All,
    When I create a model from Any R/3 RFC in Webdynpro(JAVA) and map the RFC model context to Controller Context then every thing works fine, but when I create model from SRM RFC(Model is created with no problems at all) and map the SRM Model context to Controller Context, then I get below error:
    com.sap.tc.webdynpro.services.exceptions.TypeNotFoundException: type com.cnsl.srm.model.types.Bbp_Category_Id could not be loaded: com.sap.dictionary.runtime.DdException: Type com.cnsl.srm.model.types.Bbp_Category_Id does not exist
    Is there any thing specific to SRM that we have to do on the Webdynpro(JAVA) side to be able to call the SRM RFC. Kindly suggest me. Also please if you can forward me to forum thread/blog in case there is any.
    -Shekhar.

    Hi,
    Please look at this thread. Similar problem
    Webdynpro Services Exception
    WebDynpro using BAPI has an error
    Regards,
    Marcin Gajewski

  • Calling perl script from java ---help needed

    I haven't been doing a lot with java lately and i'm building an app with netbeans and having some difficulty with my button calling an outside perl script I'm pasting the code and error below...any help would be greatly appreciated. It's running on fedora 9 pretty much default install...
    thanks.
    code:
    Runtime r = Runtime.getRuntime();
    Process p = null;
    String s = null;
    String cmd123[] = { "perl /home/deaddev/test1.pl" };
    try {
    p = r.exec(cmd123);
    catch {
    foo bar/etc/etc
    error:
    Oct 12, 2008 4:09:37 PM photomainmgr readToPerlActionPerformed
    SEVERE: null
    java.io.IOException: Cannot run program "perl /home/deaddev/test1.pl": java.io.IOException: error=2, No such file or directory
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:474)
    at java.lang.Runtime.exec(Runtime.java:610)
    at java.lang.Runtime.exec(Runtime.java:483)
    at photomainmgr.readToPerlActionPerformed(photomainmgr.java:117)
    at photomainmgr.access$000(photomainmgr.java:21)
    at photomainmgr$1.actionPerformed(photomainmgr.java:54)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2012)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2335)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:404)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:253)
    at java.awt.Component.processMouseEvent(Component.java:6101)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3276)
    at java.awt.Component.processEvent(Component.java:5866)
    at java.awt.Container.processEvent(Container.java:2105)
    at java.awt.Component.dispatchEventImpl(Component.java:4462)
    at java.awt.Container.dispatchEventImpl(Container.java:2163)
    at java.awt.Component.dispatchEvent(Component.java:4288)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4461)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4125)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4055)
    at java.awt.Container.dispatchEventImpl(Container.java:2149)
    at java.awt.Window.dispatchEventImpl(Window.java:2478)
    at java.awt.Component.dispatchEvent(Component.java:4288)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:604)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:200)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:190)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:185)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:177)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:138)
    Caused by: java.io.IOException: java.io.IOException: error=2, No such file or directory
    at java.lang.UNIXProcess.<init>(UNIXProcess.java:164)
    at java.lang.ProcessImpl.start(ProcessImpl.java:81)
    at java.lang.ProcessBuilder.start(ProcessBuilder.java:467)
    ... 30 more
    error executing perl /home/deaddev/test1.pl

    jschell wrote:
    sabre150 wrote:
    As and alternative you can useString cmd123 = "perl /home/deaddev/test1.pl";Using the single string approach YOU have to do any quoting so with this line no quoting takes place and the script /home/deaddev/test1.pl will be executed.Although that should be true apparently it isn't. I have just run  
    Process p = Runtime.getRuntime().exec("perl /home/sabre/work/dev/perl/xxx.pl");
    new Thread(new SyncPipe(p.getErrorStream(), System.err)).start();
    new SyncPipe(p.getInputStream(), System.out).run();
    int returnCode = p.waitFor();
    System.out.println("Return code = " + returnCode);which correctly executes the perl script xxx.pl.
    P.S. SyncPipe is a Runnable that copies an InputStream to an OutputStream.
    Edited by: sabre150 on Oct 14, 2008 9:19 AM
    Interesting! Even though Runtime.exec() works with a single String, ProcessBuilder fails with this approach! You have to split the argument string. This certainly looks like a bug! Some while ago I looked at the source for Runtime.exec() to look at the differences between Runtime.exec() and ProcessBuilder and found that behind the scenes Runtime.exec() uses ProcessBuilder.
    More research is required.

  • Unknown/Junk Characters in RFC call

    Hey All,
        I am having a strange issue in one of the RFC calls made from a Java System to our SAP system. We were getting random errors with this interface( the interface was working well before for a long time) . When I Captured the values sent during the RFC calls I found a lot of junk characters being sent by the other system. Is this the problem of the sending sytem or something in between?
    Has anyone experienced anything like this before.
    Any inputs on what could be the Issue.
    Thanks

    Ash,
    The Java Application is connected to the SAP System using Java Connector.
    aRs,
    The rfc is basically a wraper of standard Bapi "BAPI_REPMANCONF1_CREATE_MTS" for confirmations which has a IMSEG related structure with a lot of QUAN fields. What do you think is the issue with RFC calls and QUAN fields. Becausing changing all the QUAN's to Chars and converting it back to QUAN in the wrapper will be a decently big change.
    I was kindoff ruling out the unicode issue because this interface was working fine for more the 6 months, and we were unicode long time ago.
    One thing I suspect where the Issue could be is the SDK kit for the Java application. We recently Updated our Kernel Version and I think we should Upgrade the SDK';s too which was not done. What do you think??
    Thanks

  • RFC call from java webdynpro

    Hi,
    I'm creating a Java Webdynpro where I call RFC's from SAP.
    For the images in the webdynpro, I call the standard SAP function 'CVAPI_DOC_VIEW'
    When I execute the function in SAP, I get the url to the contentserver with the correct image.
    After calling the same function in my Java Webdynpro, the url is empty.
    I've checked the importing parameters after calling from webdynpro and SAP and they are the same.
    After debugging, I saw that the function 'CVAPI_DOC_VIEW' is the problem. He's exporting an empty url after calling from the webdynpro.
    Does anybody knows the possible fault and solution for my problem?

    I'm not an ABAPer but the last time I've dealt with DMS from Web Dynpro an ABAPer wrote a custom function that gets the file content (XSTRING) by sending DMS parameters (documenttype, documentnumber, documentversion, documentpart).
    After getting the XSTRING from my Web Dynpro Java, I convert it to byte[] and created URL by using WDResourceFactory.
    Hope it helps...
    Omri

  • Why we call adaptive RFC in webdynpro java..

    Hi,
    I want to know why we call adaptive RFC connection in webdynpro java whenever we import new rfc in our  java web dynpro project.  why name  ADAPTIVE RFC  is used
    if we  make any structure changes in the model which we imported in web dynpro project , like adding a new field, or changing the length/datatype of the existing field, then we always have to reimport the model in our webdynpro project so why adaptive name used. wats especial in the word ADAPTIVE RFC

    Hi Rahul,
    please read the guide:
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/10465350-b4f5-2910-61ba-a58282b3b6df?quicklink=index&overridelayout=true
    Best Regards,
    Ervin

  • Calling RFC with webdynpro java (in NetWaver Dev.Studio)

    Hi,
    I have a RFC like below
    FUNCTION ZSAP_X.
    *""Local interface:*
    *"  IMPORTING
    *"     VALUE(USNAM) TYPE  USERNAME
    *"  EXPORTING
    *"      VALUE(PWD) TYPE  CHAR8
    1-I want to write webdynpro java application to call RFC
    2-Call RFC with USNAM parameter
    3-Get PWD output parameter and write it's value into View TextInput field.
    I wrote application but I did not get PWD (output parameter) value. I checked RFC running poreperly.I did not achieve to get PWD.
    How can I do that?
    Thanks.

    Hi Bala,
    I checked RFC, it is running properly and getting the output value.
    And I used command below, but it produces error
    String X = wdContext.currentPWDElement().getpwd().toString();
    Error:
    java.lang.ArrayIndexOutOfBoundsException: -1
    Thanks.

  • Calling RFC with webdynpro java (in NetWeaver Developer studio)

    Calling RFC with webdynpro java (in NetWeaver Developer studio)
    Hi,
    I want to call only one parameter RFC with webdynpro.
    Flight example is very complex.
    I want to push a button and pass parameter to RFC input and call RFC.
    After execution some message must appaer on the screen.
    Is there a step by step .pdf?
    Thanks.

    Hello Cemil,
    There's a seperate Web Dynpro forum for such posts, you should take a look there.
    Nonetheless, the classic tutorial is the FlightList. If I was you, I would make sure to do this tutorial step-by-step as it should give you the fundamentals for understanding aRFC. On top of that, it's most likely already available to you on your SAP system...
    Here's the link:
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/a00f7103-6790-2a10-ac9c-fcac7c5b18a3
    Cheers,
    Hermann

  • Call stateless session bean EJB 2.0 from Webdynpro Java UI

    Hello,
    Can someone please tell me asto how to call a stateless session bean EJB 2.0 from Webdynpro Java UI?
    The NWDS version is 7.0.
    Thanks and Regards,
    Arya

    Hi Aryadipta
    Please check this pdfs
    https://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/b00917dc-ead4-2910-3ebb-b0a63e49ef10&overridelayout=true
    Steps for calling stateless session bean in Webdynpro java
    Go to NWDS -> open perspective ->j2ee
    select EJB Module Project ->create a project with name
    Open the Project -->RC on ejb-jar.xml -> Select new --> EJB
    Give name to EJB Bean (First letter should be in capital letters)
    select the type of bean as Stateless session bean and give the package name to store that EJB bean.
    After that Expand ejb-jar.xml and then select the <projectEJB> 
    Double click on this on method  tab double click you will get business method where we will create the methods for business logic
    Double click on projectEJB and then RC on bean tab and write required business logic in bean window as follows(based on requirement we will design a business logic).
    After writing the business logic go to project -> rebuild
    Till now we have created one EJB jar file
    then go to File-->Enterprise Application Project -->create a project (projectEAR)
    After creating a project click on next-> here we will have ear projects and then we select specific project required for our application.(here select projectEJB)
    After that Calculate EAR project will be available on j2ee explorer.
    Right click on <Bean> here
    select New->Web Service->give a name to webservice and select Default configuration type as simple SOAP
    -->click next -> Finish.
    That webservice and related are created in ejb-jar.xml .
    Expand the ejb-jar.xml.and double click on < webservice>
    RC ProjectEJB -> Build EJB Archive RC on CalculateEAR ->Build applicationarchive.
    Expand the projectEAR->RC on CalculateEAR.ear->Deploy to J2EE Engine
    Double click on calculateEAR.ear ->Webservice navigator tab ->we eill servers expand the node
    select the specific WebService  
    Here we test the webservice by click on Test and test it.
    After that go to Web dynpro perspective ->create one webdynpro Project and one component
    RC on model> Select import Web Service model(last)>give model name and package
    and select radio button as local file system or URL
    Go to WSnavigator->copy the WSDL path and paste it in model WSDL path and click on finish.
    from here onwards steps are same as that adaptive RFC model
    Hope it helps
    Thanks
    Tulasi Palnati
    Edited by: Tulasi Palnati on Aug 26, 2009 12:15 PM
    Edited by: Tulasi Palnati on Aug 26, 2009 12:43 PM

  • Looking for a beginner guide - Adaptive RFC  call BAPI  in Web Dynpro Java

    Hi,
    im new in SAP Developeing. I developed some basic web Dynpro applications (after some tutorials) and they are all working.
    Now i want to build an Web Dynpro application with an adaptive RFC Model.
    I already imported the adaptive RFC Modell with a function Model (BAPI Z_...) from the R3 System successfully.
    But if i deploy the application i will get following error:
    com.sap.tc.webdynpro.services.exceptions.TypeNotFoundException: type extern:mypackages.com.types.BapiModel:mypackages.com.types.Zmbs_Bapi_Dispo_Orderdata could not be loaded: com.sap.dictionary.runtime.DdException: TypeBroker failed to access SLD: Error while obtaining JCO connection.
         at com.sap.tc.webdynpro.services.datatypes.core.DataTypeBroker.getStructure(DataTypeBroker.java:305)
         at com.sap.tc.webdynpro.progmodel.context.DataNodeInfo.doInit(DataNodeInfo.java:234)
         at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:671)
         at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:674)
         at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:674)
         at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:674)
         at com.sap.tc.webdynpro.progmodel.context.Context.init(Context.java:40)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:199)
         at com.sap.tc.webdynpro.progmodel.controller.Component.getCustomControllerInternal(Component.java:449)
         at com.sap.tc.webdynpro.progmodel.controller.Component.getMappableContext(Component.java:387)
         at com.sap.tc.webdynpro.progmodel.controller.Component.getMappableContext(Component.java:416)
         at com.sap.tc.webdynpro.progmodel.context.MappingInfo.getDataNode(MappingInfo.java:83)
         at com.sap.tc.webdynpro.progmodel.context.MappingInfo.initMapping(MappingInfo.java:125)
         at com.sap.tc.webdynpro.progmodel.context.MappingInfo.init(MappingInfo.java:121)
         at com.sap.tc.webdynpro.progmodel.context.MappedNodeInfo.doInit(MappedNodeInfo.java:215)
         at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:671)
         at com.sap.tc.webdynpro.progmodel.context.NodeInfo.init(NodeInfo.java:674)
         at com.sap.tc.webdynpro.progmodel.context.Context.init(Context.java:40)
         at com.sap.tc.webdynpro.progmodel.controller.Controller.init(Controller.java:199)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.getView(ViewManager.java:709)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.bindRoot(ViewManager.java:579)
         at com.sap.tc.webdynpro.progmodel.view.ViewManager.init(ViewManager.java:155)
         at com.sap.tc.webdynpro.clientserver.window.WebDynproWindow.doOpen(WebDynproWindow.java:295)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.show(ApplicationWindow.java:183)
         at com.sap.tc.webdynpro.clientserver.window.ApplicationWindow.open(ApplicationWindow.java:178)
         at com.sap.tc.webdynpro.clientserver.cal.ClientApplication.init(ClientApplication.java:364)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.initApplication(ApplicationSession.java:754)
         at com.sap.tc.webdynpro.clientserver.session.ApplicationSession.doProcessing(ApplicationSession.java:289)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessingStandalone(ClientSession.java:713)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doApplicationProcessing(ClientSession.java:666)
         at com.sap.tc.webdynpro.clientserver.session.ClientSession.doProcessing(ClientSession.java:250)
         at com.sap.tc.webdynpro.clientserver.session.RequestManager.doProcessing(RequestManager.java:149)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doContent(DispatcherServlet.java:62)
         at com.sap.tc.webdynpro.serverimpl.defaultimpl.DispatcherServlet.doGet(DispatcherServlet.java:46)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.runServlet(HttpHandlerImpl.java:401)
         at com.sap.engine.services.servlets_jsp.server.HttpHandlerImpl.handleRequest(HttpHandlerImpl.java:266)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:386)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.startServlet(RequestAnalizer.java:364)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.invokeWebContainer(RequestAnalizer.java:1039)
         at com.sap.engine.services.httpserver.server.RequestAnalizer.handle(RequestAnalizer.java:265)
         at com.sap.engine.services.httpserver.server.Client.handle(Client.java:95)
         at com.sap.engine.services.httpserver.server.Processor.request(Processor.java:175)
         at com.sap.engine.core.service630.context.cluster.session.ApplicationSessionMessageListener.process(ApplicationSessionMessageListener.java:33)
         at com.sap.engine.core.cluster.impl6.session.MessageRunner.run(MessageRunner.java:41)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:102)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:172)
    Caused by: com.sap.dictionary.runtime.DdException: TypeBroker failed to access SLD: Error while obtaining JCO connection.
         at com.sap.tc.webdynpro.services.datatypes.core.DataTypeBroker$1.fillSldConnection(DataTypeBroker.java:90)
         at com.sap.dictionary.runtime.ProviderFactory.internalResolveLogicalNameToJCODestination(ProviderFactory.java:377)
         at com.sap.dictionary.runtime.ProviderFactory.resolveLogicalNameToJCODestination(ProviderFactory.java:322)
         at com.sap.dictionary.runtime.ProviderFactory.internalGetProvider(ProviderFactory.java:181)
         at com.sap.dictionary.runtime.ProviderFactory.getProvider(ProviderFactory.java:146)
         at com.sap.dictionary.runtime.DdDictionaryPool.getProvider(DdDictionaryPool.java:97)
         at com.sap.dictionary.runtime.DdDictionaryPool.getDictionary(DdDictionaryPool.java:79)
         at com.sap.dictionary.runtime.DdDictionaryPool.getDictionary(DdDictionaryPool.java:48)
         at com.sap.dictionary.runtime.DdBroker.getDataType(DdBroker.java:149)
         at com.sap.dictionary.runtime.DdBroker.getStructure(DdBroker.java:180)
         at com.sap.tc.webdynpro.services.datatypes.core.DataTypeBroker.getStructure(DataTypeBroker.java:303)
         ... 49 more
    Caused by: com.sap.tc.webdynpro.services.sal.sl.api.WDSystemLandscapeException: Error while obtaining JCO connection.
         at com.sap.tc.webdynpro.serverimpl.wdc.sl.SystemLandscapeFactory.getJCOClientConnection(SystemLandscapeFactory.java:152)
         at com.sap.tc.webdynpro.serverimpl.wdc.sl.SystemLandscapeFactory.getJCOClientConnectionUnMapped(SystemLandscapeFactory.java:178)
         at com.sap.tc.webdynpro.services.sal.sl.core.SystemLandscapeInternal.getJCOClientConnectionUnMapped(SystemLandscapeInternal.java:62)
         at com.sap.tc.webdynpro.services.datatypes.core.DataTypeBroker$1.fillSldConnection(DataTypeBroker.java:77)
         ... 59 more
    Caused by: com.sap.tc.webdynpro.services.exceptions.WDRuntimeException: Failed to load client to connect to SLD. Please check your SLD connection settings using the Visual Admin.
         at com.sap.tc.webdynpro.serverimpl.wdc.sl.SystemLandscapeFactory$1.run(SystemLandscapeFactory.java:754)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.tc.webdynpro.serverimpl.wdc.sl.SystemLandscapeFactory.getClient(SystemLandscapeFactory.java:747)
         at com.sap.tc.webdynpro.serverimpl.wdc.sl.JCOClientConnection.readJCODestinationFromSLD(JCOClientConnection.java:511)
         at com.sap.tc.webdynpro.serverimpl.wdc.sl.JCOClientConnection.resolveConnectionParameter(JCOClientConnection.java:439)
         at com.sap.tc.webdynpro.serverimpl.core.sl.AbstractJCOClientConnection.init(AbstractJCOClientConnection.java:233)
         at com.sap.tc.webdynpro.serverimpl.core.sl.AbstractJCOClientConnection.<init>(AbstractJCOClientConnection.java:218)
         at com.sap.tc.webdynpro.serverimpl.wdc.sl.JCOClientConnection.<init>(JCOClientConnection.java:129)
         at com.sap.tc.webdynpro.serverimpl.wdc.sl.SystemLandscapeFactory.getJCOClientConnection(SystemLandscapeFactory.java:150)
         ... 62 more
    Caused by: com.sap.sldserv.exception.SldServiceRuntimeException: Failed to create CIM client. Check via 'Visual Administrator' tool if the secure store is operational.
         at com.sap.sldserv.SldApplicationService.getCimClient(SldApplicationService.java:117)
         at com.sap.tc.webdynpro.serverimpl.wdc.sl.SystemLandscapeFactory$1.run(SystemLandscapeFactory.java:751)
         ... 70 more
    Caused by: com.sap.lcr.api.cimclient.CIMClientException: java.net.MalformedURLException: URL must have a host part
         at com.sap.lcr.api.cimclient.ClientFactory.createConnection(ClientFactory.java:466)
         at com.sap.lcr.api.cimclient.ClientFactory.createClientImpl(ClientFactory.java:413)
         at com.sap.lcr.api.cimclient.ClientFactory.createClient(ClientFactory.java:363)
         at com.sap.sldserv.SldApplicationService.getCimClient(SldApplicationService.java:113)
         ... 71 more
    ........Looks like a have a Problem with JCO.
    Is there a good guide, which explains the Basic steps in developeing Web dynpro applications and BAPI ?!

    thank you guys for all the answers.I have to read all the documentations.
    to my szenario:
    I installed on my notebook the Trial Versions of:
    SAP NetWeaver Application Server 7.00/Java AS 7.00
    SAP NetWeaver Developer Studio Version: 7.0.14
    All my basic Web Dynpro Applications in Java are running (even with Adobe Interactive Forms) on the local NetWeaver Trail- Web AS Trail perfectly.
    Now i want to connect per RFC to another SAPERP Server, which is in the intranet.
    I did the whole RFC tutorial with the flights -
    http://help.sap.com/saphelp_nw04/helpdata/en/c3/76b45d9688e04abe1a1070410ddc1e/content.htm (also with the JCO codeing etc)
    so my web dynpro application should work.
    I think I have to configure - like ramesh said something on the NetWeaver Trail.
    So what do i need and configure excactly on my Netweaver Trial to work with RFC - to call the BAPIS in the other System?
    - SLD ? JCO ?
    If i over Web Dynpro - Content Administrator - >
    it says "Connection to System Landscape Directory (SLD) could not be opended successfully." and all the buttons
    create Jco destinations etc. are greyed out.
    I didn´t configured the SLD and JCO in the Netweaver yet.

  • Webdynpro JAVA call ARFC

    Hi Friend
    I created the "ZBEN_DEMO_RFC" RFC in IDS.
    When Webdynpro Java call the "ZBEN_DEMO_RFC" get a error.
    How to get a ARFC?
    Regards
    Ben

    Hi Ben,
    I think problem is related to autherization, please chekc the userID/password and check SSO ticket for authorization while defining a metadata JCO Destination.
    You can trace error RFC_ERROR_SYSTEM_FAILURE exception, have a look at the dev_jrfc.trc files. These files are written by JRFC and can be found in the directories j2ee/cluster/server* of the J2EE Application Server Installation.
    Refre this WDJ - Adaptive RFC Troubleshooting Guide:-
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/d0019b1a-775f-2910-beb8-d81f27d0d8d0?quicklink=index&overridelayout=true
    http://wiki.sdn.sap.com/wiki/display/EP/8EstablishSingleSignOnbetweenPortal%28frontend%29andESS6.0%28backend%29
    Hope this may help you
    Deepak!!!
    Edited by: Deepak Arora on May 17, 2010 6:00 AM

  • Java Error in RFC Lookup in XSLT Mapping usinf Java helper class

    Hi All,
    I am doing RFC Lookup in XSLT Mapping using Java Helper class.
    The Lookup works fine when called one RFC at a time However my requirement is I want to do 2 Lookups.
    Both Lookups works when done individually however when I call both lookups in one mapping I get following error "javax.xml.transform.TransformerException: DOMSource whose Node is null."
    Following is the code I have written in XSLT for the lookup:
         <xsl:template name="Lookup_1">
              <xsl:param name="STDPN"/>
                   <rfc:RFC_READ_TABLE>
                        <QUERY_TABLE>KNA1</QUERY_TABLE>
                        <OPTIONS><item><TEXT>
                                  <xsl:value-of select="$STDPN"/>
                             </TEXT></item>
                        </OPTIONS>
                        <FIELDS>
                             <item>
                                  <FIELDNAME>KUNNR</FIELDNAME>
                             </item>
                        </FIELDS>
                   </rfc:RFC_READ_TABLE>
              </xsl:variable>
              <xsl:variable name="response" xmlns:lookup="java:urn.mt.pi" select="lookup:execute($request, 'BS_D, 'cc_RfcLookup', $inputparam)"/>
              <xsl:element name="STDPN">
                   <xsl:value-of select="$response//DATA/item/WA"/>
              </xsl:element>
         </xsl:template>
         <xsl:template name="Lookup_2">
              <xsl:param name="BELNR"/>
                   <xsl:variable name="Query">AGMNT = '<xsl:value-of select="$BELNR"/>'</xsl:variable>
                   <xsl:variable name="request1">
                        <rfc:RFC_READ_TABLE>
                             <QUERY_TABLE>ZTABLE</QUERY_TABLE>
                             <OPTIONS><item><TEXT>
                                  <xsl:value-of select="$Query"/>
                                  </TEXT></item>
                             </OPTIONS>
                             <FIELDS>
                                  <item>
                                       <FIELDNAME>KUNAG</FIELDNAME>
                                  </item>
                             </FIELDS>
                        </rfc:RFC_READ_TABLE>
                   </xsl:variable>
                   <xsl:variable name="response1" xmlns:lookup="java:urn.mt.pi" select="lookup:execute($request1, 'BS_D','cc_RfcLookup', $inputparam)"/>
                   <xsl:element name="BELNR">
                        <xsl:value-of select="$response1//DATA/item/WA"/>
                   </xsl:element>
         </xsl:template>
    My Question: Am I doing anything wrong? Or Is it possible to call multiple lookups in one XSLT?
    Thanks and Regards,
    Atul

    Hi Atul,
    I had the same problem like you had.
    The main Problem is that with the example code the request variable is created as NodeList object. In XSLT a variable is somekind of a constant and can't be changed. As the request object is empty after the first request the programm fails at the following line:
    Source source = new DOMSource(request.item(0));
    So I've created a workaround for this problem.
    In the call of the template I've put the request as a parameter object at the template call:
    <xsl:with-param name="req">
    <rfc:PLM_EXPLORE_BILL_OF_MATERIAL xmlns:rfc="urn:sap-com:document:sap:rfc:functions">
      <APPLICATION>Z001</APPLICATION>
      <FLAG_NEW_EXPLOSION>X</FLAG_NEW_EXPLOSION>
      <MATERIALNUMBER><xsl:value-of select="value"/></MATERIALNUMBER>
      <PLANT>FSD0</PLANT>
      <VALIDFROM><xsl:value-of select="//Recordset/Row[name='DTM-031']/value"/></VALIDFROM>
      <BOMITEM_DATA/>
    </rfc:PLM_EXPLORE_BILL_OF_MATERIAL>
    </xsl:with-param>
    With this change the request will be provided as a String object and not as a NodeList object.
    Afterwards the RfcLookup.java has to be changed to the following:
    package com.franke.mappings;
    import java.io.ByteArrayInputStream;
    import java.io.ByteArrayOutputStream;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.PrintWriter;
    import java.io.StringWriter;
    import java.util.Map;
    import javax.xml.parsers.DocumentBuilder;
    import javax.xml.parsers.DocumentBuilderFactory;
    import javax.xml.transform.Source;
    import javax.xml.transform.Transformer;
    import javax.xml.transform.TransformerFactory;
    import javax.xml.transform.dom.DOMSource;
    import javax.xml.transform.stream.StreamResult;
    import org.w3c.dom.Document;
    import org.w3c.dom.Node;
    import org.w3c.dom.NodeList;
    import com.sap.aii.mapping.lookup.Channel;
    import com.sap.aii.mapping.api.StreamTransformationConstants;
    import com.sap.aii.mapping.api.AbstractTrace;
    import com.sap.aii.mapping.lookup.RfcAccessor;
    import com.sap.aii.mapping.lookup.LookupService;
    import com.sap.aii.mapping.lookup.XmlPayload;
    * @author Thorsten Nordholm Søbirk, AppliCon A/S
    * Helper class for using the XI Lookup API with XSLT mappings for calling RFCs.
    * The class is generic in that it can be used to call any remote-enabled
    * function module in R/3. Generation of the XML request document and parsing of
    * the XML response is left to the stylesheet, where this can be done in a very
    * natural manner.
    * TD:
    * Changed the class that request is sent as String, because of IndexOutOfBound-exception
    * When sending multiple requests in one XSLT mapping.
    public class RfcLookup {
         * Execute RFC lookup.
         * @param request RFC request - TD: changed to String
         * @param service name of service
         * @param channelName name of communication channel
         * @param inputParam mapping parameters
         * @return Node containing RFC response
         public static Node execute( String request,
                 String service,
                 String channelName,
                 Map inputParam)
              AbstractTrace trace = (AbstractTrace) inputParam.get(StreamTransformationConstants.MAPPING_TRACE);
              Node responseNode = null;
              try {
                  // Get channel and accessor
                  Channel channel = LookupService.getChannel(service, channelName);
                  RfcAccessor accessor = LookupService.getRfcAccessor(channel);
                   // Serialise request NodeList - TD: Not needed anymore as request is String
                   /*TransformerFactory factory = TransformerFactory.newInstance();
                   Transformer transformer = factory.newTransformer();
                   Source source = new DOMSource(request.item(0));
                   ByteArrayOutputStream baos = new ByteArrayOutputStream();
                   StreamResult streamResult = new StreamResult(baos);
                   transformer.transform(source, streamResult);*/
                    // TD: Add xml header and remove linefeeds for the request string
                    request = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"+request.replaceAll("[\r\n]+", ""); 
                    // TD: Get byte Array from request String to send afterwards
                    byte[] requestBytes = request.getBytes();
                   // TD: Not used anymore as request is String
                    //byte[] requestBytes = baos.toByteArray();
                    trace.addDebugMessage("RFC Request: " + new String(requestBytes));
                    // Create input stream representing the function module request message
                    InputStream inputStream = new ByteArrayInputStream(requestBytes);
                    // Create XmlPayload
                    XmlPayload requestPayload =LookupService.getXmlPayload(inputStream);
                    // Execute lookup
                    XmlPayload responsePayload = accessor.call(requestPayload);
                    InputStream responseStream = responsePayload.getContent();
                    TeeInputStream tee = new TeeInputStream(responseStream);
                    // Create DOM tree for response
                    DocumentBuilder docBuilder =DocumentBuilderFactory.newInstance().newDocumentBuilder();
                    Document document = docBuilder.parse(tee);
                    trace.addDebugMessage("RFC Response: " + tee.getStringContent());
                    responseNode = document.getFirstChild();
              } catch (Throwable t) {
                   StringWriter sw = new StringWriter();
                   t.printStackTrace(new PrintWriter(sw));
                   trace.addWarning(sw.toString());
              return responseNode;
         * Helper class which collects stream input while reading.
         static class TeeInputStream extends InputStream {
               private ByteArrayOutputStream baos;
               private InputStream wrappedInputStream;
               TeeInputStream(InputStream inputStream) {
                    baos = new ByteArrayOutputStream();
                    wrappedInputStream = inputStream;
               * @return stream content as String
               String getStringContent() {
                    return baos.toString();
              /* (non-Javadoc)
              * @see java.io.InputStream#read()
              public int read() throws IOException {
                   int r = wrappedInputStream.read();
                   baos.write(r);
                   return r;
    Then you need to compile and upload this class and it should work.
    I hope that this helps you.
    Best regards
    Till

  • Error in starting SAP GUI as part of an Java RFC call from a PC

    Hi,
    We are on the 4.6C version of SAP and have the latest basis kernel patches that allow an RFC connection to start the SAP GUI. The program that I am running externally is java using the 3.0.1 JCo. The OS of the PC I am using is Windows XP. The SAPGUI version is 7.10 patch level 11.
    The program seems to be working properly as the command prompt window goes grey as if there is another window being opened but then I get back this error message and I do not see the GUI.
    The message I am getting back is:
    Exception in thread "main" com.sap.conn.jco.JCoException:(136) JCO_ERROR_ILLEGAL_STATE:Launching SAP GUI failed, though it was requested(error message:Communication with SAPGUI timed out)
    at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcClient.startSAPGui(MiddlewareJavaRfc.java:1853)
    at com.sap.conn.jco.rt.MiddlewareJavaRfc$JavaRfcClient.connect(MiddlewareJavaRfc.java:1285)
    at com.sap.conn.jco.rt.ClientConnection.connect(ClientConnection.java:661)
    at com.sap.conn.jco.rt.PoolingFactory.init(PoolingFactory.java:103)
    at com.sap.conn.jco.rt.ConnectionManager.createFactory(ConnectionManager.java:171)
    at com.sap.conn.jco.rt.DefaultConnectionManager.createFactory(DefaultConnectionManager.java:44)
    at com.sap.conn.jco.rt.ConnectionManager.getFactory(ConnectionManager.java:160)
    at com.sap.conn.jco.rt.RfcDestination.initializ(RfcDestination.java:766)
    at com.sap.conn.jco.rt.RfcDestination.getSystemID(RfcDestination.java:794)
    at com.sap.conn.jco.rt.RepositoryManager.getRepository(RepositoryManager.java:32)
    at com.sap.conn.jco.rt.RfcDestination.getRepository(RfcDestination.java:865)
    at GISToSAPWO_Test.get_wo_call(GISToSAPWo.java:91)
    at GISToSAPWO_Test.main(GISToSAPWO_Test.java:206)
    I have been all over trying to find the solution to this and have come up empty. Any help will be greatly appreciated. If this is the wrong forum for this please let me know and I will re-post.
    Thank you in advance for any information you can pass on about the issue,
    Mark

    Hi Greetson,
    Thank you in advance for your response. It is greatly appreciated.
    1) In a way yes. I am using the connection setting USE_SAPGUI = 1. This is suppose to start the GUI prior to starting the RFC's program run. If this is not correct please let me know.
    2) The code is part of the JCo and the RFC library from what I have read. If this is not correct please let me know.
    3) I am only testing from my PC at this moment. I have re-installed my SAP GUI and am now at patch level 13 on 7.10.
    4) The application passes in the connection information which includes username and password along with the parameters for the RFC call. I would like the SAP GUI to open without the user having to re-enter his/her username and password. I thought that once the RFC is called using the dialog users credentials that the GUI would then open using the connection. I have used the java pooled connection method and it still does not open the GUI.
    5) The purpose is to pass Equipment objects, Functional Location objects and Leak Id objects to an RFC to open a list screen from IW39, List Maintenance Order transaction, for display of each at one pass, as well as open Excel with data from classification for the Leak Id's.
    Hope this sheds some light on the problem I am having. Please let me know if more information is needed.
    Best regards,
    Mark

  • Calling Webdynpro Java Application from Webdynpro ABAP Application.

    Hi,
    We have developed one Application using Webdynpro Java and I m in need to call the Webdynpro Java application from Webdynpro ABAP.
    Require Suggestions to acheive this.
    Thanks In advance.
    Reg,
    Ajay.

    Dear Ajay,
    Assuming that both your applications WDA & WDJ are in the portal & you don't have to pass any parameters to the WDJ application.
    Write the following code on the action  where you would call the WDJ application.
      DATA:
            lr_compcontroller TYPE REF TO ig_componentcontroller,
            l_component TYPE REF TO if_wd_component ,
            lr_port_manager TYPE REF TO if_wd_portal_integration ,
            wa_navigation TYPE navigation.
      lr_compcontroller =   wd_this->get_componentcontroller_ctr( ).
      l_component = lr_compcontroller->wd_get_api( ).
      lr_port_manager = l_component->get_portal_manager( ) .
    * The value inserted into the navigation-target field can be found in the Portal
    * content administration tab of your portal. It is the ID or PCD Location field
      wa_navigation-target = pcd. " Please provide the PCD Location of the WDJ Application here.
      wa_navigation-mode   = '0'.  "0 = INTERNAL(same page) and 1 = EXTERNAL(new page).
      CALL METHOD lr_port_manager->navigate_absolute
        EXPORTING
          navigation_target = wa_navigation-target
          navigation_mode   = wa_navigation-mode.
    You can get the PCD from the Page properties of the WDJ application page in the Portal.
    Hope it helps!
    Warm regards,
    Upendra Agrawal

  • RFC Call from ABAP (R3) to Webdynpro EP

    Hi experts,
    I have a requirement to initiate a call from an ABAP program on R3 to a standard Portal (Webdynpro) API. Does anyone have any experience with this?
    I understand that normally Portal (Webdynpro) applications will make the RFC call to ABAP via the established JCO connection. However there's very limited literature elaborating how the call can be made in the other direction i.e. from ABAP R3 to Portal
    Anyone, please kindly advise how, if this can be done. Many thanks!
    Best regards,
    Lionel

    Hi,
    I'm trying to make a RFC call from the ABAP program to a built in Java method residing on EP. It is part of a suite of methods provided by the UME engine.
    Typically a call is made from a webdynpro program to a SAP ABAP function module. In this case, I'd like to make a call from the SAP ABAP report to the EP method.
    Best regards,
    Lionel

Maybe you are looking for

  • Creating Open Directory Replica fails with Server Admin Error Value 1127

    Hallo, I have seen a lot of similar threads here and they were helpful up to a certain point, but in the end, they did not solve my problem. Currently, it comes down to this. The Server Admin Error message ist really meaningless and I could not find

  • Rest iPod touch is not recognized by itunes

    I was given a used ipod touch and i deleted everything off of it from the ipod. It then asks me to plug into itunes, which I have. Itunes does not pick up the device so I can upload all my stuff. What do I do?

  • Adobe Shockwave Player crashes at literally any use of it in any browser

    Ok, so this started happening two days ago, and I've been trying to fix this for a total of six hours to no avail.  I tried to watch a YouTube video, but the page stops loading halfway, and I get a drop down message saying Shockwave has crashed. The

  • Linksys Web pg has me hostage

    I went to the Linksys page 192.168.1.1 to check the statis of my router and download the firmware. Installed firmware and now after 3 weeks I finally have No red X through my little computer icon bottom right screen and I connect to the internet ALMO

  • Airport Extreme blinking yellow , auto reset ?

    I have two Airport Extremes connected via ethernet.  One is connected to the Internet and the other is to extent the WIFI in the house for better signal coverage. Every so often the Airport Exterme that is used to extend the WIFI signal, starts to fl