Tables parmeters in the subroutienes and function modules

Does we use tables parameter in the sub routienes and in function modules?
Moderator message: please search for available information/documentation.
Edited by: Thomas Zloch on Mar 10, 2012 4:56 PM

hi,
goto: system-utilities- debug system
A.
Message was edited by: Andreas Mann

Similar Messages

  • Tracing Form and Function modules using SE30

    Hi,
      I want to trace only the Forms and function modules that are executed by a program using SE30. I have tried setting the variants in different ways but it still gives lot of junk information which i dont need. How can I set up the variant so that it only traces Forms and function modules executed by a program?
    Will give points to right answer. Thanks for reading

    Hi Srikrishna,
    First of all create a vraian tin SE30. While creating the variant, in th Tab 'Duratn/Type' select the radio buton 'NONE'. Now execute yur program and then analyse.Select 'GROUP HIT LIST' Icon which gives Function Modules,Subroutines etc.
    Regards,
    Srinivas.

  • What is the difference between subroutine and function module?

    What is the difference between subroutine and function module?

    Hi,
    they can both return values.
    FMs are mainly used when a routine is to be performed by many programs.
    Subroutines (forms) are generally only executed within one program.
    You can perform routines from other programs, but it's not often done.
    both forms and FMs are reusable modularization units.
    To distinguish we generally say that forms are used for internal modularization and
    FMs are used for external modularization.
    To decide on which to implement, consider whether you need the content to be used just for a limited program
    or wheteher it can be called from many independent programs.
    For the first purpose it is better to implement a form whereas for the second we implement an FM.
    However, ABAP does not isolate the usage context.
    That is; you can call a form from another program within whose code the form is not actually implemented.
    However, this requires attention since the form may utilize global variables.
    The same issue holds for FMs.
    FMs are encapsulated in function groups and function groups may have global variables that can be globally
    used by all FMs inside it.
    Thanks,
    Reward If Helpful.

  • Name fo table whcih stores names of  all function modules

    I want to create list of all the Z function modules in the system present in an excel file...Can u tell me the name of table where all the names of fucntion modules are stored in SAP..I found that the names of funtion groups and Z programs are stored in table TADIR..but i did not find function modules name  there....

    Hi
      TFDIR is the table that contains all the FMs.
      TRDIR is the table that contains all the Reports.
    Regards,
    Sreeram

  • How to write the exceptions in function module

    dear all,
         how to write the exceptions in function modules with example.
    thanq
    jyothi

    Hi,
    Raising Exceptions
    There are two ABAP statements for raising exceptions. They can only be used in function modules:
    RAISE except.
    und
    MESSAGE.....RAISING except.
    The effect of these statements depends on whether the calling program handles the exception or not. The calling program handles an exception If the name of the except exception or OTHERS is specified after the EXCEPTION option of the CALL FUNCTION statement.
    If the calling program does not handle the exception
    · The RAISEstatement terminates the program and switches to debugging mode.
    · The MESSAGE..... RAISING statement displays the specified message. Processing is continued in relation to the message type.
    If the calling program handles the exception, both statements return control to the program. No values are transferred. The MESSAGE..... RAISING statement does not display a message. Instead, it fills the system fields sy-msgid, sy-msgty, sy-msgno , and SY-MSGV1 to SY-MSGV4.
    Source Code of READ_SPFLI_INTO_TABLE
    The entire source code of READ_SPFLI_INTO_TABLE looks like this:
    FUNCTION read_spfli_into_table.
    ""Local Interface:
    *" IMPORTING
    *" VALUE(ID) LIKE SPFLI-CARRID DEFAULT 'LH '
    *" EXPORTING
    *" VALUE(ITAB) TYPE SPFLI_TAB
    *" EXCEPTIONS
    *" NOT_FOUND
    SELECT * FROM spfli INTO TABLE itab WHERE carrid = id.
    IF sy-subrc NE 0.
    MESSAGE e007(at) RAISING not_found.
    ENDIF.
    ENDFUNCTION.
    The function module reads all of the data from the database table SPFLI where the key field CARRID is equal to the import parameter ID and places the entries that it finds into the internal table spfli_tab. If it cannot find any entries, the exception NOT_FOUND is triggered with MESSAGE ... RAISING. Otherwise, the table is passed to the caller as an exporting parameter.
    Calling READ_SPFLI_INTO_TABLE
    The following program calls the function module READ_SPFLI_INTO_TABLE:
    REPORT demo_mod_tech_fb_read_spfli.
    PARAMETERS carrier TYPE s_carr_id.
    DATA: jtab TYPE spfli_tab,
    wa LIKE LINE OF jtab.
    CALL FUNCTION 'READ_SPFLI_INTO_TABLE'
    EXPORTING
    id = carrier
    IMPORTING
    itab = jtab
    EXCEPTIONS
    not_found = 1
    OTHERS = 2.
    CASE sy-subrc.
    WHEN 1.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno.
    WHEN 2.
    MESSAGE e702(at).
    ENDCASE.
    LOOP AT jtab INTO wa.
    WRITE: / wa-carrid, wa-connid, wa-cityfrom, wa-cityto.
    ENDLOOP.
    The actual parameters carrier and jtab have the same data types as their corresponding interface parameters in the function module. The exception NOT_FOUND is handled in the program. It displays the same message that the function module would have displayed had it handled the error.
    Or
    just have to decide what exceptions u want and under what conditions.
    then declarethese exeptions under the exceptions tab.
    in the source code of ur function module.
    if
    like this u can code .
    now when u call the function module in tme mainprogram.
    if some error occurs and u have declared a exception for this then it will set sy-subrc = value u give inthe call of this fm.
    in the fm u can program these sy-subrc values and trigger the code for ur exception.
    Please reward if useful
    Regards,
    Ravi
    Edited by: Ravikanth Alapati on Mar 27, 2008 9:36 AM

  • 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 Groups and Function Modules

    Hi,
    Can anyone give me the detail steps for creating Function Group and then from that function group creation of function module with example?
    Regards,
    Chandru

    Hi,
    Function Group creation -
           A function group is a program that contains function modules. With each R/3 system, SAP supplies more than 5,000 pre-existing function groups.
         In total, they contain more than 30,000 function modules. If the functionality you require is not already covered by these SAP-supplied function modules, you can also create your own function groups and function modules.
          We can put all the relevant function modules under one function group and all the global variables can be declared in this FG.
    FG Creation:
    1)     Function group can be created in SE80. There choose the 'Function Group' from the list of objects.
    2)    Then give a name for ur function group (starts with Y or Z) and press ENTER.
    3)   The click 'YES' in the create object dialog box and give a short desc. for this FG and save.
    Function Module:
                 A function module is the last of the four main ABAP/4 modularization units. It is very similar to an external subroutine in these ways:
    Both exist within an external program.
    Both enable parameters to be passed and returned.
    Parameters can be passed by value, by value and result, or by reference.
    The major differences between function modules and external subroutines are the following:
    Function modules have a special screen used for defining parameters-parameters are not defined via ABAP/4 statements.
    tables work areas are not shared between the function module and the calling program.
    Different syntax is used to call a function module than to call a subroutine.
    Leaving a function module is accomplished via the raise statement instead of check, exit, or stop.
    A function module name has a practical minimum length of three characters and a maximum length of 30 characters. Customer function modules must begin with Y_ or Z_. The name of each function module is unique within the entire R/3 system.
    Defining Data within a Function Module
    Data definitions within function modules are similar to those of subroutines.
    Within a function module, use the data statement to define local variables that are reinitialized each time the function module is called. Use the statics statement to define local variables that are allocated the first time the function module is called. The value of a static variable is remembered between calls.
    Define parameters within the function module interface to create local definitions of variables that are passed into the function module and returned from it (see the next section).
    You cannot use the local statement within a function module. Instead, globalized interface parameters serve the same purpose. See the following section on defining global data to learn about local and global interface parameters.
    Defining the Function Module Interface
    To pass parameters to a function module, you must define a function module interface. The function module interface is the description of the parameters that are passed to and received from the function module. It is also simply known as the interface. In the remainder of this chapter, I will refer to the function module interface simply as the interface.
    To define parameters, you must go to one of two parameter definition screens:
    1) Import/Export Parameter Interface
    2) Table Parameters/Exceptions Interface
    Then in the FM interface screen, give the following
    1) Import parameters
    2) Export parameters
    3) Changing parameters
    Then give
    1) Define internal table parameters
    2) Document exceptions
    You enter the name of the parameter in the first column and the attributes of the parameter in the remaining columns. Enter one parameter per row.
    Import parameters are variables or field strings that contain values passed into the function module from the calling program. These values originate outside of the function module and they are imported into it.
    Export parameters are variables or field strings that contain values returned from the function module. These values originate within the function module and they are exported out of it.
    Changing parameters are variables or field strings that contain values that are passed into the function module, changed by the code within the function module, and then returned. These values originate outside the function module. They are passed into it, changed, and passed back.
    Table parameters are internal tables that are passed to the function module, changed within it, and returned. The internal tables must be defined in the calling program.
    An exception is a name for an error that occurs within a function module. Exceptions are described in detail in the following section.
    Syntax for the call function Statement
    The following is the syntax for the call function statement.
    call function 'F'
        [exporting   p1 = v1 ... ]
        [importing   p2 = v2 ... ]
        [changing    p3 = v3 ... ]
        [tables      p4 = it ... ]
        [exceptions  x1 = n [others = n]].
    where:
    F is the function module name.
    p1 through p4 are parameter names defined in the function module interface.
    v1 through v3 are variable or field string names defined within the calling program.
    it is an internal table defined within the calling program.
    n is any integer literal; n cannot be a variable.
    x1 is an exception name raised within the function module.
    The following points apply:
    All additions are optional.
    call function is a single statement. Do not place periods or commas after parameters or exception names.
    The function module name must be coded in uppercase. If it is coded in lowercase, the function will not be found and a short dump will result.
    Use the call function statement to transfer control to a function module and specify parameters. Figure 19.9 illustrates how parameters are passed to and received from the function module.
    sample FM
    CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
    EXPORTING
      I_INTERFACE_CHECK                 = ' '
      I_BYPASSING_BUFFER                = ' '
      I_BUFFER_ACTIVE                   = ' '
      I_CALLBACK_PROGRAM                = ' '
      I_CALLBACK_PF_STATUS_SET          = ' '
      I_CALLBACK_USER_COMMAND           = ' '
      I_CALLBACK_TOP_OF_PAGE            = ' '
      I_CALLBACK_HTML_TOP_OF_PAGE       = ' '
      I_CALLBACK_HTML_END_OF_LIST       = ' '
      I_STRUCTURE_NAME                  =
      I_BACKGROUND_ID                   = ' '
      I_GRID_TITLE                      =
      I_GRID_SETTINGS                   =
      IS_LAYOUT                         =
      IT_FIELDCAT                       =
      IT_EXCLUDING                      =
      IT_SPECIAL_GROUPS                 =
      IT_SORT                           =
      IT_FILTER                         =
      IS_SEL_HIDE                       =
      I_DEFAULT                         = 'X'
      I_SAVE                            = ' '
      IS_VARIANT                        =
      IT_EVENTS                         =
      IT_EVENT_EXIT                     =
      IS_PRINT                          =
      IS_REPREP_ID                      =
      I_SCREEN_START_COLUMN             = 0
      I_SCREEN_START_LINE               = 0
      I_SCREEN_END_COLUMN               = 0
      I_SCREEN_END_LINE                 = 0
      I_HTML_HEIGHT_TOP                 = 0
      I_HTML_HEIGHT_END                 = 0
      IT_ALV_GRAPHICS                   =
      IT_HYPERLINK                      =
      IT_ADD_FIELDCAT                   =
      IT_EXCEPT_QINFO                   =
      IR_SALV_FULLSCREEN_ADAPTER        =
    IMPORTING
      E_EXIT_CAUSED_BY_CALLER           =
      ES_EXIT_CAUSED_BY_USER            =
      TABLES
        t_outtab                          =
    EXCEPTIONS
      PROGRAM_ERROR                     = 1
      OTHERS                            = 2
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Example
    1  report ztx1905.
    2  parameters: op1 type i default 2,   "operand 1
    3              op2 type i default 3.   "operand 2
    4  data rslt type p decimals 2.        "result
    5
    6  call function 'Z_TX_DIV'
    7       exporting
    8            p1      = op1
    9            p2      = op2
    10      importing
    11           p3      = rslt.
    12
    13 write: / op1, '/', op2, '=', rslt.
    Regards,
    Shanthi.P
    Reward points if useful ****
    Edited by: shanthi ps on Jan 26, 2008 12:03 PM

  • What are the parameters of Function Module

    Hi,
    What are the parameters of Function Module?

    Function Modules are special external subroutine stored in a central library. The R/3 system provides numerous predefined function modules that you can call from the ABAP/4 programs.
    All the function Modules are created under the Function Groups. Function Groups are nothing but the related group of function modules.
    The function modules can be maintained through T.CodeSE37 and T.Code SE80.
    In general the function module has the following components.
    Documentation:
    This is the place where you can find the discription/purpose of the function module.
    Import & Export Parameters.
    Import parameters correspond to the formal input parameters of subroutines. They pass data from the calling program to the function module.
    Export parameters correspond to the formal input parameters of subroutines. They pass data from the function module back to the calling program.
    Table Parameters.
    Table parameters are internal tables. Internal tables are treated like changing parameters and are always passed by reference.
    Exceptions.
    Exceptions are used to handle error scenarios which can occur in the function modules. The function modules checks for any type of error and raise exception and returns SY-SUBRC value to the calling program.
    Source Code:
    the programming logic of the function module is written in this source code.
    Rewards if useful.

  • Tracking the execution of Function Modules

    Hi there,
    for ABAP reports there is an enhancement S38MREP1 'Exit at Start report' in transaction CMOD available which could be used e. g. to track the execution at least of executable programs (TRDIR-SUBC = 1); limitation: it is executed before the selection screen, so no guarantee that a certain program is really submitted afterwards.
    Is there something similar available in release 4.5B (or in any higher release?) or how can I track the execution of function modules in the customer name space in a smart way?
    Thanks in advance for any support,
    Peter

    Expanding a bit on Seigfried's post,  you could write a little function module with with a parameter which would be function module name and it would update a custom table everytime it is executed.
    Put this function call at the end of the function module that you want to log.
    call function 'Z_LOG_FUNCTION_EXECUTION'
          exporting
             fcname = 'Z_THE_NAME_OF_THE FUNCTION'.
    The code inside this function module could be something like this.
    ztable-fcname = fcname.
    ztable-uname  = sy-uname.
    ztable-datum  = sy-datum.
    ztable-uzeit  = sy-uzeit.
    insert ztable.
    Regards,
    Rich Heilman

  • Clarification on some reading: Datasource and Function Module extraction

    Hi,
    I found a link on Help.sap which explains how to create a function module and I have some questions after my review:
    It basically uses function module to read some filght data from the table SPFLI
    1.
    I got into this research since one of the methods for data extraction from R3/ECC to BW is through Function Modules.
    Why couldn't that extraction be based on a view of the table SPFLI.
    i.e. why is this complication of writing an ABAP code to achieve something which could be done with a DB view or table?
    2.
    Any example or scenario where you think a datasource could NOT be created based on a table, Database View or Sap Query and that it must be done with a Function Module?
    3.
    So, once the function module is successfully created; how to do create a Datasource based on this function modeule to take care of the delta's on the source data?
    4.
    There was a discussion about "remote function call" which I did not get completely. Will extracting data from R3/ECC to BI be regarded as "remote call"
    Thanks

    1. Why couldn't that extraction be based on a view of the table SPFLI. i.e. why is this complication of writing an ABAP code to achieve something which could be done with a DB view or table?
    A DataSource could have been created directly from table SPFLI. It was used as an example in the case of the document is my guess. There are some table types, however, that you cannot create a DataSource directly off of.
    2. Any example or scenario where you think a datasource could NOT be created based on a table, Database View or Sap Query and that it must be done with a Function Module?
    Pool/Cluster tables cannot be directly read and therefore must use a Function Module for extraction. Another reason for using a Function Module, even against a single table, is in the case that you have more than one field that you want to create a generic delta against. SAP delivers the capability in the application to set a generic delta on only one field within the DataSource. If there is more than one, say created on and changed on dates, a Function Module is require in order to enable that.
    3. So, once the function module is successfully created; how to do create a Datasource based on this function modeule to take care of the delta's on the source data?
    Go to tocde RSO2, enter the DataSource name, click on the Create button. In the next screen, there are three buttons toward the top to tell what is the source of the DataSource: 1) Extraction from View (default); 2) Extraction from Query; and 3) Extraction from Function Module. When you click on the Extraction from Function Module button, the View/Table field will gray out and the Function Module and Extraction Structure fields will un-gray.
    4. There was a discussion about "remote function call" which I did not get completely. Will extracting data from R3/ECC to BI be regarded as "remote call"
    I think that this is referring to a process whereby you create a remote-enabled Function Module on the source R3/ECC system and then create an ABAP program in BW that calls that remote-enabled Function Module. Basically, the ABAP program on BW would send some parameters through to the remote-enabled Function Module on R3/ECC. The Function Module would extract data into an internal table and then pass that internal table back through to the ABAP program in BW for further processing.
    Edited by: Dennis Scoville on Aug 20, 2009 8:18 AM

  • Diff b/w BAPI and Function Module.

    What is the difference between BAPI and Function Module....
    By Interface programming do we mean posting data thru  BAPI,BDC....

    Hi Alex,
    BAPI: Standard Interface in the R/3 system that allows the system to communicate with components of other business suites.
    FM: These are the procedures that are defined in the Function Groups and can be called from any ABAP Program. FM allow you to encapsulate and reuse global functions int he R/3 system.
    The main basic difference between BAPI and FM are
    1) All BAPIs are FM but not all FMs are BAPIs
    2) BAPIs are remote enabled
    3) BAPIs interface will not have a changing and exceptions. They can not be used to have use dialog.
    Interface programs can post data to SAP either through a BDC, BAPI, IDOC etc. It depends on the type of requirement.
    Hope this solves your question.
    Enjoy SAP
    Rajasekhar

  • How to raise the exception in function module

    Dear abaper's.
                   I am creating a Function module .In that in' EXCEPTION' Tab i am giving
    3 exception .1.NO_DATA_FOUND 2.NO_PRINTER_FOUND 3.SMARTFORM_INTERFACE_NOT_FOUND.
    In my coding if this condtion matches i want to raise this exception.how can i do this in my coding .can any one suggest me..
    advance thanks,
    Warm regards,
    Veera

    Hi,
    if that condition is not satisfied,and u didn't handle that exception while calling function module then in the runtime error u will get the text as the description of the exception in function module definition.
    rgds,
    bharat.

  • Difference between bapi and function module

    Can you guys tell me what are the differences in calling bapis and function modules?
    I see we are calling both as the same way we call function modules. May be for bapis, we need to be careful in declaring and passing those exact structures. Can you please make it clear reg. the differences between them?
    I appreciate it.
    Thanks!

    HI,
    See these links on help.sap.com
    <b>For BAPI:</b>
    The data entered in the Internet is transferred to the R/3 System via BAPIs (Business Application Programming Interfaces).
    Data in the R/3 System is accessed via BAPIs as well.
    A Good Site for BAPI's
    http://searchsap.techtarget.com/originalContent/0,289142,sid21_gci948835,00.html
    http://help.sap.com/saphelp_erp2005/helpdata/en/7c/3ce38765ba11d395fe00a0c94260a5/frameset.htm
    <b>For Function Module:</b>
    The important use of functional module is it is used by Enhancements.
    SAP Enhancements are used to expand the standard functionality within SAP.
    Enhancements use function modules and are called from the standard SAP code.
    http://help.sap.com/saphelp_erp2005/helpdata/en/41/7af4daa79e11d1950f0000e82de14a/frameset.htm
    List of functional modules ( Good Site)
    http://www.geocities.com/victorav15/sapr3/abapfun.html
    Hope it helps!!!!
    Thanks
    Sudheer

  • Tcode for the execution of function module

    Hi!
    A very simple question:
    What is the Tcode for the execution of function module? (Se38,???)
    I have to execute  the function module RRSI_INITIAL_LINE_INSERT with import parameter I_CHABASNM = 0REQUID.
    Thank you very much!
    regards
    Thom

    hi,
    You create new or edit Fm in SE37. You also put the code for that FM in SE37.
    You can call it through pattern button in SE38, where u pass the importing and exporting parameters of that Fm
    Hope this helps, Do rewad.

  • Whats the use  of function module RSAP_IDOC_SEND?

    Hi Gurus,
    Can anyone please let me know the use of Function Module - RSAP_IDOC_SEND.
    Regards
    Avi....

    Hi
    Check this...
    Send IDOC in parallel dialog process.
        CALL FUNCTION 'RSAP_IDOC_SEND'
             STARTING NEW TASK l_task
             PERFORMING callback_parallel_idoc ON END OF TASK
             EXPORTING
                  i_mestyp              = p_mestyp
                  i_rcvprt              = p_rcvprt
                  i_rcvprn              = p_rcvprn
                  i_flag_commit_work    = sbiwa_c_flag_on
                  i_s_rqstprms          = l_s_rorqstprms
             TABLES
                  i_t_idoc_data         = p_t_idoc_data
             EXCEPTIONS
                  system_failure        = 1
                  communication_failure = 2.
    <b>reward if Helpful</b>

