Include structure in TYPES declaration

Hello All:
Many forum posts have discussed similar topics, but I couldn't exactly find one answering my requirement. Apologies if I have missed out reading some.
Instead of creating a type as below (as suggested in few forum posts)
TYPES begin of types ty_itab
                     include type BISEG
                     xxxx type xxx
                     xxxx type xxx
            End of types ty_itab
I need to create the type with include structure after the additonal fields.
TYPES begin of types ty_itab
                     <fld1> type <ty1>
                     <fld2> type <ty2>
                     include type <struc>
            End of types ty_itab
Can someone give the right syntax?
Please help,
Fred.

Hello Fred
If you are using the extended syntax you should not encounter any problems:
TYPES: begin of types ty_itab.
TYPES:                     <fld1> type <ty1>.
TYPES:                     <fld2> type <ty2>.
                     include type <struc>.
TYPES: End of types ty_itab
Regards
  Uwe

Similar Messages

  • Including structure in TYPES-- urgent

    hi
    this is an itab with header line
    data: begin of xdb_mchb occurs 0.
            include structure mchb.
    data:   vrfmg      like v01fdk-vrfmg.
    data:   cuobj      like inob-cuobj.
    data:   lifnr      like mkol-lifnr.
    data:   sobkz      like mkol-sobkz.
    data:   lobm_bprio like bfstock-lobm_bprio.
    data: end of xdb_mchb.
    and i want to define an explicit work area  so i have done it like this :
    types :       BEGIN OF ts_xdb_mchb ,
           <b>include structure mchb,</b>
            vrfmg      TYPE v01fdk-vrfmg,
            cuobj      TYPE inob-cuobj,
            lifnr      TYPE mkol-lifnr,
            sobkz      TYPE mkol-sobkz,
            lobm_bprio TYPE bfstock-lobm_bprio,
           END OF ts_xdb_mchb.
    but i m getting error. as ""," expected after "INCLUDE"."
    can we include structure in TYPES please let me know..
    thnx<b></b><b></b><b></b><b></b>

    Hi neha,
    After INCLUDE don't put " , " instead put " . "
    So that you can errors.
    It will work try.OK
    types : BEGIN OF ts_xdb_mchb ,
                 vrfmg TYPE v01fdk-vrfmg,
                 cuobj TYPE inob-cuobj,
                 lifnr TYPE mkol-lifnr,
                 sobkz TYPE mkol-sobkz,
                 lobm_bprio TYPE bfstock-lobm_bprio,
                 <b>include structure mchb.</b>
    END OF ts_xdb_mchb.
    If helps, reward.
    regards,
    V.Raghavender.

  • How to include structure in Types Definition ???

    Hello All,
          I want a declaration like this in BSP :-
    DATA : BEGIN OF imkop OCCURS 100.
                   INCLUDE STRUCTURE mkop.
    DATA :   waers LIKE mepro-waers.      
    DATA : END OF imkop.
    <b>In BSP: Type Definitions</b>
    I wrote like this :-
    Types : BEGIN OF imkop.
                    INCLUDE STRUCTURE mkop.
    Types :   waers type mepro-waers.      
    Types : END OF imkop. 
                   I'm getting an error saying that I can't use structures in this .
    Now what should I do ?
    Can anyone help me out ?
    Regards,
    Deepu.K

    deepu,
    we can declare structures as below.
    DATA:  event_data      TYPE REF TO cl_htmlb_event.
    TYPES: BEGIN OF row_iid_type,
           row_iid  TYPE hap_row_iid,
           END OF row_iid_type.
    DATA:
           t_row             TYPE STANDARD TABLE OF row_iid_type,
           t_row_wa          TYPE row_iid_type,
           t_message  TYPE STANDARD TABLE OF bal_s_msg .
    DATA:
           lw_body_element   TYPE hap_s_body_elements,
           lw_body_column    TYPE hap_s_body_columns,
           lw_body_cell      TYPE hap_s_body_cells,
           lw_return         TYPE bal_s_msg,
           warning TYPE i.
    regards,
    manasa

  • Include structure problem

    Hi,
    I'm trying to compile simple construction in ECC 60:
    types: begin of t_bbseg.
             include structure bbseg.
    types: end of t_bbseg.
    I have compilation error:
    "The type "SI_BBSEG" is unknown"
    Is anyone had something like this before?
    We are NetWeaver 2004S Unicode enabled.
    Thank you,
    Ihar

    If you are trying to include BSEG as a structure in the TYPE, use the TYPE keyword instead
    types: begin of t_bbseg.
    include type bseg.
    types: end of t_bbseg.
    REgards,
    Rich Heilman

  • Include a structure in a TYPES declaration

    Hii
    I have a structure BISEG
    i need to declare an internal tabel with that structure BISEG + some additional fields
    i did like below please advise if this correct
    TYPES begin of types ty_itab
                         include type BISEG
                         xxxx type xxx
                         xxxx type xxx
                End of types ty_itab
    DATA:
       itat TYPE standard tabel of ty_itab
    note i don't want to use header line

    Hello All:
    Can I reopen this q, I searched but couldn't find a confirmative answer.
    Instead of creating a type as below
    TYPES begin of types ty_itab
                         include type BISEG
                         xxxx type xxx
                         xxxx type xxx
                End of types ty_itab
    I need to create the type with include structure after the additonal fields.
    TYPES begin of types ty_itab
                         <fld1> type <ty1>
                         <fld2> type <ty2>
                         include type <struc>
                End of types ty_itab
    Can someone give the right syntax?
    Please help,
    Fred.

  • Error on extended check for types include structure statements

    Hi All ,
                  On Extended check im getting error :
    Program:  ZFIR_VALUATE_OBSOLETE_STOCK  Include:  ZFIR_VALUATE_OBSOLETE_STOCK_F  Row:   1205
    The current ABAP command is obsolete
    Within classes and interfaces, you can only use "TYPE" to refer to ABAP Dictionary
    types, not "LIKE" or "STRUCTURE".
    Internal Message Code: MESSAGE G/B
    (The message cannot be hidden using pseudo-comment "#EC .., bzw. durch SET
    EXTENDED CHECK OFF/ON)
    The error is in below line :
    TYPES: BEGIN OF t_fttax.
              INCLUDE STRUCTURE fttax.
      TYPES: END OF t_fttax.
    and fttax is a dictionary strucuture . i made internal table and work area using it .
    DATA: i_fttax TYPE STANDARD TABLE OF t_fttax,
            wa_fttax TYPE t_fttax.
    Need Help ,what i should do to remove this error ?
    Regards

    declare as :
    DATA: i_fttax TYPE STANDARD TABLE OF fttax,
               wa_fttax TYPE fttax.
    No need to declare as :
    TYPES: BEGIN OF t_fttax.
              INCLUDE STRUCTURE fttax.
      TYPES: END OF t_fttax.

  • Table type with include structure

    Hi All,
    How to declare a table type with include structure
    i am declaraing it in the following way its giving epc check of obselete statement,
    could any one tell me how to declare a table type and internal table for the following code.
    DATA:BEGIN OF TY_OUTPUT OCCURS 0.
    DATA:PS_PSP_PNR TYPE EKKN-PS_PSP_PNR.
    INCLUDE STRUCTURE ST_ZCDTT0005.
    DATA:END OF TY_OUTPUT.
    Thanks in advance.

    Hi
    TYPES: BEGIN OF TY_OUTPUT,
             PS_PSP_PNR TYPE EKKN-PS_PSP_PNR.
             INCLUDE STRUCTURE ST_ZCDTT0005.
    TYPES: END OF TY_OUTPUT.
    TYPES: TY_T_OUTPUT TYPE TABLE OF TY_OUTPUT.
    Max

  • Itab declaration include structure error

    hi ,
    types : begin of it_address_info_type,
           include structure zadrc,
    end of it_address_info_type.
    here zadrc is a structure.
    why its giving error.
    shall i need to change this structure to table?
    if yes how i will do that?

    Hi ,
    Please make it as,
    types : begin of type.
    include type zadrc.
    types : end of type. 
    or
    TYPES: iref TYPE REF TO ZADRC.
    or
    TYPES: iref type table of mara.
    or
    TYPES: iref type standard table of mara.
    Else.
    data : begin of it_address_info_type.
    include structure zadrc.
    data : end of it_address_info_type.
    If you use types it is used to create user defined data type.
    But you are refrerring a data object as zadrc. Thats why it shows error.
    Regards,
    Sankar.
    Edited by: sankar on Mar 23, 2008 8:31 AM

  • Extended syntax check for include structure

    Hello Everyone,
    While declaring the internal table as:
    TYPES: BEGIN OF t_data.
            INCLUDE STRUCTURE mara.
    TYPES: END   OF t_data.
    DATA: it_data TYPE table of t_data.
    When performing extended check, i get following error:
    The current ABAP command is obsolete and problematic, especially so in ABAP
    Objects
    Within classes and interfaces, you can only use "TYPE" to refer to ABAP Dictionary
    types, not "LIKE" or "STRUCTURE".
    I am using 4.7 version.
    Any clue how to avoid this error during extended check.
    Regards,
    Tarun

    Tarun,
    With WAS 6.20 you should not declare internal tables with header line or using the old syntax as they are not compatible with OO ABAP.
    So, you either declare a TYPE the way you have done, in case you want additional fields apart from the INCLUDE structure, or declare the table directly like the way I have shown.
    Good thing, you can even specify the type of internal table that you want to create using this - STANDARD, SORTED, HASH. These tables will help you with the performance issues.
    regards,
    Ravi
    Note : Please mark the helpful answers

  • Include structure and extra fields in the same Internal Table

    Hi developers,
    im trying to declare an internal table with include structure and extra fields,
    something like this:
    data: BEGIN OF it_loans occurs 0,
          include structure zthrca006,   
          status(10),
          pernr   like pa0001-pernr,
          sname   like pa0001-pernr,
          tipomov(20),
          monto   like zthrca006-monto,
    data: END of it_loans.
    zthrca006 is huge so i dont want to type everithing.

    What is the issue?
    data: BEGIN OF it_loans occurs 0.
                 include structure zthrca006.
    data :     status(10),
    data :     pernr like pa0001-pernr.
    data :     sname like pa0001-pernr.
    data :     tipomov(20).
    data :     monto like zthrca006-monto,.
    data:  END of it_loans.
    Regards,
    Ravi
    Note - Please mark all the helpful answers

  • Syntax error on INCLUDE STRUCTURE.

    Hi Experts,
    It is abit hard to explain what I need here.
    But I try to explain as much as I can.
    I am writing this code in order to update the customer material numbers into internal table tvbdpa. As you can see in my code, getting the customer material numbers require mapping the position number.
    I am stuck at the LOOP below with ***.
    Also getting the syntax error
    _The declaration for the key field "KDMAT" is imcomplete.
    However "KDMAT" is is contained in the key of table "TVBDPA" and must be filled._
    TABLES: vbco3.
    DATA: da_mess LIKE vbfs OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF tvbdpa OCCURS 0,        "Internal table for items
            kdmat LIKE LIPS-KDMAT.
            INCLUDE STRUCTURE vbdpa.
    DATA: END OF tvbdpa.
    DATA: itab_vbak TYPE SORTED TABLE OF vbak
             WITH UNIQUE KEY vbeln,
          wa_vbak  LIKE LINE OF itab_vbak,
          itab_lips TYPE SORTED TABLE OF lips
             WITH UNIQUE KEY vbeln,
          wa_lips   LIKE LINE OF itab_lips,
          wa_tvbdpa LIKE LINE OF tvbdpa,
          lv_zuonr  TYPE vbak-zuonr.
      vbco3-mandt = sy-mandt.
      vbco3-spras = nast-spras.
      vbco3-vbeln = nast-objky.
      vbco3-kunde = nast-parnr.
      vbco3-parvw = nast-parvw.
    CALL FUNCTION 'RV_DOCUMENT_PRINT_VIEW'
      EXPORTING
        comwa                       = vbco3
      IMPORTING
        kopf                        = vbdka
      TABLES
        pos                         = tvbdpa
        mess                        = da_mess
      EXCEPTIONS
        fehler_bei_datenbeschaffung = 1.
    IF NOT tvbdpa[] IS INITIAL.
      SELECT SINGLE zuonr FROM vbak
        INTO lv_zuonr
        WHERE vbeln = vbdka-vbeln.
        IF sy-subrc = 0 AND lv_zuonr <> ''.
          SELECT vbeln posnr kdmat FROM lips
            INTO CORRESPONDING FIELDS OF TABLE itab_lips
            WHERE vbeln = lv_zuonr.
    ***I am stuck at here.
          LOOP AT itab_lips INTO wa_lips.
            READ TABLE tvbdpa INTO wa_tvbdpa
              WITH TABLE KEY posnr = wa_lips-posnr.
            wa_tvbdpa-kdmat = wa_lips-kdmat.
            MODIFY TABLE tvbdpa FROM wa_tvbdpa
                   TRANSPORTING kdmat.
          ENDLOOP.
    ***end I am stuck at here.
        ENDIF.
    ENDIF.
    All advise are welcome and greatly appreciated.
    Thanks in advance.

    Hi Subramanian,
    Does this more make sense for you?
    Can I read the table like :-
            READ TABLE itab_lips INTO wa_lips
              WITH TABLE KEY VBELN = wa_tvbdpa-matnr." AND POSNR = wa_tvbdpa-posnr.
    TABLES: vbco3.
    DATA: da_mess LIKE vbfs OCCURS 0 WITH HEADER LINE.
    DATA: BEGIN OF tvbdpa OCCURS 0,        "Internal table for items
            kdmat LIKE LIPS-KDMAT.
            INCLUDE STRUCTURE vbdpa.
    DATA: END OF tvbdpa.
    DATA: itab_vbak TYPE SORTED TABLE OF vbak
             WITH UNIQUE KEY vbeln,
          wa_vbak  LIKE LINE OF itab_vbak,
          itab_lips TYPE SORTED TABLE OF lips
             WITH UNIQUE KEY vbeln,
          wa_lips   LIKE LINE OF itab_lips,
          wa_tvbdpa LIKE LINE OF tvbdpa,
          lv_zuonr  TYPE vbak-zuonr.
      vbco3-mandt = sy-mandt.
      vbco3-spras = nast-spras.
      vbco3-vbeln = nast-objky.
      vbco3-kunde = nast-parnr.
      vbco3-parvw = nast-parvw.
    CALL FUNCTION 'RV_DOCUMENT_PRINT_VIEW'
      EXPORTING
        comwa                       = vbco3
      IMPORTING
        kopf                        = vbdka
      TABLES
        pos                         = tvbdpa
        mess                        = da_mess
      EXCEPTIONS
        fehler_bei_datenbeschaffung = 1.
    IF NOT tvbdpa[] IS INITIAL.
      SELECT SINGLE zuonr FROM vbak
        INTO lv_zuonr
        WHERE vbeln = vbdka-vbeln.
        IF sy-subrc = 0 AND lv_zuonr <> ''.
          SELECT vbeln posnr kdmat FROM lips
            INTO CORRESPONDING FIELDS OF TABLE itab_lips
            WHERE vbeln = lv_zuonr.
          LOOP AT tvbdpa INTO wa_tvbdpa.
            READ TABLE itab_lips INTO wa_lips
              WITH TABLE KEY VBELN = wa_tvbdpa-matnr." AND POSNR = wa_tvbdpa-posnr.
            wa_tvbdpa-kdmat = wa_lips-kdmat.
            MODIFY TABLE tvbdpa FROM wa_tvbdpa
                   TRANSPORTING kdmat.
          ENDLOOP.
        ENDIF.
    ENDIF.

  • Alv field catalog include structure

    Hi I have declared the tables like this :
    TYPES: BEGIN OF tt_vbak,
            cbox TYPE c.
            INCLUDE STRUCTURE vbak.
    TYPES: END OF tt_vbak.
    DATA: lt_vbak TYPE STANDARD TABLE OF tt_vbak,
          wa_vbak TYPE tt_vbak.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
         EXPORTING
           i_program_name               = sy-repid
    *       i_internal_tabname           = 'LT_VBAK'
           i_structure_name             = 'LT_VBAK'
    *       I_CLIENT_NEVER_DISPLAY       = 'X'
    *       I_INCLNAME                   =
    *       I_BYPASSING_BUFFER           =
    *       I_BUFFER_ACTIVE              =
        CHANGING
          ct_fieldcat                  = g_fieldcat_tab[]
         EXCEPTIONS
           inconsistent_interface       = 1
           program_error                = 2
           OTHERS                       = 3.
    I am not getting the field catalog...

    Hi
    That fm doesn't work if the internal table is defined using TYPE, but u need to use LIKE:
    DATA: BEGIN lt_vbak OCCURS 0.
                CBOX(1) TYPE C.
    DATA:  INCLUDE STRUCTURE VBAK,
              END OF IT_VBAK.
    DATA: GT_REPORT TYPE SY-REPID.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
         EXPORTING
           i_program_name              = GT_REPORT
           i_internal_tabname          = 'LT_VBAK'
           i_include_name               = GT_REPORT
        CHANGING
          ct_fieldcat                  = g_fieldcat_tab[]
         EXCEPTIONS
           inconsistent_interface       = 1
           program_error                = 2
           OTHERS                       = 3
    If you want to use the TYPES defination, u can do in this way:
    TYPES: BEGIN OF tt_vbak,
                    cbox TYPE c.
                    INCLUDE STRUCTURE vbak.
    TYPES: END OF tt_vbak.
    DATA: lt_vbak TYPE STANDARD TABLE OF tt_vbak,
    wa_vbak TYPE tt_vbak.
    CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
         EXPORTING
           i_program_name              = sy-repid
           i_internal_tabname          = 'LT_VBAK'
           i_structure_name             = 'VBAK'
        CHANGING
          ct_fieldcat                  = g_fieldcat_tab[]
         EXCEPTIONS
           inconsistent_interface       = 1
           program_error                = 2
           OTHERS                       = 3.
    Max

  • Types Declarations

    Hi all,
    What is the exact syntactical declaration for the types with Include structure ?
    I have the below existing types as
    TYPES: BEGIN OF exceplist_inv.
            INCLUDE STRUCTURE erdod.
    TYPES: END OF exceplist_inv
    I need to add a new field to this TYPE, the field being         username like CDHDR-USERNAME. 
    The below change to the declaration gives error.
    TYPES: BEGIN OF exceplist_inv.
            INCLUDE STRUCTURE erdod,
            username like CDHDR-USERNAME,
    TYPES: END OF exceplist_inv
    Moreover I have tried  placing the commas and the fullstops at many places but the syntax error still appears.
    Need help for the exact syntax for the above.
    Regards,
    Stock

    Hi,
    If 'erdod' is a standard structure, please try the below given code:
    TYPES BEGIN OF exceplist_inv.
    TYPES: username LIKE cdhdr-username.
            INCLUDE STRUCTURE erdod.
    TYPES END OF exceplist_inv.
    (OR)
    If 'erdod' is a structure defined by you, then try the following code:
    data: t_erdod type erdod.
    TYPES BEGIN OF exceplist_inv.
    TYPES: username LIKE cdhdr-username.
            INCLUDE STRUCTURE t_erdod.
    TYPES END OF exceplist_inv.
    Please award points if it is helpful.
    Regards,
    Renjith Michael.

  • Assigning structures using types

    Hi all,
               There is a structure declared in the program as follows
               TYPES : BEGIN OF TY_CUMM .
           INCLUDE STRUCTURE ZHRCUMWTMAP.
    TYPES : END OF TY_CUMM.
    but its giving extended check error as "  Within classes and interfaces, you can only use "TYPE" to refer to ABAP Dictionary
    types (not "LIKE" or "STRUCTURE")."
    So frnds any suggestions.
    regards,
    sahakla

    Hi!
    Yes, the coding, you wrote is obsolete. It is working, but a newver version of SAP, this coding will cause problems.
    You might try out this style.
    TYPES : BEGIN OF TY_CUMM .
      hrcum TYPE ZHRCUMWTMAP.
    TYPES : END OF TY_CUMM.
    DATA: gt_hrcum TYPE STANDARD TABLE OF TY_CUMM,
         wa_hrcum LIKE LINE OF gt_hrcum.
    * access fields in the work area
      wa_hrcum-hrcum-field1 = wa_hrcum-hrcum-field2.
    Regards
    Tamá

  • In a server proxy how can I use a INCLUDE STRUCTURE?

    Hi people!!, how can I put an internal table with an INCLUDE statement in a server proxy in abap. If I put the next code the system present me this error: Within classes and interfaces, you can only use "TYPE" to refer to ABAP     , Dictionary types, not "LIKE" or "STRUCTURE".
    The problem is that I need the STRUCTURE to make a APPEND.
    Thanks for the help.
    DATA: BEGIN OF bdc_tab .
            INCLUDE STRUCTURE bdcdata.
    DATA: END OF bdc_tab.

    Hi Carlos,
    Yes. It mainly accepts TYPE statements.
    You can use this as:
    DATA: BDC_LINE type bdcdata.
    DATA: BDC_TAB type table of bdcdata.
    When you want to use,
    Fill the BDC_LINE.
    Then:
    Append BDC_LINE to BDC_TAB.
    Or:
    Loop at BDC_TAB into BDC_LINE.
    Cheers,
    Bhanu

Maybe you are looking for

  • HT4929 installing icloud on windows 7 64 bit

    How can I install the icloud desktop on a Windows 7 64 bit PC?

  • Runtime error in MEQ1

    Hi Expert, Found this error when user was executing MEQ1 to update Quota Arrangement for two Materials while there was no problem for other Materials at this moment. Below is more info. from the error. 1. it comes runtime error: DYNPRO_FIELD_CONVERSI

  • End-to-end layer-2 link with CPE administration

    Dears I am working on a scenario to monitor a CPE in a layer-2 setup. The CPE is connected with the local PE across a last mile with a single vlan from the provider. The customer has purchased layer-2 end-to-end connection from local CPE to remote CP

  • Subversion in xcode not showing anything

    Could some kind sould give me a hint why subversion seems to be not working in my xcode? I've got a repository via svn+ssh, and i can access it just fine via command line 'svn' commands. I've checked it out, and switched on SCM in Xcode. When i load

  • User Defaults

    Hi All,           I am transferring certain personnel nos. from R/3 system to E-Rec system through ALE. The personnel nos. in R/3 system have their default decimal notation set to "12345678.00", whereas when I see those users in E-Rec their decimal n