How to call ABAP function module/ class method through web service?

Hi Colleagues,
I need to write an iphone version of current ABAP program. I want to call ABAP method and function module through my iphone so that I can re-use the ABAP APIs.So I choose web service. Can you give me any details information about how to do that?
Thank you very much

Hi,
you need to create webservice out of FM. goto SE80 and follow the webservice creation wizard. Finally use webservice url for calling FM (remote enabled) from your iPhone.
Regards,
Gourav

Similar Messages

  • How to run ABAP Function Module in Background Wchich Takes Long Time to Run

    How to run ABAP Function Module in Background FOR LONG TIME
    I am not that experienced with ABAP. I am on SAP BI 7.0. I WANT TO RUN A FUNCTION MODULE
    RSDRT_INFOCUBE_DATA_COPY.
    I used SE37 and then executed the module, I supplied  the parameters on the form which opped-up and then  program started running. . Program was however interrupted after 10 minutes by ABAP. How can I run  it in background without interruption?
    THANKS A LOT.

    Hi,
    You can call this FM in a program and run that program in background.
    Regards,
    Raju

  • How can call a function module(RFC)in one server to another sever in my rep

    How can call a function module(RFC)in one server to another sever in my report program.
    What i am know whenever rfc enabled immediately radio button checks then only it will come.
    please justify.

    Syntax
    CALL FUNCTION func DESTINATION dest [EXPORTING p1 = a1 p2 = a2 ...]
    [IMPORTING p1 = a1 p2 = a2 ...]
    [CHANGING p1 = a1 p2 = a2 ...]
    [TABLES t1 = itab1 t2 = itab2 ...]
    [EXCEPTIONS [exc1 = n1 exc2 = n2 ...]
    [system_failure = ns [MESSAGE smess]]
    [communication_failure = nc [MESSAGE cmess]]
    [OTHERS = n_others]].
    http://help.sap.com/saphelp_47x200/helpdata/en/22/042537488911d189490000e829fbbd/frameset.htm

  • Calling a function module out of a web template

    Hi experts,
    I need to call an ABAP function module out of a web template including a query with the variable values of the query as input parameters. There shall be button, which starts the funtion module, if the user clicks it. I don't need to transfer any other data just the variables. I have no idea how to accomplish that.
    I experimented with implementing interface IF_BICS_CONS_WEBITEM_CUST_EXIT but this does not seem to help me, as the initialize method is called when starting the web template and I did not manage to bind it or the execute method to that button. Besides I was getting shortdumps when starting the web template with the customer extension web item. I declared it as ABAP_CLASS_NAME exit and set the right class name. Variable Container Access and Navigational State Access is on, Result Set Access is off.
    Is there any other possibility to do this? Perhaps with BSP?
    Can I call an ABAP function module with Javascript out of the template? If yes, which command can I use to do it?
    Thank you very much in advance
    Edited by: Markus Maier on Aug 17, 2009 4:15 PM
    Edited by: Markus Maier on Aug 17, 2009 4:32 PM

    Hi Markus,
    if you are on BI 7.0 or higher I recommend using Integrated Planning for this requirement. If you implement a fox formula you can easily get the current variable value and execute the function module. You can execute the fox formula upon button click.
    If you need more information just let us know.
    Brgds,
    Marcel

  • Calling session bean's business method through web dynpro component

    Hi All,
    Can anybody tell me how to call a session bean's methods through a web dynpro WITHOUT java-model or web service model ??
    I have following scenario:-
    1. Stateless Session bean having two business methods
    2. Web Dynpro component
    3.Now i want to call business methods without using any model. I have got following piece of code but I dont know how to go about it.
    4.Where do i have to set JNDI name for session bean? which interface will be looked for?
    5. Do I have to declare public part for EJB DC? If yes, how?
    //This is inside web dynpro component
    InitialContext   context = new InitialContext();
    o = context.lookup(JNDIName);
    TestSessionbeanHome homeRef = (TestSessionbeanHome) PortableRemoteObject.narrow( o,                                                                               
    TestSessionbeanHome.class);
    TestSessionbean beanRef = homeRef.create();
    <returnValue> = beanRef.<ejb method name>
    Please help to get a step-by-step approach to this case.
    Thanks and regards,
    Amey Mogare

    Hi,
    If  I comment out the part that is using session bean's business method, DC is building fine.
    And if I uncomment, then compiler is unabl eto resolve business method(s).
    And i would like to mention that my EJB + J2EE App DC is building properly, but it havent yet deployed properly as I am waiting for data-source-alias name prefix to be configured by ERP team. So will this be a reason why Web Dynpro DC is not able to resolve business methods ??
    Because Web Dynpro DC is able to resolved all interfaces of Session bean and entity bean. But when it comes to business method, its not able to resolve.
    Any more ideas why it is not happening?
    Pls help.
    Now i went through some forum posts regarding this and found that we also need to add EJB DC to Java Build Path for WebDynproDC>Properties>Java Build Path.
    I did this and now it is able to resolve business methods and DTOs as well. So to summarize I did following:-
    1. Added EJB DC (complete DC) as a Used DC to Web Dynpro DC with Buid-n-Deploy-n-Run time dependency
    2. Added Sharing reference of J2EE application DC to Web Dynpro DC -->Properties
    This reference I constructed as follows:-
    <vendorname>/<name of j2ee application as appearing under display name tag in application.xml (replacing '/' with '~')>
    So my Sharing Reference becomes:- <vendorname>/reqpstapscreqpstapja_reqid
    3. Added EJB DC to Java Build Path in Web Dynpro DC's properties
    4. Then I added following piece of code to get object of SessionBean class
    InitialContext context = new InitialContext();
    Object o = context.lookup("java:comp/env/ejb/SessionRequestIDBean");
    SessionRequestIDHome homeRef = (SessionRequestIDHome) PortableRemoteObject.narrow(o, SessionRequestIDHome.class);
    SessionRequestID beanRef = homeRef.create();
    beanRef.<business method>
    But After doing this I am facing another problem :-
    The build fails saying it is not able find the package for DTOs. But when I see the Component Controller's code it is not showing any red or yellow marks.
    Can anybody pls help me out here?
    Thanks and regards,
    Amey Mogare

  • Expose a class method as web service

    hi ABAPers,
    is it possibile to expose a class method as web service? I would like to write a base class with common code, while derived classes implement specific application logic.
    I have both R/3 6.40 and Netweaver 7.0 kernels, so I'm interested in both.
    thank you.

    No, it is not yet possible.
    You can only create a web service for an RFC Function Module, Function Group or Business Object.
    You may create a RFC FM as a wrapper to your Class methods and create a web service on the RFC FM.
    Regards,
    Naimesh Patel

  • Call ABAP function module from script?

    Hi,
    I have an ABAP function module, which works fine when I call it in a transformation.
    Since I don't need to execute this function for each record but rather for each file I process, I would like to move the call from the DataFlow to a script in the WorkFlow. When I click on the 'functions' button the ABAP FM is available in my SAP Datastore, so I drag and drop it into my script. I also make sure to populate all required variables.
    There are no error messages or warning when I check my job definition.
    When I execute it, I get the following RFC error:
    Function call <xxx  ( abcd ) > failed, due to error <150413>: <RFC CallReceive exception <FUNCTION_NOT_FOUND>.>.
    Is it just not possible to call an RFC enabled function module in SAP from a script or am I doing something wrong here?
    Thanks,
    Jan.

    Could you please let me know how I can call an abap function module from a transformation? (from abap xslt program). I know how we can call methods of a class from the transformations, but no idea how we can call function modules. Any suggestions or a sample code snippet towards this will be very useful for me.
    Thanks,
    Shashi.

  • How to call a function module from a transformation

    Hi,
    Could somebody please let me know how I can call an abap function module from a transformation (abap xslt program). I know how to call the class methods from transformation, but how do i call a function module..?
    Thanks,
    Shashi.
    Edited by: Shashi Kanth Kasam on Apr 8, 2010 12:45 PM

    Ya. I can do that. But I don't want to use a class and a method to call that function module. Want to directly call function module from transformation. Is that possible..?
    Thanks,
    Shashi

  • How to call a function module in VC

    Hi,
    I want to call a function module for an addition formula which shall calculate and infer the value.
    eg. quantities of 5 different characteristics (of numeric data) is to be summed up and inferred against the 6th characteristic.
    I want to know the detailed process to create a Variant Function and use it in a dependency.
    Request to please advise the steps, type of dependency and its code.
    Regards,
    Rajesh Mohapatra

    Dear Rajesh,
    I also wanted to learn how to do that, your post motivated me to use a bit of freetime and investigate on the subject. I finally made my function work, so here are the tips.
    The example is very simple, just a variant function with two inputs and which multiplies inside the input values and transfer that result to the output ( 3 x 4 => 12 ).
    Deducting how to add five values or any other logic would be easier starting from there.
    STEP 1: Create Variant Class for the product. I imagine you already have that. In my case its name is ZVC_CLASS, you have already a material assigned to the class, a configuration profile, etc....
    STEP 2: Create Three Characteristics Z_NUM_CH_1,Z_NUM_CH_2,Z_NUM_CH_3 the three of numeric type
    STEP 3: Assign characteristics from step 2 into class ZVC_CLASS
    STEP 4: Create the function module with the code given below. I put the name ZVC_FUN_TEST
    FUNCTION ZVC_FUN_TEST.
    ""Interfase local
    *"  IMPORTING
    *"     REFERENCE(GLOBALS) TYPE  CUOV_00
    *"  TABLES
    *"      QUERY STRUCTURE  CUOV_01
    *"      MATCH STRUCTURE  CUOV_01
    *"  EXCEPTIONS
    *"      FAIL
    *"      INTERNAL_ERROR
    *- Inicializar los valores.
      DATA:
      GV_VALOR_FINAL        TYPE CUOV_01-ATFLV,
      GV_VALOR_NUM1         TYPE CUOV_01-ATFLV,
      GV_VALOR_NUM2         TYPE CUOV_01-ATFLV.
      CLEAR:
        gv_valor_final,
        gv_valor_num1,
        gv_valor_num2.
    CALL FUNCTION 'CUOV_GET_FUNCTION_ARGUMENT'
        EXPORTING
          ARGUMENT            =  'Z_NUM_CH_1'
        IMPORTING
         VTYPE               =  P_VTYPE1
         SYM_VAL             =  P_VALOR_SYM1
          NUM_VAL             =  gv_valor_num1
      IO_FLAG             =
        TABLES
          QUERY               =  QUERY
        EXCEPTIONS
          ARG_NOT_FOUND       = 01.
      IF SY-SUBRC <> 0.
        RAISE INTERNAL_ERROR.
      ENDIF.
    CALL FUNCTION 'CUOV_GET_FUNCTION_ARGUMENT'
        EXPORTING
          ARGUMENT            =  'Z_NUM_CH_2'
        IMPORTING
         VTYPE               =  P_VTYPE1
         SYM_VAL             =  P_VALOR_SYM1
          NUM_VAL             =  gv_valor_num2
      IO_FLAG             =
        TABLES
          QUERY               =  QUERY
        EXCEPTIONS
          ARG_NOT_FOUND       = 01.
      IF SY-SUBRC <> 0.
        RAISE INTERNAL_ERROR.
      ENDIF.
    *- Calculate final value
      gv_valor_final = gv_valor_num1 * gv_valor_num2.          "Especifico de c/u.
    DATA: VTYPE TYPE CUOV_01-ATFOR.
    VTYPE = 'NUM'.
    CALL FUNCTION 'CUOV_SET_FUNCTION_ARGUMENT'
        EXPORTING
          ARGUMENT                = 'Z_NUM_CH_3'
          VTYPE                   = VTYPE
          NUM_VAL                 =  gv_valor_final
        TABLES
          MATCH                   = MATCH
        EXCEPTIONS
          EXISTING_VALUE_REPLACED = 01.
      IF SY-SUBRC <> 0.
        RAISE INTERNAL_ERROR.
      ENDIF.
    ENDFUNCTION.
    STEP 5: Activate the function module for Variant Configuration in transaction CU65, put there your function module, release int and in button characteristics write  Z_NUM_CH_1,Z_NUM_CH_2,Z_NUM_CH_3. Flag the first two lines as they are inputs.
    STEP 6: Create a Dependency ZVC_PROC_TEST of type Procedure to call the function with this code:
    000010 Function ZVC_FUN_TEST           
    000020 (Z_NUM_CH_1 = $root.Z_NUM_CH_1, 
    000030 Z_NUM_CH_2 = $root.Z_NUM_CH_2,  
    000040 Z_NUM_CH_3 = $self.Z_NUM_CH_3)  
    STEP 7: Lets say I want to calculate the multiplication only upon the selection of another characteristic "Calculate" YES/NO. For this I create a characteristic in CT04 Z_CALCULATE type CHAR 1 with possible values Y or N. For the value Y y add the procedure ZVC_PROC_TEST so that formula only activates on Y.
    STEP 8: Add characteristic Z_CALCULATE to class  ZVC_CLASS
    STEP 9: VA01, it should work

  • How to call a function module from a workflow ? ?

    hi all,
    i have to call a function module from an workflow, i got a hint from someone that i have to enhance an object and then write and methode, in this methode i can call that function module. I dont know even how to go for it.
    Can anyone suggest that how to go for it ?
    thanks.
    raman khurana.

    Hi Raman Khurana,
    Please  go through the links it might be helpful , notsure
    http://help.sap.com/saphelp_nw2004s/helpdata/en/c5/e4af8b453d11d189430000e829fbbd/content.htm
    http://www.abapcode.info/2007/07/standard-function-module-text.html
    http://it.toolbox.com/wiki/index.php/SAP_Workflow
    Regards,
    Sreekar.Kadiri.

  • How to create RFC function module and how to call this function module

    Hi,
    i want to know step for creating RFC function module and then How to  use this function module from some other sap system.
    Thnaks,
    jigar

    Jigar,
    To implement a remote function module in ABAP, perform the following steps:
    Register the module as remotely callable in the RFC server system.
    In the function module Administration screen (transaction code SE37), set the field Can be called via REMOTE CALL. Registering a module as remote causes an RFC stub to be generated for it.
    Write the code for the function module.
    Create the destinations.....................
    Displaying, Maintaining and Testing Destinations
    To display, create or modify destinations, choose Tools ® Administration ® Administration ® Network ® RFC destinations or enter transaction code SM59.
    Remote Destinations are stored in table RFCDES. The RFCDES table describes logical destinations for remote function calls.
    It is not possible to maintain the RFCDES table directly.
    You can also access logical destinations via the Implementation Guide (IMG) by choosing Tools ® AcceleratedSAP ® Customizing ® Execute Project ® SAP Reference IMG.
    In the Implementation Guide, expand the following hierarchy structure:
    Basis
    Application Link Enabling (ALE)
    Sending and Receiving Systems
    Systems in Network
    Define Target Systems for RFC Calls
    Displaying Destinations
    The initial screen for this transaction displays a tree:
    Different connection types (i.e. partner systems or programs) are possible. For further information, see Types of Destinations.
    To display all information for a given destination, double-click it, or place the cursor on it and press F2 .
    To search for a destination, press the Find button and specify your selection. You get a list of all entries matching your selection. Place the cursor on the one you want, and press F2 or simply double-click the destination. All information for the given entry appears.
    Creating Destinations
    On the destinations overview screen (transaction code SM59), the connection types and all existing destinations are displayed in a tree structure.
    All available connection types are explained in Types of Destinations.
    To create a new RFC destination, press the Create button. A new screen is displayed with empty fields for you to fill in.
    If you want to create a new destination
    As you create a remote destination, you can specify a particular application server or a group of servers for a balanced distribution of system load.
    For details of the destination parameters, see Entering Destination Parameters.
    Changing Existing Destinations
    On the destinations overview screen (transaction code SM59), the connection types and all existing destinations are displayed in a tree structure.
    You can display all information for a given destination by double-clicking it or pressing F2 on it.
    To change an existing destination, double-click it, or place the cursor on it and press the Change button.
    For details of the destination parameters, see Entering Destination Parameters.
    Testing Destinations
    To test a destination, choose the appropriate function from the Test menu.
    Connection (also available via the Test connection pushbutton)
    Authorization (checks logon data)
    Local network (provides a list of application servers)
    You can use the CALL FUNCTION statement to call remote functions, just as you would call local function modules. However, you must include an additional DESTINATION clause to define where the function should run:
    CALL FUNCTION RemoteFunction
    DESTINATION Dest
    EXPORTING
    f1 =...
    f2 =...
    IMPORTING
    f3 =...
    TABLES
    t1 =...
    EXCEPTIONS......
    The field Dest can be either a literal or a variable: its value is a logical destination (for example, "hw1071_53") known to the local SAP System. Logical destinations are defined in the RFCDES table (or the TRFCD table in R/2 Systems) via transaction sm59 or the following menu path: Tools ® Administration, Administration ® Network ® RFC destinations. You can also access logical destinations via the Implementation Guide (IMG) by choosing Tools ® Customizing ® Enterprise IMG. In the Implementation Guide, you can then choose Cross-application components ® ALE ® Communication ® Define RFC destination.
    The remote function call concept, for example, allows you to access a function module in an R/2 System from an ABAP program in an R/3 System. If you want to read a customer record from your R/2 System’s database, create a remotely callable function module in the R/2 environment which retrieves customer records. Call this function from your R/3 System using a remote function call and listing the destination for the target R/2 System:
    Pls. reward if useful

  • How to call a function module from the Web Template?

    Hi all,
    how can I call a function module from a BI 7.x web template and then show the result of the FM on the web template?
    Many thanks for your hints.
    Regards, Nils

    Hi!
    I am too working on a similar issue.
    Probably this helps:
    Re: Calling a function module from a Web Template
    Regards,
    Sri

  • How to call a function module dynamically?

    Hi
    I am doing a smartform development and here my scenario.
    <b>Scenario:</b>
    There will be a simple report which will trigger a smartform output. The report has a selection screen and and in one of the field the user will enter the layout name or the layout name will be stored in the variant so that the user need not remember the layout name.
    Based on the layout selected i need to show the output.
    <b>What i have coded:</b>
    In my program after selecting the data i am calling the FM SSF_FUNCTION_MODULE_NAME which will return the function module name to be called.
    <b>Question:</b>
    How do i call the function module dynamically. I cannot do a single call to the function module using the FM name derived from the above function call. I want to make the interface calling dynamic. We dont want to hardcode the function calls coz we may have many layouts to be called so how is it possible in SAP to call the FM interface dynamically.
    ~Suresh

    Actually you can call the FM dynamically in by taking it into one variable and than use the CALL FUNCTION V_FM_NAME.
    But the problem here is, you need to take care about the importing, exporting and tables parameters. They needs to be same for all FMs which you are planning to call. Otherwise system will give you a run time error.
       CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
             EXPORTING  FORMNAME           = LF_FORMNAME
    *                 variant            = ' '
    *                 direct_call        = ' '
             IMPORTING  FM_NAME            = LF_FM_NAME
             EXCEPTIONS NO_FORM            = 1
                        NO_FUNCTION_MODULE = 2
                        OTHERS             = 3.
          CALL FUNCTION LF_FM_NAME
               EXPORTING
                          ARCHIVE_INDEX        = TOA_DARA
                          ARCHIVE_PARAMETERS   = ARC_PARAMS
                          CONTROL_PARAMETERS   = LS_CONTROL_PARAM
    *                 mail_appl_obj        =
    *                     mail_recipient       = ls_recipient
                          MAIL_SENDER          = LS_SENDER
    Regards,
    Naimesh Patel

  • Calling ABAP Function Module in BODS, but not RFC_enabled

    Hello Experts
    We have an ECC ABAP Function Module takes 5 input parameters and returns Division Name for an Employee and Employee PERNR is one of the input parameters for the Function Module.
    I tried adding a function call in the target schema of Query Transform and the output parm passes out as an Output column. But getting an error that ABAP FM is not RFC_enabled. I checked attributes, and it is not RFC_enabled.
    So is there way to invoke this FM as part of BODS ABAP Dataflow?. Becuase the code executes on ECC, it does not need to be RFC enabled, I believe. But on the Query Transform, the option "New Function Call" isn't enabled or it is greyed out, I can't select it.
    What is the solution to invoke this ABAP FM with enabling RFC on it ?
    Please provide me your inputs.
    thank you

    Hi,
    Create a custom wrapper FM which is Remote enabled & call the FM DD_DOMA_GET inside your custom Remote FM. Changing the std. FM would be a core code mod. hence above approach would be safe.
    Thanks,
    Best regards,
    Prashant

  • How to call a function module from debugger?

    Hi all,
           i just wanted to know whether we can call a function module from a debugger ,
           if yes how ?

    Hi Laxmikanth,
    How ur going to call a function module which is not present in program???
    In debugging mode u can change the values of variables,put break points and watch points,but i thnk its not possible to call a function module(not present in program) while debugging .
    Please share with us if u have any solution...
    Regards,
    lakshman.