Maybe you are looking for

  • In Business Rule child elements of Unbounded element are not visible.

    Hi All, Jdev version 11.1.1.7.0 I am facing one issue in Business Rule... Scenario: I am creating Approval Service (BPEL) with Human Work flow and Bunises Rule. I am assingning participant in HW by using Rule based(Connecting HW and BR). Problem here

  • How do I store more messages in my Mail App?

    Only storing last couple of days, before I remember option in settings to store up to 5000 messages? So annoying, as search for emails from last week or last month, and got no record of them. Wasting so much time accessing Hotmail search via Safari,

  • Mac-mini june 2010 mini-dislay port do audio as well?

    Does the mini-display port on the new mac mini provide audio as well? It does have an hdmi port so not as big a deal any more but I'm still curious as this can't be determined from the techspecs on the apple store page.

  • Multiple TaskFlow instances in the UIShell - popup and dynamic tab

    Hi all, I have strange situation with JDev 11.1.1.6 First, I run the one, fragment based, bounded TF (named TF_A) in the one dynamic tab. Also, run another TF (named TF_B) in the second dynamic tab. Then, from that second dyn tab, I run second instan

  • How to turn on the shift key

    before when I pressed the shift key there would be an upshift icon on the screen. now it has disappeared. so now I have to always hold the shift key to use upper case please help