Is it possible to create a Functional module dynamically?

Hello All,
Does any one know whether is it possible to create a FM dynamically and write some code in it?
Regards,
Lisa.

Hi,
Yes it is possible.
Use this FM to create a function module on the fly programatically.
RS_FUNCTIONMODULE_INSERT.
Here is an example
Here an example how to call it:
call function 'RS_FUNCTIONMODULE_INSERT'                                                   
  exporting                                                                               
funcname                      = '/TEST40P/FB_TEST_EVE99'                               
    function_pool                 = 'CRAS1'                                                
*   INTERFACE_GLOBAL              = ' '                                                    
*   REMOTE_CALL                   = ' '                                                    
    short_text                    = 'TEST Anlage FB'                                       
   suppress_corr_check           = ' '                -----------------> means with transport popup                                                 
   update_task                   = '1'                                                     
*   corrnum                       = 'B20K8A0V3F'                                           
   namespace                     = '/TEST40P/'                                             
*   suppress_language_check       = 'X'                                                    
*   AUTHORITY_CHECK               = 'X'                                                    
*    save_active                   = ' '                                                   
    new_source                    = it_report[]                                            
* IMPORTING                                                                               
*   FUNCTION_INCLUDE              =                                                        
*   CORRNUM_E                     =                                                        
tables                                                                               
import_parameter              = if_import                                               
   export_parameter              = if_export                                               
   tables_parameter              = if_tables                                               
   changing_parameter            = if_change                                               
   exception_list                = if_except                                               
   parameter_docu                = if_docu_tab                                             
*   SOURCE                        =                                                        
exceptions                                                                               
double_task                   = 1                                                       
   error_message                 = 2                                                       
   function_already_exists       = 3                                                       
   invalid_function_pool         = 4                                                       
   invalid_name                  = 5                                                       
   too_many_functions            = 6                                                       
   no_modify_permission          = 7                                                       
   no_show_permission            = 8                                                       
   enqueue_system_failure        = 9                                                       
   canceled_in_corr              = 10                                                      
   others                        = 11.
Regards,
Sesh

