Table type & Structure

Hi Experts. I have created on structure in DDIC and one table type.I have one class and within class from method I am passing the values of select statement threw the table type to my main program of se38.I need the syntax to use the structure and 'table type' and both get populated form the class method.

Hi
U need to define an internal table just like your TABLE TYPE:
DATA: ITAB TYPE <TABLE TYPE>.
and a work area like the LINE TYPE of the TABLE TYPE:
DATA: WA TYPE <LINE TYPE>.
Now you can read, update that table just like an internal table without the header line.
So:
WA-FIELD1 = ....
WA-FIELD2 = ....
WA-FIELDN = ....
APPEND WA TO ITAB.
Max

Similar Messages

  • ALV Grid with table type structure

    I created a structure with a table type in it. I want to display an ALV Grid report with that structure. Is it even possible. If yes, can someone please provide some reference. Thanks.
    Edited by: Sreekanth Nadella on Sep 4, 2010 2:29 AM

    Hi Clemens,
    The output should like a normal ALV Grid report. Just like a deep structure, one of the cell will have multiple row/value just like table. So you are looking at something like this.
    A               B               C              1         2         3            D             E
                                                       4         5         6
                                                       7         8         9
    F               G               H              1         2         3            I               J
                                                       4         5         6
                                                       7         8         9
    Thanks.

  • Accessing Table Type

    Hi All,
        In the code below WFAT_EMP_INT_EMPWA is a table type.
    For the function module 'WFA_EMP_DATA_GET' ,  ET_EMP_WORKAREA is an export parameter of type WFAT_EMP_INT_EMPWA
    For the function module 'WFA_EMP_DATA_MODIFY' , IT_EMP_WORKAREA is an import parameter of the same type.
    I need to get  the parameter from one function module and pass it to the next function module.
    Do i need to create a work area for the table type or can we simply define the table type and just pass it to the next FM as shown below.
    DATA: ITAB_WRKAREA TYPE WFAT_EMP_INT_EMPWA.
    DATA: itab_bapiret TYPE BAPIRET2_T,
          wa_bapiret TYPE LINE OF BAPIRET2_T.
    DATA: itab_bapiret1 TYPE BAPIRET2_T,
           wa_bapiret1 TYPE LINE OF BAPIRET2_T.
    FORM GET_WRKAREA_CODE.
      CALL FUNCTION 'WFA_EMP_DATA_GET'
        EXPORTING
          IV_EMP_BPID       = W_BUPNR
          IV_ORG_OBJID      = W_ORGEH
          IV_EFFECTIVE_WEEK = SY-DATUM
          IV_TEMPORARY      = GC_SPACE
        IMPORTING
          ET_EMP_WORKAREA   = ITAB_WRKAREA
          ET_RETURN         = itab_bapiret.
      LOOP AT itab_bapiret
      INTO wa_bapiret.
      WRITE :/ wa_bapiret-MESSAGE.
      ENDLOOP.
    ENDFORM.                    "get_wrkarea
    FORM TRANSFER_WRKAREA.
      CALL FUNCTION 'WFA_EMP_DATA_MODIFY'
        EXPORTING
          IV_EMP_BPID            = W_BUPNR
          IV_ORG_OBJID           = W_ORGEH
          IV_EFFECTIVE_WEEK      = SY-DATUM
          IS_EMP_INTERFACE_ADMIN = WA_WFAS_EMP_INT_ADMIN
         IT_EMP_WORKAREA        = ITAB_WRKAREA
        IMPORTING
          ET_RETURN              = itab_bapiret1.
          LOOP AT itab_bapiret1
          INTO wa_bapiret1.
          WRITE :/ wa_bapiret1-MESSAGE.
          ENDLOOP.
    ENDFORM.                    "transfer_wrkarea
    In the above context does ITAB_WRKAREA(table type) will have only one record.
    What is the difference between these 2 statements
    DATA:  x type TT.   " TT refers to table type
    DATA: x type ST.    "ST refers to structure type
    I am getting confused with the table types and structures . Table type refers to a line type which inturn refers to a structure? Can some one explain this.
    Thanks in Advance

    *-- Table type is a table.. when you refere to a table type u need not use again standard table of , or occurs 0 addition the follwoing statmenet will declare x as a internal table with out header line.
    DATA: x type TT. " TT refers to table type
    *-- Structure is a flat structure and x is a work area not internal table.
    DATA: x type ST. "ST refers to structure type
    if you have to create x as intenaal table using strrucre ST then
    data : x type standard table of ST..
    Thanks
    Mahesh

  • Assigning data from one Table type to another structure

    Hi every one,
    I have a table type X sent from one function module to another Proxy generated method which has the parameter defined as a structure.
    I have declared a variable Y as a LINE TYPE OF X.
    Then I have this statement which fills up the data.
    READ TABLE X INTO Y INDEX 1.
    The data is transferred from X to Y.
    Now i need to send this to the proxy generated Function module which has a structure Z.
    Now when i say MOVE-CORRESPONDING Y to a variable of type Z, it says it cannot be converted.
    The structure in proxy generated FM has different data type but the same domain as that of standard one.
    Everywhere it is prefixed with YY.
    And also has one additional Controller tab inserted,
    Can you guys tell me how to move the data from this table type to the structure.
    - Venkat

    Hi,
    Declare a variable of line type Z.
    Move corresponding values from variable X to this variable.
    Append this variable to the table Z.
    Try this.
    Regards,
    R.Nagarajan.

  • Structure or Table Type ??

    Hi Epxerts,
    Can someone give me an idea of passing multiple records in the parameter it_prxkna1 which of type structure  as in code below :
    I am working on this to pass it to XI.
    Note :  it_prxkna1 contains a 3 more nested structures and not an internal table.
    Should it_prxkna1 be a table type or structure to hold multiple records?
    TRY.
      Assign row
        it_prxkna1-MT_KNA1-record-row = wa_zcaap. --> one record of a customer
    loop at t_zcaap into wa_zcaap.
        CALL METHOD kna1_prxy->execute_asynchronous
          EXPORTING
            output = it_prxkna1.
        COMMIT WORK.
    endloop.
      CATCH cx_ai_system_fault .
        DATA fault TYPE REF TO cx_ai_system_fault .
        CREATE OBJECT fault.
        WRITE :/ fault->errortext.
    ENDTRY.
    Please suggest.
    Thanks
    Dany
    Edited by: Dan on Apr 11, 2008 9:42 AM

    You can append even if it is structure.
    check the code below,
    REPORT  ZTEMPB_TEST7.
    types: begin of st1,
           s1 type c,
           s2 type c,
           end of st1.
    types: st2 type st1 occurs 1.     
    data: begin of itab,
          f1 type c,
          f2 type st2,
          end of itab.
    data: wa_f2 type st1.
    wa_f2-s1 = '1'.
    wa_f2-s2 = '2'.
    append wa_f2 to itab-f2.
    Here ST1 is the structure with 2 fields.
    ST2 is table type with the structure ST1.
    f2 is the structure in the structure jtab with table type ST2.
    But ST2 must be internal table.
    Regards,
    Bhanu
    Edited by: Bhanu  P on Apr 11, 2008 4:23 PM

  • Creating abap program to develop and activate a global table type and global structure.

    Hi friends,
    I want to create and activate a global structure and global table type by coding in ABAP editor only. so can I do that anyhow.
    Please help me.
    Thanks in advance.

    Thanks guys for your fruitful replies, as most of you asked the main purpose of my question, the answer is as follows:
    in fact my purpose to do so is to create a function module that can fetch data dynamically from different database tables based on the codings in different abap program.
    for example: in one abap program i am coding as follows:
    tables: kna1.
    types: begin of itab,
              kunnr type kna1-kunnr,
              name1 type kna1-name1,
              end of itab.
    data: it_tab type standard table of itab,
             wa_tab type itab.
    similarly in other program i am coding as follows:
    tables: vbrp.
    types: begin of itab,
              posnr type vbrp-posnr,
              matnr type vbrp-matnr,
              arktx type vbrp-arktx,
              end of itab.
    data: it_tab type standard table of itab,
             wa_tab type itab.
    so now for both programs i want to call the same function module and fetch data as required in relative programs as mentioned above. in that case how to create that function module?

  • Se11 structure with se11 table type included

    Hi ABAP Gurus,
    in order to pass a complex datastructure by RFC I want to create a new structure via SE11 which includes in addition to some normal fields an field which represents a table of a certain type. Therefore I created a table type and tried to include that in the structure definition but without success. Any ideas of how I can create such a 'non-flat' structure in the ABAP dictionary ?
    I know that such a thing can be declared as a type in ABAP, but I'm not sure if I can do it in the dictionary.
    Any reply is very appreciated,
    Best regards, Philipp

    Hi,
    You can insert structure into the table, and vice versa is not possible.
    If you want to insert structure GO to Se11 -> provide table name -> chnage/create -> edit -> include -> insert -> provide the strcuture you want to include.
    Thanks,
    Sriram Ponna.

  • How to create an internal table with a types structure?

    Hi experts,
    I've 3 internal tables with the same structure, I think I could put a type structure and put that type inside the body of the internal data, is this possible? If true, how can I put that?
    Example:
    TYPES: Begin of type_s,
                   pernr like pa0001-pernr,
                 end of type_s.
    Data: begin of itab_1 occurs 0,
    ¿¿¿??? reference to type_s
             end of itab_1.
    Thanks a lot,
    Regards,
    Rebeca

    Hi,
    Use like this..
    DATA: Begin of type_s,
    pernr like pa0001-pernr,
    end of type_s.
    DATA: BEGIN OF ITAB_1 OCCURS 0.
    INCLUDE STRUCTURE type_s.
    DATA: END OF ITAB_1.
    Otherwise like this.
    types: Begin of type_s,
    pernr like pa0001-pernr,
    end of type_s.
    Data: itab_1 type standard table of type_s.
    Note: You have to create work area explicitly.
    Like this
    data wa like itab1.
    Edited by: Velangini Showry Maria Kumar Bandanadham on May 26, 2009 1:04 PM

  • 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

  • Define structure with table type fields using keyword "TYPES"

    Hi Gurus,
    Using keyword "TYPES", I want to define a structure in which there is a field must be table type. It seems not allowed. For example:
        TYPES tt_items TYPE TABLE OF sflight.
        TYPES: BEGIN OF str,
          field1 TYPE i,
          field_tabl TYPE tt_items.
        TYPES:  END OF str.
    Then I got a syntax error:
    "TT_ITEMS" is a generic type. Use of this type is only possible for     typing field symbols and formal parameters. -     
    What should I do if I want to have a table type field in it?
    Thanks a lot.

    include type EKKO includes the whole strucutre of EKKO.
    if you see the structure in debug mode, it_ekko contains the fields of EKKO as well as the field CHK of type C.
    In your case you can do this
    TYPES: BEGIN OF str.
    INCLUDE TYPE sflight.  " includes whole structure of SFLIGHT
    TYPES : field1 TYPE i. " include the field1 of type I
    TYPES: END OF str.
    DATA : it_str TYPE TABLE OF str, " internal table
           is_str TYPE str.          " work area
    Regards
    Gopi

  • Create Structure with dynamical Table-Type

    Hi experts,
    is there a possibility, to create a structure via SE11 and including there a field which referes to a dynamic table-type.
    So that I can append to this structure-field all different table-types?
    for example: ones I append MARA[] and ones AFKO[]
    Thx for help

    Hi Christian,
    There's not predefined generic type to do that, but you could create your own field type (deep structure) which would be able to keep table lines after transposition (90 degree flip) where in example it would have four columns: Table type, row id(index) field name, value. That way you could store ANY table row you need... This will not come cheap and will involve some work of course.
    You may want have a look at standard ABAP services RRTS and RTTI (see classes and structures used in attributes an parameters) - these are two services for handling data types and metadata related operations during runtime. You may want to use them for flipping your table entries to the tabular form and so on. You may also find some ideas there on how to compose your own data type for your purposes.
    Good luck!
    Marcin

  • Calrification of structure and table type

    hai experts,
    what is the difference between STRUCTURE AND TABLE TYPE?

    Refer this for TABLE TYPE
    http://help.sap.com/saphelp_nw2004s/helpdata/en/fc/eb35de358411d1829f0000e829fbfe/content.htm
    STRUCTURE
    http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb2d74358411d1829f0000e829fbfe/content.htm
    SE11, In structre u <b>cant maintain any values</b>. Its just used as a refernce.
    In tables u can maintain values.

  • How to create and add table type to a DDIC Structure in sap 3.1H

    How to create and add table type to a DDIC Structure in sap 3.1H

    How to create and add table type to a DDIC Structure in sap 3.1H

  • How to access the table type field in the structure

    Hi All,
    I have a BADI CRM_MKT_ADR_SEARCH and a method CHANGE_SEARCH_RESULTS in this method I have a parameter CT_BP_CP_CHANNEL .This parameter has type CRMT_BP_CP_CHANNEL_TAB(this is table type) this has the line type CRMT_BP_CP_CHANNEL(this is structure) in this line type we have one field addrnumber.How to access this field in my method?Please help me in this regard.

    data lw_tab type CRMT_BP_CP_CHANNEL.
    loop at CRMT_BP_CP_CHANNEL_TAB into lw_tab.
       lv_field = lw_tab-addrnumber.
       <further processing>
    endloop.

  • Dont work 'REUSE_ALV_FIELDCATALOG_MERGE' with table type

    Hi Experts ;
    My problem about   'REUSE_ALV_FIELDCATALOG_MERGE' .
    I use intarnal table with Table Type ( with header line ). And 'REUSE_ALV_FIELDCATALOG_MERGE'  is not working . Field catalog is employ. I dont use 'REUSE_ALV_FIELDCATALOG_MERGE' have any problem.

    'REUSE_ALV_FIELDCATALOG_MERGE' expects a flat structure.
    Give the reference of the line type of the table type if you wish to have fieldcatalog as per that..
    Even if you dont use 'REUSE_ALV_FIELDCATALOG_MERGE' you can create your own Fieldcatalog..

Maybe you are looking for