Call RFC (Abap) with Javascript

Hi all,
i'm new to Javascript.
Now i have to write a small piece of code in Javascript that calls an Abap RFC.
Does anyone have an example for something like that ?
Greetings
Henning

Hi Henning,
Chk these links Hope this will help you out...
http://publib.boulder.ibm.com/infocenter/tivihelp/v2r1/index.jsp?topic=/com.ibm.IBMDI.doc_6.1/referenceguide120.htm
Please reward points if you find this as a right solution
Regards,
Harini

Similar Messages

  • WebDynpro Call RFC, Handling with structures

    Hi together,
    Does someone know where I can find examples showing me the handling of RFC - Exportparameters.
    I've got succees handling tables with the webdynpro-TableControl.
    But know I'm interested using the export-structure of a function module from R/3 in Java, filling automatically an
    form.
    Please Help.
    Special Thx to Armin Reichert, who helped me with Excel Problems.
    Thx
    Greetings Sascha

    Hi Sascha,
      There is no single example which will explain all the possibilities that you are asking for. There is a book called "Inside WebDynpro for Java". Its an excellent book for developers. It really gives you a good understanding of the concepts. In this book you have examples on how to handle RFC's.
    Well if you require an example that really explains all the scenarios.
    As far as i can see the Flight example is the best to start off with as a WebDynpro newbie. Its the same.
    If you have any problem in a particular scenario, then you can post it and you will get good replies out here :).
    Using the Flight example you will be covering almost all the scenarios. In case a scenario is not covered do post it here and we will be able to guide you.
    regards
    ravi

  • Call applet method with javascript

    my html - code:
    <APPLET NAME="Mail" ... ... ></APPLET>
    <form action="javascript:document.applets("Mail").test("Execute JAVA Applet Function")">
    <input type="submit" value="Execute Applet Function">
    </form>
    my applet code:
    public void test(String t)
    {System.out.println("executing test()");
    teststr = t;
    repaint();
    in the paint() method i draw the teststr with Graphics.drawString - but nothing happens...
    any suggestions?
    thx

    Directly calling a Java Applet's public method from within
    JavaScript is made possible by LiveConnect which is not implemented by Internet Explorer as of yet. LiveConnect is only available on Netscape navigator at this time.

  • ADS Error while calling WebDynpro Abap with Adobe Form

    Hi Experts,
    I have created an Adobe Form and its interface in Transaction SFP. In a WebDynpro Abap Component I created an UI-element "Interactive Form" with the context of my form. So the WebDynpro Context was created automatically. Then I tried to call the WebDynpro Application in  the Internet Explorer but got the error message:
    german(original):
    WebDynpro Exception: Der Aufruf des ADS schlug fehl. Informationen zur Ursache finden Sie im error.pdf auf dem Applikationsserver.
    english:
    WebDynpro Exception: The call of ADS failed. You find information in error.pdf on Application server.
    How can I call error.pdf and what can that be? One WebDynpro Component with the form runs without any problems, the other one doesn't do this. I have no idea if it is a problem with context or server or something else.
    I hope you can help.
    Thanks al lot.
    Best regards,
    Ingmar

    Hi,
    Check the note in this site...
    https://websmp204.sap-ag.de/notes
    Regards,
    <i><b>Raja Sekhar</b></i>

  • How to call Web Services (with javascript) in a view load event ?

    Hello to the expert community,
    I'm looking for a piece of javascript code allowing to call Web Services in a view load event ?
    Any ideas will be really appreciated.
    Regards.
    Have a nice week.

    Thank you for your answer, dongmei.
    It seems that the MethodResultTableDataProvider does not return the response of the web service as a value field if the WSDL contains only one result element.
    E.g. from WSDL of the USWeather Web Service which returns theGetWeatherReportResult string:
    <?xml version="1.0" encoding="utf-8"?>
    <wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:tns="http://www.webserviceX.NET" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" targetNamespace="http://www.webserviceX.NET" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
      <wsdl:types>
        <s:schema elementFormDefault="qualified" targetNamespace="http://www.webserviceX.NET">
          <s:element name="GetWeatherReport">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="ZipCode" type="s:string" />
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="GetWeatherReportResponse">
            <s:complexType>
              <s:sequence>
                <s:element minOccurs="0" maxOccurs="1" name="GetWeatherReportResult" type="s:string" />
              </s:sequence>
            </s:complexType>
          </s:element>
          <s:element name="string" nillable="true" type="s:string" />
        </s:schema>If I drag the web service method on the page and I should be able to select the response value in the Bind to Data dialog box. But there is no value field. Value fields only occur if the web service returns more than one value.
    The question is how can I get the response GetWeatherReportResult from the service.

  • Calling FP Methods with Javascript

    I'd like to be able to jump to specific pages in my
    flashpaper document using an html / javascript link. My javascript
    function setThePage gets a page number from the HTML link and feeds
    the value to the flash file (which my flashpaper movie clip loads
    into). That value is then dumped into a function that eventually
    sets the setThePage value equal to setCurrentPage, which is listed
    in the flashpaper API as the function that changes the current
    page. I've had no luck. I'm getting a javascript error telling me
    the object doesn't support the method or function and I think it
    has to do with the setCurrentPage function only working on the load
    of the flashpaper swf. Does anyone have a different solution for
    using html links to jump to specific flashpaper pages?

    Rich,
    I am interested in doing similar things from within a
    FlashPaper document loaded into my Flash movie. I wish to create
    links within the FlashPaper doc. that will talk to Actionscript in
    the main movie. I know that using the Flash 8 ExternalInterface
    Class is key, but in creating links in a Word Doc that eventually
    becomes FP, I haven't a clue. It's easy enough to create links that
    navigate to other URLs, or with the same page, but with the parent
    Flash movie...
    Anyway, if you have discovered anything, please share. I will
    also, should I discover anything. Thanks, Mike.
    mailto:[email protected]

  • Reg: Calling RFC FM in JavaScript

    Hello Gurus,
    I am trying to call FM from Masthead,
    The FM is used to delete an entry in the table. And I need to execute the FM when Closing the browser or click on Logoff.
    And Input to the FM is logged in User.
    Please help me in resolving this.
    Thanks & Regards,
    Pramod

    Hi Pramod,
    I thnink of few ways to achieve this
    Option 1:
    - create a class which does the FM operation(Abstarct class with JCO connector).
    -deploy this as a par file.
    -take note of the url created when you run this par file from the portalapp.xml.
    -goto logoff form,
    <form name="logoffForm"
    here under action="...., include the url from the above par file starting frome'/irj/....'.
    -now when the user clicks the logoff, he would eb redirected to your abstract calss which does the table operation with FM.
    Option2:
    - the logoffRedirectURL is being called when the user clicks the logOff button. Let us manipulate this URL, instead of this URL change the URL through Visual Admin.
    -create a WdJava or WdABAP appln. which does this Table operation with FM. create an iView and put QuickURL(say- deleteEntry).
    -under redirect URL, call this iView by mentiong as '/irj/portal/deleteEntry).
    -here you have to ensure that this iView is assigned to the users with a role or so.
    note: if you are taking the user away from when he clicks logoff, I believe you may have to handle the logOff yourself.
    May be you could invlidate the HTTP session. In the abstract class mentioned in option1, by using
    'request.getHTTPRequest(..).
    you can do this.
    Thanks,
    Jakes.

  • Calling an ABAP WebDynpro Popup from a BSP view

    I need to know if the following is possible.
    I have a requirement to call an ABAP WebDynpro Popup from a BSP view.
    When the Popup is triggered (eg via pushbutton) the BSP will pass data to the Popup, before the Popup is closed the Popup will pass data back to the BSP to be displayed in the BSP view.
    I do not want to rely on Portal Events as Portals may not be used, would really appreciate a clean simple solution.

    Hi,
    any webdynpro application has a URL behind it. Haven´t you tried to call that URL with Javascript code ??
    script language="Javascript"
          url = "test_page.htm" + "?field=" + param;
          window.open(url, "F4window", "width=400, height=400");
    /script
    You can pass data to the WD application using parameters as I show you after the "?".

  • Calling ABAP Class with Javascript (Example?)

    Can anyone provide an example of calling an ABAP class with Javascript?  I'm looking to retrieve a variable value from a Web Application
    Thanks

    I need this too.
    I have a Selection Screen in JAVA. And I want to fill the f4-help with a abap-function.
    with kind regards
    Maria Kiltz

  • Calling a abap method in a javascript

    Hi all,
    I've been browsing a bit through this forum, but there has no answer been completely covering my problem...
    I would like to call an abap method in the javascript in order to check some values...
    This is what I have done:
    <script language="JavaScript" defer="defer">
        function do_checks(htmlbevent)
            try
                  var doubles = "<%= controller->check_doubles( )%>";
                  if(doubles == true){
                      var Check = confirm("Test??");
                      if(Check == false){
                        htmlbevent.cancelSubmit = true;
            catch(e)
      </script>
    The method has the following code:
    mehod check_doubles. " returning parameter = rv_double of type flag
      rv_double = abap_true.
    endmethod.
    the button is defined like this...
    <htmlb:button
                              id      = "Save"
                              onClick = "save"
                              onClientClick = "do_checks(htmlbevent);"
                              text    = "<%= otr(crm_ic_appl/Save) %>"
                              />
    The funny thing is, that the controller->check_doubles( ). is already processed at load of the page (although there is no on_load used somewhere...
    If I leave out the " if(doubles == true){ } ", the javascript reacts as foreseen..., but when I keep the " if(doubles == true){ } ", the javascript doesn't go through the method anymore...
    Can anybody help me out here???
    Thanks!!
    Micha

    Hi,
    You can call them FM inside the javascript something like below...
    <script language="JavaScript">
    function yourFM()
    <%
       DATA: guid TYPE GUID_32.
       CALL FUNCTION 'GUID_CREATE' IMPORTING ev_guid_32 = guid.
    %>
    </script>
    <b>To call the class & method:</b>
    <script language="JavaScript">
        function yourFM()
          <% CLASS cl_bsp_login_application DEFINITION LOAD. %>
          var EXIT_URL  = "<%= CL_BSP_LOGIN_APPLICATION=>GET_SESSIONEXIT_URL( page = page ) %>";
      </script>
    But i am not clear what do you want to achieve. I didnt understand what you are trying to do with you code. Could you give more detail?
    <i>* Reward each useful answer</i>
    Raja T
    Message was edited by:
            Raja Thangamani

  • 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

  • NW RFC SDK: Non-SAP to ABAP with username (trust relationship)

    Hello,
    I have a quite challenging non-SAP-to-ABAP RFC scenario with a trust relationship.
    Hereu2019s the scenario:
    An Oracle database server acts as an RFC client and calls RFC function modules in an ABAP server. (I assume the Oracle programmers are going to use NW RFC SDK 7.1 or JCo 3.0 on the Oracle server and call that from their PL/SQL based database application.)
    The challenge is that I donu2019t want to use a single u201Ctechnical useru201D on the ABAP side because that would mean that all the users on the Oracle side would be mapped to one single ABAP user. Also, I donu2019t want to have to store individual ABAP passwords on the Oracle side.
    Instead, I want the ABAP server to trust the RFC client the same way it might
    a) trust a NetWeaver AS Java server after installing the Java serveru2019s certificate in transaction STRUSTSSO2 or
    b) the way it might trust another ABAP server after configuring a trust relationship (transaction SMT1?)
    The ABAP server should accept incoming RFC connections from the Oracle RFC client with just the user name and no password given and run the resulting processes in the ABAP system under the user id given in the RFC call.
    I imagine the ideal solution somehow along the following lines (simplified scenario for a PC-based prototype):
    - I download run a program that creates a certificate file (public key?) which I import into the ABAP system.
    - The same program creates a matching file (private key?) for the RFC client.
    - For reasons of simplicity, let us imagine the RFC client as a stand-alone Java SE application running on a PC.
    - The Java SE application uses the JCo library to connect to the ABAP system.
    - When opening the connection, it passes a username, but no password. Instead, it passes a Base64-encoded string that was generated by our key/certificate generator program.
    - On the ABAP side, the function modules are run under the username used by the Java SE application when establishing the RFC connection.
    Is that possible at all? How would you solve this?
    Thank you very much in advance and best regards,
    Thorsten

    Hello,
    Thanks a lot for your extremely high-quality replies. Iu2019ve been trying to work with them.
    Frankly, just when (after Gregoru2019s and Timu2019s posts) I was hoping that working my way deeply enough into SNC, I would be able to solve my problem, Wolfgang comes along and tells me what Iu2019m aiming at wonu2019t work. Now Iu2019m confused.
    The way I understand Wolfgang, the special trust an AS ABAP can put into another AS ABAP or an AS Java (u201Cremote RFC client, give me one certificate and I will accept every username if they come from youu201D) can not be put into a custom-made remote server software (such as the Oracle server application) acting as the RFC client, because when acting as RFC clients, the remote AS Java or AS ABAP use proprietary elements of the RFC protocol which are not available to me when I program my RFC client in the Oracle application.
    @Wolfgang, is that correct?
    Solution 1: Individual X.509 Certificates
    Instead, I can establish X.509-based trust relationships at the level of individual usernames: create a certificate for each Oracle user, import them into the AS ABAP, map them to an ABAP user, and store the certificate on the Oracle side (Iu2019m still note sure about the different certificates and keys used publicly and privately here).
    Solution 2: AS ABAP as User Management Engine for the Oracle Application
    I can also see an alternative that would spare me the trouble of generating, importing, mapping and storing the certificates: delegate the user management to the AS ABAP and delete the (custom-built) logon and password-checking mechanism in the PL/SQL application:
    Users are created centrally in CUA and distributed along with their passwords into (among others) the AS ABAP.
    When a user logs on to the PL/SQL application, the username and password are sent for validation to an ABAP BAPI.
    If authentication is successful, the AS ABAP returns a SAPLogon ticket which can be stored in the session context of the PL/SQL application and used in subsequent RFC calls. The password (a hash?) would only be transferred once during logon.
    What do you think? Would both solutions work or am I still getting something wrong? Can you see a better alternative that would reduce
    for solution 1 the administrative overhead for synchronization
    for solution 2 the run-time dependency Oracle-ABAP and the change impact on the Oracle applicationu2019s user management concept?
    Thanks a lot,
    Thorsten

  • RFC Call from ABAP (R3) to Webdynpro EP

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

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

  • 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 an Abap Web Service from IBM WebSphere with a MYSAPSSO2 Cookie

    Hello,
    I have the following problem :
    I have to develop a proof of concept between IBM Web Sphere 5.1 and SAP AS JAVA 7.0.
    I have created an IBM sevlet in Web Sphere, I use a specific redirect from an SAP AS Java to call it, this way I can have a SAP Logon Ticket, and I manage to call an ABAP module function with JCO with SSO.
    Scenario 1 : browser  + authentication --> AS Java redirect servlet MYSAPSSO2 cookie -> IBM WebSphere servlet JCO -> Abap module function (ECC5)
    This scenario works fine.
    I have to do the same scenario with a Web Service and I don't know what to do.
    I try to use jax-rpc handlers but I don't know how to pass my cookie from my servlet to my handler.
    Scenario 2 : browser + authentication --> AS Java redirect servlet MYSAPSSO2 cookie -> IBM WebSphere servlet JCO -> Abap Web Service (ECC5)
    Has someone already done that  ?
    Regards,  Julien.

    Julien,
    Why are you using 5.1....go for 6.0 and its cake walk, i have integrated WebSphere 6.0 with R/3 uysing xi.....in a week.
    Scenario changed to:--
    Browser+ authentication --> WebSphere AS servlet request --> XI --> RFC/bapi --> abap webService
    Hope that helps
    Regards
    Ravi

Maybe you are looking for

  • Problems in Dialog instance installation for ECC6.0(ABAP+JAVA)

    Does anyone can help me what should be a procedure of installing Dialog instance for ECC 6.0 with both ABAP + Java Stacks. When installing app server do we also choose ABAP and Java or just ABAP. Installation manual does not cover this and when we ru

  • Emca -config dbcontrol db fails with grid control error

    hi friends i am using oracle 11.2.0.2.0 in windows xp 32 bit while i was trying to config the EM with the command emca -config dbcontrol db i am getting the following error The existing database you have specified has Grid Control repository.This ope

  • Generating an HTML report from two tabs.

    Hi Guys, and sorry if the title is not clear. My situation is like this: I have two tabs for two different conditions. In the first tab, I want generate part of my HTML report regarding the first tab. Then, in the second tab, I want add more details

  • PlSql query required

    Hello All, I have one requirement like below. I've written a StoredProcedure which has i/p parameter as segment_id I have two tables T1 and T2 T1--> line_id,ssection_id,cat_id T2--> parent_id,child_id, segment1,segment2,segment3 parent_id is equivale

  • Register Virtual Machine in OVM manager

    I have created a virtual machine on server manually by copying system.img and configuring vm.cfg file. How can I register this machine with OVM manager? Thanks.