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
615

Hi ,

How to add one or more fields to existing internal table .

THX

6 REPLIES 6
Read only

Former Member
0 Likes
601

Hi

Please be more specific in ur reqmt .

If currently u have 2 fields in ur Internal Table and you want to add another 2 fields then you need to change the Internal Table Declaration .

Let us know more abt ur reqmt .

Thanks . Praveen

Read only

0 Likes
601

HI Praveen,

see initially i have declared internal table with some N fields

and based on some conditions i want to add one or more fields to internal table in dynamic not in initially ,

so for ex : for adding fields to data base table we are using Structures right like that i want to add to internal table but in dynamic so cleared .

THX

Read only

Former Member
0 Likes
601

Hi,

There are many ways:

1. You can create a structure with all the fields you want to add. Like:

TYPES: BEGIN OF street_type,

name TYPE c LENGTH 40,

no TYPE c LENGTH 4,

END OF street_type.

data: itab type table of street_type.

You can add fields to this structure at any time.

2. You can define an internal table like a database table:

like:

data: itab type table of sflight.

if you want to add field to this itab, then create a structure like:

TYPES: BEGIN OF street_type,

name TYPE c LENGTH 40,

no TYPE c LENGTH 4.

Include sflight.

Types: END OF street_type.

3. You can create an se11 stucture to associate with the internal table.

Regards,

Renjith Michael.

Read only

Former Member
0 Likes
601

Hi,

There are 2 ways to add fields to your internal table.

Suppose

1. if you declare your internal table with include structure like below

DATA : Begin of itab occurs 0.

INCLUDE STRUCTURE structure name.

DATA : END OF itab.

adding fields.

DATA : Begin of itab occurs 0.

INCLUDE STRUCTURE structure name.

DATA : v_num type i ,

v_char TYPE c,

END OF itab.

2.If it is general declaration add 2 more fields to your

internal table

DATA : Begin of itab occurs 0,

here add more fields.

end of itba.

3.If it is like belwo.

DATA: itab like mara occurs 0 with header line.

then use include structures like 1.

DATA : Begin of itab occurs 0.

INCLUDE STRUCTURE mara.

DATA : v_num type i ,

v_char TYPE c,

END OF itab.

Don't forget to reward iuf useful....

Read only

0 Likes
601

Hi,

Is it posible to merge two database tables like VBAK and VBAP.

Is the following query correct for that purpose.

SELECT * FROM ( vbak AS it_vbak INNER JOIN vbap AS it_vbap ON it_vbakvbeln = it_vbapvbeln )

INTO itab WHERE it_vbapvbeln IN it_vbapvbeln.

And also please let me know about the declarations of internal tables for this query.

Thanks,

chandrika.

Edited by: samantha m.v on Apr 23, 2008 11:52 AM

Read only

Former Member
0 Likes
601

Hi,

It is better you to go for dynamic internal tables using string.

It will make your requirement more easier.

Regards,

Sankar.