Include a type in a internal table declaration.

Hi.
How can I do this?:
TYPES: BEGIN OF ty_simples,
  agr_name LIKE agr_define-agr_name,
  text     LIKE agr_texts-text.  
TYPES: END OF ty_simples.
Transacciones de GS.
TYPES: BEGIN OF ty_transacciones_gs,
  tcode    LIKE agr_tcodes-tcode,   
  text     LIKE bmeniface-text.   
TYPES: END OF ty_transacciones_gs.
And after:
DATA: begin of t_simples occurs 0.
  include structure ty_simples.
  include structure ty_transacciones_gs.
data: end of t_simples.
I have got a verification error.
Thanks!

Hi,
Use as follow,
TYPES: BEGIN OF ty_simples,
       agr_name LIKE agr_define-agr_name,
       text1 LIKE agr_texts-text.
TYPES: END OF ty_simples.
TYPES: BEGIN OF ty_transacciones_gs,
        tcode LIKE agr_tcodes-tcode,
        text2 LIKE bmeniface-text.
TYPES: END OF ty_transacciones_gs.
* INTERNAL TABLES 
data: BEGIN OF t_simples occurs 0.
        INCLUDE TYPE ty_simples.              
        INCLUDE TYPE type ty_transacciones_gs.
data: END OF t_simples.
Regards.
Marcelo Ramos