Similar Messages

  • Calling Function Modules Dynamically

    Hi All,
           Is it possible to call a function module dynamically i.e. to pass the module name and the import and export parameters dynamically at runtime. Please provide a way of achieving this.
    Regards,
                 Milan Thaker

    Hello,
    Read this SAP documentation on calling function modules dynamically: [http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_DYNAMIC.htm|http://help.sap.com/abapdocu_70/en/ABAPCALL_FUNCTION_DYNAMIC.htm] Here you have an example explaining the technique.
    Also check this link on [ABAP FAQs|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/840ad679-0601-0010-cd8e-9989fd650822#q-29].
    Cheers,
    Suhas
    Edited by: Suhas Saha on Mar 9, 2010 3:33 PM

  • IIs it possible to retrive deleted Function Module

    Hi all,
    i just want to know is it possible to retrive deleted Function Module .
      the request is not released yet.

    Hi Sai,
    Its not possible. (Confirm by contacting ur Basis people, if they can help).
    But the following is valid only if your function module is(or was) a transportable object.
    Go to SE37, enter your function module name and create. Assign it to the same function group and have the same interface and description. Save it, activate it.
    Now go back to SE37, enter the function module name, in the menu, 'Utilities>Versions>Version Management'. Now you should see all your previous versions. Select the most recent past version. Do a retrieve and then activate it as the latest version.
    Not sure if it works. But still give it a try.
    Best Regards,
    Anjali
    Message was edited by: Anjali Devi

  • I'm very new tp SAP ABAP, how to create a function module..V.URGENT

    hi folks,
    I'm very new to sap abap.
    I want to create a function module.
    the following is my requirement.
    by passing(eporting parameters to funtion module from pgm point of view) a field, i want to get(importing parameters from the funtion module, from pgm point of view) some 7 fields(of various tables).
    please also tell me how can code an inner join for tables 5 tables(a,b,c,d,e). i'm joining a on b, b on c, c on d,the problem here is that i can not join d on e as there are no common fields in d and e.
    can i join e and c or b, there are no common fields even in a and e.
    please tell me the solution as soon as possible, this very important and urgent deliverable.
    thanks in advance

    Here is link for creating function modules
    <a href="http://help.sap.com/saphelp_47x200/helpdata/en/9f/db98fc35c111d1829f0000e829fbfe/frameset.htm">Creating Function Modules</a>
    Regds
    Manohar

  • 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

  • Creating a Function module to send XML Byte String

    Hi all,
    I have to create a Function module to get XML byte string.The internal table is dynamic coloums based on how many data selected as a importparameter.from the internal; table data I have to create a XML byte string as a output.Pl help me to proceed further.
    Thanks in Advance.
    Ram

    If i have your question right you need to convert an internal table of unknown type to an xml string then to a byte string.
    data xmlString type string.
    data xmlXString type xstring.
    call transformation id
       source
          table = internalTableYouWantToExport
       result
          xml xmlString.
    export xmlString to data buffer xmlXString.
    xmlString has the xml of the table and xmlXString contains the byte representation of the string.

  • Creating a function module

    please help me to
    create a function module as follows-
    i) Have the following import parameters
            empnm TYPE zb19rv2_table-empnm ,
            empdj  TYPE  zb19rv2_table-empdj ,
            empad TYPE  zb19rv2_table-empad ,
            empph TYPE  zb19rv2_table-empph ,
            depid   TYPE  zb19rv2_table-depid.
    ii) Have the following export parameter
            empid TYPE zb19rv2_table-empid ,
    iii) Have the following exceptions
            Raise exception if the Name field is blank
    iv)       Source code-
            Check if the import parameter has name given, if not raise exception, else
            Select the latest empid from table zb19rv2_table
            Increment this id by one
            Use the import parameters and the new generated empid to insert record in to the table zb19rv2_table
            If the record is inserted, then move the new generated empid to the export parameter of the function module

    Hi Ravinder ,,
    check this link for step by step procedure to create function module ,
    http://abaplovers.blogspot.com/2008/02/creating-function-module-in-sap-abap.html
    http://help.sap.com/saphelp_nw04/helpdata/en/26/64f623fa8911d386e70000e82011b8/content.htm
    Reward if useful,,
    Thanks &  regards ,
    Sreekar.Kadiri.

  • Using a function module i want to create another function module

    Hi all,
            My requirement is by using a function module i want to create another function module(if needs modify action should also be done if i need this is for the created function module) and the main thing is that the function module which we are used to create is should be RFC enabled.
    Thanks,
    Vichu.

    Hi,
    You can do one thing... you write the BDC code in the function module name you are creating... so that if you call the function module in a program and execute that program and if you give the function module to be created in the selection screen of the program... in this way there is chance of creating another function module.
    Hope this would help you.
    Good luck
    Narin

  • Creating a function module in background

    Hi
    Is there any way by which if i want to create any function module in background .
    like in any screen i have created a button  and on pressing that button a blank fucntion module should be created in the function group that is already created .
    waiting for your reply.

    Hello, Ashish;
    When you mention a "Function Module" where are you trying to create it? The report designer? A .NET form?
    What version of Crystal Reports are you using?
    What version of Visual Studio .NET?
    What requirements are you trying to meet?
    Elaine

  • Howt 2 delta with the extractor created on Function Module..

    hi there,
    can anybody tell me how to update delta with the extractor created on Function Module..
    rgds,
    amol

    refer to the document at the below link
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/d3219af2-0c01-0010-71ac-dbb4356cf4bf
    Generic Extractor using FM with Delta Logic
    hope it helps,
    rgs,
    Parth.
    Edited by: Partho Mukherjee on Jan 12, 2009 6:00 PM

  • Creating BW Function module to extract R3 Function module data.

    Could you tell me how to create a BW Function Module to Extract data from  R/3 Function module?.
    Also, the BW function module needs to pass a date/time filter to R/3 function module basis which the R/3 function module passes the date/time restricted data to BW function module.
    Thanks,
    Gautam

    You will have to create a function module in R/3 and then call the same in BW using the RFC call function option.
    Please do not raise separate threads for each question - you have asked the same question in another post of yours..
    bw extraction using function module
    http://tinyurl.com/lwhtk8
    this will give you an idea on how you can achieve this.

  • Is it possible to call Normal function Module from WD4A , Not RFCs

    Is it possible to call Normal function Module(FM) from WebDynPro for ABAP , Not RFCs

    There is no difference, unless you are specifically calling the RFC to connect to another system. If so, then you need to add the DESTINATION keyword to the function call and specify the destination name. This name must be defined in SM59.  But, if you are not going to another system, you can call the RFC the same way you call the regular function module.
    REgards,
    Rich Heilman

  • How to delete Thr created functional module dynamically

    Hi All,
    How to delete Thr created functional module dynamically
    Regards,
    Lisa
    Message was edited by:
            Lisa Roy

    Hi,
    You can use the function module RS_FUNCTION_DELETE to do that.
    Make sure you are not deleting any standard FM's.
    Example
          call function 'RS_FUNCTION_DELETE'
               exporting
                    funcname          = 'ZFM_NAME" " Function modue name
                    suppress_popups   = 'X' " TO suppress any pop-ups that come when you delete
               exceptions
                    error_message     = 1
                    cancelled         = 2
                    function_released = 3
                    others            = 4.
    Regards,
    Sesh

  • I need to create RFC function module which creates the IDOC

    Hi-
    Any idea how to create RFC function module which creates the outbound IDOC. If you have any sample code please forward to me.
    Thanks,
    Sony

    My Problem is
    Whenever they create Invoice using T-code's like FV65(Parked Document), automatically should create IDOC's...
    I have used message type FIDCC1 but this message type is usefull only for Posting documents.
    1. Whenever they create parked document, entries will be stored in BKPF(Parked Document-Filed-BKPF-BSTAT = 'V') and Bseg....
    2. I have to read entries from those tables and should create IDOC...
    3. I checked FM's(FI_IDOC_CREATE_FIDCC1, FI_IDOC_PREPARE) but are not useful...
    4. Now I need to write one RFC function module and that FM should create the IDOC's....
    Can anyone please help me out?
    Thanks,
    Sony

  • How to create a Function Module

    Hi
    Please tell me the procedure to create a function module.
    Thanks in advance,
    Priya

    Hi Srinivas,
    In order to create a function module firstly you need to assign it to a function group.
    In order to create function group goto t-code se37.
    Choose Goto->Function groups-> Create group .
    Give the function group name.
    Then come back to se37 type in the name of your FM and then press <b>CREATE</b> button.

Maybe you are looking for

  • How to enable 802.11k in 6.1.2

    I'd like to make sure .11k is enabled on my IPHONE. I can see the RRM bit is set in the ASSOC REQ, but my AP doesn't recognize it as an RRM enabled device.

  • Embed Media Player from Myspace

    I am trying to embed media player from my myspace page onto my other website but the 'open player in new window' link doesn't seem to work on my second website. It works fine on my myspace page and I have copied the code from there. Does anyone know

  • My iPad air keeps turning itself off,why?

    My iPad air -purchased Oct 13 keeps turning itself off. Software updated. Can take up to 2 hours to turn on again. Anyone know why?

  • Horrible Customer Service from Verizon and Anytime Assurian Insurance is a SCAM

    I am posting this so everyone is aware how horrible the customer service has become at Verizon and the insurance replacement coverage offered.  Please read and BEWARE before purchasing this extended coverage as Verizon will NOT work with you!! We hav

  • Oracle DB among Multiple Sites

    Helo DBAs I have six sites running oracle databases, accessing between any of them at any time. 5 sites running Oracle 8i and One site running 11g. Each site having number of computers, installed with Oracle Client 8i All the sites connected by 64kbp