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

structure compatibility

Former Member
0 Likes
1,157

hi,

can we define a structure as like this:

cht_outtab[] = lt_outtab_me05.

i am assigning this to cht_outtab, where cht_outtab is type any table and lt_outtab_me05 like table of zmere_outtab_me05.

please help me on this?

11 REPLIES 11
Read only

Former Member
0 Likes
1,119

If both are internal tables with identical structures:

cht_outtab[] = lt_outtab_me05[].

If that is not the case, you'll have to loop over lt_outtab_me05 and move each corresponding field of lt_outtab_me05 to cht_outtab.

Read only

0 Likes
1,119

hey,

its defined like this :

FORM w3_alv_fill_table CHANGING cht_outtab TYPE ANY TABLE.

DATA: ls_outtab_me05 like zmere_outtab_me05,

lt_outtab_me05 like table of ls_outtab_me05.

and lastly it is cht_outtab[] = lt_outtab_me05.

i am not understanding wats wrong?

any other way of defing cht_outtab??

Read only

0 Likes
1,119

Last statement should be ...

cht_outtab[] = lt_outtab_me05[].

and while calling procedure w3_alv_fill_table you should pass table parameter cht_outtab as internal table of type zmere_outtab_me05

Edited by: Vishal Jadhav on Oct 9, 2008 2:18 PM

Read only

0 Likes
1,119

FORM w3_alv_fill_table CHANGING cht_outtab like zmere_outtab_me05.?????

should i define it like this?

Read only

Former Member
0 Likes
1,119

Hi Poonam,

I think, may be you should use field-symbols in that case.

Regards,

Vishal

Read only

0 Likes
1,119

can you tell me detail? how to proceed?

Read only

0 Likes
1,119

To move the contents from 1 internal table to another in 1 go:

itab1[] = itab2[].

But what is the error you are getting?

Read only

0 Likes
1,119

as they are not compatible. still getting the same error.

Edited by: Poonam Naik on Oct 9, 2008 11:10 AM

Read only

0 Likes
1,119

Both internal tables must have the same structure.

Somewhere you do a PERFORM w3_alv_fill_table CHANGING your_table.

The definition of your_table must be the same as the local internal table you want to copy from.

Read only

0 Likes
1,119

the problem is : perform statement is in standard include which i cant change and form is in z include.

any other way out?

Read only

0 Likes
1,119

Change the definition of your local internal table

DATA: ls_outtab_me05 like zmere_outtab_me05,
lt_outtab_me05 like table of ls_outtab_me05.

to the definition of the internal table you pass in the PERFORM.

But... if this routine is going to be used for other internal tables (wiht other definition) as well, then you'll notice those will go wrong.