Function module in a program

Hi All,
I have created and tested the FM successfully, but can naybody guide me with regards to using the FM in the program.
My FM contains import parameters a and b of type i.
Export : res of type i.
I understand that we would have to use the pattern button to use the FM but any details would be great.
Regards,
Sagar

hi,
   supose ur function module has 2 import parameters and 1 export parameter then do the following in ur code where u r calling the function module:
=> declare 2 variables of the same type as import parameter
=> declare one variable of the same type as export parameter.
=> initialize these above declared variables(import parameters) with some value.
=> go to pattern and give ur function module name
=> ur function module structure will appear in  ur code.
=> pass on ur locally declared variables to import parameter.
=> if ur function module works properly then the o/p will be in the export parameter which u had declared locally.

Similar Messages

  • How to upload Excel file in BI using function module in abap program

    How to upload Excel file in BI using function module in abap program?

    Hi Anuj,
    To upload the file , you can try a standard program "RSEPSFTP" .
    while you execute the program , a selection screen appears in which the inputs should be give as
    RFC destination - The target server name
    FTP command- PUT
    local file - your file name
    local directory - path of your local file
    remote file - your target file name
    remote directory - where it has to be stored
    Hope this is useful for you
    Thanks & regards
    Anju

  • Which is better Function modules or Include programs?

    Hi,
    I am working on an enhancement and it has lot of screens with a tree structure on the left. Now we are planning to have each screen to have its PAI/PBO and the processing logic to be in seperate include programs.
    However in our team we have debate as to go in for include programs or for Function modules. The opinion here is that the program should not take long time to load if its going to be include programs.
    Please suggest what approach is better, is it Function modules or include programs.
    Any other suggestion is also welcome.
    Thank You,
    SAC.

    Thank You all.
    In this enhancement I have about 13 screens and has business logic in each. So if I go with each screens and business logic coding in seperate Function modules than includes under 1 function group is adviceable?
    Using object oriented approach is really the best thing here, but however most of my team members are not welversed in OO concepts. The deadlines are very tight for grooming my team members as well.
    My only concern is that with so much screens and business logic in 1 transaction should not bring down this programs performance when its executed.
    Any other suggestions to keep in mind for this is appreciated.
    Thank You.
    SAC

  • Standard Macro and Functional Module in HR -Programming.

    Hi friends,
    Could i know the difference between a standard macro and a function module in hr programming.
    how do we have to use that and what are the different std macro's and functional modules used in HR-Programming...
    Thanks in Advance..
    Regards
    Shiva

    You will find the macros in table TRMAC .
    Macros are set of pre defined instructions .
    You can define your own macros in the program using 'definition' command  or use standard macros.
    you will find most of the HR function module starting  with HR*  or RH * .
    You can get Macro  definition  /  its fundamental difference with function module on web .
    Hopw this is helpful

  • Function module or abap program

    Hello ABAP gurus,
           I need a function module or a program which can read and write into a transactional infocube. We have local currency as CAN and we wanted it to be overwritten as USD in the group currency. Here it is not a currency conversion as we are not changing the currency value but just the unit from CAN to USD. Note: No change with the transfer rules is allowed where USD can be given as a constant value. So the only option is either a function module or a ABAP program. So please any suggestion on this would be greatly appreciated.
    Thanks,
    anjali

    Hello ABAP gurus,
           I need a function module or a program which can read and write into a transactional infocube. We have local currency as CAN and we wanted it to be overwritten as USD in the group currency. Here it is not a currency conversion as we are not changing the currency value but just the unit from CAN to USD. Note: No change with the transfer rules is allowed where USD can be given as a constant value. So the only option is either a function module or a ABAP program. So please any suggestion on this would be greatly appreciated.
    Thanks,
    anjali

  • Function Modules and ABAP programs Where-Used

    Hi,
    Can anyone teach me on how to check where a function module or ABAP programs have been used? When I click the where-used button, there's nothing found but I know the FM/ABAP programs have been used somewhere.
    Thanks.

    Hi,
    This is very basic question, you simply need to go to transaction SE37 for FM and click on the where used list, in the next popup you will have to make proper selections, e.g. ABAP reports, FM's etc. then it will give you the list of objects where the current object is getting used.
    I am not sure whether we will have any where used list for SE38 programs, just check it out.
    Regards,
    Durgesh.

  • Updating liveCache Data using Function Module or ABAP program.

    Is it possible to update APO Live Cache using Function Module or ABAP Program.
    Will the aggregation/disaggreagation remain the same if data is modified using Function Module or ABAP Program.
    Regards,
    Vikas

    ello Vikas,
    -> Please click at
    http://help.sap.com/saphelp_nw04/helpdata/en/f2/0271f49770f0498d32844fc0283645/frameset.htm
    & read about 'SAP liveCache'.
    As you know objects stored in liveCache in the class containers can be accessed
    and manipulated only via LCA routines which are methods of LCA objects.
    The registration of the LCA routines is done automatically when
    the liveCache is started by the LC10, check the lcinit.log file.
    The shared procedures in the LiveCache are written in C++ and shipped
    to the customers as binary shared libraries(LCA-Routines) < LCA build >
    together with the LiveCache. The original C++ source code of the
    libraries is not generally available to the customers.
    The LCA routines could be called via "/SAPAPO/OM*" ABAP functions.
    -> For SAP liveCache documentation in English:
    http://help.sap.com/saphelp_nw04/helpdata/en/f2/0271f49770f0498d32844fc0283645/frameset.htm
    < -> Database Administration in CCMS: SAP liveCache -> liveCache Assistant ->
    liveCache: Monitoring -> Problem Analysis-> DB Procedures >
    In transaction LC10 for the LCA connection choose liveCache:Monitoring
    then go to Problem Analysis -> DB Procedures=>
    The system displays an overview of all database procedures loaded into
    liveCache, their input and output parameters, and other details.
    -> Tr. /n/SAPAPO/OM16 ( in further releases /n/sapapo/om19 ) is provided by
    SAP to get information about data stored in the LiveCache. If you would
    like to get your own views, you should write a special report in ABAP using
    "/SAPAPO/OM"-development class functionality.
    -> There are standard function modules in ABAP available to extract/change data from/in liveCache.
    -> In addition to the given information => find more information at:
    SCM 4.0 -> http://help.sap.com/saphelp_scm40/helpdata/en/12/3dfd81126e1c448c870f335f11d016/frameset.htm
    SCM 4.1 ->
    http://help.sap.com/saphelp_scm41/helpdata/en/12/3dfd81126e1c448c870f335f11d016/frameset.htm
    SCM 5.0 ->
    http://help.sap.com/saphelp_scm50/helpdata/en/12/3dfd81126e1c448c870f335f11d016/frameset.htm
    You can go to the Advanced Planner and Optimizer documentation from the above links < Supply Network Planning Run -> Aggregated Planning -> SNP Disaggregation Or SNP aggregation . >.
    If you still have open questions on the posted topic =>
    Could you please give more information on your application scenario.
    Thank you and best regards, Natalia Khlopina

  • Run time error due to custom function module in a program

    Hi,
    I  have created one program using custom function module ZIN_COMEV_CUSTDETAILNOTIF_OUT .The program is showing runtime error
    "Incorrect parameter with CALL FUNCTION."
    I have tested the FM using same set of parameter as in program it is working.It is throwing error while executing in program help.
    Regards
    Datta

    Hello Nagraj or harish
    I think you may be right.There is date  field in my function module ,when I am testing function module I am giving it as
    Y_DATE = 01.01.2011,but in program the field is DATS type and I have to give 20110101.If this is the problem how I can solve it.
    CALL FUNCTION 'ZIN_COMEV_CUSTDETAILNOTIF_OUT'
      EXPORTING
        Y_SENDER              = gv_g_sender
        Y_RECEIVER            = gv_g_reciever
        Y_PARTNER             = GV_V_PARTNER
        Y_BASIC_PROCESS       = GC_BASIC_PROCESS
      Y_SWITCHNUM           =
      Y_SEN_LOAD            =
        Y_INTUI               = GV_V_INTUI
      Y_TRANSACTIONID       =
        Y_DATE                = GV_V_DATE

  • Editi an existing function module though a program

    Hi All,
    Is there any to edit the existing code and/or parameters of an existing function module through another program.
    Is there any FM known or any other technique ?
    Please let me know.
    Thanks in advance,
    Archana

    Try transaction WE57 (assigning a function module to a logical message and IDoc type. In your case it should be function module
    BAPI_IDOC_INPUT1 (a more generic function module).

  • How to take back the control from RFC function module to calling program

    Hi,
    In our system landscape, more than 200 child systems are connected to Solution manager(SMP). I have copied a RFC enabled function module into all the child systems and calling that FM from Sol Man in sychronous mode.
    Here goes my code in SolMan.
    LOOP AT it_dest INTO wa_dest.
      CALL FUNCTION 'Z_GET_LOGIN_DETAILS' DESTINATION wa_dest-rfcdest
        EXPORTING
          date_fr               = s_date-low
          date_to               = s_date-high
        TABLES
          tab_data              = it_val
        EXCEPTIONS
          communication_failure = 1
          system_failure        = 2
          OTHERS                = 3.
      IF sy-subrc EQ 0.
    *     Updates zuserlogon
          MODIFY zt_logon_det FROM TABLE it_val.
          COMMIT WORK.
          WRITE:/'RFC for Destination', wa_dest-rfcdest, 'succesfully updated.'.
      ELSE.
          WRITE:/'RFC for Destination', wa_dest-rfcdest, ' failed.'.
      ENDIF.
    ENDLOOP.
    Few child systems are very slow & takes more than 20 minutes(Many of the times system hangs) to return the result. But I should not wait for so long. Even if the child system doesn't return any values in 5 minutes I shoud continue with other system ignoring the current one.
    I tried calling the FM in asynchronous mode(STARTING NEW TASK) but no success because only 6 DIA processes possible but as I said I have more than 200 systems connected to SolMan.
    Please help me resolving this problem.
    Thanks,
    Prathap

    If there are only few child systems with bad response time, use asynchronous call using a CALL FUNCTION func STARTING NEW TASK task DESTINATION dest PERFORMING subr or CALLING meth ON END OF TASK. Count asynchronous calls still running/waiting (increment a counter when creating a task (not the one used for task id). In the form/method performed at end of a call decrement the counter. When counter is lower than a limit, 4-5 if 6 processes (*), perform an asynchronous call else perform a synchronous call or wait until the counter falls below the limit.
    Regards,
    Raymond
    (*) Use SPBT_INITIALIZE at start of program to get actual number of free/available processes.

  • Mass Approval of Leave Request...need function module or any program

    Hi All,
    I have developed Custom Application in webdynpro java  for Leave,Travel,now i got the new requirements for mass approval of Leave and Travel can any baddy provide me any input ,i don't know which functional module or program i use , help gurus...
    Regards,
    Pramod gupta

    Refer below links to get an idea :
    uwl mass Approval- Select all option
    UWL Mass Approval XML changes or Custom App
    Mass leave approval?
    As an alternative to this service, you can use the Leave Request: Mass Approval report (RPTARQMASS_APPROVAL) in the back-end system. These reports enable you to approve multiple leave requests in batch.

  • Functional module in abap program

    hi guys,
    Do we have any OS specific Functional module  to be used in ABAP program.
    If so how to find this. please suggest me.
    Thanks.
    baasha

    hi,
    There is no such thing.
    Before you use any FM just confirm wheather it exists in that version or not
    in se37.
    If it is there you can always use that.
    regards,
    Guru
    mark if helpful

  • Subroutine in function module exit include program

    Hi Friend,
    I want to modularise the code inside the include program defined in funtion module exit. but it is giving out errors.
    Can any one help on this.
    Regards
    Gautham

    Hello Gautam,
    Use the PERFORM  (FORM ................. ENDFORM.) for modularizing the code inside the function module exit. You can not use the include inside the function module directly but once u create a  PERFORM  (FORM ................. ENDFORM.). Inside this  FORM ................. ENDFORM .. u can create any number of include's.
    I hope it will resolve your problem.
    Thanks.
    Anurag

  • Ways to call a ABAP Function module or ABAP Program from WAD

    Hi,
      Is there any way to execute an ABAP function module or program from the WAD?
    Thanks

    what you could do is create a bsp application which receives workbook id as url parameter.
    from WAD create a link to this BSP page and pass the wbook id in the url.
    within the BSP you can then read the excel as binary string like below
    select * from rsrwbstore into table wb_tab
          where workbookid = wbid.
    you can then set wb_tab-clustd as the response of the page with mime type to 'application/vnd.ms-excel'. which will open as excel
    Regards
    Raja

  • Function Module not released yet. Has anybody used them in their programs?

    Hi
    I am trying to use the barcode functionality during a goods movement 101 (using MIGO). As we donu2019t have any control of SAPu2019s barcode functionality thru configuration in MIGO I have developed a custom popup and I am calling this in a BADI implementation MB_MIGO_BADI. Once the user enters the barcode then I call Function module ARCHIV_BARCODE_GLOBAL to save the barcode to the standard tables.
    This Function module is not released to the customers and it was last changed on 11/12/2004.
    My question is should I be using this Function module in my BADI implementation even though it is not released (does not have a release date) ?. Has anyone of have used a unreleased Function module in your programs?.
    Additionally I need this info
    I am using ECC 5.0. If anyone of you is using ECC 6.0 or higher can you please check and let me know if this FM ARCHIV_BARCODE_GLOBAL is released or not or when was it last changed.
    Please advice me at you earlist
    Thanks of your time
    SHraj

    Hi,
    We are not using the above FM. But I can give some Info from ECC 6.0.
    In ECC 6.0 the above FM is realeased for customers.
    Last changed on:28.12.2004 18:28:16.
    You can use the same code in ur Z function module.
    Thanks and Regards

Maybe you are looking for