Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

internal table

Former Member
0 Likes
851

how write coding for intertable with out header line

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
812

Hi Sonti,

You will have to use a work area for this, which is a structure having a single row of the type of the internal table.

Now this structure can be used to read an internal table, and also to modify and update it.

<b>Reward points, if helpful.</b>

Regards,

Atin

11 REPLIES 11
Read only

Former Member
0 Likes
812

If a table does not have a header line, you MUST provide a work area as a separate record to hold the content of the current entry for most commands used in processing tables.

Read only

Former Member
0 Likes
813

Hi Sonti,

You will have to use a work area for this, which is a structure having a single row of the type of the internal table.

Now this structure can be used to read an internal table, and also to modify and update it.

<b>Reward points, if helpful.</b>

Regards,

Atin

Read only

Former Member
0 Likes
812

TYPES <t> TYPE|LIKE <tabkind> OF <linetype> [WITH <key>] [INITIAL SIZE <n>].

I hope u are asking about the declaration. Hope this solves.

Thanks,

Max

Read only

Former Member
0 Likes
812

Hi sonti,

1. One way is this :

<b>data : ITAB TYPE TABLE OF T001.

DATA :WA_ITAB TYPE T001.</b>

select * from t001

into table itab.

loop at itab into wa_itab.

write : / wa_itab-bukrs.

endloop.

regards,

amit m.

Read only

Former Member
0 Likes
812

Hi,

For this you have to declare an internal table(without header line) and a workarea.

types : begin of t_tab,      "Type Declaration 
               matnr type matnr,
               maktx type maktx,
           end of t_tab.
data : x_tab type t_tab.           "Work Area
data : it_tab type standard table of t_tab.  "Internal table

Start-of-selection.    "Get Data
  select matnr maktx 
    from makt
    into table it_tab
   where matnr in s_matnr.

end-of-selection.
  loop at it_tab into x_tab.  " loop the table to get the data in workarea.
                              "Inside the loop you can access the data using workarea.
     write :/ x_tab-matnr.
     write : x_tab-maktx.
  endloop.

Hope this helps.

Regards,

Richa.

Read only

Former Member
0 Likes
812

Hi,

Data : itab like standard table of mara,

wa like itab.

select * from mara into wa.

append itab.

Regards,

Priyanka.

Read only

Former Member
0 Likes
812

Hi Welcome to Sdn,

Go to the link and you will find all the details about internal table.

http://help.sap.com/saphelp_nw04/helpdata/en/fc/eb3660358411d1829f0000e829fbfe/frameset.htm

Reward if usefull.

Thanks,

Ramya.R

Message was edited by:

RAMYA RAVIKUMAR

Read only

Former Member
0 Likes
812

HI,

use like this.

data:i_mara like mara occurs o,

wa like mara.

select * from mara into table i_mara up to 20 rows.

loop at i_mara into wa.

write:/ wa-matnr,wa-mtart,wa-ernam,wa-ersda.

endloop.

<b>reward all helpful answers.</b>

rgds,

bharat.

Read only

Former Member
0 Likes
812

HI.

Two way to create internal table

first way:

data:begin of itab occurs 0.

fildes1 type char,

end of itab.

second way:

dataLitab like table of <table name like EKKO>.

Reward all helpfull answers.

Regards.

Jay

Read only

Former Member
0 Likes
812

Hi,

You can declare internal table without header line as

data: itab type standard table of table_name.

thanks,

Muthu.

Read only

Former Member
0 Likes
812

Example:

<b>Create a type:</b>

TYPES: BEGIN OF t_contactaddress.
        INCLUDE STRUCTURE bapicontact_addressdata.
TYPES: END OF t_contactaddress.

<b>Create a workarea:</b>

DATA: wa_contactaddress TYPE bapicontact_addressdata.

<b>Process the data like:</b>


LOOP AT t_contactaddress INTO wa_contactaddress.
* processing logic
ENDLOOP

Remember that using a CLEAR statement on a table without header line will refresh the table!