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.

Similar Messages

  • 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

  • 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

  • I changed RFC but Webdynpro java still using old RFC, why?

    Hi,
    I changed RFC but Webdynpro java still using old RFC, why?
    How can I solve this problem?(Wihtout resetting j2ee engine.)
    Thanks.

    Cemil,
    check whether cache invalidation tool is installed on your portal or not.
    go to system administration-system configuration-webdynpro console-invalidate ARFC cache
    or you can reimport model using another jco connection.
    check this link for more details
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/10465350-b4f5-2910-61ba-a58282b3b6df
    Thanks
    Bala Duvvuri

  • 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

  • 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

  • Calling RFC in Webdynpro...

    Hello,
    I am new to WebDynpro Java. How can I call a RFC in webdynpro. We have different SAP lanscapes viz: 4.7, ecc 5.0 and ecc 6.0. I want to call BAPI from 4.7 landscape in my webdynpro. How can I do this ?
    Regards,
    Jainam.

    Hi,
    The better way to call a RFC from Web Dynpro, is using Adaptive RFC Model.
    See it to help you :
    https://www.sdn.sap.com/irj/sdn/nw-wdjava?rid=/webcontent/uuid/403e6bf5-426e-2910-b0a8-a95548724af9#section10 [original link is broken]
    Read the all documents about Adaptive RFC Model to understand all details to use it with Web Dynpro.
    Its to a step by step sample:
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a00f7103-6790-2a10-ac9c-fcac7c5b18a3
    Best regards

  • Not able to call RFC from webdynpro

    Dear Experts , I want to call a rfc from my webdynpro application , but its not working
                          I have a function module in my ECC system , that I want to call from webdynpro application of SRM system but its not working , it is not showing any error also
    I called the function module like
      CALL FUNCTION 'ZFM_SR_GET_PLANT_RFC'  DESTINATION lv_logsys
        TABLES
          it_plant = lt_pr.
    the control is just passing thru this function call but not going inside it,
    at the same time when I call this function module from my report program in SRM it's working fine , is there anything else i have to specify to call it from webdynpro application ?
    Please help

    Hi thomas ,
    I have added the exception for my function module , but they didnt triggered ,while debugging I have observed that no exception occured at the point of call , and my sy-subrc eq 0 ,
    se I did like this
      CALL FUNCTION 'ZFM_SR_GET_PLANT_RFC' DESTINATION lv_logsys
        TABLES
          it_plant                            =    lt_pr
        EXCEPTIONS
          system_failure                =    1  MESSAGE msg
          communication_failure    =    2  MESSAGE msg
          OTHERS                          =    3.
      IF sy-subrc <> 0.
        MESSAGE ID 'ZMSG01' TYPE 'E' NUMBER '00' WITH msg
                INTO ls_message-message.
        CALL METHOD wd_comp_controller->gref_message_manager->report_error_message
          EXPORTING
            message_text = ls_message-message.
      ENDIF.
    AT CALL FUNCTION  statment the control is just passing thru it , and not going inside function module

  • Build gui for existing oracle database tables with webdynpro java?

    hi
    i want to build a GUI to maintain existing oracle tables
    so far we used oracleFORMS to do so
    is there a good approach for webdynpro java? or do you recommend other sap tools?
    can we generate the gui with a wizard based on the fields in the table?
    do we have to generate sql statements or type in manually?
    regards
    joerg

    Hi Joerg,
    generally that is possible, but you'll have to implement the data access by yourself, by means of EJB or another Java persistance framework such as JDO, SQLMaps, Hibernate, whatever...
    Web Dynpro allows to build a GUI based upon a model - in this case this could be some POJOs (DTOs) representing your database tables, which are communicated to the GUI by your data access layer. Consider a model as a simple Java bean representing database data.
    This approach would require to build a data access layer which incorporates manually generated sql statements, so you'll have to have expert database and java knowledge.
    There might be other approaches, this is just to demonstrate one working possibility.
    regards,
    Christian

  • Call RFC with DLL created with DCOM CONNECTOR

    I try to call a RFC with a DLL that i created with the SAP R/3 DCOM CONNECTOR (Release 4.5.B):
    My external soft calls the DLL, which calls the RFC, which calls a transaction (Call Transaction Mode N, Update S)...
    When i test the RFC in SAP (SE37), it's OK.
    But when i call the RFC with my soft (and with the DLL), the Call Transaction returns sy-subrc = 1.001 (the methode "AdviseRfcGuiSink" included in the DLL allows me to launch the debugging with my external soft).
    I found no SAP notes about this problem.
    If you met the same problem, could you help me ?
    Thanks.
    Julien.

    Some Years later I have the same Problem.
    As discripet in the post before - first I've got an error in the Method "CreateNewRow()" where the Method wants to return "return new byte[]()". Well I don't know why the .Net-Connector creates that code - but it looks strange to me.
    The origin Code is:
        /// <summary>
        /// Creates an empty new row of type byte[].
        /// </summary>
        /// <returns>The newbyte[].</returns>
           public override object CreateNewRow()
                return new byte[]();;
    With Changing that method I've got the same Error as in the post before:
    System exception thrown while marshaling RFCTYPE_XMLDATAto .NET type.
    Does someone has found a solution for that kind of Problem?

  • Accessing SAP DB(Oracle/Max DB) without using RFC in webdynpro java

    Dear Friends,
    I'm developing an application in Adobe interactive Forms using webdynpro java. To retrive the data from R/3 generally we use RFC / BAPI's.
    But i dont want to use RFC / BAPI's which is written in ABAP.
    I want to write one RFC /BAPI using java to store  / retreive the data from R/3. or how to access the data / store the data using JAVA from R/3.
    Can any one guide me on the same.
    Thanks in Advance.
    Regards,
    Gowripathirao.
    Edited by: Gowripathirao on Nov 30, 2009 7:58 AM

    don't do that ( I always wanted to write this since joining SDN )
    If you want to access database tables in general, check the EJB3 tutorial in SAP Help
    http://help.sap.com/saphelp_nwce10/helpdata/en/45/f72761af4020fde10000000a1553f6/frameset.htm

  • SAP MDM Connection with WebDynpro Java

    Hi,
    I am working with SAP WebDynpro Java (UI) and SAP MDM (Database). I had added the respective jars-
    a) I want to test whether I am able to make a connection to the MDM server. Let me know input parameters (sample source code required) which I need to pass from SAP WebDynpro Java (UI) to make a successful connection to MDM (DB). Please let me know this in details.
    b) After making connection to MDM, I need to write a query where I need to pass Lot No1 & Lot No2 from WebDynpro Java (UI) & check in a MDM table numbers of records existing and later display  the corresponding records details  (sample source code required) in the screen.
    Your inputs will be highly appreciated.
    Thanks.

    Anmol,
    Depending on what version of WAS you are on...you might have WDJ components available that you can use. Just to offer a different view on your question.
    Otherwise follow the links above or the following link to get sample code.
    Read MDM ItemDetail Record in WDJ
    You should get lots of sample code on SDN.
    Thanks,
    Praveen.

  • Integrating flex with webdynpro java

    hi,
    iam new bie in webdynpro java.please tell is there possibility of integrating flex in webdynpro java,if so what are the prerequisites for it.

    Hi
    This is possible through Adobe Flash Islands under Mimes folder in your Webdynpro project. You create flex objects in FlexBuilder and generate the .swf files. Then the swf files need to be placed under the Mimes folder of Webdynpro Project from which they can be accessed.
    Follow the link below for details :
    http://wiki.sdn.sap.com/wiki/display/WDJava/WebDynproJava(CE7.1EHP1)andAdobeFlexIntegration-ColumnChart
    http://help.sap.com/saphelp_nw72/helpdata/en/48/825afcf53d3ff6e10000000a42189c/content.htm
    Regards,
    Sayan Ghosh

  • Creating EVS , OVS with RFC in WebDynpro Java (F4)

    Hello All,
    I am struggling with EVS creation through aRFC. I followed all the tutorials given on the SDN, but of no use till now.
    I have two DC's <b>rmmodel</b> and <b>rmcomponents</b>
    I have created <b>Model</b> in the rmmodel DC through aRFC and added it in the public part. further I added the rmmodel DC in rmcomponent DC's <b>used DC</b> list. Finally i added rmmodel in the <b>used models</b> list of rmcomponent DC.
    Then i created a component in rmcomponent DC.
    I have already done model binding and context binding (XYZ_XYZ_XYX_Input -->Output)
    Now I want to create an EVS with InputField , in my case i want to populate EVS from R/3 Table dynamically. Till now am getting a simple InputField with the first record selected on running my application.
    Please Help.
    Please avoid posting links to other similar threads, as i have already checked most of the popular threads, blogs and tried my hands on tutorials given on sdn library.
    Regards,
    Amol

    Hi Biswal,
    I am trying to do the above but having some problem with the "<attributeName>"
    I created a custom controller and a view then i did the model binding and context binding.
    In my custom controller <b>EvsController</b> I have the following context.
    = Context
    ===Test_xyz_xyz_Input
    =====Output
    =======Lt_xyz_xyz
    <b>Short</b>
    here my attributename is <b>Short</b> so i am writing the following code in the <b>EvsController's</b> wdDoInit()
    IModifiableSimpleValueSet valueset =
         wdContext.nodeLt_xyz_xyz().getNodeInfo().getAttribute(Short).getModifiableSimpleType().getSVServices().getModifiableSimpleValueSet();
    The problem is, it's not able to identify "Short" and giving me an error "Short can not be resolved"
    Please suggest something..
    Regards,
    Amol

  • Regards with Webdynpro Java in ESS

    Hi,
    i wanted to know whether we can use webdynpro abap in a J2EE server.
    I have the issue that at the client, all the objects are customized and what i came to know that
    we can use webdynpro only on the standard packages but not on the customized ones.
    so here my issue is that can we use Webdynpro ABAP for the customized ones (objects)
    if yes then how do we proceed further.
    and how do use webdynpro ABAP in J2ee server
    please reply me at the earliest possible

    Web Dynpro ABAP is SAP's strategy to build Web Applications in ABAP environment.
    Web Dynpro ABAP is run on ABAP Engine not on Java Engine. ECC 6.0 by default has the ABAP Web Application Server. You can develop Web Dynpro ABAP Applications in the ECC itself and can be integrated into Portal via iViews.
    Web Dynpro Java is a tool to develop Web Applications in Java Environment. Jco is the medium through which it connects to R/3 system and calls the RFC Function Modules.
    I hope it is clear.
    Abhi

