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

Similar Messages

  • 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

  • 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

  • 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

  • Call RFC  using java procedure

    Hi
    How can I to use java procedure and call RFC for to access tables of SAP ?
    Thank You

    RFC? That term in the IT environment usually means "+Request For Comments+" and refers to Internet protocol and usage standards.
    Do you perhaps means RPC (Remote Process/Procedure Calls)? Or something else?
    Also, SAP is a company. Not a product. SAP has a product called R3. This runs inside a database.
    Connecting from Java to a database typically requires nothing more than a JDBC driver. So why can't you use a JDBC driver and need to call the database (and access tables) using another method?

  • Problem while calling RFC in java

    hi,
    I writed a java program  calling a batch input RFC.  The RFC return an internal table which storing the system messages of the batch input process. My problem is:
    When i debug the java program,the RFC excecuted and return the correct internal table to me.
    But when i executed it not in debug mode, there is no batch input messages return to me.
    My code is:
    package com.hongta.com.z_delivery_bdc;
    import com.sap.mw.jco.IFunctionTemplate;
    import com.sap.mw.jco.JCO;
    import com.sap.mw.jco.JCO.ParameterList;
    @author Administrator
    To change the template for this generated type comment go to
    Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
    public class ConnectRFC extends Object {
         JCO.Client mConnection;
         JCO.Repository mRepository;
         String filePath;
         String BDCLOG;
         JCO.Function function;
         public void Connect1() {
              filePath =
                   "C:
    Documents and Settings
    Administrator.3939200975DB4C5
    desktop
    cigaXY2008-12-15.xml";
              function = null;
              try {
                   // Change the logon information to your own system/user
                        mConnection = JCO.createClient("610", // SAP client
              "xxxxxx", // userid
              "xxxxxx", // password
              null, // language
              "10.96.0.53", // application server host name
         "01"); // system number
          // mConnection.setAbapDebug(true);
                   mConnection.connect();
                   mRepository = new JCO.Repository("ARBsoft", mConnection);
              } catch (Exception ex) {
                   ex.printStackTrace();
                   System.out.println("jco connect failed");
                                            mConnection.disconnect();
                   System.exit(1);
              //JCO.Table codes = null;
              try {
                   function = this.createFunction("Z_BAPI_CONTRACT_BDC");
                   if (function == null) {
                        System.out.println(
                             "Z_BAPI_contract_bdc" + " not found in SAP.");
                        if ( mConnection != null && mConnection.isAlive()) {
                             mConnection.disconnect();
                        System.exit(1);
                   //function.getImportParameterList().setValue(filePath, "FILEPATH");               
                   //function.getImportParameterList().setValue(BDCLOG, "BDCLOG");
                   mConnection.execute(function);
                                   catch (Exception ex) {
                                       //System.out.println(ex.toString());
                                    ex.printStackTrace();
                                     System.out.println("execute failed");
                                            mConnection.disconnect();
                                     System.exit(1);
              JCO.Table codes = null;
              codes =
                 function.getTableParameterList().getTable("MESSAGE");
              try {
                        codes.firstRow();
                        for (int i = 0; i < codes.getNumRows(); i++, codes.nextRow()) {
                        System.out.println(codes.getString("CON")"  "codes.getString("MESG"));
              catch(Exception ex1){
                   ex1.printStackTrace();
                   System.out.println("codes");
              if ( mConnection != null && mConnection.isAlive()) {
                   mConnection.disconnect();
                   System.out.println("chenggong");
              public JCO.Function createFunction(String name) throws Exception {
                   try {
                        IFunctionTemplate ft =
                             mRepository.getFunctionTemplate(name.toUpperCase());
                        if (ft == null){
                             return null;
                        return ft.getFunction();
                   } catch (Exception ex) {
                        throw new Exception("Problem retrieving JCO.Function object.");
              public static void main(String[] args) {
                   ConnectRFC app = new ConnectRFC();
                   app.Connect1();
    Regards,
    taowenbo.

    hi,
    i had resolved my problem in other way.I don't upload my data using ws_upload now,but upload with table.
    here is my code.Maybe helpful to somebody:
           JCO.Table C_XYORDERTable;
         JCO.Table C_XYORDPR_FINALTable;
         public void getXyordprFinalElement(Element e) {
              try {
                   for (Iterator i = e.getChildren().iterator(); i.hasNext();) {
                        Element child = (Element) i.next();
                        if (child.getName().equals("ORDER_ID"))
                             C_XYORDPR_FINALTable.setValue(child.getText(), "ORDER_ID");
                        else if (child.getName().equals("ID"))
                             C_XYORDPR_FINALTable.setValue(child.getText(), "ID");
                        else if (child.getName().equals("PRODUCT_ID"))
                             C_XYORDPR_FINALTable.setValue(
                                  child.getText(),
                                  "PRODUCT_ID");
                        else if (child.getName().equals("MATNR"))
                             C_XYORDPR_FINALTable.setValue(child.getText(), "MATNR");
                        else if (child.getName().equals("QUANTITY"))
                             C_XYORDPR_FINALTable.setValue(child.getText(), "QUANTITY");
                   C_XYORDPR_FINALTable.nextRow();
              } catch (Exception ex) {
                   ex.printStackTrace();

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

  • Problem with calling Webservice from Java Webdynpro

    Hi,
    I have a scenario where I need to call a Webservice through my Webdynpro application. I need to pass few parameters(of type string) and the Webservice is suppose to retrun a few records based on the input values.
    When I run the webservice directly using the browser, the output is in XML format.
    When I create a model for the webservice in webdynpro, the return value is a Node element of type java.lang.Object. From webdynpro, I am successfully able to make a call to the Webservice (as there is no exception with model execute command), but the return value is always null. I am not sure if the webservice is not returning any data or if I am not reading the correct context element. There is no documentation available for the webservice either.
    Can anyone tell me what is that I am missing. Is it not possible for Webdynpro to call a webservice which can return only XML data?
    Any help on this issue would be greatly appreciated.
    Thanks,
    Sudheer

    Hi Sudheer,
    You can refer to wiki link (& other links available at the end in this)
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/wdjava/faq-Models-AdaptiveWebService
    Kind Regards,
    Nitin

  • Adobe Interactive forms - ABAP Webdynpro or JAVA Webdynpro?

    Hi,
    I am an ABAPER and I got few requirements for Adobe Interactive forms Offline Scenario/Online scenarios & ALV reports.
    I have practiced a session ( How Tou2026execute an RFC model with inputs from Interactive Formswith RFC  Module ) -JAVA webdynpro where it interacts with SAP via BAPI.
    Now my question is  I am bent more towards ABAP.. I want to do this in ABAP but unfortunately I haven't found any similar material for ABAP webdynrpo.Could anyone pls suggest me !
    FYI.. We are also developing some ALV Webdynpro reports and I am using PURE ABAP which i like it.
    So the other reason is we don't want install NWDI and complicate this structure as we don't have ESS/MSS requirment here. Just we  need some forms/reports on portal.
    Any suggestions and links which can help me here?
    rgds
    Vara

    Hi Vara,
    You can develop Interactive forms using WD ABAP also.
    [E Learning- Interactive Forms using WD ABAP|https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/media/uuid/c766e918-0b01-0010-99b1-c2b78cd059b3]
    WD Java is useful in case, when your ABAP system is less than ECC 6.0. Otherwise you can achieve same functionalities in WD ABAP also.
    Hope this will help you.
    Amit

  • 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

  • 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

  • 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

  • CNTL_ERROR while calling a function module from Java webdynpro

    I am calling a RFC function module from javawebdynpro app
    which inturn calls a function module performing BDC on CAPP transaction. When I run this from SE37 of the same system or a different system everything works fine. But when called from Java webdynpro app, it raises a CNTL_ERROR exception and creates a short dump.
    Any help on this is highly appreciated

    Good catch, BI Learner. This was exactly it: when assigning the values from SOURCEFIELDS directly to the import/export parameters, you have to make sure that the types are EXACTLY the same, otherwise it will not work (the routine stops with an error when calling the FM, but there is no dump).
    Therefore, to solve my problem, I created the declarations precisely as expected by the FM and assigned the values to these fields:
    DATA:
          SOURCEVAL TYPE  /BIC/OIINVQTY,
          SOURCEUOM TYPE  /BIC/OIUSUOM,
          USITM TYPE  /BIC/OIUSITM,
          TARGETUOM TYPE  /BIC/OIUSUOM,
          CONVERTED_COST TYPE  /BIC/OIINVQTY.
    DATA PRODUCTION_UOM TYPE /BIC/OIUSUOM.
    " get the Production UOM
        SELECT SINGLE I~/BIC/USPRDUOM
          FROM /BIC/PUSITM AS I
          INTO PRODUCTION_UOM
          WHERE I~/BIC/USITM = SOURCE_FIELDS-/BIC/USITM AND I~OBJVERS = 'A'.
        IF ( SY-SUBRC = 4 ). " no records found
          "RAISE PARTNO_NOT_FOUND.
          RAISE EXCEPTION TYPE CX_RSROUT_SKIP_RECORD.
        ENDIF.
    " load the parameters
        SOURCEVAL = SOURCE_FIELDS-/BIC/USFRZMFC.
        SOURCEUOM = SOURCE_FIELDS-BASE_UOM.
        USITM = SOURCE_FIELDS-/BIC/USITM.
    " then you can call the FM
        CALL FUNCTION 'Z_CA_CONVERT_US_COST'
          EXPORTING
            PSOURCEVAL                = SOURCEVAL
            PSOURCEUOM                = SOURCEUOM
            PUSITM                    = USITM
            PTARGETUOM                = PRODUCTION_UOM
          IMPORTING
            PTARGETVAL                = CONVERTED_COST
          EXCEPTIONS
            CONVERSION_NOT_MAINTAINED = 1
            PARTNO_NOT_FOUND          = 2
            OTHERS                    = 3.
    " ... [do the rest]
    Thanks for your help,
    Dennis

  • 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

Maybe you are looking for