Help in Creation of a Function Module.

Hi Abapers,
                I am new to ABAP and hardly have knowledge abt it. I need to create a Function Module which is of the type RFC. Pls provide me information and steps to create the same.
Many thanks in Advance.

Hi Pooja,
Please follow the below steps to create a function module :
1. Goto Transaction code : SE37.
2. Create a Function Group first.
   a) From the Menu Bar Choose Goto -> Function groups ->  Create group.
   b) Specify the function group name and a short text.
   c) Choose Save.
When you create a new function group, the system automatically creates a main program containing two includes. Like any other programs and includes, you can display them in the Repository Browser.
3. Now create a Function Module.
4. Enter the function's name in the field Function module.
5. Choose Create.
6. In the Enter function group dialog box, enter the function group to which you want to assign the function module.
7. In The Attributes Tab select Remote Enabled Module (since you want a RFC function module ).
8. Give the Import and Export parameters and exceptions(if any).
9. Write the functioning part of the fuction module in the Source code tab.
10. Save and Activate your function Module.
Now go ahead and use your function module where ever you want.
Hope it helps.
Reward if helpful.
Regards
Hemant Khemani

Similar Messages

  • Help , if there exists a Function Module

    Hello everybody,
       I want a help whether SAP has some Function Module which can take an "Internal Table" as an Import Parameter and give us "CSV File" as an export parameter , more-or-less like the "GUI_DOWNLOAD" Function Module , which downloads the file as ".DAT" or ".ASC" .
        Please remember that i would need a CSV file , which i can read later through Opening a Dataset and transferring the contents into a file.
         Your immediate answers is most needed.
    Thanks,
    Suddha Laik

    hi suddha,
    try with GUI_DOWNLOAD with filetype as 'ASC' and
    give the filename as 'C:\TEST.CSV'.
    CALL FUNCTION 'GUI_DOWNLOAD'
      EXPORTING
      BIN_FILESIZE                    =
        FILENAME                        = 'C:\TEST.CSV'
       FILETYPE                        = 'ASC'
      APPEND                          = ' '
       WRITE_FIELD_SEPARATOR           = 'X'
      HEADER                          = '00'
      TRUNC_TRAILING_BLANKS           = ' '
      WRITE_LF                        = 'X'
      COL_SELECT                      = ' '
      COL_SELECT_MASK                 = ' '
      DAT_MODE                        = ' '
      CONFIRM_OVERWRITE               = ' '
      NO_AUTH_CHECK                   = ' '
      CODEPAGE                        = ' '
      IGNORE_CERR                     = ABAP_TRUE
      REPLACEMENT                     = '#'
      WRITE_BOM                       = ' '
      TRUNC_TRAILING_BLANKS_EOL       = 'X'
      WK1_N_FORMAT                    = ' '
      WK1_N_SIZE                      = ' '
      WK1_T_FORMAT                    = ' '
      WK1_T_SIZE                      = ' '
    IMPORTING
      FILELENGTH                      =
      TABLES
        DATA_TAB                        = itab
      FIELDNAMES                      =
    EXCEPTIONS
       FILE_WRITE_ERROR                = 1
       NO_BATCH                        = 2
       GUI_REFUSE_FILETRANSFER         = 3
       INVALID_TYPE                    = 4
       NO_AUTHORITY                    = 5
       UNKNOWN_ERROR                   = 6
       HEADER_NOT_ALLOWED              = 7
       SEPARATOR_NOT_ALLOWED           = 8
       FILESIZE_NOT_ALLOWED            = 9
       HEADER_TOO_LONG                 = 10
       DP_ERROR_CREATE                 = 11
       DP_ERROR_SEND                   = 12
       DP_ERROR_WRITE                  = 13
       UNKNOWN_DP_ERROR                = 14
       ACCESS_DENIED                   = 15
       DP_OUT_OF_MEMORY                = 16
       DISK_FULL                       = 17
       DP_TIMEOUT                      = 18
       FILE_NOT_FOUND                  = 19
       DATAPROVIDER_EXCEPTION          = 20
       CONTROL_FLUSH_ERROR             = 21
       OTHERS                          = 22.
    do reward if it helps,
    regards,
    priya.
    Message was edited by: Priya

  • Help in enhancing CRM logon function module

    Hello all,
    We have a situation where in the past we have allowed the creation of multiple Business Partners sharing the same e-mail address. We are about to close this loophole but we have this as a master data issue for some existing Customers/Business PArtners.
    Currently, our CRM Webshop only uses e-mail address and password for login verification (not using Business Partner/Customer number).
    We would like to enhance the webshop logon to include customer number as well ie. We want to determine which customer number associated with the ambiguous e-mail address is used. I have attempted to identify which function module is involved by inserting an endless WHILE loop into the following , but none of them seems to be called :
    CRM_ICSS_USER_LOGIN
    CRM_ISA_IUSER_LOGINr
    CRM_ISAI_BP_LOGIN_BPARTNER_GET
    CRM_ISA_BP_LOGIN_CHECK
    CRM_ISA_LOGIN_R3USER_CHECK
    CRM_ISA_IUSER_LOGIN
    CRM_ISA_LOGIN_CHECK
    CRM_ISAI_BP_LOGIN_BPARTNER_GET
    In addition I notice the function SUSR_CHECK_LOGON_DATA can not be enhanced as it's a Basis FM.
    I have attempted to look up documentation in SAP Help and not much joy. Can anyone tell me whether I'm barking up the wrong tree and this needs to be addressed by a kernel level function or recommend another place in the standard code ?
    Regards,
    Gabriel

    Hi Pooja,
    Please follow the below steps to create a function module :
    1. Goto Transaction code : SE37.
    2. Create a Function Group first.
       a) From the Menu Bar Choose Goto -> Function groups ->  Create group.
       b) Specify the function group name and a short text.
       c) Choose Save.
    When you create a new function group, the system automatically creates a main program containing two includes. Like any other programs and includes, you can display them in the Repository Browser.
    3. Now create a Function Module.
    4. Enter the function's name in the field Function module.
    5. Choose Create.
    6. In the Enter function group dialog box, enter the function group to which you want to assign the function module.
    7. In The Attributes Tab select Remote Enabled Module (since you want a RFC function module ).
    8. Give the Import and Export parameters and exceptions(if any).
    9. Write the functioning part of the fuction module in the Source code tab.
    10. Save and Activate your function Module.
    Now go ahead and use your function module where ever you want.
    Hope it helps.
    Reward if helpful.
    Regards
    Hemant Khemani

  • Problem in the creation of rfc function module

    hi,
                I am creating one rfc function module comparing to standard non-rfc function module. In that one i have one export parameter with the standard strcture type. but this stcture component contains with strcture type. among all these components four fields are common. but when i am trying to activate function module it is giving message you cannot use internal tables, strings,references, or strctures as components. that function module name is BAL_FILTER_CREATE and that export parameter name is that export parameter name is E_S_LOG_FILTER that associated type is BAL_S_LFIL. how can i solve the problem. pls give me solution as soon as possible.

    hi,
    for rfc fm's u should enable the call by value check box which will appear on that of import and export parameters. tick that one for each parameter in rfc and activate.
    if helpful reward some points.
    with regards,
    Suresh Aluri.

  • Very urgent help needed in activating a function module

    Hello experts.
    I had a standard report and i copied into an z report. i need to change some field output , and that field is there in a standard function module.so i copied that fun module  into z fun module and stored in a new fun group. Now it is showing the error in the z fun module. include in the fun module is giving the error stating that it is not existing. please help me in coping the standard fun module correctly . please its very urgent.

    Hi,
    You should not copy a Function module alone, as it will have some dependant INLCUDES and global data in TOP include of the function group.
    SO if you want the function module copy the entire Function Group into Z function group.
    Regards,
    Sesh

  • Help on Parameters in RFC Function Module

    Hi,
    I am creating a RFC function module. The requirement is:
    In a report program, the user enters ABC and XYZ values on the selection screen. These 2 fields are select options so will have From-Value and To-Value. This report program will pass these values to my RFC FM and depending upon these values I have to read a DB table and pass the data back to the program.
    My doubt is, how should I intake these select options value? i.e should I specify them in import tab or tables tab? What TYPE/LIKE should I use?
    Please help me in this...
    Rgds,
    Nimma.

    Hi Anji,
    What is 'WSELKUNNR'? Is it a user defined type?
    I am doing as below in the IMPORT tab.
    Parameter name/Type Spec/Associated Type
    ABC/LIKE/
    I am not sure what type I have to use here as the incoming values will be of type SELECT-OPTIONS. Is there any standard type to specify here? If not, what should I do?
    Best Regards,
    Nimma.

  • Search help in  output(using alvgrid function module)

    HEllo Experts,
        I hav developed report using ALV grid function module, now my req is I need to provide the search help for particular field in the output.
    my output contains .MATNO, PLANT AND STORAGE LOCATION.
    Now based on mat and plant I need to provide the F4 help for storage location field in the out put.
    could u pls anbody help me on the req asap. with details code.
    will give u Full point if it suits my req....

    Hi Raja,
    This is what you can try to do....first select the sales org and distribution channel for the value entered in the material in an 2 separate internal tables.
    Then use the FM 'F4IF_INT_TABLE_VALUE_REQUEST' for each internal table to get a search help for the sales org and distribution channel for any particular material number.
    Please write the code at AT SELECTION-SCREEN ON VALUE-REQUEST event.
    or,
    try this code.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_salesorg.
    select salesorg from tablename into itab where matnr = p_matnr(selction screen value).
    if sy-subrc eq 0.
    CALL FUNCTION 'POPUP_WITH_TABLE_DISPLAY'
    EXPORTING
    ENDPOS_COL =
    ENDPOS_ROW =
    STARTPOS_COL =
    STARTPOS_ROW =
    TITLETEXT =
    TITLETEXT =
    IMPORTING
    CHOISE = W_LINEN0
    TABLES
    VALUETAB = itab
    EXCEPTIONS
    BREAK_OFF = 1
    OTHERS = 2.
    IF SY-SUBRC EQ 0.
    READ TABLE itab INDEX W_LINENO.
    IF SY-SUBRC EQ 0.
    P_salesorg = itab-salesorg.
    endif.
    endif.
    similarly for distribution channel pass sales org ....
    kindly reward if found helpful.
    cheers,
    Hema.

  • PM Notification creation using BAPI_ALM_NOTIF_CREATE Function module

    Hi Experts,
    I am creating PM Work order using Custom BAPI which is being invoked by third party system and Imports data from third party system,including the IT_OBJECTLIST.Custom BAPI would Validate the data and by calling the Satandard BAPI BAPI_ALM_ORDER_MAINTAIN it will create the PM Order.
    Once the Order is created i am Calling the Function modules BAPI_ALM_NOTIF_CREATE,BAPI_ALM_NOTIF_SAVE,BAPI_TRANSACTION_COMMIT to create the Notifications for the Equipments in IT_OBJECTLIST structure imported by custom BAPI.
    To my surprise this sequence of function modules are not creating any Notifications in the Objects tab in Order.where as i called the same sequence of function modules in a report Program which is successfully creating the notification.
    i doubt calling BAPI function module to update Notification withing  BAPI Function module may not work.
    could you please help me how to proceed in this case.

    Hi,
    The functional location affected is set to the reference f/l unless a different value is specified.
    That field is not available in BAPI_ALM_NOTIF_CREATE, it is not available in the MODIFY bapi either - so not possible to create then modify.
    You can set a value for the field in exit QQMA0025 / EXIT_SAPLIQS0_017. This is called by the BAPI but you would need to find a way to get the required value from your calling program into the exit.
    -Paul

  • Noob help with creating a new function module

    Hi everyone,
    I'm just learning SAP and trying to integrate a WMS system towards it and I'm losing hair over it hehehe
    The scenario is that I want to extract Purchase Order Rows details and that's not a hard thing to do since there are multiple BAPIs that can be invoked, for example BAPI_PO_GETDETAIL.
    I'm using .NET Connector 3 to talk to SAP.
    The problem however is that I want to see how many articles that have already been delivered into the warehouse using BAPI_GOODSMVT_CREATE. There is no information returned when using BAPI_PO_GETDETAIL that specifies that a Purchase Order Row has a quantity of 30 and that 20 has already been delivered.
    That information can be retrieved by using BAPI_GOODSMVT_GETITEMS.
    The problem with using BAPI_GOODSMVT_GETITEMS is that it returns all of the rows and I am only interrested in retrieveing the rows with quantity for a specific purchase order.
    So i decided to create my own BAPI or Function Module (or whatever it's called) that would take a PO_NUMBER and PO_ITEM and return the quantity of already delivered items. For example if one of the PO Rows (10) has 100 items and there has been 2 partial deliveries of 20 and 30. The function should return the value of 50 because it's the sum of 20 and 30.
    My code looks like this:
    FUNCTION ZBAPI_GOODSMVT_GETITEMS.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(PO_NUMBER) TYPE  BSTNR
    *"     VALUE(PO_ITEM) TYPE  EBELP
    *"  EXPORTING
    *"     REFERENCE(ENTRY_QNT) TYPE  ERFMG
    SELECT SUM( MENGE ) INTO ENTRY_QNT FROM MSEG
      WHERE
      EBELN = PO_NUMBER AND
      EBELP = PO_ITEM.
    ENDFUNCTION.
    The problem is that when i try to Activate it it says:
    REPORT/PROGRAM statement missing, or program type is INCLUDE.          
    What am i missing? Is there an easier way to extract already delivered quantities when extracting PO information?

    A document was produced for Designer 7.1 and the principles still apply.
    http://partners.adobe.com/public/developer/en/pdf/lc_designer_perf_guidelines.pdf
    You can poke around here as well....
    http://help.adobe.com/en_US/livecycle/9.0/designerHelp/index.htm
    Steve

  • Error in creation of custom function module.

    hi,
              i am trying to create custom rfc enabled function module by copying the standard function module prgn_profile_name_get. in the export parameter PROFILE_FROM_TPRPROF what is the type i have to associate for this parameter. when i try to compare with char30 it is giving the error "char30 must be a flat strcture.you cannot use internal tables,strings,references,or strctures as components.
                          please solve my problem.

    Hi,
    Leave it blank ,..
    You can get any type of value into it.
    regards,
    nazeer

  • Help required in bapi or function module..

    Hi,
    Is there any BAPI or Function Module to get cost center description by giving cost center as input parameter? please suggest me.Thanks in advance.
    Regards,
    Sandy.

    Hi,
    write a simple select query instead of FM or BAPI.
    select single ltext
    into lv_ltext
    from cskt
    where spras = sy-langu
    and kokrs = lv_kokrs           " put your controlling area
    and kostl = lv_kostl             "put your cost center
    and datbi = lv_datbi.          "put your valid-to date
    Thanks,
    Srilakshmi.
    Edited by: Srilakshmi Moola Ram on Sep 17, 2009 7:19 AM

  • Need help in INBOUND idoc generation function module!

    Can anyone send me the inbound idoc function module !
    i have the outbound code but i need the inbound code

    Might be a constant C_WF_RESULT_OK is assigned to
    variable WORK_RESULT .
    Please check if they are declared in the function module ..

  • IS Oil specific Sales Order Creation thru any Function Module

    Hi All,
    Do you know any FM which can be used to create Sales Orders for Oil specific values.
    there is a FM which creates the Sales Contracts - RFC_SDCONOIL_CREATEFROMDATA. Can we use this FM to create the Sales Orders.
    Thanks
    Pankaj

    Hi Pankaj,
    You can use the TAS function module OIK_SD_CALLOFF_CREATE for creating a sales call-off with Oil specific values.
    There is no documentation for the function module. You would have to browse through the FM to know the usage for your requirements.
    If you need an example for using the function module you can look at the TSW FM OIJ_EL_DOCG_CREATE_SD_CALLOFF. This function module is used for creating a call-off through TSW ticketing..
    Best Regards
    Vishnu

  • Errors in the creation of the function module

    hi,
          i created one rfc enabled funtion module but it is giving the errors when activating it. it is giving the error report/program statment  missing, or program type is i (include). i am getting this error pls any body help me in solving this problem.

    Hi,
    Go To SE80 and Select Function Group.
    Select your Function Group and Right Click it and activate.
    It will solves your problem.
    Thanks,
    Reward If Helpful.

  • Creation of RFC function module

    Hi experts,
            My requirement is, an XML file is coming from non sap to middleware in XML format. Middleware converts it into sap format and  it will access the RFC, i.e., BAPI, which will be created by me and updates the same in CRM.
           There is one mapping sheet given, ie., from source format to destination format.Now the point is,  for creation of BAPI, what should be taken as parameters, ie import, export   etc., Can I take the destination fields as importing and table parameters? Please suggest  
    Rgds,
    Gsaasg.

    Hi,
    If I understand your requirement correctly, you want how the mapping file will be used to decide the import and export parameters of your BAPI.
    Though we should have a look at the mapping sheet, but it is more useful to the middleware person. The middleware person will use them to create a mapping on their side. Once teh data from legacy will be received by them, those data will be mapped to respective SAP format. This format will be shared to them by you.
    Let them know of your import parameter details, and what data you expect in each field. This will help them map the data correctly.
    We should create the standard ABAP structure as per the data coming in XML, and should be used as the import parameter.
    For ex:
    if the XML file is:
    <ContactInfo>
           <address>
               <city>XYZ</city>
               <postcode>ABCDEF</postcode>
            </address>
             <Number>
                   <type>Mobile</type>
                   <No>0123456789</No>
              </Number>
    </ContactInfo>
    then we have to create a structure as ZCONTACTINFO, with two components ADDRESS and NUMBER.
    ADDRESS will be of structure ZADDRESS with two components CITY and POSTALCODE.
    NUMBER should be of a table type with line type containing TYPE and NO. (as Number node can contain multiple entries..one for mobile, one for home, one for office)
    And this CONTACTINFO will be the IMPORT parameter in your RFC FM.
    In your case, no export parameter is to be maintained. Only thing is that we should understand the XML well.
    Hope this clarifies your case.
    Regards,
    Susanta

Maybe you are looking for

  • Problem with preloader not passing over nextFrame();

    The preloader I created doesn't transistion to the next frame, it just hangs on the preloader frame at 0%.  Here is my code: stop(); loaderInfo.addEventListener(ProgressEvent.PROGRESS, updatePreloader); function updatePreloader (evtObj:ProgressEvent)

  • Adding address book to a backup

    I'd like to backup the address book database with Retrospect. Where is the address book data stored so I can add it to be backed up? I know that I can make a backup of it with exporting it but that's not what I want - I want it to be automated.

  • Removing desktop icon of NFS mounted drive

    Hi, I have an NFS mounted drive (on a linux server) on my mac mini, running OS 10.4. I don't want the icon to appear on the desktop. Is there any way to remove this? The reason is as follows: - the NFS mounted directory is of the form servername:/hom

  • Blank CC App

    I just down loaded the trial CC app. When it opens the white box is blank/empty. Help? I am running Windows 8.1 on a Dell Inspiron 11 3000 series thanks

  • License server communication problem: E_ADEPT_INTERNAL ??

    When our customer downloads an epub link created by the adobe content server: http://acs.riverwatcher.com:8080/fulfillment/URLLink.acsm?action=enterorder&ordersource=Sa gamore+Publishing+Store&orderid=1069267236_0&resid=urn%3Auuid%3A183e17c3-e5e3-43d