Tables as part of function module

I am trying to develop a function module and want i_mcha as part of the tables section. But i_mcha should be part of a custom type that I can create. Is it possible to create a type in the global data of the function module and use that type for the parameter in tables?

Hi Flores
you can do like this,
goto SE11 and create a table type of your requirment and use it as type for the changing parameter.
OR
if you are not interested in creating table in SE11,you can type the table as TYPE ANY.
This will solve your problem.
Regards
Hareesh Menon
Edited by: Hareesh Menon on Mar 6, 2009 9:13 PM

Similar Messages

  • How to declare Dynamic table in Tables Parameters of a Function Module...

    Hi Gurus,
    I would like to Know how to declare a Dynamic table in Tables parameters of a Function Module.
    so that it should be able to hold any table data ....
    I have tried all possible ways of trying to assign fields-symbol like declarations which doesnt allow here ...
    plz Dont reply with the basics of creating dynamic internal tables, coz my case is not an Internal table it is FM table parameter declaration.....

    Hi,
    If you are requirement is to create a function module with tables parameter having a generic line type i.e. no specific line type
    just declare it with a name under Parameter name with out specifying the type.
    A reference function module with such parameter, i would quote is the standard GUI_UPLOAD/ GUI_DOWNLOAD where the parameters specified under TABLES are generic.
    If you want to process the values passed to these parameters in the source code of function module, field symbols would be a preferable option.
    Regards,
    Sharath Panuganti

  • Doubt in  export, import and table para when creating Function Module

    Dear fellow ABAPers,
    I have a doubt in defining export, import and table parameter while creating a function module.
    I am calling a function module inside a user exit. Now in the user exit the SAP fills an internal table called i_lfa1 with all the data user has eneterd.
    Now I want to pass this whole internal table to function module and the perform some checks on the values of internal table.
    After that function module fills an error structure with values depending on some check.
    1)
    How do I pass this internal table to function module ? 
    When I am creating function module in se37 where do I define this iternal table type ? Is it in Import or Table parameter during function module creation?
    2)
    Where do I define error structure type (which is returned by function module to main program)? Is it in Export or table parameter during function module creation?
    Please clear my doubt..
    Relevant points will be awarded.
    Regards,
    Tushar.

    Hi Tushar,
    1. How do I pass this internal table to function module ?
       I assume u are creating your own Y/Z FM.
       Pass it thru TABLES parameter.
    2. When I am creating function module in se37 where do I define this iternal table type
       Define this in TABLES interface.
       What Type ?
       THE SAME TYPE WHICH HAS BEEN DEFINED
        WHILE PASSING IN THE USER-EXIT FUNCTION MODULE.
       IF U SEE THE FM OF THE USER-EXIT,
       U WILL COME TO KNOW.
    3.
    Where do I define error structure type (which is returned by function module to main program)? Is it in Export or table parameter during function module creation?
    Define it in TABLES interace. (not in export, import)
      (Since what u are going to return is an internal table)
      U can take for eg. BDCMSGCOLL.
      OR u can create your own Y/Z structure
    for the same purpose.
      (or u can use the structure type T100)
    I hope it helps.
    Regards,
    Amit M.

  • How to get tables used by a Function Module

    Hi,
    How to know the tables used by a function module dynamically.
    Cuurently im using BAPI_MATERIAL_SAVEDATA in my report program.
    I tried FM GET_TABLES to know the tables, but could see only tables used in the report.
    Main issue in my case is when im running this update program, could observe different tables being displayed as updated in SM50(Process Overview).Want to clarify as why these tables which are not being used in my report are being displayed in SM50.
    So was doubtin weather this FM is using these displayed tables.
    Thanks in advance for u r replys.
    Regards,
    Dedeepya

    Hi Dedeepya,
    you could use a SQL Trace (tx. ST05) to list all tables affected and operations that realize. Just active the trace, execute FM, and Deactive trace. Then click in "Display trace" and check it.
    Best regards,
    Pablo

  • Update TVARV table entries using a Function Module or Program

    Hi Gurus,
    My requirement is that I have a entry in TVARV table which has a 'low'. We would like to change this value whenever we desire. We are unable to do it via sm30 and se16 as table maintenance access is not permitted in Production environment.
    Can you please provide any Function module or program code to do it?
    Requirement - User can enter a value into TVARV table by executing a function module or program
    Thank you all, will award points,
    Priyansh

    Hi Priyansh,
    Please refer to SAP Help for more information on variant maintenance and more specifically variable values in variants. You can use t/code STVARV for maintaining the variant variables in table TVARVC (Client-Specific Variant Variables).
    Note: I suggest to use the TVARVC table instead of TVARV.
    If you are looking for Function Modules in the area of Variant Maintenance, then please have a look at Function Group SVAR (t/code SE80).
    If you are looking for Function Modules in the area of User Variables in Variants, then please have a look at Function Group SVUV (t/code SE80).
    Furthermore, if you are looking for a program to update table TVARVC, please have a look at ABAP: Dynamic Variant Processing with STVARV.
    Best eregards,
    Sander

  • Passing selection table as parameter to function modules

    i tried to pass a selection table as a parameter to a function module but there is a problem stating the eror the table length is different.
    *& Report  ZSFSELECT_OPTIONS_PGM
    REPORT  zsfselect_options_pgm.
    TABLES zselect_options.
    SELECT-OPTIONS sop FOR zselect_options-id.
    DATA  : fname(15) TYPE c.
    *CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
       formname                 = fname
      VARIANT                  = ' '
      DIRECT_CALL              = ' '
    IMPORTING
      FM_NAME                  =
    EXCEPTIONS
      NO_FORM                  = 1
      NO_FUNCTION_MODULE       = 2
      OTHERS                   = 3
    *IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    *ENDIF.
    DATA lth(2) TYPE c.
    DATA ty TYPE i.
    DATA o TYPE i.
    DATA l TYPE i.
    DATA k TYPE c.
    DESCRIBE FIELD sop-sign TYPE lth LENGTH ty IN CHARACTER MODE.
    CALL FUNCTION fname
    EXPORTING
      ARCHIVE_INDEX              =
      ARCHIVE_INDEX_TAB          =
      ARCHIVE_PARAMETERS         =
      CONTROL_PARAMETERS         =
      MAIL_APPL_OBJ              =
      MAIL_RECIPIENT             =
      MAIL_SENDER                =
      OUTPUT_OPTIONS             =
      USER_SETTINGS              = 'X'
    IMPORTING
      DOCUMENT_OUTPUT_INFO       =
      JOB_OUTPUT_INFO            =
      JOB_OUTPUT_OPTIONS         =
      TABLES
        sf_sop                     =sop
    EXCEPTIONS
      FORMATTING_ERROR           = 1
      INTERNAL_ERROR             = 2
      SEND_ERROR                 = 3
      USER_CANCELED              = 4
      OTHERS                     = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    in the smart form i have tried to pass the sp as the table.
    i have created a program line node
    :SELECT * FROM zselect_options INTO TABLE it_tab WHERE id IN sf_sop.

    Hi,
    If i understand ur problem correctly u r trying to pass a select-option to Tables for a smartform function module. It gives an error & it correct.
    If u understand the structure of a select option, it will have 4 fields in it & the structure will be
    SIGN                   CHAR1
    OPTION               CHAR2
    LOW                   Type Zfield
    HIGH                   Type Zfield
    But ur receiving Table paramter of the smnartform FM will be having only 1 field - Type Zfield
    So this mismatch gives u an error.
    Solution:
    Case1:
    Write code outsied th FM in ur program to get all the values & build an internal table & pass that to the FM.
    Case2:
    Define the Structure of table in the smartforms as tols earlier & then try passsig the Select option.
    Thanks & Regards,
    Bhargava

  • CRM Tables , Tables Mappings , T-codes , Function modules

    Hi All,
    I am new to CRM , I want to know the tables , table mappings transaction
    codes , functional modules used . Can any one mention the link / list down all which i have mentioned above .
    I will be very helpful if i get this information.
    cheers,
    Chandra.

    hi,
       CRM tables:
        https://forums.sdn.sap.com/click.jspa?searchID=2400935&messageID=3134573
        https://forums.sdn.sap.com/click.jspa?searchID=2400935&messageID=3128631
        https://forums.sdn.sap.com/click.jspa?searchID=2400935&messageID=3269744
    CRM FM:
       https://forums.sdn.sap.com/click.jspa?searchID=2400963&messageID=3239545
    Reward points if useful..
    Regards
    Nilesh

  • Update the custom table by using Custom Function module.

    Hi Experts,
            My requirement is ,
    1) To create the Custom Z table with fields
               vbak-vbeln
               likp-vbeln
               vbuk-vbeln
      After creating this Z table.
    2) I have to create one custom function module.
        Based on this function module i have to update that Z table.
    3) Before these steps i have to write down an ALV report based on the tables vbak and vbeln, in that table i have to print vbak-vbeln. and also in report i generated check box and one custom button in application toolbar. after the report will displayed , when ever i click the button in application tollbar , this function module will executed and the table will be updated.
        But I developed the ALV report with custom button and check box successfully.
      My doubt is how to write the function module and based on that function module how to update the table.
          Please suggest me on this requirement.
        Thanks in Advance.
    Thanks and Regards
    Srihari.

    HI ,
         Can any one help me out on my above requiremnet..
    Thanks and Regards
    Srihari.

  • Export, Import and Table declaration in custom function module

    I am creating a custom function module. Parameters needed are export internal table and one data field from the internal table.
    What do i need to fill for 'associated type' for these export parameters since size of the internal table and type for the data field from the internal table vary.

    Hello Albert
    If the function module need not be RFC-enabled then you have many ways to define such dynamic parameters, e.g.:
    FUNCTION ZUS_SDN_DYNAMIC_PARAMS.
    *"*"Local Interface:
    *"  EXPORTING
    *"     REFERENCE(ET_ITAB) TYPE  TABLE
    *"     REFERENCE(ET_ITAB_1) TYPE  ANY
    *"     REFERENCE(ET_ITAB_2)
    *"     REFERENCE(ED_DATA) TYPE  CLIKE
    *"     REFERENCE(ED_DATA_1) TYPE  ANY
    *"     REFERENCE(ED_DATA_2)
    ENDFUNCTION.
    See also: How to return back a structure of dynamic tables in a Function Module
    Regards
      Uwe

  • Table name in which function module and function group store

    Hai,
    Any one help me, What is the table name, the function modules and fouction groups are stored.
    Thanks,
    Elamaran

    ...and table enlfdir has additional info.... function module RS_GET_ALL_INCLUDES is useful for getting a list of includes used by an fm.
    Message was edited by: Neil Woodruff

  • Dynamic table as output in Function Module

    Hi all,
    I am trying to output a dynamic table from a FM. I am a generating a dynamic internal table in the FM. Now i want to assign that internal table to a table parameter of the FM so that i can use that table in the calling program. can this be done?
    regards,
    hamza

    You may need to look into code of sap function module
    RFC_READ_TABLE

  • "Changing" parameter and "Tables" parameter defintions in function module

    If one defines "Changing" or "tables" parameters, they are treated as reference parameters.
    It becomes obvious for "tables" parameters where one does not have option to check box for "Pass by Value". But for "Changing" parameters, they provide the checkbox for "Pass by Value". Even when you select this option, the function module seems to handle the parameter as a reference parameter (whatever changes you make to it in the function module are retained when you return back to a calling program).
    My question is why then SAP has provided the checkbox of "Pass by Value" for "Changing" parameter?
    Thanks.
    Jitendra Mehta

    Hi Chaiphon:
    Thanks for explanation but I know the theory of "Pass by reference" versus "Pass by Value".
    Let me rephrase my question.
    When I use the importing parameter (say as a table with a dictionary table type) with reference (not "passing by value"), and if I modify the value of the parameter, the calling program (which calls function module) receives the changed value after the call.
    When I use the importing parameter with "Pass by Value" box checked, the modifications made to the table inside the function module is not retained after the code leaves function module and returns to the calling program.
    My question is why not the same behaviour with the "Changing parameter" in function module definition?
    And if Changing parameters are always reference parameters, then why SAP has provided the "Pass by Value" check box?

  • GTS tables relations and important function modules

    Hi Friends,
    I am totally new for the developments in GTS.  Wanted some help on the  tables for master data, transactional data in GTS. 
    Also what are the important function modules used in GTS.
    Anybody can give me some inputs on the above..?
    regards
    Nalin

    Well, passing a table thru the interface with no type is easy, just don't assign a structure when defining the interface.  It will then take its structure by what is being passed to it. 
    So if you would pass an internal table to it with the structure like so.
    Data: begin of itab occurs 0,
          line(1000) type c,
          end  of itab.
    Then that is the structure inside the function module. 
    Did this answer your question?   Please explain further if not.
    Regards,
    Rich Heilman

  • Static table in normal abap function module

    Hi All,
    I have written a code which calls multiple function module multiple times with parameters. However in code review I got comments: 'Please declare a static table to maintain the values of x/y/z.... this can be used when the FM is called evry time for the same values.'
    I have never implemented this functionality. I guess in class and object programming we have functionality to put parameters as static. Can anybody put more light on this? An example would help a lot.
    Thanks in advance.
    Regards,
    Jignesh

    Structured Static Data Object Definitions
    - STATICS: BEGIN OF struc,
                   END   OF struc.
    Structured Static Internal Table Definition
    - STATICS itab TYPE tabtype [WITH HEADER LINE].
    - STATICS itab TYPE tabkind OF linetype
                 [WITH [UNIQUE|NON-UNIQUE] keydef]
                 [INITIAL SIZE n] [WITH HEADER LINE].
    - STATICS itab LIKE tabkind OF lineobj
                [WITH [UNIQUE|NON-UNIQUE] keydef]
                [INITIAL SIZE n] [WITH HEADER LINE].
    - STATICS itab TYPE linetype OCCURS n [WITH HEADER LINE].
    - STATICS itab LIKE lineobj  OCCURS n [WITH HEADER LINE].
    - STATICS: BEGIN OF itab OCCURS n,
             END   OF itab [VALID BETWEEN f1 AND f2].
    STATICS itab TYPE RANGE OF type.
    STATICS itab LIKE RANGE OF f
    REGARDS
    SHIBA DUTTA

  • Identify tables from where the function module extracts data for the ES

    Hi All,
    For the datasource, 0CRM_SALES_ORDER_I in the CRM system, we need to add a new field (in the table level). This datasource's extraction type is 'F1 - function module'. Is the extractor itself is this function module? If it is a sepeate FM, where can we find the function module name used for this datasource?
    We need to identify the tables from where the fields in this datasource fetch data from. Where can we find this information?
    To be specific, in the sales order in tcode crmd_order, if we goto conditions tab and create a new condition, in what table this will get stored?
    Thank you in advance,
    Hari

    Ignore this thread! there is another thread I have created for the same problem.
    I created only one; wonder how it became two!!

Maybe you are looking for