Append one register to internal table in abap oo

DATA: l_fields TYPE STANDARD TABLE OFsval ,
LINEA TYPE sval.
linea-tabname = 'CSKS'.
linea-fieldname = 'KOSTL'.
linea-value = 0.
APPEND linea to l_fields.
i want to do this append, but i have an error because i work in a ABAP Objects
Some suggestions?
Thanks

Hi!
Could you Copy & Paste the text of the error? If you can it would be good to give the message id (sy-msgid) and number (sy-msgno) also.
I'm assuming that "OFsval" is a typo and in your code it's like "OF sval".
Regards,
  Mário Espinheira
Edited by: Mário Espinheira on Dec 20, 2007 9:22 PM

Similar Messages

  • Internal table in ABAP Query

    Hi all,
    Can we use internal table in ABAP/SAP Query (Infoset - SQ02)? If yes, Pls guide me on the same.
    Thanks in advance
    Regards
    Madhumathi A

    to my knowledge u can't use internal tables in ABAP query...it is a mix of tables...

  • How to extract data from info cube into an internal table using ABAP code

    HI
    Can Anyone plz suggest me
    How to extract data from info cube into an internal table using ABAP code like BAPI's or function modules.
    Thankx in advance
    regds
    AJAY

    HI Dinesh,
    Thankq for ur reply
    but i ahve already tried to use the function module.
    When I try to Use the function module RSDRI_INFOPOV_READ
    I get an information message "ERROR GENERATION TEST FRAME".
    can U plz tell me what could be the problem
    Bye
    AJAY

  • Generating an XML Document from an internal table in ABAP

    Good day to all of you;
    With ABAP, in the R/3 system, I'm trying to figure out a way to accomplish the following:
    1) SELECT a set of Purchase Order data into an internal table.
    2) Generate an XML document, containing the above data, using a specific schema.
    I've been playing around with function module SAP_CONVERT_TO_XML_FORMAT which has the following interface:
    CALL FUNCTION 'SAP_CONVERT_TO_XML_FORMAT'
          EXPORTING
          I_FIELD_SEPERATOR    = ''
          I_LINE_HEADER        = ''
            I_FILENAME           = v_fname
          I_APPL_KEEP          = ''
          I_XML_DOC_NAME      = v_docname
          IMPORTING
            PE_BIN_FILESIZE      = v_byte
          TABLES
            I_TAB_SAP_DATA       = i_SapData
          CHANGING
            I_TAB_CONVERTED_DATA = i_XMLData
          EXCEPTIONS
            CONVERSION_FAILED    = 1
            OTHERS               = 2.
    I'm uncertain as to whether or not the Export parameter, I_XML_DOC_NAME refers to some schema or definition and therefore have been excluding it.  In doing so, the generated XML document seems to use the field name/type information from my itab for the tags.
    If this function module requires an XML Document Name, how do I create one and where do I store it in R/3?  If this is not the recommended solution, is anyone familiar with a way to load an XML schema, retrieve some data then have SAP generate an XML document using the schema?
    Many thanks for any help available.
    T

    Hai Phillips
    Try with the following Code
    This program exports an internal table to an XML file.
    Report ZPRUEBA_MML_13 *
    Export an internal table to XML document *
    NO BORRAR ESTE CODIGO *
    REPORT ZPRUEBA_MML_13.
    PANTALLA SELECCION *
        PARAMETERS: GK_RUTA TYPE RLGRAP-FILENAME.
    PANTALLA SELECCION *
    TYPE TURNOS *
    TYPES: BEGIN OF TURNOS,
        LU LIKE T552A-TPR01,
        MA LIKE T552A-TPR01,
        MI LIKE T552A-TPR01,
        JU LIKE T552A-TPR01,
        VI LIKE T552A-TPR01,
        SA LIKE T552A-TPR01,
        DO LIKE T552A-TPR01,
    END OF TURNOS.
    TYPE TURNOS *
    TYPE SOCIO *
    TYPES: BEGIN OF SOCIO,
        NUMERO LIKE PERNR-PERNR,
        REPOSICION LIKE PA0050-ZAUVE,
        NOMBRE LIKE PA0002-VORNA,
        TURNOS TYPE TURNOS,
    END OF SOCIO.
    TYPE SOCIO *
    ESTRUCTURA ACCESOS *
    DATA: BEGIN OF ACCESOS OCCURS 0,
        SOCIO TYPE SOCIO,
    END OF ACCESOS.
    ESTRUCTURA ACCESOS *
    START OF SELECTION *
    START-OF-SELECTION.
        PERFORM LLENA_ACCESOS.
        PERFORM DESCARGA_XML.
    END-OF-SELECTION.
    END OF SELECTION *
    FORM LLENA_ACCESOS *
    FORM LLENA_ACCESOS.
    REFRESH ACCESOS.
    CLEAR ACCESOS.
    MOVE: '45050' TO ACCESOS-SOCIO-NUMERO,
                  'MOISES MORENO' TO ACCESOS-SOCIO-NOMBRE,
                  '0' TO ACCESOS-SOCIO-REPOSICION,
                  'T1' TO ACCESOS-SOCIO-TURNOS-LU,
                  'T2' TO ACCESOS-SOCIO-TURNOS-MA,
                  'T3' TO ACCESOS-SOCIO-TURNOS-MI,
                  'T4' TO ACCESOS-SOCIO-TURNOS-JU,
                  'T5' TO ACCESOS-SOCIO-TURNOS-VI,
                  'T6' TO ACCESOS-SOCIO-TURNOS-SA,
                  'T7' TO ACCESOS-SOCIO-TURNOS-DO.
    APPEND ACCESOS.
    CLEAR ACCESOS.
    MOVE: '45051' TO ACCESOS-SOCIO-NUMERO,
                  'RUTH PEÑA' TO ACCESOS-SOCIO-NOMBRE,
                  '0' TO ACCESOS-SOCIO-REPOSICION,
                  'T1' TO ACCESOS-SOCIO-TURNOS-LU,
                  'T2' TO ACCESOS-SOCIO-TURNOS-MA,
                  'T3' TO ACCESOS-SOCIO-TURNOS-MI,
                  'T4' TO ACCESOS-SOCIO-TURNOS-JU,
                  'T5' TO ACCESOS-SOCIO-TURNOS-VI,
                  'T6' TO ACCESOS-SOCIO-TURNOS-SA,
                  'T7' TO ACCESOS-SOCIO-TURNOS-DO.
    APPEND ACCESOS.
    ENDFORM.
    FORM LLENA_ACCESOS *
    FORM DESCARGA_XML *
    FORM DESCARGA_XML.
    DATA: L_DOM TYPE REF TO IF_IXML_ELEMENT,
                  M_DOCUMENT TYPE REF TO IF_IXML_DOCUMENT,
                  G_IXML TYPE REF TO IF_IXML,
                  W_STRING TYPE XSTRING,
                  W_SIZE TYPE I,
                  W_RESULT TYPE I,
                  W_LINE TYPE STRING,
                  IT_XML TYPE DCXMLLINES,
                  S_XML LIKE LINE OF IT_XML,
                  W_RC LIKE SY-SUBRC.
    DATA: XML TYPE DCXMLLINES.
    DATA: RC TYPE SY-SUBRC,
    BEGIN OF XML_TAB OCCURS 0,
                  D LIKE LINE OF XML,
    END OF XML_TAB.
    CLASS CL_IXML DEFINITION LOAD.
    G_IXML = CL_IXML=>CREATE( ).
    CHECK NOT G_IXML IS INITIAL.
    M_DOCUMENT = G_IXML->CREATE_DOCUMENT( ).
    CHECK NOT M_DOCUMENT IS INITIAL.
    WRITE: / 'Converting DATA TO DOM 1:'.
    CALL FUNCTION 'SDIXML_DATA_TO_DOM'
    EXPORTING
                  NAME = 'ACCESOS'
                  DATAOBJECT = ACCESOS[]
    IMPORTING
                  DATA_AS_DOM = L_DOM
    CHANGING
                  DOCUMENT = M_DOCUMENT
    EXCEPTIONS
                  ILLEGAL_NAME = 1
                  OTHERS = 2.
    IF SY-SUBRC = 0.
                  WRITE 'Ok'.
    ELSE.
                  WRITE: 'Err =',
                  SY-SUBRC.
    ENDIF.
    CHECK NOT L_DOM IS INITIAL.
    W_RC = M_DOCUMENT->APPEND_CHILD( NEW_CHILD = L_DOM ).
    IF W_RC IS INITIAL.
                  WRITE 'Ok'.
    ELSE.
                  WRITE: 'Err =',
                  W_RC.
    ENDIF.
    CALL FUNCTION 'SDIXML_DOM_TO_XML'
    EXPORTING
                  DOCUMENT = M_DOCUMENT
    IMPORTING
                  XML_AS_STRING = W_STRING
                  SIZE = W_SIZE
    TABLES
                  XML_AS_TABLE = IT_XML
    EXCEPTIONS
                  NO_DOCUMENT = 1
                  OTHERS = 2.
    IF SY-SUBRC = 0.
                  WRITE 'Ok'.
    ELSE.
                  WRITE: 'Err =',
                  SY-SUBRC.
    ENDIF.
    LOOP AT IT_XML INTO XML_TAB-D.
                  APPEND XML_TAB.
    ENDLOOP.
    CALL FUNCTION 'WS_DOWNLOAD'
    EXPORTING
                  BIN_FILESIZE = W_SIZE
                  FILENAME = GK_RUTA
                  FILETYPE = 'BIN'
    TABLES
                  DATA_TAB = XML_TAB
    EXCEPTIONS
                  OTHERS = 10.
    IF SY-SUBRC <> 0.
                  MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
                  WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    ENDFORM.
    FORM DESCARGA_XML *
    Thanks & regards
    Sreenivasulu P

  • Declaring the internal table in ABAP objects

    Hi every1,
    Please any one let me know how to declare an internal table in class (ABAP objects). Bcos i am new to this classes.
    help me out.
    Regards,
    Madhavi

    Hi,
    Check this example..
    TYPES: BEGIN OF TYPE_DATA,
                   MATNR TYPE MATNR,
                   WERKS TYPE WERKS_D,
                 END OF TYPE_DATA.
    DATA: T_DATA TYPE STANDARD TABLE OF TYPE_DATA.
    DATA: WA_DATA TYPE TYPE_DATA.
    Adding rows to the internal table.
    WA_DATA-MATNR = 'AA'.
    APPEND WA_DATA TO T_DATA.
    Processing the interna table
    LOOP AT T_DATA INTO WA_DATA.
    ENDLOOP.
    Thanks,
    Naren

  • How to convert xml file into internal table in ABAP Mapping.

    Hi All,
    I am trying with ABAP mapping. I have one scenario in which I'm using below xml file as a sender from my FTP server.
    <?xml version="1.0" encoding="UTF-8" ?>
    - <ns0:MTO_ABAP_MAPPING xmlns:ns0="http://Capgemini/Mumbai/sarsingh">
      <BookingCode>2KY34R</BookingCode>
    - <Passenger>
      <Name>SARVESH</Name>
      <Address>THANE</Address>
      </Passenger>
    - <Passenger>
      <Name>RAJESH</Name>
      <Address>POWAI</Address>
      </Passenger>
    - <Passenger>
      <Name>CARRON</Name>
      <Address>JUHU</Address>
      </Passenger>
    - <Flight>
      <Date>03/03/07</Date>
      <AirlineID>UA</AirlineID>
      <FlightNumber>125</FlightNumber>
      <From>LAS</From>
      <To>SFO</To>
      </Flight>
      </ns0:MTO_ABAP_MAPPING>
    AT the receiver side I wnat to concatenate the NAME & ADDRESS.
    I tried Robert Eijpe's weblog (/people/r.eijpe/blog/2005/11/21/xml-dom-processing-in-abap-part-ii--convert-an-xml-file-into-an-abap-table-using-sap-dom-approach)
    but couldnt succeed to convert the xml file into internal table perfectly.
    Can anybody help on this. 
    Thanks in advance!!
    Sarvesh

    Hi Sarvesh,
    The pdf has details of ABAP mapping. The example given almost matches the xml file you want to be converted.
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/xi/3.0/how to use abap-mapping in xi 3.0.pdf
    Just in case you have not seen this
    regards
    Vijaya

  • I want to call components of an internal table in ABAP-Objects!!!!

    Hy all,
    I am trying to call the component my_query_info-compuid. But if I do it that way like shown below I get a Syntax error message.
    "MY_QUERY_INFO" is a table without a header line and therefore has no component called "COMPUID".
    And in Classes and OO its forbidden to declare internal tables with header lines and I also tried it?!
    I hope you can give me some help.
    DATA: my_query_info TYPE STANDARD TABLE OF
                                       rrmx_s_query_info
                                       WITH DEFAULT KEY
                                        INITIAL SIZE 0.
    METHOD get_queries_from_wb.
        CALL FUNCTION 'RRMX_WORKBOOK_QUERIES_GET'
          EXPORTING
            i_workbookid   = obj_id
            i_objvers      = 'A'
          IMPORTING
            e_t_query_info = my_query_info.
        SELECT *
        FROM rsrrepdir
        INTO table long_query_info
        WHERE compuid = my_query_info-compuid.
      ENDMETHOD.                    "get_queries_from_wb

    Hello Peter
    Fortunately ABAP-OO does no longer allow to use header lines which are only good for spoiling programs.
    Below you find my suggestion for OO-compatible coding:
    DATA: my_query_info TYPE STANDARD TABLE OF rrmx_s_query_info
                                     WITH DEFAULT KEY,
              ls_query          LIKE LINE OF my_query_info.
    METHOD get_queries_from_wb.
    CALL FUNCTION 'RRMX_WORKBOOK_QUERIES_GET'
    EXPORTING
    i_workbookid = obj_id
    i_objvers = 'A'
    IMPORTING
    e_t_query_info = my_query_info.
    "SELECT *
    "FROM rsrrepdir
    "INTO table long_query_info
    "WHERE compuid = my_query_info-compuid.
    IF ( my_query_info IS NOT INITIAL ).
       SELECT * FROM rsrepdir INTO TABLE long_query_info
         FOR ALL ENTRIES IN my_query_info
         WHERE compuid = my_query_info-compuid.
    ENDIF.
    " Or:
    LOOP AT my_query_info INTO ls_query.
      SELECT * FROM rsrrepdir APPENDING TABLE long_query_info
        WHERE compuid = ls_query-compuid.
    ENDLOOP.
    ENDMETHOD. "get_queries_from_wb
    Regards
       Uwe

  • Append a record to internal table

    hello:
    when i execute the code below,there is a runtime error." In die sortierte interne Tabelle (Typ SORTED_TABLE)
      "PROGRAM=ZJOIN_INTER_TABLEDATA=T_ITAB1" sollte an
    Position 1 eine Zeile eingefügt bzw. geändert werden.
    Dadurch wurde die für die Tabelle durch ihren Schlüssel festgelegte
    Sortierreihenfolge zerstört."
    how can i resolve it?which one can tell me?Thanks very much
    REPORT  ZJOIN_INTER_TABLE.
    DATA:BEGIN OF WA_ITAB,
            COL1 TYPE I,
            COL2(10) TYPE C,
          END OF WA_ITAB.
    DATA:T_ITAB1 LIKE SORTED TABLE OF WA_ITAB WITH NON-UNIQUE KEY COL1.
    WA_ITAB-COL1 = 10.
    WA_ITAB-COL2 = 'col2'.
    APPEND WA_ITAB TO T_ITAB1.
    WA_ITAB-COL1 = 9.
    WA_ITAB-COL2 = 'col2'.
    APPEND WA_ITAB TO T_ITAB1.

    hi
    kindly go thro the lines.
    syntax:
    DATA itab {TYPE tabkind OF linetype|LIKE tabkind OF lineobj}
              WITH [UNIQUE|NON-UNIQUE] keydef
              [INITIAL SIZE n] [WITH HEADER LINE].
    The system creates an internal table with table type tabkind. Since there is no generic field definition, you cannot use the table types ANY TABLE or SORTED TABLE.
    The construction of the table lines is defined by linetype (if you are using a TYPE reference) or by the type of the referred object lineobj (if you are using a LIKE reference). If you specify the line type, you can also use REF TO to refer to a reference type.
    The same rules apply to UNIQUE and NON-UNIQUE as apply to the TYPES definition. You may only omit this specification with standard tables.
    If you do not specify an INITIAL SIZE, the system assumes a default value of INITIAL SIZE 0.
    i think now u r clear... now yr code will work.
    DATA:BEGIN OF WA_ITAB,
    COL1 TYPE I,
    COL2(10) TYPE C,
    END OF WA_ITAB.
    DATA:T_ITAB1 like TABLE OF WA_ITAB WITH NON-UNIQUE KEY COL1.
    WA_ITAB-COL1 = 10.
    WA_ITAB-COL2 = 'col2'.
    APPEND WA_ITAB TO T_ITAB1.
    WA_ITAB-COL1 = 9.
    WA_ITAB-COL2 = 'col2'.
    APPEND WA_ITAB TO T_ITAB1.

  • Append new column to internal table

    Hi all,
    i have an internal table that was generated based on an ddic structure - now i want to add a column to that table. how can i do that ?
    thank you!
    clemens

    Hi to all, thank you for your help! here is the code that i have:
    REPORT *************_4 .
    TYPE-POOLS : abap.
    FIELD-SYMBOLS: <dyn_table> TYPE STANDARD TABLE,
                   <dyn_wa>,
                   <dyn_field>.
    TYPE-POOLS: slis.
    TABLES: dd03l, dd04t.
    TYPES:
      BEGIN OF ty_table_struct,
        fieldname   TYPE dd03l-fieldname, " Tabellenname
        ddtext      TYPE dd04t-ddtext,    " Kurztext
        checkbox,
       END OF ty_table_struct.
    DATA:t_fieldcat TYPE slis_t_fieldcat_alv,
         w_fieldcat TYPE slis_fieldcat_main.
    DATA:
    gt_table_struct TYPE TABLE OF ty_table_struct.
    DATA: v_repid TYPE sy-repid.
    DATA:
          dy_table TYPE REF TO data,
          dy_line  TYPE REF TO data,
          xfc TYPE lvc_s_fcat,
          ifc TYPE lvc_t_fcat,
          l_tab_fields TYPE STANDARD TABLE OF ty_table_struct,
          w_tab_fields LIKE LINE OF l_tab_fields.
    SELECTION-SCREEN :
      SKIP, BEGIN OF LINE,COMMENT 5(28) v_1 FOR FIELD p_table.
    PARAMETERS p_table TYPE dd03l-tabname OBLIGATORY VALUE CHECK.
    SELECTION-SCREEN END OF LINE.
    INITIALIZATION.
      v_1 = 'Tabelle für Dublettenprüfung'.
      v_repid = sy-repid.
    START-OF-SELECTION.
      PERFORM f_read_data.
      PERFORM f_display_data.
      PERFORM get_structure.
      PERFORM create_dynamic_itab.
      PERFORM get_data.
      PERFORM write_out.
    *&      Form  get_structure
    FORM get_structure.
      DATA : idetails TYPE abap_compdescr_tab,
             xdetails TYPE abap_compdescr.
      DATA : ref_table_des TYPE REF TO cl_abap_structdescr.
    * Get the structure of the table.
      ref_table_des ?=
          cl_abap_typedescr=>describe_by_name( p_table ).
      idetails[] = ref_table_des->components[].
      LOOP AT idetails INTO xdetails.
        READ TABLE l_tab_fields INTO w_tab_fields
        WITH KEY fieldname = xdetails-name.
        IF sy-subrc = 0.
          CLEAR xfc.
          xfc-fieldname = xdetails-name.
          xfc-datatype = xdetails-type_kind.
          xfc-inttype = xdetails-type_kind.
          xfc-intlen = xdetails-length.
          xfc-decimals = xdetails-decimals.
          APPEND xfc TO ifc.
        ENDIF.
      ENDLOOP.
    ENDFORM.                    "get_structure
    *&      Form  create_dynamic_itab
    *       text
    FORM create_dynamic_itab.
    * Create dynamic internal table and assign to FS
      CALL METHOD cl_alv_table_create=>create_dynamic_table
        EXPORTING
          it_fieldcatalog = ifc
        IMPORTING
          ep_table        = dy_table.
      ASSIGN dy_table->* TO <dyn_table>.
    * Create dynamic work area and assign to FS
      CREATE DATA dy_line LIKE LINE OF <dyn_table>.
      ASSIGN dy_line->* TO <dyn_wa>.
    ENDFORM.                    "create_dynamic_itab
    *&      Form  get_data
    *       text
    FORM get_data.
    * Select Data from table.
      SELECT (l_tab_fields) INTO CORRESPONDING FIELDS OF TABLE <dyn_table>
                 FROM (p_table).
    ENDFORM.                    "get_data
    *&      Form  write_out
    *       text
    FORM write_out.
      CALL FUNCTION 'REUSE_ALV_FIELDCATALOG_MERGE'
           EXPORTING
                i_program_name         = v_repid
                i_structure_name       = p_table
           CHANGING
                ct_fieldcat            = t_fieldcat
           EXCEPTIONS
                inconsistent_interface = 1
                program_error          = 2
                OTHERS                 = 3.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    * Show only fields that are needed
      LOOP AT t_fieldcat INTO w_fieldcat.
        READ TABLE l_tab_fields INTO w_tab_fields
        WITH KEY fieldname = w_fieldcat-fieldname.
        IF sy-subrc <> 0.
               DELETE t_fieldcat.
        ENDIF.
      ENDLOOP.
      w_fieldcat-tabname = '<dyn_table>'.
      w_fieldcat-fieldname = 'NETPR'.
      w_fieldcat-seltext_m = 'Net Price'.
      w_fieldcat-outputlen = 15.
      w_fieldcat-col_pos = 10.
    *  w_fieldcat-do_sum = 'X'. "Display column total
      w_fieldcat-datatype = 'CURR'.
      append w_fieldcat to t_fieldcat.
    * Write out data from table.
      CALL FUNCTION 'REUSE_ALV_GRID_DISPLAY'
           EXPORTING
                it_fieldcat   = t_fieldcat
                I_BYPASSING_BUFFER = 'X'
           TABLES
                t_outtab      = <dyn_table>
           EXCEPTIONS
                program_error = 1
                OTHERS        = 2.
      IF sy-subrc <> 0.
        MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
                WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
      ENDIF.
    ENDFORM.                    "write_out
    *&      Form  f_read_data
    *       text
    FORM f_read_data.
      SELECT * FROM ( dd03l
                INNER JOIN dd04t
                ON  dd03l~rollname = dd04t~rollname
                AND dd04t~ddlanguage = syst-langu
                AND dd04t~as4local = 'A' ) INTO CORRESPONDING FIELDS OF
    TABLE
      gt_table_struct WHERE dd03l~tabname = p_table .
    ENDFORM.                               " F_READ_DATA
    *      Form  f_display_data
    FORM f_display_data.
    * Macro definition
      DEFINE m_fieldcat.
        add 1 to ls_fieldcat-col_pos.
        ls_fieldcat-fieldname   = &1.
        ls_fieldcat-ref_tabname = &2.
        ls_fieldcat-rollname = &3.
        append ls_fieldcat to lt_fieldcat.
      END-OF-DEFINITION.
      TYPE-POOLS: slis.                    " ALV Global types
      DATA:
        l_exit,
        ls_private  TYPE slis_data_caller_exit,
        ls_field    TYPE ty_table_struct,
        ls_fieldcat TYPE slis_fieldcat_alv,
        lt_fieldcat TYPE slis_t_fieldcat_alv.
    * Build the field catalog
      m_fieldcat 'FIELDNAME' 'ty_table_struct' 'FIELDNAME'.
      m_fieldcat 'DDTEXT'    'ty_table_struct' 'DDTEXT'.
    * Optimize column width
      ls_private-columnopt = 'X'.
    * Display data in a popup
      CALL FUNCTION 'REUSE_ALV_POPUP_TO_SELECT'
           EXPORTING
                i_selection          = 'X'
                i_zebra              = 'X'
                it_fieldcat          = lt_fieldcat
                i_tabname            = 'gt_table_struct'
                i_checkbox_fieldname = 'CHECKBOX'
                is_private           = ls_private
           IMPORTING
                e_exit               = l_exit
           TABLES
                t_outtab             = gt_table_struct.
      CHECK l_exit = space.
    * write selected columns to the internal table for inclusion
    * into fieldcat
      LOOP AT gt_table_struct INTO ls_field WHERE checkbox = 'X'.
        APPEND ls_field-fieldname TO l_tab_fields.
      ENDLOOP.
    ENDFORM.
    What
    i want it to do is, have the alvgrid displaying the fields from t_fieldcat, plus some fields ( that should be appended to the internal table before, i think ? ). What went wrong ? 
    Clemens

  • Appending data from amultiple internal tables

    Hi Experts,
    I need to append data from more than one internal tables to one internal table. But the internal tables has different structure.
    For example, I have internal tables I_A550 table which has field KNUMH, and I_A573 which has same filed KNUMH. Same way I have 25 tables, and all have KNUMH field.
    Now I have taken an internal table I_AXXX which has only one field KNUMH. I need to transfer data from all those 25 tables to I_AXXX.
    I wrote code as below.
    LOOP AT I_A550
       MOVE I_A550-KNUMH to I_AXXX-KNUMH.
       APPEND I_AXXX.
    ENDLOOP.
    LOOP AT I_A573.
        MOVE I_A573-KNUMH to I_AXXX-KNUMH.
        APPEND I_AXXX.
    ENDLOOP.
    But instead of writing 25 loops, is there any way we can simplify this?
    Thanks in advance.

    Hi,
    Just use field-symbols for your purpose as follows:-
    See the example below
    TYPES: BEGIN OF y_t_final,
           matnr TYPE matnr,
           END OF y_t_final.
    TYPES: y_tt_final TYPE STANDARD TABLE OF y_t_final.
    data : WA_mara type mara,
           wa_mard type mard.
    DATA : itab  TYPE STANDARD TABLE OF mara.
    DATA : itab1 TYPE STANDARD TABLE OF mard.
    DATA : it_final TYPE STANDARD TABLE OF y_t_final.
    DATA : wa_final TYPE y_t_final.
    wa_mara-matnr = '1'.
    append wa_mara to itab.
    wa_mard-matnr = '2'.
    append wa_mard to itab1.
    PERFORM f_loop USING  itab
                   CHANGING it_final.
    PERFORM f_loop USING  itab1
                   CHANGING it_final.
    The code inside the perform is as follow:-
    FORM f_loop  USING    p_itab TYPE ANY TABLE
                 CHANGING p_it_final TYPE y_tt_final.
      FIELD-SYMBOLS : <fs>     TYPE ANY TABLE,
                       <wa>    TYPE ANY,
                       <field> TYPE ANY.
      DATA: l_data TYPE REF TO data.
      ASSIGN p_itab TO <fs>.
      IF <fs> IS ASSIGNED.
        CREATE DATA l_data LIKE LINE OF <fs>.
        ASSIGN l_data->* TO <wa>.
        IF <wa> IS ASSIGNED.
          LOOP AT <fs> INTO <wa>.
            ASSIGN component 'MATNR' of structure <wa> TO <field>.
            IF <field> IS ASSIGNED.
              MOVE <field> TO wa_final-matnr.
              append wa_final to p_it_final.
            ENDIF.
          ENDLOOP.
        ENDIF.
      ENDIF.
    ENDFORM.
    I hope you can understand the concept.
    Regards,
    Ankur Parab

  • Append 3 workarea into internal table

    Hi,
      I have 3 workarea and i want to append into one internal table.so how to append.
    Thanks,
    Deesanth

    HIII
    then you need to use MODIFY statement like below code..
    IF sy-subrc EQ 0.
        LOOP AT i_output INTO wa_output.
          READ TABLE i_mard INTO wa_mard WITH KEY matnr = wa_output-matnr.
          wa_output-lgort = wa_mard-lgort.
          MODIFY i_output FROM wa_output.
          CLEAR wa_output.
        ENDLOOP.                           " LOOP AT i_output
      ENDIF.                               " IF sy-subrc EQ 0
    here you need to use READ statement to get workarea data from different tables and use MODIFY statement to append that data in the same row.
    reagrds
    twinkal

  • Conversion of internal tables from ABAP to XML and Viceversa

    Hi ,
    I am writing a BAPI to pick the data from SAP system which gives its output to a .NET application. So, i designed XSD and i want the output of the BAPI according to that XSD rather than in the form of normal internal tables.
    Can any one please tell me what is the best way to do this ?
    I know very little about the simple transformations that are available in ABAP. Do we need to write our own transformation for the conversion of the internal tables to required XML format or do we already have transformations which take the internal tables and XSD to generate the XML required ?
    Also for again converting the XML document to ABAP do we need to write a new transformation ?
    Reward points are assured for all the replies.
    Regards,
    Srinivas.

    to convert internal table to xml format you could use CALL TRANSFORMATION key word
    data: xml_out type string .
    call transformation (`ID`)
                  source output = youritab
                  result xml xml_out.
    instead of ID (xslt program) you can desing your own xslt program to generate the xml in the desired format. ID is the standard delivered one

  • Internal table in ABAP Server Proxy

    Hi Experts,
        I have developed a JDBC to ABAP Proxy scenario.
    I have a problem. In my ABAP server proxy I have to import the values into an internal table and pass them to a BAPI for GR creation.
    I get an error like. OCCURS 0 is not allowed in OO concept.
    Can anyone give me examples on declaring internal table in an ABAP Proxy(OO Concept).
    Thanks
    AK

    Hi
    Check this out.
    http://help.sap.com/saphelp_nw70/helpdata/EN/fc/eb3660358411d1829f0000e829fbfe/frameset.htm
    Cheers

  • Internal table in ABAP  memory

    HI experts,
    Is it possible to put the internal
    table in the memory in such a way that
    that I can access the content
    of it in my function calls?
    Thanks for your reply.
    best regards,
    rose

    Hai
    Program 1
    report  zImport_0001.
    data: itab type table of string with header line.
    field-symbols: <fs> type table.
    itab = 'This is the line 1'.  append itab.
    itab = 'This is the line 2'.  append itab.
    assign itab[] to <fs>.
    export <fs> to memory id 'ZSRITEST'.
    submit zsri_0002 and return.
    Program 2
    REPORT zImport_0002 .
    data: itab type table of string with header line.
    field-symbols: <fs> type table.
    data: wa type string.
    assign itab[] to <fs>.
    import <fs> from memory id 'ZSRITEST'.
    loop at <fs> into wa.
    write:/ wa.
    endloop.
    Thanks & regards
    Sreeni
    Message was edited by: Sreenivasulu Ponnadi

  • How to append data from an internal table to an external table.

    HI everyone,
    I am trying to update an DB table type 'c'from the data captured in my internal table. can any one tell me as to how to do this.the contents of the DB table needs to be erased completly before i send in new data.
    Regards,
    Vj

    Assuming that you table has 1 character field(?) besides the MANDT field
    MANDT
    FIELD
    you need to update this db table with values from ITAB which I assume has one field of type c.
    To first delete all of the data from DB table.
    * Yes there are other ways of doing this.
    tables: ztable.
    select * from ztable.
    delete ztable.
    endselect.
    Then simply LOOP your internal table and update the table.
    loop at itab.
      ztable-field = itab-field.
      insert ztable.
    endloop.
    Regards,
    Rich Heilman

Maybe you are looking for

  • Important question to Steve about passivateState() method

    <br> <font size="2">Hello Steve, <br><br>I want to store information about application user in oracle.jbo.Session hastable. It's stored as pair KEY --> VALUE. To be sure that these informations will be accessible after passivation AM I have overreade

  • Source(oracle 11g) with oracle 8i using db link with full table scan

    Hi, I'm using oracle 8i version and i'm facing some issue  while using DBlinks. SourceDB1 I'm using oracle 8i(Source) select *  from tab1 tabl where id in (select id from stab1@SourceDB1  where updt_seq_num > 167720 and work_grp_id in (2900,2901)) Fo

  • Regarding AUTOCAD interface

    Hello Frds, I'm working for a real estate project where i have excel sheet data of AUTOCAD and i need to convert that in to SAP/ABAP with an interface. How i can do it. PLZ help me with the tips THANKS in advance.

  • Authorizing my computer windows 8.1

    Having trouble authoring my computer which has windows 8.1

  • Reaccuring kernel panics

    My Mac Mini (mid 2010) started doing kernal panics/crashes, I thougth it was due to upgrade to ML because it started to crash regulary after that. All of the times it was due to entering sleep mode (or leaving hard ti tell ). So I disabled it in powe