Maybe you are looking for

  • How do i copy a photo from iPhoto to a memory stick?, how do i copy a photo from iPhoto to a memory stick?

    how do i copy a photo from iphoto to a memory stick?

  • Configuration URL in Business system

    Hi Experts, Question 1 I am creating Business system for ecc of  type Web as ABAP in PI 7.3 and in second step i have provided all technical system details and there is field called configuration URL. What information I ahve to fill here. When i clic

  • BAPI Integration

    Hi, I am working with Solidworks Interface. With in SAP i am using the BADI IF_EX_DOCUMENT_NUMBER01~DOCNUMBER_CHECK, in this BADI i am validating the data and throwing a error message (MESSAGE E007(zz)  WITH text-002). When i am creating the document

  • Weblogic WorkShop IDE does not start

    My weblogic workshop IDE was working until today. When I try opening it up, nothing happens. It doesn't open up or show me any error messages. I don't even know where to begin trouble shooting. Any ideas? Thanks. gtata Edited by gtata at 12/10/2007 3

  • Source route calls

    Hi, I have to questions. 1. I have a 3845 gateway with 2 ISDN PRA(E1) trunks. Is it possible to route the out-bound calls out of a particualar PRA based on the calling number? How can I achieve this? 2. For inbound calls, if a destination is not avai