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

Select Query

Former Member
0 Likes
849

Hi experts,

While debuggung my report it shows an error When using the addition "FOR ALL ENTRIES IN itab", the fields "OBJECTID" and "ITAB_EIPA-EBELN" must have the same type and length.

I m sending u some line of my codes, where it is showing an error.

data:begin of itab_cdhdr occurs 0,

OBJECTID like eipa-ebeln,

UDATE like cdhdr-UDATE,

TCODE like cdhdr-TCODE,

end of itab_cdhdr.

if itab_ekbe[] is not initial.

select ebeln ebelp werks preis

into table itab_eipa

from eipa

for all entries in itab_ekbe

where ebeln = itab_ekbe-ebeln and

ebelp = itab_ekbe-ebelp and

werks eq p_werks .

endif.

if itab_eipa[] is not initial.

select OBJECTID UDATE TCODE

into table itab_cdhdr

from cdhdr

for all entries in itab_eipa

where OBJECTID = itab_eipa-ebeln

and TCODE = 'ME29N' .

endif.

Plz tell what will b the possible solution.

definitely rwds pts,

Savita

7 REPLIES 7
Read only

former_member195383
Active Contributor
0 Likes
815

inside itab_eipa declare another field as

objectid like cdhdr-OBJECTID.

after the first select stmt use the following

loop at itab_eipa.

itab_eipa-objectid = itab_eipa-ebeln.

modify itab_eipa transporting objectid.

endloop.

if itab_eipa[] is not initial.

select OBJECTID UDATE TCODE

into table itab_cdhdr

from cdhdr

for all entries in itab_eipa

where OBJECTID = itab_eipa-objectid

and TCODE = 'ME29N' .

endif.

Read only

0 Likes
815

Hello Rudra,

Then also it is showing the same error

Savita

Read only

former_member202474
Contributor
0 Likes
815

Hi,

in the select staements what u have written

select ebeln ebelp werks preis

into table itab_eipa

from eipa

for all entries in itab_ekbe

where ebeln = itab_ekbe-ebeln and

ebelp = itab_ekbe-ebelp and

werks eq p_werks .

and the other one, when u r mentioning some fields u should use into corresonding clause.

modify the above select as

select ebeln ebelp werks preis

from eipa into corresponding fields of table itab_eipa

for all entries in itab_ekbe

where ebeln = itab_ekbe-ebeln and

ebelp = itab_ekbe-ebelp and

werks eq p_werks .

***reward if useful

regards,

Ruby.

Read only

Former Member
0 Likes
815

Hi,

Lenght of both the variables should be same, try to declare of same length.

Regards

Susheel.

Read only

Former Member
0 Likes
815

savita did u find he sol of 103,105.If not i will tell you

Read only

Former Member
0 Likes
815

In the declaration part of internal table itab_ekbe, declare field 'ebeln type cdhdr-objectid'.

Read only

Former Member
0 Likes
815

Hi,

define objectid in the given format in the internal table.

OBJECTID like CDHDR-OBJECTID.

Regards,

Venkat N