Reg:table declaration in a top include

Hi gurus,
I have declared few tables in the top include of a function module,but while activating the FM it's throwing error that "the table has already been declared".Where as I have not declared those tables anywhere else.
Please give me a solution regarding this.
Thanks in advance.

hi,
it might be dat u have declared the required tables in ur Function module and also declared in Top Include. check this. when ever you declared all required elements in ur Top include then try to avoid them declaring in ur FM.
if helpful reward some points.
with regards,
Suresh Aluri.

Similar Messages

  • Problem with variable declared in TOP Include

    Hi,
    I have declared a variable P_TEXT in TOP include ZPGM_TOP.  In main program ZPGM, I have declared this TOP include ZPGM_TOP and another include ZPGM_F01.
    I am  accessing P_TEXT in include ZPGM_F01, but it is giving me following error when I do syntex check.
    Error : Field P_TEXT is unknown. It is neither in one of the specified tables nor defned by DATA statement.
    But when I double click on P_TEXT in ZPGM_F01, it takes me to TOP include declaration.
    Please advise what I am doing wrong.
    Thanks.

    Check the sequence in which your includes are declared e.g.
    include zpgm_top. "data
    include zpgm_f01. "code
    would work, but:
    include zpgm_f01. "code
    include zpgm_top. "data
    will give syntax error in "zpgm_f01".
    Jonathan

  • Program with Top includes

    Hallo,
    I hope someone can help me.
    I would like to know if is it allowed this program under ?
    Program with Top Includes.
    Type 1 Exucutable Program.
    Developement class $TMP - Temporary Objects.
    Logical Database ABS. ABAP Book: Customer and bookings.
    (DB Selection Screen 1000)
    If it is allowed where can I use Events GET in flow logic ?
    Thank in advance.
    Kindest regardes.
    Claudia

    Hi Claudia,
    Welcome to SDN Forum. Don't forget to read the [rules of engagement|https://www.sdn.sap.com/irj/sdn/wiki?path=/display/home/rulesofEngagement].
    Take a look at Report "EXAMPLE_PNP_GET_PAYROLL" it demonstrate how to use Logical database and GET events.
    Logical database      PNP                   HR Master Data
    Selection screen      900                   Selection screen on payroll results
    * These three tables need to be declared for the selection screen-.
    * Currently, the declarations of  pyorgscreen, pytimescreen HAS to
    * be done in addition to setting selection screen = 900 .
    TABLES: pernr.
    * Declare the country specific structure:
    * payXX_result with  XX = country code, e.g. payDE_result for Germany
    * Country = 99 is an exception: If this structure is used, the
    * international part of every payroll result is returned regardless
    * of country code. In the other case, pernr's whose country code do
    * not fit the structure are skipped.
    NODES: payroll TYPE pay99_result.
    DATA: wa_wpbp LIKE LINE OF payroll-inter-wpbp.
    GET pernr.
    WRITE: / 'Currently working on:'(021), pernr-pernr.
    GET payroll.
      LOOP AT payroll-inter-wpbp INTO wa_wpbp.
        WRITE:   / 'Personal Area ='(018),  wa_wpbp-werks,
                   'Sub Area ='(019),  wa_wpbp-btrtl.
      ENDLOOP.
    Don't forget to close this thread and all yours previous when your question be answered !
    Best Regards.
    Marcelo Ramos

  • Top include in Function module

    Hi All,
      I have written a select statment in a FM.I want to retain the values selected so that it is available even when the FM is executed next time.Is it possibe to retain values selected by declaring  the internal table in the TOP include?
    Thanks,
    Rakesh.

    hi Rakesh,
    if you declare the internal table in the TOP include, that only means it will be avaliable for each FM in the function group. The internal table will be avaliable, not the data (which is filled with the SELECT statement)!
    The question is when do you execute the FM next time? It it's only a while, you can export the data into the memory, import by the next FM call and you don't need to select again. but it only works if it is still the same user, same session. can you enlight the scenario?
    thanks
    ec

  • Type pools VS Top Include.

    Hi all,
    Is there any difference between a top include and Type pools.
    As both are used for data declaration purpose, i would like to know any differences between these two.
    Please kindly clarify me on this.
    Thanks in advance.

    It might come as a surprise to some, but this is all information that can be easily derived from the online SAP documentation. Here we go...
    A type group (which can be defined via the [TYPE-POOL|http://help.sap.com/abapdocu_70/en/ABAPTYPE-POOL.htm] statement) is more or less a historical artifact, which allowed you since release 3.0 to define any type globally in the data dictionary (and at that time the data dictionary was limited and didn't allow for example types for internal tables). For further reading I recommend the online help on [data types in the ABAP dictionary|http://help.sap.com/saphelp_nw70ehp2/helpdata/en/fc/eb3138358411d1829f0000e829fbfe/frameset.htm].
    Now, a type group is not like any include, because it only allows certain statements (see [TYPE-POOL|http://help.sap.com/abapdocu_70/en/ABAPTYPE-POOL.htm] in the online ABAP help) and is designed as a global object for re-use. E.g. in TOP includes you would also define your global data (e.g. if you have a module pool for a dialog program), whereas in type groups you cannot do that. And obviously a TOP include is not necessarily a global object that should be shared across programs (though of course you can do that).
    As Clemens already pointed out, type groups are nowadays considered obsolete, because you have different alternatives  (see comments in [data types in the ABAP dictionary|http://help.sap.com/saphelp_nw70ehp2/helpdata/en/fc/eb3138358411d1829f0000e829fbfe/frameset.htm]). Note also that with 7.0 EhP2 the ABAP compiler automatically loads type groups on demand (which also shows you their global nature) and thus making the statement [TYPE-POOLS|http://help.sap.com/abapdocu_70/en/ABAPTYPE-POOLS.htm] obsolete (see the comments there).
    Cheers, harald

  • Top include

    hi,
    what is the meaning of tp include.
    regards,
    dhiraj

    Hi,
    top include is usually meant for global delcarations
    for eg you have written a function module
    and obviously it will be in afunction group
    then by default it will be creating two includes
    one of it is top include
    in a function group we can have many function modules
    and we will use so many variables in that
    and some times the same variables may be used in many function  modules
    in that case we used todeclare them in the top include so that all the function
    modules can access it..
    <b>so top include is a common space for all the related program to declare the
    variables and internals tables or what ever the declarations...</b>
    same as  for the reports
    thanks & regards,
    Venkatesh

  • Error in ABAP Report TABLES declaration

    Hi,
    I am a Basis administrator and trying to write a small program for archiving.
    I get a folowing error when user the following statement in a report -
    TABLES: RSDAARCHREQ.
    The error is as follows -
    "RSDAARCHREQ" must be a flat structure. You cannot use internal tables,
    strings, references, or structures as components. -
    I can include all the other tables requred but somehow this particular table gives me this error which I have never encountered earlier. This is BI 7.0 and it is standard SAP transparent table.
    Please help me.
    I will appreciate it.
    Regards,
    Sume

    Hi Sume,
    Do not declare RSDAARCHREQ in tables.
    If you want a internal table  declare in the below mentioned way .
    data: it_RSDAARCHREQ TYPE STANDARD TABLE OF RSDAARCHREQ.
    select * into table
    it_RSDAARCHREQ
      from RSDAARCHREQ.
    Regards
    Naresh

  • How to create a top include for module pool program

    hi all..
      I want to add my global declarations in one top inlcude.. There are so many other includes in my pgm. But how can i create top include explicitly. Also I have one normal report pgm attached with this module pool.

    hi Cynthia ,
       there are two ways of creating a top include at your situation  ,
    1) Insert an include <Prog name >TOP  in your mpool program and cut n paste your declarations there .. check if this works ...
    2)else .. create another m pool program in SE80 , while creating a pop up will ask for with TOP include ... check mark that and then proceed ..
       anything of these two will work ...
    Reward if helpful !!
    Regards,
    Ranjita

  • How to include Standard Top include in custom FM ?

    Hi Experts ,
    I have copied a standard FM to custom RFC. (and also all declarations in a custom TOP include) .
    I have a variable that is declared in the Standard TOP include also .
    How I can include that Include in my Custom RFC .
    This is because the standard TOP include is geting called at run time and overwriting the variable.
    Regards,
    Sunitha

    Hi Rahul,
    You will not find the "CatalogItemImpl" in the 'businessobject.xml'. The 'businessobject.xml' is there to define session based API of modules. Those API have properties and web channel builder values injected when the user start a web session.
    For the "CatalogItem", you will have to use the Generic Factory concept. The Generic Factory is used to allocate instance given a configuration. If no configuration exists, the default implementation is used. By adding an entry in the Generic Factory you can choose to allocate your class instead of the default class.
    Within the catalog module, the alias to use for classes extending "CatalogItemImpl" is "com.sap.wec.app.common.module.catalog.businessobject.ext.interf.CatalogItemExtInterf".
    Please refer to the extension guide on how to manage the Generic Factory configuration file.
    Regards,
    Robin

  • DIFF: Field string ,Structure and Internal table declaration

    Hai,
           what is the diference between  Field string ,Structure in ABAP program and Internal table declaration and how it will work ?
    Thank you
    ASHOK KUMAR.

    hi,
    Look this u will get a good idea.
    *& Report  ZTYPES                                                      *
    REPORT  ZTYPES                                                  .
    * Table declaration (old method)
    DATA: BEGIN OF tab_ekpo OCCURS 0,             "itab with header line
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
    END OF tab_ekpo.
    *Table declaration (new method)     "USE THIS WAY!!!
    TYPES: BEGIN OF t_ekpo,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
    END OF t_ekpo.
    DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,      "itab
          wa_ekpo TYPE t_ekpo.                    "work area (header line)
    * Build internal table and work area from existing internal table
    DATA: it_datatab LIKE tab_ekpo OCCURS 0,      "old method
          wa_datatab LIKE LINE OF tab_ekpo.
    * Build internal table and work area from existing internal table,
    * adding additional fields
    TYPES: BEGIN OF t_repdata.
            INCLUDE STRUCTURE tab_ekpo.  "could include EKKO table itself!!
    TYPES: bukrs  TYPE ekpo-werks,
           bstyp  TYPE ekpo-bukrs.
    TYPES: END OF t_repdata.
    DATA: it_repdata TYPE STANDARD TABLE OF t_repdata INITIAL SIZE 0,   "itab
          wa_repdata TYPE t_repdata.                 "work area (header line)
    Regards
    Reshma

  • Internal table declaration - work area and body

    Hi all
    I have declared my internal table in my program as
    data : itab_wa type ZRESULT_LINE,
           itab    type ZRESULT_ROW.
    Where ZRESULT_LINE and ZRESULT_ROW are the structure and table types.
    Now I want to add
    data: TCOLOR TYPE SLIS_T_SPECIALCOL_ALV.
    in my internal table declaration. How can I do this. Please remember I need to have work area and body in my internal table as I have used work area and body in my code.
    Waiting..............
    Message was edited by: Raju Boda

    HI,
    See the Declarion types of workarea and Internal tables
    * Table declaration (old method)
    DATA: BEGIN OF tab_ekpo OCCURS 0,             "itab with header line
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
    END OF tab_ekpo.
    *Table declaration (new method)     "USE THIS WAY!!!
    TYPES: BEGIN OF t_ekpo,
      ebeln TYPE ekpo-ebeln,
      ebelp TYPE ekpo-ebelp,
    END OF t_ekpo.
    DATA: it_ekpo TYPE STANDARD TABLE OF t_ekpo INITIAL SIZE 0,      "itab
          wa_ekpo TYPE t_ekpo.                    "work area (header line)
    * Build internal table and work area from existing internal table
    DATA: it_datatab LIKE tab_ekpo OCCURS 0,      "old method
          wa_datatab LIKE LINE OF tab_ekpo.
    * Build internal table and work area from existing internal table,
    * adding additional fields
    TYPES: BEGIN OF t_repdata.
            INCLUDE STRUCTURE tab_ekpo.  "could include EKKO table itself!!
    TYPES: bukrs  TYPE ekpo-werks,
           bstyp  TYPE ekpo-bukrs.
    TYPES: END OF t_repdata.
    DATA: it_repdata TYPE STANDARD TABLE OF t_repdata INITIAL SIZE 0,   "itab
          wa_repdata TYPE t_repdata.                 "work area (header line
    you need to maintain same structure for both workarea as well Internal table
    Regards
    Sudheer

  • Top Include in Module Pool

    Hi Experts,
    Can anybody will suggest me how I can create TOP include in module pool program?
    Actually wanted to create select option in module pool.
    Please suggest.
    Regards,
    Neha

    Hi Neha,
    Please find the below code for creating a select-options in Module pool
    Note: dont create a Screen first.
    TABLES VBAP.
    SELECTION-SCREEN BEGIN OF SCREEN 100 .
    SELECTION-SCREEN BEGIN OF BLOCK B1 WITH FRAME TITLE TEXT-001.
    SELECT-OPTIONS S_VBELN FOR VBAP-VBELN.
    PARAMETER P_WERKS LIKE VBAP-WERKS.
    SELECT-OPTIONS S_ERDAT FOR VBAP-ERDAT.
    SELECTION-SCREEN END OF BLOCK B1.
    SELECTION-SCREEN END OF SCREEN 100.
    Thanks
    Surendra P

  • How to use a TOP INCLUDE of my_function_module for/into my_report?

    Hello Experts,
    I put the below code in my_function_module
    PERFORM my_routine
    IN PROGRAM my_report_prog
    USING xyz.
    Now, i want to use the TOP INCLUDE/Data declaration part of my_function_module for/into my_report_prog, because i do not want to declare all again.
    Pls. let me know how to use a TOP INCLUDE of a my_function_module for/into my_report?
    Thank you

    Hi,
        I think we can directly use the include using INCLUDE stat.
    Go to your function group get the top include name
    and use it in your report.
    Thanks,
    Anmol.

  • Errors in  activating Program with TOP INCLUDE

    Hi,
    I have a report with TOP INCLUDE. In the global declaration include, I keep encountering an error for a deferred class definition. The codes were working perfectly fine previously, before I changed from a report WITHOUT TOP INCLUDE to report with TOP INCLUDE. Can anyone help? Thanks..
    ============================================
    Main Program
    INCLUDE ZXXX_RULES_ENGINE_TOP.  " Global Data
    INCLUDE ZXXX_RULES_ENGINE_C01.  " CLASS-Objects
    ============================================
    ZXXX_RULES_ENGINE_TOP
    REPORT   ZXXX_RULES_ENGINE.
    CLASS CL_TREE DEFINITION DEFERRED.
    " ==> Error encountered: "CLASS CL_TREE DEFINITION DEFERRED" does not have "CLASS CL_TREE DEFINITION".
    CLASS CL_GUI_CFW DEFINITION LOAD.
    ============================================
    ZXXX_RULES_ENGINE_C01
    CLASS CL_TREE DEFINITION.
      PUBLIC SECTION.
    ENDCLASS.
    CLASS CL_TREE IMPLEMENTATION.
    ENDCLASS.
    ============================================
    Edited by: Kian Keong on Mar 17, 2008 6:37 PM

    Hi,
    Go to ur main program in display mode and press CntrlShiftf5.
    On the left hand side select your main program and click on activate button.
    Hope ur problem will be solved.
    If still sm error is there then tell me the error message.
    Award Points If Useful

  • Ranges in top include

    helllo all,
    In my function mdoule i have a top inculde
    where i need to declare ranges but it gives me a error
    message when i declareranges
    -->statement not accessible
    Very strange problem....any clue??

    Hi Bhanu,
    By saying "In my function mdoule i have a top inculde" do you mean you have added an INCLUDE statement inside the code of the function module? If so, that is not the way.
    Instead, every function module is attached to a function group, and the every function group has a top include (which is accessible to all function modules under the function group).
    Hence, e.g. say your function group is ZFGRP, then your function module's top include would be program LZFGRPTOP which is added as an INCLUDE in the function group main program.
    Please declare your RANGE in the LZFGRPTOP program and everything should be fine.
    Regards,
    Aditya

Maybe you are looking for

  • Spool not getting generated in OO ALV report

    Hi, I developed a report in which we are giving output in same selection screen through OO ALV. But,when we are scheduling that report in background,spool is not getting generated. Waiting for your reply. BR, Praveen

  • Converting PDF to WORD DOCX

        I downloaded the free 30 day trial of Adobe XI Pro so that i can convert a pdf to a word doc, something that comes with the free trial i installed, however, i'm allowed to do nothing but the basics within the upgraded version. Can anyone tell me

  • Why is my Quick Preview taking ages to load

    I am finding the Quick Preview in Aperture is taking a long time to load the picture. I have to come out of quick preview to allow the picture to load and be clear. Once it has loaded, I can go back in to QP and it works as expected. Until I try to o

  • Is a certain MAC recognizable by unwanted cookies, regardless of IP?

    Hi folks, I have been searching the web but I can´t seem to find a definitive answer to this quick question: If I visit a certain website (say a forum, like this) they most certainly log the I.P etc. But I hear all kind of horror stories that certain

  • Best practices for subcriptions of many servers

    Thinking of monitoring free space on my servers. Servers are 2003,2008,2012 (plus R2). Basing on http://fehse.ca/2013/07/disk-space-monitoringcommon-practices/ - need to make three monitors for each version of server. So, the best practice is to crea