Maybe you are looking for

  • Scanning from flatbed

    I have a Laserjet Pro 200 color MFP M276nw & Macbook Pro running OSX 10.9.5. I can print wirelessly and scan from the document feeder to my desktop using System Preferences, however, when I try and scan from the flatbed and save to desktop, it appear

  • SSD/HDD Time Machine Back Up Issue

    I am having an issue with my 2010 13" MacBook Pro. A few months ago I removed the optical drive, replaced it with the existing HDD, and then replaced the HDD with an SSD. The SSD runs my OS (Mountain Lion 10.8.4) and Applications, while the HDD is wh

  • Mapping calls dblink that does not exist

    Hi, we read data from a foreign table using a connector/dblink. That works fine on the development environment. When we deploy it to integration environment the mapping generated a strange link like "SCHEMA"."VIEWNAME"@"SID@LOCATION_NAME" Is this a b

  • My Notes app is frozen on  my i phone 4s, how do I correct?

    My Notes app is frozen on  my i phone 4s, how do I correct?

  • Slow flash issue STILL OCCURRING. Can I please get a response?

    If you guys don't mind, can you please vote for the following issue below, so it can get more attention for the support team? https://bugbase.adobe.com/index.cfm?event=bug&id=3155813 I've been experiencing this issue for almost 2 years now and so far