Call RFC directly from PI

Hi. Is there a way to call an RFC from PI? I want the scenario to be triggered by PI, not an external system.
Thank you.
Nicole

Hi Nicole,
You have to create a RFC Receiver Adapter. In this case, PI sends the data in the RFC format to the target system where the RFC is executed. Configuring the receiver adapter is even simpler. Look at:
http://help.sap.com/saphelp_nw70/helpdata/en/33/c6e63b60c25767e10000000a11402f/frameset.htm
Depend on your scenario and ERP version, consider using ABAP Proxy instead of RFC module.
Regards,
Rogério

Similar Messages

  • Calling RFC funtions from VBA

    Hi all,
    I would like to call RFC funtions from VBA, could you please advise on what library should I set reference to?
    A piece of sample code would also be highly appreciated.
    Thanks in advance.
    Tomas

    here is a small code sample using vbscript
    <html>
    <head>
    <meta http-equiv="Content-Language" content="en-us">
    <title>RFC Example - THUSRINFO</title>
    <script language="VBScript">
    sub get_cust_data()
    dim fns
    set fns = createobject("SAP.Functions")
    fns.logfilename = "my_log.txt"
    fns.loglevel = 6
    dim conn
    set conn = fns.connection
    conn.ApplicationServer = "application server name or ip address"
    conn.System = "DEV"
    conn.user = document.myf.t1.value
    conn.password = document.myf.t2.value
    conn.Client = "025"
    conn.Language = "E"
    conn.tracelevel = 6
    if conn.logon(0, true) <> true then
    exit sub
    end if
    dim myfunct
    set myfunc = fns.add("THUSRINFO")
    result = myfunc.Call
    the_exception = myfunc.exception
    dim users
    if result = true then
    set users = myfunc.tables.item("USR_TABL")
    document.write "Table USR_TABL, " & users.rowcount & " rows"
    document.write "<table border=1>"
    document.write "<tr>"
    document.write "<td>BNAME</td>"
    document.write "<td>MANDT</td>"
    document.write "<td>TCODE</td>"
    document.write "<td>TERM</td>"
    document.write "<td>ZEIT</td>"
    document.write "<td>HOSTADR</td>"
    document.write "<td>RFC TYPE</td>"
    document.write "</tr>"
    for each user in users.Rows
    document.write "<tr>"
    document.write "<tr>"
    document.write "<td>"
    document.write trim(user("BNAME"))
    document.write "</td>"
    document.write "<td>"
    document.write trim(user("MANDT"))
    document.write "</td>"
    document.write "<td> "
    document.write trim(user("TCODE"))
    document.write "</td>"
    document.write "<td> "
    document.write trim(user("TERM"))
    document.write "</td>"
    document.write "<td>"
    document.write trim(user("ZEIT"))
    document.write "</td>"
    document.write "<td>"
    document.write trim(user("HOSTADR"))
    document.write "</td>"
    document.write "<td> "
    document.write trim(user("RFC_TYPE"))
    document.write "</td>"
    next
    document.write "</table>"
    set users = nothing
    end if
    fns.connection.logoff
    Set fns = nothing
    Set conn = nothing
    end sub
    </script>
    </head>
    <body>
    <form method="POST" name="myf">
      User Id <input type="text" name="T1" size="20"></p>
      <p>Password<input type="password" name="T2" size="20"></p>
      <p> </p>
      <p><input type="button" value="Submit" onclick="get_cust_data()" name="B1"><input type="reset" value="Reset" name="B2"></p>
    </form>
    </body>
    </html>
    Regards
    Raja

  • 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_ERROR while calling RFC FM from XI

    Hi Guys,
                  I am getting following error in the XI Monitor
    <rfc:ZFIBAPI_ACC_DOCUMENT_POST.Exception xmlns:rfc="urn:sap-com:document:sap:rfc:functions"><Name>RFC_ERROR_SYSTEM_FAILURE</Name><Text>Type conflict when calling a function module.</Text><Message><ID>RFC_ERROR_SYSTEM_FAILURE</ID><Number>341</Number></Message><Attributes><V1>CALL_FUNCTION_CONFLICT_TYPE</V1></Attributes></rfc:ZFIBAPI_ACC_DOCUMENT_POST.Exception>
    Have you come across this type of error.
    Is it an issue with mapping.
    Cheers
    Senthil

    Hi Sentil,
    Have you created a message type for your RFC ? You dont need a message type for your RFC, you can use RFC request and response directly in your message mapping.
    For re-importing an RFC, I would prefer deleting the RFC and then importing it again. Most of your field mapping ( in case of graphical mapping) will be taken care by XI, except for the new fields, if any, will be there in your RFC.
    Thanks,
    Pooja pandey

  • Setting Characteristics after calling RFC Fucntion from IPC

    From the java Class with the name as the Function Module, I connected to R/3 and called an RFC enabled Function Module.  Now I get more parameters from the output table. How do I set these output Parameters back to the Configuration page characteristics. I tried args.set_value() but it throwed error saying that the characteristics is not in the args.
    So how do i set the characteristics from the output of the FRC function call?

    Answer is:
    scelib.set_value(inst, output_parameter_name,output_parameter_value);
    Just thought of sharing..

  • CALL RFC DATA FROM TWO LINKED TABLES IN EXCEL VBA

    Hi,
    I am using Excel VBA to call information from tables in SAP.
    This is working correctly, however I now need to be able to call information from another table where the two tables are linked by a common data field.
    Example.
    The first table I have lists all items in stock and contains an article number. The second table contains all article numbers and their descriptions.
    I want to be able to call the first table but to have the article codes description on there aswell.
    Here is the code I am currently using.
    Sub GetTable()
    'Connect to SAP
    Dim sapConn As Object 'Declare variant
    Set sapConn = CreateObject("SAP.Functions") 'Create ActiveX object
    sapConn.Connection.System = "QA2"
    sapConn.Connection.client = "900"
    sapConn.Connection.user = "mbrough"
    sapConn.Connection.Password = "st34lh"
    sapConn.Connection.Language = "EN"
    If sapConn.Connection.Logon(1, False) <> True Then 'Try Logon
       MsgBox "Cannot Log on to SAP"
    End If
    'Define the table specifics
    Dim objRfcFunc As Object
    Set objRfcFunc = sapConn.Add("RFC_READ_TABLE")
    Dim objQueryTab, objRowCount As Object
    Set objQueryTab = objRfcFunc.Exports("QUERY_TABLE")
    objQueryTab.Value = "LQUA"
    Set objRowCount = objRfcFunc.Exports("ROWCOUNT")
    objRowCount.Value = "15000"
    Dim objOptTab, objFldTab, objDatTab As Object
    Set objOptTab = objRfcFunc.Tables("OPTIONS")
    Set objFldTab = objRfcFunc.Tables("FIELDS")
    Set objDatTab = objRfcFunc.Tables("DATA")
    'Set the condition and refresh the table
    objOptTab.FreeTable
    objOptTab.Rows.Add
    objOptTab(objOptTab.RowCount, "TEXT") = "LGTYP BETWEEN 'K01' AND 'K06'"
    'Set fields to obtain and refresh table
    objFldTab.FreeTable
    'Then set values to call
    objFldTab.Rows.Add
    objFldTab(objFldTab.RowCount, "FIELDNAME") = "LGNUM"
    objFldTab.Rows.Add
    objFldTab(objFldTab.RowCount, "FIELDNAME") = "MATNR"
    objFldTab.Rows.Add
    objFldTab(objFldTab.RowCount, "FIELDNAME") = "WERKS"
    objFldTab.Rows.Add
    objFldTab(objFldTab.RowCount, "FIELDNAME") = "LGTYP"
    objFldTab.Rows.Add
    objFldTab(objFldTab.RowCount, "FIELDNAME") = "LGPLA"
    objFldTab.Rows.Add
    objFldTab(objFldTab.RowCount, "FIELDNAME") = "GESME"
    objFldTab.Rows.Add
    objFldTab(objFldTab.RowCount, "FIELDNAME") = "VERME"
    objFldTab.Rows.Add
    objFldTab(objFldTab.RowCount, "FIELDNAME") = "MEINS"
    If objRfcFunc.Call = False Then
       MsgBox objRfcFunc.Exception
    End If
    Dim objDatRec As Object
    Dim objFldRec As Object
    For Each objDatRec In objDatTab.Rows
       For Each objFldRec In objFldTab.Rows
          Cells(objDatRec.Index, objFldRec.Index) = _
                Mid(objDatRec("WA"), objFldRec("OFFSET") + 1, objFldRec("LENGTH"))
       Next
    Next
    End Sub
    The table which contains the article descriptions is called 'MAKT' and this table also contains the column 'MATNR' which is the article field.
    Many thanks,
    Mike

    Is there no way of connecting the tables within the code.
    IT won't give me access to SE11
    Thanks,
    Mike

  • Help for Calling RFC in B2C application.

    hi,
    We had written one RFC and all java classes related to that.
    we are able to call RFC in b2c application.we are calling RFC on loading of JSP.
    now my requirement is to call same RFC in other JSP but muliple times(in a for loop).But how can i do that?
    one thing is sure we cannot calll this RFC on loading of new jsp page.we have to call inside jsp page(in a loop).
    there is any way?
    please help me out.
    thanks in advance.
    jayesh talreja

    Two things I would like to say here:
    1) Calling RFCs directly from JSP is not supported so we need to use interfaces and backend classes.
    2) Calling an rfc is java code and in jsp we write java code along with html to make it dynamic...so dynamic
    call is also possible.
    ie. suppose we want to call our rfc for fetching some data from the backend based on the data entered at item level once the user clicks on update button on order creation page.So we can write the code like below
                                  <%--   messages --%>
                                       <%@ include file="/b2b/itemErrMsg.inc.jsp"%>
                                       <% } %>
                                       <%-- ui.showItemDetailButton() --%>
                                       <% } %>
                                       <%-- ui.isBOMSubItemToBeSuppressed() --%>
                                       <%--Start of addition by Arshid --%>
                        <!-- From here our custom rfc call is starting-->
                        <%
                             String arg1[]= {"crm~isa~isacore~resources_en"};
                             if((JspUtil.removeNull(item.getProduct()).length()) !=0 && !(JspUtil.removeNull(item.getNetValue()).equals(WebUtil.translate(pageContext,"yourcompany.order.minimumValue",arg1))) )
                                  String baseUOM = "";
                                  int enteredQuan= 0;
                                  double minOrderQuan = 0.00;
                                  double roundingValue = 0.00;
                                  BusinessObjectManager isaBOM = (BusinessObjectManager)userSessionData.getBOM(BusinessObjectManager.ISACORE_BOM);
                                  User user = (User)isaBOM.getUser();
                                  Shop shop = (Shop)isaBOM.getShop();
                                  String distrChannel = shop.getDistributionChannel();
                                  String sod = shop.getSalesOrganisation();
                                  Z_CustomBusinessObjectManager customBOM = (Z_CustomBusinessObjectManager)userSessionData.getBOM(Z_CustomBusinessObjectManager.CUSTOM_BOM);
    //Z_prodInfoValue is a bo that will hold the data returned from rfc call
                                  Z_prodInfoValue z_prodinfo = customBOM.getZ_prodInfobo().getProdInfo(Zeropadding.productInfoNoPadding(item.getProduct()), sod, distrChannel);
    <!-- Call ends here and this piece of code is called for every item on clicking on update buton -->
    Although this is not a good code design as instead of making multiple calls to the backend we can get the above thing done in a single call also.I wrote this code just to give an example .
    This clearky proves we can have dynamic calls to the backend through jsps also.
    But Jayesh, your question is not very clear to me.
    If its about for loop, where you want to call the backend for multiple times with different set of values than i would rather suggest you to create lists of these different datasets and send these in a single call to the backend and fetch the data similarily in tables in a single call.
    Regards,
    Arshi

  • How to call the RFC's from the third party applications or Non SAP applicat

    Hi,
    For calling RFC's from the wedynpro , SAP has provided the modeling concept.
    In the same way, if i want to access or call the RFC 's from the third applications or Non SAP applications what is the procedure and what is the methodoligy.
    As per my knowledge, we need to expose those RFC's as webservices . Then we must be able to acces in hetrogeous environment from any third party applications..
    Please revert back soon, It is very urgent.
    Regards
    Vijay

    Ayyappa Raj,
    Thanks for the reply.
    Please let me the detailed information for implementing.
    AS you said . I need expose the RFC's as webservice. This point is clear to me.
    2) Use tthe JCo to connect and create client proxy.
    Can u please elabrate the above point?
    If u have any steps created in the document or url to refer. Please forward it to me.
    Please forwar the document to this id "vijay00" in yahoo.
    AS the sdn is not allowing to give  the maill id i have given only the id details in yahoo.
    I am new to this procedure.
    Regards
    Vijay

  • Calling a Report from Bapi

    Dear  all,
    I am trying to create a customer from external system through bapi. For this is i have to follow these steps.
    1)  I am trying to call a report from external system through bapi.
    2)  I want to pass data from bapi to a bdc program and run it to create a customer.
    3) After creating a customer I need to send the  ceated customer no again to the bapi from where i passed the data to bdc.
    is it possible .
    Give me a good idea on this how to work with it.
    Regards,
    Madhu.

    Hi Madhu,
    SAP has already given standard BAPI to create customer creation "BAPI_CUSTOMER_CREATEFROMDATA". So there is no need for you to create any thing new. Jut test this BAPI first whether this suit your requirement or not. If it satisfy your requirement then call it directly from external system. On how to call this BAPI or other BAPis searc google or SDn you will definetaly find something.
    second approach is if nothing works for you( No BAPI satisfy your requirement) then only go for BDC aapproach. To do that, create a RFC function module( BAPi and RFC FM are diff thing, they looks same  but they are not ). Inside your RFC FM directly write the BDC code to create customer.
    Regards
    Anurag

  • How to call a BAPI from Visual Composer

    hi,
       I am new to Visual composer. can some body give me step by step information of calling a bapi or RFC from VC.
    Thanks in advance,
    Gopi

    Hi Gopi,
    Steps involed for calling RFC/BAPI from VC
    1. Choose Model->Select Data Services.
    (Alternatively, click the Data button in the task panel toolbar.)
    2. In the Portal field at the right end of the main toolbar, enter the URL of the portal from
    which you can access the back-end system used by the iView.
    For example, you could enter: http://<yourportal>:50000/..
    3. Click the traffic light icon to the right of the Portal field. The portal Welcome screen
    appears.
    4. Log on to the portal as a user that exists in the connected back-end system, or which is
    mapped to a user of that system. Click OK.
    Once a connection to the portal is established, a list of system aliases defined in the
    portal system landscape appears in the System drop-down
    list.
    From the System drop-down list, choose the SAP system that contains the function module.
    6. Under Search SAP System, click the Search tab and in the Name field, enter the search string: <RFC/BAPI name>. Then click Search (at the bottom).
    5. A list of function modules matching the search string is displayed.
    7. Drag the function module/bapi from the Data task panel into the
    workspace: The data service is added to your model.
    8. Periodically save your work. To do so, choose File->Save Model.
    Finally test the iview in VC.
    In the workspace, drag your mouse from the Input port of the data service, <inputform> and dragn your mouse from the outut port from the data service <tabelview and etc..>
    or
    Go through the this documentation...
    http://help.sap.com/download/netweaver/nw04/visualcomposer/VC_60_UserGuide_v1_1.pdf
    Thanks,
    Suriya.

  • Calling Web Service from SIM

    Hi all,
    We have to call a web service from SIM.
    I don't have any idea how to implement this.
    Do we have to create a custom adapter for this, or we have to use SPML or we can call it direct from workflow?
    Please suggest the appropriate option and also what kind of web services can be called from SIM i.e. they are as simple as other web services or there is any specific implementation details for that. In our web service we only have to call a method that accepts an integer argument and also returns an integer.
    If there is any link or document that can be helpful please provide.
    Thanks
    Edited by: IDM_Discussion on Feb 25, 2008 5:49 AM

    Calling direct to the web service does work. But the advantage of doing a resource adapter is that the calls are integrated into the standard IdM processing. So you will have the standard auditing and tracing capabilities and the ability to see the user in the IdM GUI etc.
    I think as a short cut under time pressure calling direct is ok but architecturally the RA approach is probably better.
    Also a precision: I should have said 'mix and match alomost certainly will not work, out of the box'. We did manage to make Sun JWSDP webservice code run in Web Sphere. But you have to bung all the jars you need into the idm war file and then do a tricky WASsy thing where you set the 'Parent Last' parameter on the IdM web app AND module (two levels) to ensure that the JWSDP classes are loaded before any WAS webservice classes. Oh joy.

  • Calling RFC placed in PI from Portal

    Dear All,
    We have a scenario where we have RFCs in ECC and it has to be called from Portal through PI.
    Please suggest the possible and easiest ways.
    Please note these RFC are already being called from Portal to ECC directly. So we need to change it be called from PI.
    with regards,
    Ravi Siddam

    Hi Ravi,
    You can do it in either any one of the below ways.
    Use PI Http Url to push the data to PI and from there you can call RFC.
    Plz check below link: Sender Synchronous HTTP Adapter
    Or you can use Web sevice to push the data to PI and then you call RFC.
    Plz check below link on Web service scenario:/people/shabarish.vijayakumar/blog/2007/11/07/walkthrough--soap-xi-rfcbapi
    But before going for above solutions. Please have a looku2026 on below info and decide whether to go for it or not.
    SAP NetWeaver PI 7.1 Usage Scenarios: When NOT to use SAP PI
    User Interface Integration scenario: This is a common scenario faced by the development team u2013 the Webdynpro application is developed on the SAP J2EE application server integrated with the portal. The business data has to be fetched from the SAP ECC backend.
    The User Interface would demand a quick response from the backend for fetching data and conducting the transaction. This is a synchronous scenario, and it would also be conducted with high usage every day. Hence, it is recommended to have a direct integration between the source application (WebDynpro application) and the target application (SAP ECC6) without using SAP PI. It is also recommended to expose the backend functionality as standard services.
    For example, integration between SAP Portals (containing SAP BPM, SAP CAF, SAP WebDynpro) and SAP Suite (SAP ECC, SAP CRM, SAP SCM, SAP SRM etc.) should be conducted without the usage of SAP PI; the services should be exposed from the SAP suite as standards-compliant enterprise services.
    Web Service interface of backend application: Many times, the target application in SAP/Microsoft/Java/Legacy is available as a standard web service. In such cases, the web service interface can be easily consumed in the source application. In such scenarios, SAP PI adds no value for transformation or backend integration.
    In conclusion, SAP PI usage is usually not recommended for User facing applications where the backend application is available as a standard web service. SAP PI is almost always suitable for integration between backend applications not requiring human intervention.

  • Web services call directly from SAP ?

    Hi ESA Experts,
    Is it possible to make a web service call directly from a SRM or SAP R3 system without using SAP XI ?. If so, have you some code samples ?
    Thanks a lot for your response.
    Best regards
    Etienne

    Hi, Etienne.
      There are two things to do.
      1. Prepare Service Provider
      For providing services, there are many tools to publish as web services
    from BAPI, RFC and Enterprise Services.
      Please look at here.
      help.sap.com - Web Service Toolset
      http://help.sap.com/saphelp_nw04s/helpdata/en/db/99c04ba22fe64f96a8651df68eab92/frameset.htm
      i recommend Web Service Creation Wizard as first step.
      2. Prepare Service Consumer
      Also has many tools. What i like is WS Navigator for basic test of web services.
      help.sap.com - Web Service Homepage
      http://help.sap.com/saphelp_nw2004s/helpdata/en/b7/d7baaf1481a349ab723e3acd7334b3/frameset.htm
      Best Regards.

  • Direct RFC pull from SAP without staging files

    Hi,
    I am able to use OWB 10.2.0.2 to execute an ABAP report, ftp the generated file and load it into a DW table. This works fine as documented and demoed.
    There is a requirement to get comments for a certain report. Comments can be arbitrarily long and can have any delimiter in them. To put them in files can become extremely tedious. Now I do not think that the client should be getting comments in a DW but this is the requirement I have to work with.
    What I would like to do is call a SAP functional module and get the result piped into OWB using RFC protocol. This is how many SAP applications that use the RFC protocol get data out of SAP instead of staging it in a file first. OWB uses RFC to connect to SAP as well. And I noticed that there is an execution function module field in the connection explorer. Is this something that can be done through that?
    Thanks

    Here are a few bits on SAP. For your scenario could you go against the underlying database tables? The default for extracting from SAP is to generate and run ABAP reports.
    However, if your source tables are all transparent tables, you can always extract directly from database through PL/SQL. To do that:
    1. create an oracle module with proper credential to connect to the databases used by SAP.
    2. In the SAP mapping, change the generation language from: ABAP (default) to PL/SQL.
    Note, extracting directly from database is not typical in an SAP shop.
    1. Data consistency:
    SAP application server manages its own transactions, which are different from database transactions.
    2. Security:
    In the database level, you will see the data belongs to all clients this is not good:)
    In each PL/SQL mapping that you created, you need to manually add a filter on MANDT to view the data for a specific client.
    3. DATE format handling.
    In the database level, date columns are typically stored as VARCHAR(8).
    In each PL/SQL mapping that maps some data columns, you need to add
    transformation operators on those DATE columns: TO_DATE( column, 'YYYYMMDD')
    Cheers
    David

  • Calling RFC from server proxy

    Dear Experts,
    We would like to use server proxy instead of RFC communication with an adapter using PI. This is an inbound scenario.
    PI has created an interface exactly identical as the BAPI structure, but it has added additional controller field at every record.
    Now our ABAP team is facing the difficulty to map the BAPI structure with proxy structure created because of this additional field.
    Also, the BAPI has multilevel hierarchy and thus it needs lot of looping.
    Please share the better approach by which we can call the BAPI from proxy class with direct mapping of proxy structure to the importing parameter of the RFC.
    - Shri

    We decided to go for RFC call as loops are not feasible.

Maybe you are looking for