Similar Messages

  • 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

  • Table type for an internal table

    hi Gurus
    Can I create a table type of an internal table, if yes then how?
    The declaration of the table type has fields from 10 dfferent Infotyopes.
    Edited by: swarnali_IBM on Feb 2, 2012 6:25 AM
    Moderator Message: Search for available information before posting.
    Edited by: kishan P on Feb 2, 2012 11:13 AM

    Hi
    The problem is ALV can shown a flat data, but you have a deep structure: you can have several lines of a text for the same items, this kind of structure can't be used in ALV.
    So you should indicate us how you need to show it by ALV:
    to show the first line for every item?
    to show all lines? (but it means to repeat the document and item number for every line of the text
    In this case the structure for the ALV should be:
    VBELN    TYPE VBELN_VA,
    POSNR    TYPE POSNR_VA
    TEXTLINE TYPE TDLINE
    Max

  • Internal tables whose line type contains further internal tables

    Hi,
    can you please demonstrate through a code sniplet the follwing topics .
    structures containing internal tables as components (deep structures)
    Internal tables whose line type contains further internal tables.
    Thx in advance
    Regards
    sas

    Hi,
    Check the code
    TYPES : BEGIN OF t_gr,
              wrbtr TYPE ekbe-wrbtr,
              menge TYPE ekbe-menge,
              bwart TYPE ekbe-bwart,
             END OF t_gr.
      DATA :  i_gr    TYPE TABLE OF t_gr.
      TYPES : BEGIN OF t_ekbe,
               ebeln TYPE ekbe-ebeln,
               ebelp TYPE ekbe-ebelp,
               *llggr LIKE i_gr,*
              END OF t_ekbe.
       DATA : i_ekbe      TYPE TABLE OF t_ekbe.
       SELECT ebeln
              ebelp
              wrbtr
              FROM ekbe
              INTO TABLE i_ekbe1
              FOR ALL ENTRIES IN i_data1
              WHERE ebeln = i_data1-ebeln   AND
                    ebelp = i_data1-ebelp   AND
                      bewtp = c_e          AND
                    ( bwart = c_101        OR
                      bwart = c_102        OR
                      bwart = c_103        OR
                      bwart = c_104 ).
    loop at i_ekbe1 into wa_ekbe1.
    wa_ekbe = wa_ekbe1.
    wa_gr-wrbtr = wa_ekbe-wrbtr
    append wa_gr to i_gr.
    on change of  wa_ekbe1-ebeln.
           *INSERT LINES OF i_gr INTO wa_ekbe-llggr INDEX 1.*
           *APPEND wa_ekbe TO i_ekbe.*
    endon.
    edloop.
    the above code the ekbe table is having one move itab l_gr
    l_gr is updated in each loop and and each change the i_ekbe is updated with one set of l_gr data as internal table line for i_ekbe.
    regards,
    Nandha

  • Longest length of a data type in an internal table in abap

    Hi everyone,
    I have a requirement for a client in which i want to read a standard text from SO10 which can be up to 5000 words, store that into an internal table & display it in an excel sheet in a single column in a single field.
    I have tried declaring my field as:
    field(65535) TYPE c,
    edidd-sdata,
    char1024,
    /SDF/CCM_XSTRING, etc. But the field does not store morre than 128 characters.
    Im attaching a screen shot of my final requirement.
    can anybody help in this regard??

    Hi Vinnet,
    Declare field with string type and use below sample code to display in a single row or colum.
    CONSTANTS: "Char
                   lc_char1 TYPE char2 VALUE '"' ,
                AT NEW esnum.                               "#EC AT_LOOP_WH
                  CONCATENATE lc_char1 l_string
                              INTO l_string
                              SEPARATED BY space.
                ENDAT.
                CONCATENATE l_string <field_name>
                            INTO l_string
                            SEPARATED BY space.
    *           Check for last line item to get payment note
                AT END OF esnum.                            "#EC AT_LOOP_WH
                  CONCATENATE l_string lc_char1
                              INTO l_string
                              SEPARATED BY space.
                ENDAT.
    reward if it helpfull.

  • TSV_TNEW_PAGE_ALLOC_FAILED  with internal table declared with occurs 0

    HI guys,
    when the internal table is declared as occurs 0, the dump TSV_TNEW_PAGE_ALLOC_FAILED is encountered, when changing the declaration into standard table, th dump disappears. Why is this so?
    Thanks!

    There are three type of tables: Standard, sorted and hashed tables (see [here|http://help.sap.com/abapdocu_70/en/ABAPDATA_ITAB.htm]). When you define a table using the keyword OCCURS you're still defining a standard table.
    Your exception indicates that you're running out of memory. The difference in the declarations that you mention shouldn't cause that. Main difference between the two declaration versions is probably that your table defined via OCCURS has a header line, whereas your other table doesn't (unless you declared it explicitly as WITH HEADER LINE).
    I don't think though that with that little information anybody could explain the short dump. Actually it sounds rather odd that the change you mention should cause the dump (or make it go away). So I suspect you probably have to post further details. You might want to check the shortdump yourself and place a breakpoint at this place and run it for each version. Maybe you can see some difference...

  • Accessing internal table declared outside of BAdI  implementation

    I am working on a BAdI implementation and within the BAdI, I need to manipulate the data of an internal table that is declared in the calling routine.  This internal table is not a parameter to the BAdI call.  I am wondering is there a way to access the internal table that is not recognized by the BAdI implementation?  If so, what's the syntax to do this?
    I know in debug mode, I am able to access the content of the internal table by using (Program)Itab.  But I get a syntax error when accessing the internal table using (Program)Itab syntax. 
    Any help is appreciated!

    Thanks, Max.
    I tried your method, but I am getting a short dump due to type conflict.  I think it's because the internal table I'd like to access is declared using the following syntax:
    data: begin of itab occurs 0,
          end of itab.
    Therefore, when processing the assign statement, the field-symbol is being treated as a structure...
    I tried to change the field-symbol type to any, but after that, I can't modify the table content using loop at type of syntax..
    Do you have any other suggestions? 
    Thanks very much!

  • How to fill LRAW data type from an internal table?

    Hi experts,
    I have a data type LRAW.
    ZCLUSTR type INT2.
    ZLOG type LRAW.
    It is said that: LRAW: Uninterpreted byte string of any length, but has to be declared with a minimum length of 256. Fields of this type must be located at the end of transparent tables (in each table there can be only one such field) and must be preceded by a length field of type INT2. If there is an INSERT or UPDATE in ABAP programs, this length field must be filled with the length actually required. If the length field is not filled correctly, this may lead to a data loss in the LRAW field! A fields of this type cannot be used in the WHERE condition of a SELECT statement.
    So my question is how can I store data in ZLOG? I want to store the content of an internal table into ZLOG, but I don't know how to use INSERT statement correctly. What should I do with ZCLUSTR?

    Hi Chaitanya,
    Refer IMPORT EXPORT statement with addition TO DATABASE in abap help.
    Refer below link from SAP help where it is described in detail.
    http://help.sap.com/saphelp_nw04/helpdata/EN/fc/eb3bf8358411d1829f0000e829fbfe/content.htm
    Regards,
    Vishal

  • Problem with internal table declaration in function gui_upload

    hi friends,
    can u tell me how should i define internal table when i use this function?
    i get error that in oo my declaration not good.
    thanks,
    dana.

    see this example:-
    DATA: BEGIN OF itab OCCURS 0,
            tdname   TYPE mara-matnr,
            tdline1  TYPE tline-tdline,
            tdline2  TYPE tline-tdline,
            tdline3  TYPE tline-tdline,
            tdline4  TYPE tline-tdline,
            tdline5  TYPE tline-tdline,
                  END OF itab.
    DATA: BEGIN OF itab_error OCCURS 0,
            tdname  TYPE mara-matnr,
            error   TYPE string,
          END OF itab_error.
    DATA: lines    TYPE STANDARD TABLE OF tline WITH HEADER LINE.
    DATA: temp     TYPE string.
    DATA: tdspras  TYPE thead-tdspras.
    DATA: tdname   TYPE thead-tdname.
    DATA: tdobject TYPE thead-tdobject.
    DATA: tdid     TYPE thead-tdid.
    DATA :flag     TYPE c.
    At Selection Screen Event
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p1.
      CALL FUNCTION 'F4_FILENAME'
        IMPORTING
          file_name = p1.
    At Start of Selection Event
    START-OF-SELECTION.
      PERFORM upload_data.
      PERFORM upload_text.
    *&      Form  upload_data
          text
    -->  p1        text
    <--  p2        text
    FORM upload_data .
      temp = p1.
    **& Upload Data from Excel
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename            = temp
          filetype            = 'ASC'
          has_field_separator = 'X'
        TABLES
          data_tab            = itab.
    ENDFORM.                    " upload_data
    *&      Form  upload_text
          text
    -->  p1        text
    <--  p2        text
    FORM upload_text .
      tdspras  = 'EN'.
      tdid = 'BEST'.
      tdobject = 'MATERIAL'.
      LOOP AT itab.
        REFRESH lines.
        CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
          EXPORTING
            input  = itab-tdname
          IMPORTING
            output = itab-tdname.
        TRANSLATE itab-tdname TO UPPER CASE.
        tdname = itab-tdname.
        PERFORM check_material.
        lines-tdline = itab-tdline1.
        APPEND lines.
        CLEAR lines.
        lines-tdline = itab-tdline2.
        APPEND lines.
        CLEAR lines.
        lines-tdline = itab-tdline3.
        APPEND lines.
        CLEAR lines.
        lines-tdline = itab-tdline4.
        APPEND lines.
        CLEAR lines.
        lines-tdline = itab-tdline5.
        APPEND lines.
        CLEAR lines.
        CALL FUNCTION 'CREATE_TEXT'
          EXPORTING
            fid       = tdid
            flanguage = tdspras
            fname     = tdname
            fobject   = tdobject
          TABLES
            flines    = lines.
      ENDLOOP.
      IF itab_error[] IS NOT INITIAL.
        WRITE : / 'PO Text For Following Material is not Uploaded'.
        WRITE : / .
        WRITE : / 'Material', '              Error'.
        LOOP AT itab_error.
          WRITE : / itab_error-tdname, '   ',  itab_error-error.
        ENDLOOP.
      ELSE.
        MESSAGE s001(38) WITH 'Data Uploaded Succcesfully'.
      ENDIF.
    ENDFORM.                    " upload_text
    *&      Form  check_material
          text
    -->  p1        text
    <--  p2        text
    FORM check_material .
      DATA : w_matnr TYPE mara-matnr.
      SELECT SINGLE matnr
      INTO w_matnr
      FROM mara
      WHERE matnr = itab-tdname.
      IF sy-subrc = 0.
        flag = 'X'.
      ELSE.
        MOVE-CORRESPONDING itab TO itab_error.
        itab_error-error = 'Material does not exist'.
        APPEND itab_error.
      ENDIF.
    ENDFORM.                    " check_material

  • Internal table declaration -OO ABAP

    Hi,
              I am looking to declare an internal table using OO objects. My declaration are as follows..
    TYPES : Begin of itab,
                         f1 type c,
                         f2 type c,
                 End of itab.
    DATA : itab1 type standard table of itab.
    DATA: wa_tab type itab.
    I have an internal table to say itab_pa2001 which i am reading all the records of pernr into ITAB_PA2001.To get the text i want to select * from t5*** into ..... Finally wht am looking is to move some of the fields into the final table ITAB. Could you please let me know how to set this up as i am getting wrong values when i am looping as below.
    how to declare a structure in ITAB using ABAP OO....??
    LOOP at ITAB_PA2001 into wa_itab.
    ENDLOOP.
    Thanks,
    Vind

    Hi,
    Please refer to following links :
    [How to declare an internal table in OO-ABAP programming? |Re: How to  declare an internal table in OO-ABAP programming?;
    [sample object oriented ABAP program |http://wiki.sdn.sap.com/wiki/display/Snippets/sampleobjectorientedABAPprogram]
    Hope this helps.
    Regards,
    Chandravadan

  • Read Type-pools into internal table

    Hi all,
    I want the type-pools content to be put into the internal table and find the Lines of Code in it.
    Can anybody suggest how it is possible?
    Regards,
    K.Tharani.

    hi
    type pool will contain a list of related datas decalred in it ,
    and we can use those datas declared
    TYPE-POOLS abap.
      DATA: litab_catalog TYPE  abap_fieldcat_alv OCCURS 0,
              s_catalog TYPE  abap_fieldcat_alv.
      DATA: LITAB_EVENT   TYPE slis_t_event,
            S_EVENT   TYPE slis_alv_event.
    CATALOG Creation.
      s_catalog-col_pos   = 1.
      s_catalog-tabname   = 'GITAB_ERROR'.       "'T_ERROR'.
      s_catalog-fieldname = 'RECNO'.
      s_catalog-outputlen = 15.
      s_catalog-seltext_l  = 'Record Number'.
      s_catalog-ddictxt = 'L'.
      APPEND s_catalog TO litab_catalog.
    i think u can move ur type pools value into a Internal table,
    and then u can use
    describe table internal table  lines work area.

  • Internal table declaration

    What is the difference between 'OCCURS 0' addition and 'INITIAL SIZE' .
    CASE I :(Declaration With 'OCCURS 0' addition)
    DATA:BEGIN OF I_TAB OCCURS 0,
           NAME(5) TYPE C,
           AGE(2) TYPE C,
         END OF I_TAB.
    CASE II :(Declartion with inital size)
    TYPES:BEGIN OF T_TAB,
                 NAME(5) TYPE C,
                 AGE(2) TYPE C,
               END OF T_TAB.
    DATA:I_TAB TYPE STANDARD TABLE OF T_TAB INITIAL SIZE 0.
    In the above cases which case is efficient for declaring internal table ?
    Moderator message: please read ABAP documentation before posting.
    Edited by: Thomas Zloch on Jun 27, 2011 4:23 PM

    What is the difference between 'OCCURS 0' addition and 'INITIAL SIZE' .
    CASE I :(Declaration With 'OCCURS 0' addition)
    DATA:BEGIN OF I_TAB OCCURS 0,
           NAME(5) TYPE C,
           AGE(2) TYPE C,
         END OF I_TAB.
    CASE II :(Declartion with inital size)
    TYPES:BEGIN OF T_TAB,
                 NAME(5) TYPE C,
                 AGE(2) TYPE C,
               END OF T_TAB.
    DATA:I_TAB TYPE STANDARD TABLE OF T_TAB INITIAL SIZE 0.
    In the above cases which case is efficient for declaring internal table ?
    Moderator message: please read ABAP documentation before posting.
    Edited by: Thomas Zloch on Jun 27, 2011 4:23 PM

  • How to get the Data type of the Internal Table.

    How can i get the data types used to create an internal table
    TYPES : BEGIN OF t_makt,
              matnr    TYPE    matnr,
              maktx    TYPE    maktx,
            END OF t_makt.
    Like this some function will give me which data types i have used for the internal table at run time.

    Use the FM ..
    data : int_fcat type SLIS_T_FIELDCAT_ALV.
    REUSE_ALV_FIELDCATALOG_MERGE ..
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                I_PROGRAM_NAME         = sy-repid
                I_INTERNAL_TABNAME     = 'IMAT'   <-- this is your internal table
                 I_INCLNAME             = sy-repid
           CHANGING
                CT_FIELDCAT            = int_fcat <--- this contains all the fields along with their characteristics ...
           EXCEPTIONS
                INCONSISTENT_INTERFACE = 1
                PROGRAM_ERROR          = 2
                OTHERS                 = 3.

  • Data type for an internal table var.

    hi guys
    i need a variable for labeling an internal table
    tablename may work with tables, but i need exactly the same for internal tables.
    data: DIM_TABLE TYPE TABLENAME.
    gt_ztsdhr000 is an internal table and i have 000-020,
    CASE ti_table .
        WHEN 'gt_ztsdhr000'.
          SELECT * FROM (dim_table) INTO TABLE dummy000.
          IF sy-subrc = 0.
            DELETE FROM (dim_table).
            IF sy-subrc = 0.
              INSERT (dim_table) FROM TABLE gt_ztsdhr000.
              IF sy-subrc = 0.
                MESSAGE msg  TYPE 'I'.
              ENDIF.
            ENDIF.
          ELSE. " si esta vacia solo insertamos
            INSERT (dim_table) FROM TABLE gt_ztsdhr000.
            IF sy-subrc = 0.
              MESSAGE msg  TYPE 'I'.
            ENDIF.
          ENDIF.
    And i want something like this:
    DATA: my_table like ittabname.
    my_table = 'gt_ztsdhr000'.
    CASE ti_table .
        WHEN 'gt_ztsdhr000'.
          INSERT (dim_table) FROM TABLE (my_table).

    Hello,
    Is it your problem solved ?
    One possible way also is by calling a PERFORM statement for each new address.
    Hints:
    PERFORM <GET_ADD>  USING  <&key_field_to_read_itab&>
                                   CHANGING  <&addr1&>
                                   CHANGING  <&addr2&>
    Than you can print the address.
    Regards,
    Amarjit

Maybe you are looking for