Occurs & with header line in Data definition

Hi,
i did an slin-check for one of my includes and got the following errors shown:
Abap-command is obsolete
1st: tables with headers are not supported in OO-context anymore. (message G1D)
2nd: the appendix occurs is not supported in OO-context. use "table of.... initial size" instead.
the line were the error occurs is:
DATA:   BDCDATA TYPE BDCDATA OCCURS 0 WITH HEADER LINE.
what should i do here?
\[removed by moderator\]
Edited by: Jan Stallkamp on Jul 17, 2008 12:33 PM

Hi
Use
DATA: BDCDATA TYPE TABLE OF BDCDATA.
(OR)
DATA: BDCDATA TYPE <table_kind> TABLE OF BDCDATA.
(<table_kind> =  Standard / Sorted / Hashed )
Hope this would help you.
Murthy

Similar Messages

  • With header line & with out header line ?

    what is difference between with header line & without header line ?

    When you create an internal table object you can also declare a header line with the same name. You can use the header line as a work area when you process the internal table. The ABAP statements that you use with internal tables have short forms that you can use if your internal table has a header line. These statements automatically assume the header line as an implicit work area. The following table shows the statements that you must use for internal tables without a header line, and the equivalent statements that you can use for internal tables with a header line:
    Operations without header line
    Operations with header line
    Operations for all Table Types
    INSERT <wa> INTO TABLE <itab>.
    INSERT TABLE ITAB.
    COLLECT <wa> INTO <itab>.
    COLLECT <itab>.
    READ TABLE <itab> ... INTO <wa>.
    READ TABLE <itab> ...
    MODIFY TABLE <itab> FROM <wa> ...
    MODIFY TABLE <itab> ...
    MODIFY <itab> FROM <wa> ...WHERE ...
    MODIFY <itab> ... WHERE ...
    DELETE TABLE <itab> FROM <wa>.
    DELETE TABLE <itab>.
    LOOP AT ITAB INTO <wa> ...
    LOOP AT ITAB ...
    Operations for Index Tables
    APPEND <wa> TO <itab>.
    APPEND <itab>.
    INSERT <wa> INTO <itab> ...
    INSERT <itab> ...
    MODIFY <itab> FROM <wa> ...
    MODIFY <itab> ...
    Using the header line as a work area means that you can use shorter statements; however, they are not necessarily easier to understand, since you cannot immediately recognize the origin and target of the assignment. Furthermore, the fact that the table and its header line have the same name can cause confusion in operations with entire internal tables. To avoid confusion, you should use internal tables with differently-named work areas.
    The following example shows two programs with the same function. One uses a header line, the other does not.
    With header line:
    TYPES: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA ITAB TYPE HASHED TABLE OF LINE WITH UNIQUE KEY COL1
    WITH HEADER LINE.
    DO 4 TIMES.
    ITAB-COL1 = SY-INDEX.
    ITAB-COL2 = SY-INDEX ** 2.
    INSERT TABLE ITAB.
    ENDDO.
    ITAB-COL1 = 2.
    READ TABLE ITAB FROM ITAB.
    ITAB-COL2 = 100.
    MODIFY TABLE ITAB.
    ITAB-COL1 = 4.
    DELETE TABLE ITAB.
    LOOP AT ITAB.
    WRITE: / ITAB-COL1, ITAB-COL2.
    ENDLOOP.
    Without header line:
    TYPES: BEGIN OF LINE,
    COL1 TYPE I,
    COL2 TYPE I,
    END OF LINE.
    DATA: ITAB TYPE HASHED TABLE OF LINE WITH UNIQUE KEY COL1,
    WA LIKE LINE OF ITAB.
    DO 4 TIMES.
    WA-COL1 = SY-INDEX.
    WA-COL2 = SY-INDEX ** 2.
    INSERT WA INTO TABLE ITAB.
    ENDDO.
    WA-COL1 = 2.
    READ TABLE ITAB FROM WA INTO WA.
    WA-COL2 = 100.
    MODIFY TABLE ITAB FROM WA.
    WA-COL1 = 4.
    DELETE TABLE ITAB FROM WA.
    LOOP AT ITAB INTO WA.
    WRITE: / WA-COL1, WA-COL2.
    ENDLOOP.
    The list, in both cases, appears as follows:
    1 1
    2 100
    3 9
    The statements in the program that does not use a header line are easier to understand. As a further measure, you could have a further work area just to specify the key of the internal table, but to which no other values from the table are assigned.
    Internal table with header line
    you can use anywhere except obkect oriented concept.
    Internal table without header line :
    You should use in Object oriented concept..
    Always try to use without header line,performance point of view it is best..
    Example :
    Without header line.
    Structure
    types : begin of ty_itab ,
    matnr type mara-matnr,
    end of ty_itab.
    Internal table
    data i_itab type standard table of ty_itab .
    Work area
    data wa_itab like line of i_itab
    With header line
    data : begin of i_itab occurs 0,
    matnr like mara-matnr,
    end of i_itab
    itab with header lines are obsolete, anyway it will work but not recommended. instead use work area or more effiecient is field symbols. so donot use itab with header line.
    i will explain use of itab w/o header line.
    Data: itab1 type standard table of mara with header line occurs 0,
            itab2 type standard table of mara,
            wa_itab2 type mara.
    loop at itab1.
    "This will work fine.
    endloop.
    loop at itab2.
    "This will give erro that itabd does not hav workarea
    endloop.
    "so write
    loop at itab2 into wa_itab2.
    "This will work
    endloop.
    <b>The difference between
    whih header line and with out heater line of internal table.
    ex:-
    a) Data : itab like mara occurs 0 with header line.
    b) Data: itab like mara occurs 0.
    -While adding or retrieving records to / from internal table we have to keep the record temporarily.
    -The area where this record is kept is called as work area for the internal table.
    -The area must have the same structure as that of internal table. An internal table consists of a body and an optional header line.
    -Header line is a implicit work area for the internal table. It depends on how the internal table is declared that the itab will have the header line or not.
    a) Data : itab like mara occurs 0 with header line.
    table is with header line
    b) Data: itab like mara occurs 0.
    table is without header line</b>
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • Alternative for 'WITH HEADER LINE' ?

    Hello All,
    In BSP's I gues we can't use table with header lines and occurs 0.
    SO whts the alternative for this ?
    I want to use the FM 'GET_COMPONENT_LIST' .
    To this FM I need to pass the table which is declared with  occurs 0 or with header line .
    Eg:
    DATA: lt_cols TYPE STANDARD TABLE OF it_cols with header line.
    DATA: v_count TYPE i.
    CALL FUNCTION 'GET_COMPONENT_LIST'
      EXPORTING
        program    = sy-repid
        fieldname  = 'LT_COLS'
      TABLES
        components = itab[].
    DESCRIBE TABLE itab LINES v_count.
    WRITE v_count.
    " I've used the following code :
          DATA: ls_final_t    TYPE STANDARD TABLE OF mara initial size 10  ,
                lt_rstrucinfo TYPE TABLE OF rstrucinfo .
          CALL FUNCTION 'GET_COMPONENT_LIST'
            EXPORTING
              program    = 'CL_O243NHIEBSRAZZG8RPTVGL3YAH9CP'
              fieldname  = 'LS_FINAL_T'
            TABLES
              components = lt_rstrucinfo[].
    But it's not working .
    I guess the problem is wid passage of parameter for program.
    Bcoz i tried the same in the ABAP Program and it's working !
    SO can any one tell me what to pass for the program ?
    I tried with sy-repid , hardcoded my BSP application name , but none of them worked !!!
    Can anyone help me out ?
    Regards,
    Deepu.K

    Hi Depp,
    The problem with your code example is that you should not have used the [] addition to the table name.
    Try this...
          CALL FUNCTION 'GET_COMPONENT_LIST'
            EXPORTING
              program    = 'CL_O243NHIEBSRAZZG8RPTVGL3YAH9CP'
              fieldname  = 'LS_FINAL_T'
            TABLES
              components = lt_rstrucinfo. "Note change here!
    It is a good idea to get used to working with tables without header lines. I like to use data references where possible.
    For example...
      DATA: i_tab TYPE TABLE OF sflight,
            w_ref TYPE REF TO sflight.
    * Append line to table
      APPEND INITIAL LINE TO i_tab REFERENCE INTO w_ref.
      w_ref->carrid = 'AA'.
      w_ref->connid = '123'.
    * Loop through table
      LOOP AT i_tab REFERENCE INTO w_ref.
        WRITE: / `ConnID is `, w_ref->connid.
      ENDLOOP.
    * Read line
      READ TABLE i_tab REFERENCE INTO w_ref WITH KEY connid = '123'.
    Cheers
    Graham Robbo

  • Passing an internal table WITH HEADER LINE to abap object

    Hi. In another thread, it was explained how to pass an internal table to an abap object method. Is it possible to pass an internal table that has a header line, and RETAIN the header line once the table has been passed?
    My problem is, that I can pass the table, update it, but the read buffer is not populated when returning from the object's method. This is the result of being able to pass a STANDARD TABLE type, but not a STANDARD TABLE WITH HEADER LINE.
    This means that I have to read the table into a work area instead of doing a READ TABLE LKNA1 within the method, which is what I need to do.
    Thanks.

    Please check this sample program, notice that it is modifing the internal table and passing it back modified as well as passing the "work area" or "header line" back thru the exporting parameter.
    report zrich_0001.
    *       CLASS lcl_app DEFINITION
    class lcl_app definition.
      public section.
        types: t_t001 type table of t001.
        class-data: it001 type table of t001.
        class-data: xt001 like line of it001.
        class-methods: change_table
                                    exporting ex_wt001 type t001
                                    changing im_t001 type t_t001.
    endclass.
    data: w_t001 type t001.
    data: a_t001 type table of t001 with header line.
    start-of-selection.
      select * into table a_t001 from t001.
      call method lcl_app=>change_table
                 importing
                     ex_wt001 = w_t001
                 changing
                     im_t001  = a_t001[] .
      check sy-subrc  = 0.
    *       CLASS lcl_app IMPLEMENTATION
    class lcl_app implementation.
      method change_table.
        loop at im_t001 into xt001.
          concatenate xt001-butxt 'Changed'
               into xt001-butxt separated by space.
          modify im_t001 from xt001.
        endloop.
        ex_wt001 = xt001.
      endmethod.
    endclass.
    Regards,
    Rich Heilman

  • Getting error of Defining an internal table with header line, SELECT-OPTIO

    Hi all,
    i have a coding for my smart form,In this coding i have define an structure which being used,but when i execute it it give me
    error of Defining an internal table with header line, SELECT-OPTIONS, and RANGES is not allowed within a structure.Even tough you can see that in  my coding im not using SELECT-OPTION or RANGES,but can't understand why it gives me this error.
    Following are the code:
      DATA: BEGIN OF traptab OCCURS 50.
            INCLUDE STRUCTURE mseg.
      DATA: vgart LIKE mkpf-vgart,
            blart LIKE mkpf-blart,
            blaum LIKE mkpf-blaum,
            bldat LIKE mkpf-bldat,
            budat LIKE mkpf-budat,
            cpudt LIKE mkpf-cpudt,
            cputm LIKE mkpf-cputm,
            aedat LIKE mkpf-aedat,
            usnam LIKE mkpf-usnam,
            tcode LIKE mkpf-tcode,
            xblnr LIKE mkpf-xblnr,
            bktxt LIKE mkpf-bktxt,
            frath LIKE mkpf-frath,
            frbnr LIKE mkpf-frbnr,
            wever LIKE mkpf-wever,
          END OF traptab. 
    Thanks & Regards,
    sappk25

    thanks

  • Why does my internal table(with header line) ignore 4 of its fields?

    Hi Gurus,
    I am a newbie to ABAP how has spent far to much of my weekend time trying to solve the following problem;
    when trying to insert data from table cdpos into my internal table, I only get the two object* fields, the other 3 are not even part of the internal table according to the debugger.
    my select code is:
      SELECT  fname tabkey changenr    objectclas objectid
       FROM  cdpos
       INTO CORRESPONDING FIELDS OF i_cd_index
      WHERE tabname = 'XXX'
       AND  fname   = 'XXX'
       AND  chngind = 'U'   
      ENDSELECT.
      IF sy-subrc <> 0.
      ENDIF.
    - If I use a wa like line of i_cd_index the other fields will show up.
    - I have tried with including 'TABLE' in the INTO statement, same result.
    Please help out, getting very frustrated here....
    /Mike

    Hi Magdic,
    I have completely coded for but i have taken as parameters rather direct values (XXXX). Under stand the code and select statement you will get it. Program which i have shown is working fine.
    Do one thing first go the table CDPOS take one entry of Objectid, Tabname, fname and chngind and then enter in the selection and find whether the values are fetched correctly or not.
    To my knowledge there might be no data in your table.
    Anyhow try the below code.
    TABLES: CDPOS.
    DATA: ITAB LIKE CDPOS OCCURS 0 WITH HEADER LINE.
    parameters: p_CHGID like CDPOS-chngind,
                p_TAB like CDPOS-TABNAME,
                P_FNAM LIKE CDPOS-FNAME.
    SELECT OBJECTID TABNAME FNAME CHNGIND FROM CDPOS INTO CORRESPONDING FIELDS OF ITAB WHERE OBJECTID = P_CHGID
                                                                                    AND TABNAME = P_TAB
                                                                                    AND FNAME = P_FNAM.
    APPEND ITAB.
    ENDSELECT.
    WRITE: ITAB-OBJECTID, ITAB-TABNAME, ITAB-FNAME, ITAB-CHNGIND.
    Cheers!!
    Balu

  • Dynamic Creation of Internal table WITH HEADER LINE

    Dear,
    Please show me the way of creating Internal table WITH HEADER LINE dynamically..
    Thanks,
    Nirav

    <font color='blue'>Hi Parekh,
    Have a look at the sample program for Dynamic internal table
    This program has been developed to update any table data in the dictionary. We give table name and File name as Input fields.
    <pre>
    REPORT znpmmm0201.
    *Types
    TYPES:
          BEGIN OF ty_file,
            data(4096) TYPE c,
          END OF ty_file.
    *Type-pools
    TYPE-POOLS:
          truxs.
    *Work areas
    DATA:
          wa_file      TYPE ty_file.
    *Internal tables
    DATA:
          it_file      TYPE STANDARD TABLE OF ty_file,
          it_data      TYPE truxs_t_text_data.
    DATA:
          gv_dref TYPE REF TO data,
          file_name TYPE string.
    *FIELD-SYMBOLS
    FIELD-SYMBOLS:
                   <gf_itab> TYPE STANDARD TABLE,
                   <wa>      TYPE ANY.
    *& Selection-screen
    PARAMETERS:
          p_table TYPE rsrd1-tbma_val,
          p_file  TYPE ibipparms-path.
    AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
      PERFORM f4_for_p_file CHANGING file_name .
    *& START-OF-SELECTION
    START-OF-SELECTION.
      CREATE DATA gv_dref TYPE TABLE OF (p_table).
      ASSIGN gv_dref->* TO <gf_itab>.
      PERFORM upload_data USING file_name.
      MODIFY (p_table) FROM TABLE <gf_itab>.
    *&      Form  UPLOAD_DATA
    FORM upload_data USING file.
      CALL FUNCTION 'GUI_UPLOAD'
        EXPORTING
          filename                = file
          filetype                = 'ASC'
        TABLES
          data_tab                = it_file.
      APPEND LINES OF it_file TO it_data.
      CLASS cl_abap_char_utilities DEFINITION LOAD.
      DATA: l_field_seperator.
      l_field_seperator = cl_abap_char_utilities=>horizontal_tab.
      REPLACE ALL OCCURRENCES OF '|' IN TABLE it_data WITH l_field_seperator.
      CALL FUNCTION 'TEXT_CONVERT_TEX_TO_SAP'
        EXPORTING
          i_field_seperator    = l_field_seperator
          i_tab_raw_data       = it_data
        TABLES
          i_tab_converted_data = <gf_itab>.
    ENDFORM.                    " UPLOAD_DATA
    *&      Form  F4_FOR_p_file
    FORM f4_for_p_file CHANGING file.
      DATA:
            l_field_name LIKE  dynpread-fieldname VALUE 'P_FILE'.
      CALL FUNCTION 'F4_FILENAME'
        EXPORTING
          program_name  = syst-cprog
          dynpro_number = syst-dynnr
          field_name    = l_field_name
        IMPORTING
          file_name     = p_file.
      file = p_file.
    ENDFORM.                    " F4_FOR_p_file </pre>
    Thanks,
    Venkat.O</font>

  • Receiver file Content Conversion with Header line

    Hi,
    Here I am doing receiver file content conversion with header line.
    I am able to get the output file correct, when I open the file in notepad the header line and data appearing in the same line (not accepted).
    But when I tried to open the name file in internet explorer I can see the header line and data in two different lines (accepted).
    What should I do I want to see the same output in the notepad?
    Please help me out.
    Thanks in advance,
    Srikanth.

    You can use NameA.addHeaderLine.
    Specify whether the text file will have a header line with column names. The following values are permitted:
    0 u2013 No header line
    1 u2013 Header line with column names from the XML document
    2 u2013 As for 1, followed by a blank line
    3 u2013 Header line is stored as NameA.headerLine in the configuration and is applied
    4 u2013 As for 3, followed by a blank line
    The below weblinks will help you to know the other paramters.
    http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/content.htm
    http://help.sap.com/saphelp_nwpi71/helpdata/en/44/686e687f2a6d12e10000000a1553f6/content.htm

  • BADI cant use an internal table with header line

    hi,
         In BADI, we cant use an internal table with header line, and I am calling a function module which requires internal table as import parameter, now, the table I am passing is without a header line, So how to solve this problem ?

    You can use a type and then create an internal table of that type.
    types :
    begin of t_<example>
    *field list
    end of t_<example>
    data :
    gt_<table> type standard table of t_<example>
    pass this to the FM

  • Error: Tables with Header line No longer Supported In WD-ABAP

    Hi folks,
               I am working on WD4A functionality.I have to use Abap code to retrive data from database and i am doing it by declaring internal table with header line in one of the Methods.I have to do manipulation on table before i can bind table to result node.I can do manipulation in Header in ABAP,but now it is no longer supported in WD4A.What can i do for this?
    Nirad.

    hi nirad.
    The example is not of much sense
    but explains the funtionality. Hope this is what you are searching for.
    data:
             lt_flights    type table of sflight.
    data:
             ls_flight     type sflight.
    select * from sflight
    into corresponding fields of table lt_flights.
    loop at lt_flights into ls_flight.
      ls_flight-price = 1000.
      modify lt_flights from ls_flight.
    endloop.
    Cheers,
    Sascha

  • Dynamicly creating an internal table with header line

    Hi experts,
    I am trying to do a read on an internal table using field symbols of type any table. To be able to read more than one row at once, I'd like to read it into another internal table (instead of just one line and instead of looping through them one by one).
    So far the following line rendered an error that the target internal table doesn't have a header line
    read table <fs_v_tab> WITH KEY (<fs_comp>) = <fs_param>-low INTO <fs_v_tab>.
    (also attempted using "<fs_v_tab>->*" & "<fs_v_tab>[]" to be silly)
    Based on the following article, I was wondering if it were possible to dynamicly create an internal table with header line.
    [http://help-abap.blogspot.com/2008/09/dynamic-internal-table-creation.html|http://help-abap.blogspot.com/2008/09/dynamic-internal-table-creation.html]
    Any help or tips on how to dynamicly filter an internal table field-symbol is greatly appreciated!

    Just read the online help:
    This statement reads a row from internal table itab.
    Or more exact:
    This statement reads one row from internal table itab.
    Therefore you can not read multiple lines into another table. The header line is needed to put the result in. And this is not what you intended, the result will be in the header line, not in the table itself.
    If the row to be read is not uniquely specified, the first suitable row is read. In the case of index tables, this row has the lowest table index of all matching rows.
    At least you have to do what you dont wanna do: looping.

  • How to create an internal table with header line in smartforms

    Hello Guys,
    I need to append the data in my internal table in smartforms by the problem is an error occurred "a table without header line  and therefore no component called tdline"
    i already declared the data under types declaration tab
    types : begin of ts_tline,
             TDFORMAT type tdformat,
             tdline type tdline,
            end of ts_tline.
    types : it_tline type table of ts_tline.
    and declare these in global data
    WA_TLINE type TS_TLINE
    XT_TLINE type IT_TLINE
    my syntax in program lines :
      LOOP AT  gy_lines INTO WA_PROJ.
        SPLIT wa_proj AT  cl_abap_char_utilities=>cr_lf
           INTO table IT_SPLIT.
        LOOP AT IT_SPLIT.
          MOVE it_split-commentext TO xt_TLINE-tdline.
    an error occured at this part ****
         append xt_TLINE.
        ENDLOOP.
      ENDLOOP.
    what is wrong with my code..it cannot append data to xt_tline.
    Please help.Will reward points
    Thanks in advance
    aVaDuDz

    check this link
    this will help u......
    http://www.****************/Tutorials/Smartforms/SFMain.htm
    reward IF..........
    regards
    Anbu

  • How to handle text files with Header lines

    Hi,
    Eventhough the number of header lines is specified, when I do Reverse to get columns, its considering only header line.
    I have file format like
    ffserver started.
    192.168.11.30 - - [Fri Apr 20 19:28:01 2007] "GET /robots.txt HTTP/1.1" 404 150
    192.168.11.30 - - [Fri Apr 20 19:28:02 2007] "GET /V23WASTINGPETROL HTTP/1.1" 200 310
    first line is header line and there are spaces within a field value, and the field separator also is space.
    regards,
    Vivek

    in this scenario of urs ,ur file has multiple delimiters like -- and spaces.
    in this case u need to convert the file in a file with single delimiter .
    this can be done by writing a code in java in ODI procedures.
    once you have the same delimiter all over the file.
    u can extract multiple headers using typical Procedure

  • Pb with header line in my report

    hi,
    I have a problem with the alignment of the header line of my table in my report
    Indeed the header line is centered on the first page but not on the second one.
    I attach the code and a pdf which shows the problem.
    If someone can help me,please.
    Best regards
    Attachments:
    test pb array.vi ‏20 KB
    Document.pdf ‏24 KB

    Hi,
    Your VIs doesn't work on my computer. Is it really running on yours? Did you try with a word report and if so, do you have the same phenomena?
    Regards
    Manuel R
    AE dans une autre vie

  • Internal table with header line

    Hi All,
         I want to declare a internal table with headerline as page attribute.
         i am having to fields in the internal table ( firstname and lastname ). how to do that?
    helpful answers will be rewarded.
    Regards,
    Azaz Ali.

    Azaz,
    Why do you need a header line?
    Header lines are a no-no in an object context and if you need to loop at the table you can always declare a line type or an field symbol to process the table.
    If you need an table as a page parameter the best way to do it is to create a table type. This is based of a line type (another name for structure ) and this may well be based off a database (transparent) table.
    If you need to do special things to the table I would look at tableview iterators.
    Let me dig out a blog reference for that...
    ... ahh here it is
    <a href="/people/thomas.jung3/blog/2004/06/17/bsp-150-a-developer146s-journal-part-i-introduction View Iterator blog</a>
    HTH,
    N

Maybe you are looking for

  • What Folders Should Install?

    I'm trying to figure out what samples should install and what instruments should install? As it seems like after upgrading to 8 from Logic 7, all the files have not installed. In the Media Browser for Loops I have 19210 Loops (which seems right) In t

  • Sync two laptops with same itunes account

    I have two macbooks that share the same itunes account. The data is not synced, so I have some songs on one but not on the other. I am sharing, but I want to sync them so the data is the same on both. Any ideas?

  • Preview Draft Number in PLD Outgoing Payment

    Hi All, Anybody know how to preview draft number (field docentry, table OPDF) in PLD Outgoing Payment? and how to link payment draft report(OPDF) with outgoing payment (OVPM)? Thank U all. Regards, Ratna

  • Cost booking during GI not during GR

    Dear Experts, We update inventory from PS module as project stock. here, durring GR of  material cost is not booking but during GI from the invenotry against reservation cost booked. Is it possible to reverse the process? I want to book cost durring

  • Cross tab column issue

    I have a cross tab report that has three column fields. I want to design the report such that when the outer most column (1st column) field get repeated again it should appear at a certain gap from the first one. By default crystal report shows all t