Retrieving of Function Module parameters dynamically

There is a function module with import and export parameters, I need to pick up the complete structure of the Header Data using a select statement.
ex: Function Module with import paremeters I1, I2 ..... table parameters t1, t2 .....
Select from 'Z' table into var .....
result of this select query is var = 'I1'.
now there is a macro swc_set_element
1st parameter = itab
2nd parameter = var
now i need to generate 3rd parameter 'I1' dynamically which is an import parameter.
Edited by: Gaurang Gujar on May 2, 2011 8:04 AM

Hi.,
Using Class CL_FB_FUNCTION_UTILITY u can get the Function Module Details.,
Check this Wiki.,  [Extracting FM details using Class|http://wiki.sdn.sap.com/wiki/display/ABAP/ExtractingFunctionModuleDetailsusingClass-+CL_FB_FUNCTION_UTILITY]
Also Check these Function Modules:
FUPARAREF
FUPARAREF_ENHA " Parameters of Function Modules
Hope this helps u.,
Thanks & Regards
Kiran

Similar Messages

  • Accessing function module parameters dynamically ?

    Hello,
    I´m searching for a possibility to access the parameters of a function module dynamically. I.e. I do not know how many parameters a function has, if it is import/export, or the data type.
    Is there a possibility to access (maybe an ABAP-internal) table with these informations? (At runtime within the function module itself)?
    Thany you for your help,
    best regards,
    Stefan

    Use the function module RPY_FUNCTIONMODULE_READ_NEW to read all of the metadata for a funciton module, it returns internal tables for all parameters of the function module interface.
    Regards,
    RIch Heilman

  • Type conflict in function module parameters

    Hi All,
    i hve to pass dynamic field <dyn_field> into function module parameters but  it's giving a dump for type conflict.
    where VALUE2  data type in 'AUTHORITY_CHECK' is UST12-VON but if i define <dyn_field> type UST12-VON . then it'll give dump in *ASSIGN COMPONENT  SECURITY_TABLE-FIELDNAME  of structure <wa> to <dyn_field> *.
    SECURITY_TABLE-FIELDNAME  data type is different with UST12-VON .
    pls guide me how to pass *<dyn_field> in fm parameters.
    FIELD-SYMBOLS: <dyn_field> type any.
      LOOP AT <DYN_TABLE_IN> INTO <WA>.
            ASSIGN COMPONENT  SECURITY_TABLE-FIELDNAME  of structure
                 <wa> to <dyn_field> .
            CALL FUNCTION 'AUTHORITY_CHECK'
              EXPORTING
                USER                = QUSER
                OBJECT              = SECURITY_TABLE-AUTHOBJCT
                FIELD1              = 'ACTVT'
                VALUE1              = '03'
                FIELD2              = SECURITY_TABLE-FIELDNAME
                VALUE2              = <dyn_field>

    Hi anuj ,,
    Can you explauin the solution ..
    Regards

  • Problem in  using function module parameters in abap program

    i want to use the coding present in on one of the function module 'AS_API_INFOSTRUC_FIND'  i got the problem using the function module parameters in my abap program.
    these are the parameters inside fm
    ""Lokale Schnittstelle:
    *"       IMPORTING
    *"             VALUE(I_FIELDCAT) TYPE  AIND_FCAT
    *"             VALUE(I_FIELDS) TYPE  TABLE OPTIONAL
    *"             VALUE(I_OBLIGATORY_FIELDS) TYPE  TABLE OPTIONAL
    *"       EXPORTING
    *"             VALUE(E_INFOSTRUC) TYPE  AIND_DESC
    *"             REFERENCE(E_ALL_FIELDS) TYPE  TABLE
    *"             REFERENCE(E_MATCHING_FIELDS) TYPE  TABLE
    *"       EXCEPTIONS
    *"              NO_INFOSTRUC_FOUND
    i want to declare     E_ALL_FIELDS  parameter    in my abap program,
    i have declared as 
    data: E_ALL_FIELDS TYPE TABLE.
    but   the system throws error that
    'type of field 'TABLE'  is generic .no table line has been specified'.
    i want to use it in my abap program how can i declare in my abap program .

    You have to declare the table using any specific type.
    The type table in the FM is generic so you can pass any type you need.
    For instance:
    TYPES: BEGIN OF ty_fields,
             fieldname LIKE dfies-fieldname,
           END OF ty_fields,
    TYPES: TY_T_GLU1              LIKE GLU1                     OCCURS 0,
           ty_t_fields            type ty_fields                occurs 0.
      DATA: lt_info_struct_fields TYPE ty_t_fields WITH HEADER LINE,
            lt_matching_fields    TYPE ty_t_fields WITH HEADER LINE.
        CALL FUNCTION 'AS_API_INFOSTRUC_FIND'
             EXPORTING
                  i_fieldcat         = ft_fieldcat-fieldcat
                  i_fields           = ft_fields_filled[]
             IMPORTING
                  e_infostruc        = lv_info_struct_name
                  e_all_fields       = lt_info_struct_fields[]
                  e_matching_fields  = lt_matching_fields[]
             EXCEPTIONS
                  no_infostruc_found = 1.

  • Mapping function module paramters dynamically with a selection screen

    Hi Experts,
    I got a situation,
    i am maintaining data of a function module paramters in a dictionary table.
    in the screen pbo i will fetch the the fm data from that table into the internal table(ITAB).
    in my report screen i am having the selection screen and the selection screen parameters are also mentioned in the FM Dictionary Table, we are having the those details in our internal table (ITAB).
    now the issue is how to call the FM by using the ITAB values.
    example: ITAB
    fmname          parametr          type        str_name           ss_field
    get_notif        im_notif            import     qmnum                 s_notif
    here s_notif[ ] is having the values in it which is nothing but selection screen parameter.
    and we are having S_NOTIF as a string values in the ITAB.
    now how can i link this S_notif(type string) to s_notif(value of notification) ?
    what i have done is ,
              loop at itab into wa_itab where type = 'import'.
                  case wa_itab-parameter.
                      when 'IM_NOTIF'.                                             " for example im dealing with only one parameter this can have  many
                              get reference of S_NOTIF[ ] to v_notif.
                       endcase.
              endloop.
    now i dont wanmt hard code the parameter name ,
    is there any way to do it dynamically... ?
    experts please help me on this ?
    thanks

    Hi ,
    This sample will help you.
    DATA: lv_fname TYPE string,
            lt_ptab TYPE abap_func_parmbind_tab,
            ls_ptab TYPE abap_func_parmbind,
            lt_etab TYPE abap_func_excpbind_tab,
            ls_etab TYPE abap_func_excpbind.
    *** Table
      ls_ptab-name = 'IT_TABLE'.
      ls_ptab-kind = abap_func_tables.
      GET REFERENCE OF <itab> INTO ls_ptab-value.
      INSERT ls_ptab INTO TABLE lt_ptab.
    *** Exceptions
      ls_etab-name = 'DATA_NOT_FOUND'.
      ls_etab-value = 1.
      INSERT ls_etab INTO TABLE lt_etab.
      lv_fname = 'GET_MY_DATA'." Function Name
      CALL FUNCTION lv_fname
        PARAMETER-TABLE
          lt_ptab
        EXCEPTION-TABLE
          lt_etab.
      IF sy-subrc NE 0.
      ENDIF.

  • Function module parameters mapping

    Hi Expert,
    We are working on a  upgradation tool in which i have to repace the obsolete function module "HELP_VALUES_GET_WITH_CHECKTAB
    " by "F4IF_FIELD_VALUE_REQUEST
    ". I am not sure about the functionalities of these function modules as i have never used it. Can anyone please help me  by providing some information abt  these FMs. Also i need to do the mapping of parameters of old and new function module. So please provide the details of mapping also. Any pointers on this will be highly appreciated.
    Thanks & Regards,
    P Sharma
    Moderator message : Duplicate post locked.  Read forum rules before posting.
    Edited by: Vinod Kumar on Jul 8, 2011 9:55 AM

    please check the below link.
    http://wiki.sdn.sap.com/wiki/display/ERP6/FMHELP_VALUES_GET_WITH_TABLEobsoleteReplacewith+F4IF_INT_TABLE_VALUE_REQUEST
    Edited by: SAP2011 on Jul 8, 2011 4:17 AM

  • Function module parameters for L_TO_CREATE_TR

    Hi All,
    Can someone help me out in using the function module 'L_TO_CREATE_TR'.
    What are the necessary import and export parameters along with the table parameters?
    If i want to pass IT_TRITE (table) as export parameters, what are the requisite fields that should be populated inthat table structure?
    Kindly help me out.
    Regards,
    Mainak

    Hi Mainak,
    This is the ABAP and the FM-call:
    data LT_TRITE type L03B_TRITE_T.
    data WA_TRITE like line of LT_TRITE.
    data GV_STORED like VBAPF-QMENGE.
    clear: LT_TRITE, WA_TRITE, GV_STORED.
    refresh LT_TRITE.
    WA_TRITE-TBPOS = GT_LTBP-TBPOS.
    WA_TRITE-ANFME = GT_LTBP-MENGE.
    WA_TRITE-ALTME = GT_LTBP-MEINS.
    WA_TRITE-LETYP = GT_MARA-VHART(3). "3-character storageunittype
    concatenate '000000000000' LTAP-NLENR+10(8) into WA_TRITE-NLENR.
    "FM L_TO_CREATE_TR wants 20 characters
    if GV_DIR = 'N'.
    WA_TRITE-NLTYP = '120'.
    WA_TRITE-NLPLA = 'OVERDRACHT'.
    else.
    WA_TRITE-NLTYP = P_NLTYP.
    WA_TRITE-NLPLA = P_NLPLA.
    endif.
    append WA_TRITE to LT_TRITE.
    TO aanleggen
    clear GT_LTAP_VB.
    refresh GT_LTAP_VB.
    call function 'L_TO_CREATE_TR'
    exporting
    I_LGNUM = GC_LGNUM_011 "LGNUM is '011' in my case
    I_TBNUM = GT_LTBP-TBNUM
    IT_TRITE = LT_TRITE
    importing
    e_tanum = gv_tanum
    tables
    T_LTAP_VB = GT_LTAP_VB
    exceptions
    FOREIGN_LOCK = 1
    QM_RELEVANT = 2
    TR_COMPLETED = 3
    XFELD_WRONG = 4
    LDEST_WRONG = 5
    DRUKZ_WRONG = 6
    TR_WRONG = 7
    SQUIT_FORBIDDEN = 8
    NO_TO_CREATED = 9
    UPDATE_WITHOUT_COMMIT = 10
    NO_AUTHORITY = 11
    PREALLOCATED_STOCK = 12
    PARTIAL_TRANSFER_REQ_FORBIDDEN = 13
    INPUT_ERROR = 14
    others = 15.
    if SY-SUBRC <> 0.
    commit work."See FM L_TO_CREATE_TR docu: commit work is needed
    perform MELDT_DE_FOUT using SY-MSGID SY-MSGTY SY-MSGNO
    SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    else.
    <b>plz reward points if helpful or if it solves ur query.</b>
    Thanks
    Chinmay

  • Issue with the RFC function module - parameters

    Hi,
        When i am creating RFC enabled function module, it was throwing an error like <b>'Reference parameters are not allowed with RFC'.</b>. I am implementing the test scenario to create BAPI, for that i have created table with 2 fields. My main intension is through RFC enabled function module planning to update the ztable.
       When i was creating RFC enabled function module, it was giving error. I remembered that  i need to use new structure when i create RFC enabled function module, so even i created structure also with the same fields of table fields.
       can you please let me know the solution for this.
    Thanks
    jaya

    Hi Ferry,
        Your solution is perfect. can you please explain the below information...
    Call by value                                                                               
    You pass the parameter with values. This means that the parameter     
         contents are copied both when the parameter is passed and when it is  
         transferred back to the calling parameter. For structures that contain
         tables, performance may be reduced considerably. Therefore, you should
         not do this.                                                                               
    I created the parameters with reference to table-fields, what do you mean by 'Call by value'check box usage there.
    Is it mean ...if i change the contents of the field in FM will it pass back to the structure which i refered to this parameter, in this case its table-field.
    Thanks
    jaya

  • Function module for dynamic view generation

    Hi experts,
    I am trying to dynamically convert all the screens used by a module pool program into their
    corresponding views in Web Dynpro environment. Although there is a function module used by the web
    dynpro conversion wizard tool in SE80, this does not generate views dynamically but only
    statically.  Can anybody please tell me a module which can perform this conversion of screens into  views when
    the module pool  program name is specified dynamically at runtime?
    Thanks in advance.............
    Edited by: Adithya K Ramesh on Oct 12, 2010 2:51 PM

    Hi experts,
    I am trying to dynamically convert all the screens used by a module pool program into their
    corresponding views in Web Dynpro environment. Although there is a function module used by the web
    dynpro conversion wizard tool in SE80, this does not generate views dynamically but only
    statically.  Can anybody please tell me a module which can perform this conversion of screens into  views when
    the module pool  program name is specified dynamically at runtime?
    Thanks in advance.............
    Edited by: Adithya K Ramesh on Oct 12, 2010 2:51 PM

  • Function module parameters declare BOR Object

    I dont know if this is even logical...
    I need to create a function module which will be used in my  program..
    Can I create an object of BOR object type say 'Sales Order'  and pass it as an export parameter in Function Module..
    i.e i will pass the obj key and obj type as import..
    I want to instantiate that Sales Order.. and pass the whole Sales oRder as export/tables  parameter..
    I know swc_object_create is supposed to create an object but as i can see it only has the handle.. and it is of type swc_object..
    But i want to export  the whole Instance .. so that i can call the methods of the object  in my original program..
    Regards,
    krishna

    Hi Ravi ,
    I simplified my requirement but my actual requirement is with workflows...
    I have a scenario in workflow where,
    1.Activity step to fill internal table with sales order numbers
    2.loop at sales order numbers internal table
    3.Activity Step to Instantiate  based on order numbers
    4. Activity Step to Edit these sales orders
    5.end the loop
    For the above logic in workflows i have separate Activity step for instantiation..What I am thinking of is to instantiate the sales orders and fill the instances in the internal table in Step 1 instead of just order numbers..In the BOR method/F.M  of Step 1 I need to export the Instance of the Sales Orders (this is my actual question/problem, how do i instantiate while coding??swc_object_create, creates only a ref to object ...If I am able to create the object what should the type be in export /tables parameter)
    This way i can remove the loop and offer parallel processing (from miscellaneous tab in activity step) and send multiple Edit workitems to user  at Once instead of one after the other..
    Please let me also know how you would handle the above situation, i am very new to workflows and BOR.

  • Function module parameters

    using the function module WDY_EXECUTE_IN_PLACE
    to call web dynpro what is the parameter internalmode and  how is it used?
    thanks

    Hi,
    This function module is used to execute the Web Dynpro Application manually. Well, this parameter is used to set the execution type, if the INTERNAL MODE is 'X' then the application executes in SAP GUI itself.If not set, then the application is executed in a browser.
    Hope this helps.
    Regards
    Raja Sekhar

  • Individual objects data retrieval through function modules (FM)

    Hi Gurus,
    I'd like to know if I can use Function Modules for the retieval of the following information:
    - Reference Product of an Individual Object within the component of an iBase.
    - Warranty of the Individual Object
    - Purchase date of the Individual Object
    (Using the FM CRM_ORDER_READ, under the path ET_SERVICE_OS-OSSET-REFOBJECT-PRODUCT_ID, I'm able to identify the iObject, but not its reference product)
    Alternatively, which is the table these information are stored in?
    Thanks in advance,
    Andrea Ricci

    HI,
    You have to refer different tables for your requirement:
    CDBD_IL_IBCWTY             Installed Base Components - Warranty Relationship
    CDBD_IL_PRDIB                 Individual Object-Installed Base Interlink
    CDBD_IBIB                         Installed Base Header Table.
    Hope this works.
    Regards,
    PP

  • Virtual InfoCube with Services - function module parameters documentation ?

    Hello,
    I have been trying to use a Virtual Infocube with Services.
    I have seen most of the posts in SDN, and read the documentation in http://help.sap.com/saphelp_nw04/helpdata/en/8d/2b4e3cb7f4d83ee10000000a114084/frameset.htm
    I did not manage to find a precise description of the import 
    parameters of the Variant 2.
    In particular, what is the meaning of the
    i_tx_rangetab TYPE rsdri_tx_rangetab parameter. I read in the code of RS_BCT_FIGL_DATA_GET that it has to do with query columns. In the tests I did this table is alway empty.
    Also, i_th_sfc gives you the list of characteristics used in the query. But it does not inform you on wether these are in the 'rows' 'free characteristics' or 'filter'. Is there a way of knowing that?
    Claudio Ciardelli

    Hi Claudio,
    I never implemented Virtual InfoCube with services with a FM, but I know there is a couple of How To Documents about named:
    - How to Reporting from External Data via Virtual InfoProvider
    -How to Implement a Virtual InfoCube with Services
    both with some code samples: did you read it?
    Hope it helps
    GFV

  • Dynamic Table Selection function module

    Dear Friends,
      We have got critical requirement on Custom BAPI function module :
         we have to pass one field name of table and table name : Eg (Matnr and MARC).
         we have to get table contents w.r.t field name of table and table : Has to display MARC based on Matnr.
    (It is something like we display table contents in SE11 and SE16, Our requirement is to get the data by giving  random field name of table and table name ).
    My View : Imports Tab of F.M of is static
                   Tables Tab of F.M could be dynamic....if so how to achieve or any other approach?
    Note :  Eg1 : Matnr and MARA  (Input to F.M) -
    > Get MARA contents (Table from F.M)
               Eg2 : Matnr and MARC (Input to F.M) -
    > Get MARC contents (Table from F.M)
               Eg3 : Lifnr and LFA1 (Input to F.M)  -
    > Get LFA1 contents (Table from F.M)       
               Eg1 : Ebeln and EKKO (Input to F.M)  -
    > Get EKKO contents (Table from F.M)
    Awaiting for positive and quick views.
    Regards
    Sekhar

    Dear Sarcevic,
       I have created zfunction module with imports and tables.
      I'm able to manage import parameters as dynamical, but tables declaration gives fuzzy.
      How do we make tables tab declaration in function module as dynamic? any other views?
    Regards
    Sekhar

  • Dynamic Export table of a function Module

    Hi Friends,
    I have a requirement where fields of  Export table of my function Module is dynamic. It is like the Fields to be expoerted by the Function Module would be stored in a seperate Z table
    The Z table would contain the records as follows .
    Table Name              FieldName
    =========     
    MARA                      MATNR
    MARC                      WERKS
    and So on..
    . How can I define my Export table in Function module dynamically so that the structure of my Export Function Module would be same as that of the Fieldnames in Z table..
    Thanks

    Just declare the associate type as "ANY TABLE" in the exporting parameter.
    FUNCTION ZTEST.
    *"*"Local Interface:
    *"  EXPORTING
    *"     REFERENCE(IT_TAB) TYPE  ANY TABLE

Maybe you are looking for