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

Similar Messages

  • How to create dynamic nested internal table

    Hi Experts,
    Pleae tell me or give sample code, how to create dynamic nested internal table ?
    I have seen threads saying creation of dynamic internal tables using some table structure only. But now the requirement is to create dynamic nested internal table.
    For example the internal table contains two fields viz., one is field1 of dynamic internal table and other is normal field2 and values as shown below:
    Nested internal table:
    field1                     |     field2 ...
    <table content1>     |     value2..
    <table content1>     |     value2..
    Here the [table content] should also a dynamic internal table.
    Let me know if you need any other info.
    regards
    Saravanan R

    see the complete code..i am currently working in ECC6.0 EHP4. just check which version you are using..
    REPORT  yst_test_000.
    DATA:
          lt_comptab         TYPE cl_abap_structdescr=>component_table,
          ls_comp            LIKE LINE OF lt_comptab,
          lref_newstr        TYPE REF TO cl_abap_structdescr,
          lref_tab_type      TYPE REF TO cl_abap_tabledescr,
          lt_fcat            TYPE lvc_t_fcat,
          ls_fcat            TYPE lvc_s_fcat,
          ls_dd03p           TYPE dd03p,
          lt_data            type ref to data.
    field-symbols: <fs_table> type standard table.
    CALL FUNCTION 'LVC_FIELDCATALOG_MERGE'
      EXPORTING
        i_structure_name       = 'SCARR'
      CHANGING
        ct_fieldcat            = lt_fcat
      EXCEPTIONS
        inconsistent_interface = 1
        program_error          = 2
        OTHERS                 = 3.
    IF sy-subrc NE 0.
      MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
              WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    LOOP AT lt_fcat INTO ls_fcat.
      IF ls_fcat-ref_table IS NOT INITIAL.
        CLEAR ls_dd03p.
        CALL FUNCTION 'BUS_DDFIELD_GET'
          EXPORTING
            i_tabnm         = ls_fcat-ref_table
            i_fldnm         = ls_fcat-fieldname
          IMPORTING
            e_dd03p         = ls_dd03p
          EXCEPTIONS
            field_not_found = 1
            OTHERS          = 2.
        IF sy-subrc EQ 0.
          ls_comp-name = ls_fcat-fieldname.
          ls_comp-type ?= cl_abap_datadescr=>describe_by_name( ls_dd03p-rollname ).
          APPEND ls_comp TO lt_comptab.
          CLEAR ls_comp.
        ENDIF.
      ELSE.
        ls_comp-name = ls_fcat-fieldname.
        ls_comp-type ?= cl_abap_datadescr=>describe_by_name( ls_fcat-rollname ).
        APPEND ls_comp TO lt_comptab.
        CLEAR ls_comp.
      ENDIF.
    ENDLOOP.
    *Now for the Field which you want deep table then you can do like this
    ls_fcat-fieldname  = 'NESTED_TABLE'.
    ls_fcat-inttype    = 'C'.
    ls_fcat-intlen     = '000006'.
    ls_fcat-rollname   = 'SFLIGHT_TAB1'. "For SFLIGHT
    APPEND ls_fcat TO lt_fcat.
    ls_comp-name = ls_fcat-fieldname.
    ls_comp-type ?= cl_abap_datadescr=>describe_by_name( ls_fcat-rollname ).
    APPEND ls_comp TO lt_comptab.
    CLEAR ls_comp.
    lref_newstr = cl_abap_structdescr=>create( lt_comptab ).
    lref_tab_type = cl_abap_tabledescr=>create( lref_newstr ).
    create data lt_data type handle lref_tab_type.
    assign lt_data->* to <fs_table>.
    break-point.
    Edited by: Vijay Babu Dudla on Apr 28, 2009 8:05 AM

  • Unable to retrieve parameters from RFC Function Module

    Hi All,
    I have created a model for the RFC Enabled function module BAPI_BUPA_CENTRAL_GETDETAIL within my webdynpro program. I am passing parameters to the function module BAPI_BUPA_CENTRAL_GETDETAIL and I have validated that this is being passed correctly by displaying the passed value from the node of the input parameters.
    Code used to pass input parameters -
      IWDMessageManager manager = wdComponentAPI.getMessageManager();
       try
          wdContext.currentBapi_Bupa_Central_Getdetail_InputElement().modelObject().execute();
          size = wdContext.nodeCentraldataperson().size();     
          wdComponentAPI.getMessageManager().reportSuccess(Integer.toString(size));
          wdContext.nodeOutput().invalidate();
       catch(WDDynamicRFCExecuteException e)
          manager.reportException(e.getMessage(), false);
    I also see that it returns 1 record by using the code below:
    IWDMessageManager manager = wdComponentAPI.getMessageManager();
       try
          wdContext.currentBapi_Bupa_Central_Getdetail_InputElement().modelObject().execute();
          size = wdContext.nodeCentraldataperson().size();     
          wdComponentAPI.getMessageManager().reportSuccess(Integer.toString(size));
          wdContext.nodeOutput().invalidate();
       catch(WDDynamicRFCExecuteException e)
          manager.reportException(e.getMessage(), false);
    But, when I try to retrieve the value returned it does not fetch that value -
       Bapi_Bupa_Central_Getdetail_Output getdata = wdContext.nodeBapi_Bupa_Central_Getdetail_Input().nodeOutput().currentOutputElement().modelObject();
       Bapibus1006_Central_Person[] getres = new Bapibus1006_Central_Person[size];
       for(int i=0; i<size; i++){
            wdComponentAPI.getMessageManager().reportSuccess(Integer.toString(i));
            getres<i> = getdata.getCentraldataperson();
              //String fullname = wdContext.nodeBapi_Bupa_Central_Getdetail_Input().nodeOutput().nodeCentraldataperson().getElementAt(i).getAttributeValue("Fullname").toString();
            String fullname = getres<i>.getFullname();
           fullname += Integer.toString(i);
            wdContext.currentContextElement().setFullname(fullname);
            wdComponentAPI.getMessageManager().reportSuccess("fullname:" + fullname);
    It always returns 0 or null. Can someone please help me with this issue. The BAPI returns values in structure format and not internal table and hence I dont see the issue there as well.
    What can be the problem?
    Thanks for all your help in advance.
    Best regards,
    Divya

    Nikhil / Srihari,
    I changed my code and it now looks like -  I am trying get the return value into the context fullname but i still cant get the value although the size of nodeCentraldataperson() is thrown as 1 and the input is being passed correctly as i have validated this in this line of code [wdContext.nodeBapi_Bupa_Central_Getdetail_Input().currentBapi_Bupa_Central_Getdetail_InputElement().getBusinesspartner();]
    IWDMessageManager manager = wdComponentAPI.getMessageManager();
       try
          wdContext.currentBapi_Bupa_Central_Getdetail_InputElement().modelObject().execute();
          size = wdContext.nodeCentraldataperson().size();     
          wdComponentAPI.getMessageManager().reportSuccess(Integer.toString(size));
          wdContext.nodeCentraldataperson().invalidate();
       catch(WDDynamicRFCExecuteException e)
          manager.reportException(e.getMessage(), false);
         for(int i=0; i <size; i++){
              String name = "FullName: ";
              wdContext.nodeBapi_Bupa_Central_Getdetail_Input().nodeOutput().nodeCentraldataperson().setLeadSelection(i);
              name += wdContext.nodeBapi_Bupa_Central_Getdetail_Input().currentBapi_Bupa_Central_Getdetail_InputElement().getBusinesspartner();
              name += wdContext.nodeBapi_Bupa_Central_Getdetail_Input().nodeOutput().nodeCentraldataperson().currentCentraldatapersonElement().getFullname();
              wdContext.currentContextElement().setFullname(name);     
    Any idea what could be wrong?
    Thanks,
    Divya

  • How Procurement cost can be captured in product master through functional module?

    Hi
    I have following Queries
    1) How Procurement cost can be captured in product master through functional module in SAP APO?
    2) How we can transfer procurement cost to product master in SAP APO through BAPI?
    Thanks
    Poorna

    Hi Poorna,
    Could you please check FM /SAPAPO/DM_PRODUCTS_POST.
    Table it_matloc of this FM can used to update Cost .

  • How to Call a standard screen with in a custom function module

    Hi Guru,
    I am copying a standard function module SWU_WF_TASK_DISPATCH in to Z function module in that they where calling a standard screen.
    Some one help me how to copy or call this standard sceen within the function module.
    Regards
    Paul

    Hi,
               for that you have to create screen from SE51 same number in standard and program name should be the name of Z function group's main program and declare all varriable in function group's top inclue.
    I think copy is not possible u have manually create screen for that.
    Regards
    Gagan

  • How can i generate correct SOAP-ENV:Fault in ABAP function module?

    We have clients consuming some functions from our SAP server, these functions are made available as web services. When a client passes wrong parameters to our functions we'd like to generate reasonable SOAP fault (using correct error code and error message) but simple raising (and declaring it in the corresponging section of the function module ) an exception gives us general "Internal Server Error" and that is all
    Are there any way to make good SOAP Fault?
    Thanx in advance.

    Hi,
    This might be helpful:
    http://help.sap.com/saphelp_nw04/helpdata/en/5d/a45c3cff8ca92be10000000a114084/frameset.htm
    Eddy

  • How can i dynamically update a table in my program?

    Hi there!
    I would like to know if anyone can assist me with advice on how to dynamically update
    a table within my program, with new values from the database?
    Thanking You all.

    Add rows to its model.
    Kind regards,
    Levi

  • How to declare class variable with generic parameters?

    I've got a class that declares a type parameter T. I know how to declare a static method, but this doesn't work for a static variable:
    public class Test< T >
        * Map of String to instances of T.
        * error: '(' expected (pointing to =)
        * <identifier> expected (pointing to () )
       private final static < T > Map< String, T > MAP = new HashMap< String, T >();
        * Get instance of type T associated with the given key.
       public final static < T > T getType( String key )
          return MAP.get( key );
    }Edited by: 845859 on Mar 20, 2011 11:46 AM

    jveritas wrote:
    I'm trying to create a generic polymorphic Factory class that contains boilerplate code.
    I don't want to have to rewrite the registration code every time I have a different return type and parameter.I haven't seen a case yet where that is reasonable.
    If you have hundreds of factories then something is wrong with your code, design and architecture.
    If you have a factory which requires large number of a varying input types (producing different types) then something is probably wrong with your code and design.
    A reasonable factory usage is one where you have say 20 classes to be created and you need to add a new class every 3 months. Along with additional functionality represented by the class itself and perhaps variances in usage. Thus adding about 3 lines of code to one class is trivial. Conversely if you have hundreds of classes to be created by the factory and you are adding them daily then it is likely that
    1. Something is wrong with the architecture which requires a new class every day.
    2. You should be using a dynamic mechanism for creation rather than static because you can't roll out a static update that often.
    More than that the idiom that leads to factory creation is different for each factory. A factory that creates a database connection is substantially different than the one used in dynamic rules logic processing. A generic version will not be suitable for both.
    Actualy the only case I know of where such a factory might be seem to be a 'good' idea is where someone has gotten it into their head that every class should be represented by an interface and every class created by a factory (its own factory.) And of course that is flawed.

  • How should tables be defined in remote-enabled function modules used in PI

    Hi,
    I know the outside-in development approach is best practice (although there is some conflicting viewpoints on the best approach for new developments, some favouring RFC).
    If I was to create a new remote-enabled function module in a backend system then import this into the Integration Repository what is the recommended parameter group for defining tables against the RFC?
    I've tested using import, export, changing and tables and they all work but SAP recommends not using the tables option anymore but when using import/export/changing option I receive a warning that using these parameters with deep/nested data types can lead to performance problems.
    Can someone offer any advice?
    Thanks,
    Alan

    > I've tested using import, export, changing and tables and they all work but SAP recommends not using the tables option anymore but when using import/export/changing option I receive a warning that using these parameters with deep/nested data types can lead to performance problems.
    You use import and export parameters, and avoid deep and nested structures.

  • How to get planning area if I have planning book - Function module/table

    Hello All,
    Our basic requirement is to find out whether the planning book we are using is DP relevant or SP relevant. (inside the custom program)
    One way is to find out the relevant planning area and find out if the planning area is DP relevant or SP relevant.
    But can anyone suggest if there are any tables or function modules to achieve the same?
    Thanks a lot.
    Regards,
    Chandan

    Dear Chandan,
    You can use the table "/SAPAPO/PBMVW" for your issue. "APP_SNP" field tells if it SNP planning book or not. Thee tables gives all planning books present in the system.
    If you want dataview's you can use table ""/SAPAPO/PBDVW"".
    I hope the information solves your issue.
    Thanks and Regards,
    Nithin.

  • Syntax Error with Table Parameter (type: ANY) when Creating Function Module

    Hello experts,
    I want to create a function module with a table parameter and table type is ANY. But when I check (Ctrl+F7) this function module, syntax error occurs - "In this statement, the internal table "MSG_TABLE_ITEM" must have the type "STANDARD TABLE"."
    Could anyone tell me what the wrong is? And how can I fix it?
    Thanks,
    Shelwin

    Hi,
    For table parameters, you can only pass
    MSG_TABLE_ITM   TYPE STANDARD TABLE
    or
    MSG_TABLE_ITM  ( don't fill other columns TYPING ASSOCIATED TYPE  ).
    For reference check FM 'GUI_UPLOAD' - Table parameters
    Regards,
    DPM

  • 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 pass dynamic selection to logical databse using ldb_process function

    dear friends,
                         can anybode tell me how to pass dynamic selection to the logical database when i m using LDB_PROCESS function module.  however, in EXPRESSIONS paramter of the function module i m  passing the selecti-option, it is passing their also but when i used more than  two select-option or paramter it throw an exception FREE_SELECTIONS_ERROR.
    SO PLEASE GUIDE ME HOW TO PASS MORE THAN TWO SELECT-OPTION IN LOGICAL DATANSE DYNAMICALLY USING LDB_PROCESS.

    would be nice if you post the answer to all

  • 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

  • Buffer table not up to date - BBP_PD_PO_SAVE Function Module

    Hi SRM Experts,
    I am trying to develop custom program for uploading POs into SRM and got struck at the time of BBP_PD_PO_SAVE function Module.
    I followed the follwoing steps:
    Step 1: Creating PO with BBP_PD_PO_CREATE - this step executed successfully.
    Step 2: Trying to save PO data into SRM with BBP_PD_PO_SAVE - this step I am getting error message "Buffer table not up to date". 
    CALL FUNCTION 'BBP_PD_PO_SAVE'
    EXPORTING
      IV_WORKITEM_ID               =
      IV_USERTYPE                  =
       IV_HEADER_GUID               = wa_header-guid
      IV_CREATE_HIST_VERSION       =
    wa_header-guid - PO GUID which is created in first step.
    Please let me know any suggestions or solution on this.
    Thanks,
    Koyya

    Hi Koyya ,
    I am also doing the same in our project . But i am able to save the PO using BBP_PD_PO_SAVE Function Module .
    If you are getting this error means , then you check the all guids mapping part .
    Check all item guids ...have mentioned same parent guid
    same to account deatils and partner data also.
    Thank you ,
    Bharathi

Maybe you are looking for

  • Why don't color values change when using proof colors?

    Hi, i am very interested in obtaining exact replicas of the image in screen (in ProPhoto) and the image printed (using a suitable printer profile). However when I select Proof Colors from the view menu, the appearance changes but the RGBV or Lab colo

  • HT1692 My Contacts synced once to my iPod, how do I get them to sync again with updates?

    My Outlook Contacts synced to my iPod once (after finally finding out how to so that). Since then it has never synced with Contacts again. It syncs the music just fine. Some instructions I have read mention an "Info Tab" after selecting the device. I

  • Web browser problem

    hi... when i got my N95 it was doin fine.. til this pm when i tried openning my n95's web browser it wont start and kicks me back to where started.

  • How to find bounds of textcolumn

    Hello , can anybody tell me ,how to find bounds of textcolumn.

  • Archiso broken by pacman 4.0 signed packages

    Hi all, I tried to build a custom Arch Linux live media using archiso. I strictly followed the wiki here: https://wiki.archlinux.org/index.php/Archiso I get to the point where I should do pacman -Sy devtools libisoburn squashfs-tools and pacman throw