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

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

  • 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.

  • 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

  • Reg: Calling RFC in webdynpro

    Hi,
    I am supporting some webdynpro application. In the application we are connecting to R3 systems using RFC. But in my application the developer had created different models for each Bapi instead of dumping them into one model. I just wanted to know the logic behind that. Is it just logical seperation or there is any performance considerations.
    Thanks in advance.

    Hi,
    I Just can say, in some of the documents that I have founded in SDN about Web dynpro best practices,
    the recommendatios is "Put  as many RFCs in a single Adaptive RFC model as possible".
    Take a look in the followinf presentation page 41
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/604ddc2f-ec9c-2b10-1682-be37e1c62dee&overridelayout=true
    Regards,
    Eduardo Campos.

  • Calling RFCs from Webdypro application!!!!

    Can anybody show me a suitable example for calling rfc from webdynpro application.

    Hi steve,
    Look at this tutorial..
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/tutorial on accessing abap functions in web dynpro - 4.htm
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/webdynpro/tutorial on handling transactions with bapis in web dynpro - 5.htm
    Follow the steps provided in those documents.
    You can easily understand how to access ABAP functions from WebDynpro.
    Let me know if you need more help on this.
    Regards,
    Karthick

  • How to call the rfc in webdynpro abap..?

    Dear Experts,
    I need to add two numbers using RFC in webdynpro abap.
    First we have to give the input then click the submit button.. The result will be shown in next screen with addition of two numbers...  Please help me in this...
    Thanks.

    Calling an RFC Function module in Web Dynpro ABAP is nothing different from Classical ABAP
    use Pattern button to call function module and use DESTINATION syntax to specify the RFC destination
    http://www.octavia.de/fileadmin/octavia_files/content_bilder/Hauptnavigation/SAP_NetWeaver/WebDynpro/Web_Dynpro_Part_II.pdf?PHPSESSID=c528a60bf8857431c0fa6f6595639da7
    In Above document, page no 7, there is a wizard for Service call, in that 4th step is select service where
    you can specify the function module name and the rfc destination name
    Abhi

  • How to Call the RFC in Webdynpro abap application

    Dear Experts,
    Good Evening to all...
    I have to add two numbers using RFC in webdynpro abap application. If we give the numbers in the input screen then the RFC should add it and give it in the output screen. This is the application for that I have created the RFC.
    But the problem is i don't know how to call the RFC in that Webdynpro abap application and how to link the input view and output view with that RFC...? I am new to Webdynpro abap. Please kindly help me on this... I am struggled here... I need your help in this....
    Thank You.

    Hi Jaga,
    You asked the same question again.
    Without closing the [previous one|Re: Where SAP store the uploaded files?].
    I think Abhi has answered your question.
    If not please elaborate on the problem.
    The solution btw is to create a Service Call.
    Sumit

  • Can not call RFC contains "call transaction"  in webdynpro

    We use Webdynpro to develope a UI that can create service orders in CRM
    system. We create an RFC funciton "ZKLEE_CRM_ORDER_MODIFY" in CRM,which
    contain a statement of "CALL TRANSACTION 'CRMD_BUS2000120' USING T_BDC
    MODE 'N' MESSAGES INTO MESSTAB.".
    But as we exacute the RFC from WEB,we got 3 error messages in the
    output "MESSTAB":
    1.MESSAGE ID = "DC",MESSAGE NUMBER = "006", MESSAGE = "Control
    Framework: Fatal error - GUI cannot be reached".
    2.MESSAGE ID = "SY",MESSAGE NUMBER = "002", MESSAGE = "Exception
    condition CNTL_ERROR raised."
    3.MESSAGE ID = "00",MESSAGE NUMBER = "359",and it is a terminate
    message.
    The problem is that we can use webdynpro to call RFCs that do not
    contain "call transaction" freely. At first we suspect that it is our
    RFC function's fault, but we tried it in ABAP enviroment,and it works
    OK. We also tried to call this RFC in JSP through JCO,the same error
    occurs.
    Our system enviroment is CRM 4.0, J2EE 640, kernel 640 patch 109.

    HI,
    Thank you for your information.
    Maybe you are right that BAPI/RFC can not contain "call transaction" statement. But two weeks ago, one of my colleagues tried to use "call transaction" in RFC through JCO in our R/3 enviroment(not in CRM),and he successed.
    So I suspect the kernel release. The kernel of R/3 is 640,while CRM is 620(I said our CRM kernel release is 640 before,and it is a mistake.).I will confirm whether what my colleague said is right by myself, and will also told you the result.
    Message was edited by: Vincent zklee

  • How can I call RFC FM from webdynpro application for ABAP? Please help!

    Hi Experts,
              I have a requirement where I have to make a call to RFC enabled function module passing some data from webdynpro for ABAP application. How can I achieve this? Any tutorial or links or docs will be very helpfull.
    I have seen some tutorial on Adaptive RFC but it talks about webdynpro for Java.
    Can I use "Call function XYZ destination A10" statement in webdynpro for ABAP application?
    Thanks
    Gopal

    am doing same thing for my current SRM implementation.I am taking data to SRM server from another R/3 server .
    This is solution I have used
    1) First of all I have made ABAP connection in SM59 .
    Go to SM59 .In ABAP Connection creat ABAP connection with system with which u want communicate .
    Eg I am connection with Systems PB1.
    So i developed Connection call PB1CLNT800.
    2) In my requirement I have taken data in my context from another r/3,
    I have give called RFC in my supply function of node.
    Call to RFC is as usual.
    In my case,
    CALL FUNCTION 'RFC_MATNR'
    DESTINATION 'PB1CLNT800'
    TABLES
    IT_MATNR = IT_MATNR.
    Onwards I have read my itab IT_MATNR and populated data to context.
    Hope solution will serve your purpose.
    Give point if it works .If any problem i have other ways.
    Cheers
    Parag Bhise

  • 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

  • The webdynpro/ABAP (WDA) calling RFC enabled FM of other ECC systems

    The webdynpro/ABAP (WDA) has problem calling RFC enabled FM of other ECC systems.
    WDA expects all the ABAPs, RFC FMs  of remote system(DEV, QA..) to reside inside its own instance.
    It is hard to transport and maintain these ABAPs FMs into a portal ABAP WDA instance.
    Proxy generation at WDA client:
    =======================
    1. If we can make an XI enable  an ABAP or RFC enabled FM of the remote ECC,
    I think the XI proxy classes can be generated at the client WDA system.
    Other options?
    How do I do it?  Can you give some tips.
    2. How do I manually code the RFC Call to BAPI/FM from Webdynpro controller or other interface?
    I am stuck with the above as the webservice option is not available at our ECC server.  It does not have a java engine installed for webservice to be available.
    Can you help on the above 2 options?

    Hi Mike ,
    <b><b> Answer of 2.</b></b>
    How do I manually code the RFC Call to BAPI/FM from Webdynpro controller or other interface?
    I am doing same thing for my current SRM implementation.I am taking data to SRM server from another R/3 server .
    This is solution I have used
    1) First of all I have made ABAP connection in SM59 .
    Go to SM59 .In ABAP Connection creat ABAP connection with system with which u want communicate .
    Eg I am connection with Systems PB1.
    So i developed Connection call PB1CLNT800.
    2) In my requirement I have taken data in my context from another r/3,
    I have give called RFC in my supply function of node.
    Call to RFC is as usual.
    In my case,
    CALL FUNCTION 'RFC_MATNR'
    DESTINATION 'PB1CLNT800'
    TABLES
    IT_MATNR = IT_MATNR.
    Onwards I have read my itab IT_MATNR and populated data to context.
    Hope solution will serve your purpose.
    Give point if it works .If any problem i have other ways.
    Cheers
    Parry B

  • 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

  • Error while calling RFC

    Hi all WebDynpro Gurus
    I am using EP7.
    I am developing an WD application for KM functionality in which I need to call RFC from backend. I followed the "<b>Creating WD application accessing ABAP function</b>" example.
    But when I executed the application I got following exception.
    <i><b>Root Cause</b>
    The initial exception that caused the request to fail, was:
       com.sap.lcr.api.cimclient.CIMClientException: java.net.MalformedURLException: URL must have a host part
    <b>Correction Hints</b>
    Accessing the System Landsape Directory (SLD) failed. Depending on the concrete reason (see root cause) check the following:
    is the SLD Supplier in the J2EE engine configured correctly? See the SLD documentation for more details about the SLD and about how to configure it.
    are all JCO destinations maintained correctly? Use the preinstalled Web Dynpro Content Admin application to check/edit the destination. Use the Ping and Test functions of the Content Admin to verify that each destination is properly configured.</i>
    I checked JcO connections in the webdynpro content admin. There the status is unknown and create tabs are disabled.
    I checked the SLD connections in content admin , the entries are as below:
    <b>Host name : blank
    Port: -1
    User: blank
    Url: http://.-1/sld</b>
    Where could i configure these SLD settings and what should be the new entries ?
    I dont have permission to view WebDynpro console.
    Please help me out.

    Vinod,
    Claim: "Hello, World" application with WD and RFC is the "Hello, World" application with most complex configuration.
    Prove:
    1. You need to run http://host:port/sld and import CIM context
    2. You need to add technical WebAS ABAP systems to SLD (same URL)
    3. You need to run Visual Administrator and setup SLD connection parameters (host, port, user, password)
    4. You need to (re)deploy your WD application
    5. You need to run web-based WebDynpro Content Administrator and configure JCO connections.
    Fortunately, [1]-[4] is necessary only ones per server, [5] is necessary per every application.
    Valery Silaev
    SaM Solutions
    http://www.sam-solutions.net
    P.S. After I'd started working with XI I understood that procedure described above is not complex at all

  • Accesing an RFC from webdynpro throws exception

    I am trying to call an RFC from Webdynpro which in turn calls another RFC in another system.....
    Example:
    I am calling an RFC function that’s exists in XYZ system from webdynpro. This RfC function is calling another RFC function that exists in ABC system.
    The webdynpro application throws an exception
    Exception thrownAccessing System ABC is not possible because RFC Metadata was retrieved using System XYZ. Please assure you have configured the RFC Connections properly. A Server restart may be necessary!
    Please Help

    as Jochen mentioned, it is not possible to run the same model against different backends within the same application.
    But you do have an option to get your problem solved:
    import only those RFCs into a single model, which will definitely run against the same system. In your case, you would import two models, each containing the RFCs targeted for only one system.
    Next, you would define individual logical system names. Iow, two distinct metadata destinations, and two distinct application data destinations. One model would use one metadata/appdata destination pair, the other model uses the other metadata/appdata destination pair.
    The only downside of this, is that you can not reference data from one model in the other model (because they ly in different java packages). But if you use the WDCopyService, you can still copy data from one model into the input structure of the RFC of the other model.
    This is also the suggested design pattern for your problem.
    Ciao, Markus

Maybe you are looking for

  • 802.1X Auto-Login

    Everytime I restart my Macbook Pro, I have to retype my 802.1x connection's password. Is there any way to avoid this? A script maybe?

  • URGENT ADVICE Needed on XRAID

    Guys, I need advice. Q1. Can I connect XServe with single fibre channel cable to XRAID (RAID50), example upper controller and will it show me the full volume? Q2. Can I connect two XRAIDs with one XServe on single fibre channel card or do I need to i

  • Dynamic variable for 0CALDAY

    Hi all, this is my scenario: I've created a query with input variable for characteristic Year/Month (0CALMONTH), in columns i added a key figure and in rows i added the characteristic 0CALDAY. The result looks someting like this: Varibale entry: 09.2

  • Mouse pointer disappears when screen sharing

    When I use Back To My Mac from work to screen share my home Mac the pointer disappears. When I first connect and put the screen sharing window into full screen mode (into a separate space) everything is fine. I can then switch back to my current Macs

  • Goods recipt against conformation qty

    Dear sir i have  production  order qty 10 nos and i conformed qty 2nos , but when i do gr system allow to me to do 10 nos . but i want do gr only 2nos as for confrmation. so system should not allow to post order qt, sysytem allow to post for gr only