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

regarding select query

Former Member
0 Likes
796

hi experts,

i am developing a report to display details of equipment number(transaction ie03).

in that to get the partner function details (parvw ' vw ' person responsible)

we have partner (PARNR I_PARNR CHAR 12 0 Partner) and name of that person. so based on parnr we get details from table pa0001 .

here we have PERNR (PERNR PERSNO NUMC 8 0 Personnel number)

(here pernr is equivalent to parnr of ihpa but data elements differ) so we get the details that is ename(employee name ).

but when i write select query i get the following error

select objnr parvw parnr

from ihpa

into table it_ihpa

for all entries in it_itab

where objnr = it_itab-objnr

and parvw = c_vw.

select pernr ename

from pa0001

into table it_pa01

for all entries in it_ihpa

where pernr = it_ihpa-parnr.

error : when using the addition "for all entries in itab",

the field pernr and it_ihpa-parnr must have same type and length.

how would i overcome that since i will get data from pa0001.

6 REPLIES 6
Read only

Former Member
0 Likes
753

Hi,

Please check the data type and field length of the fields IT_PA01-PERNR and IT_IHPA-PARNR.

Hope this would solve your problem.

Reward if useful.

Nilesh.

Read only

Former Member
0 Likes
753

Hi,

the fields you are equaitng in 2nd select statement are not havine same characterstics,

select pernr ename

from pa0001

into table it_pa01

for all entries in it_ihpa

where pernr = it_ihpa-parnr.

here

pernr is numc 8.

parnr is char 12.

Regards,

Ruchika

Reward if useful.........

Read only

0 Likes
753

thats what the problem is how would i overcome that since i get data from that table only.

Read only

seshatalpasai_madala
Product and Topic Expert
Product and Topic Expert
0 Likes
753

Hi,

You are getting this error coz your internal table field PARNR is of type I_PARNR and PERNR is of differen type.

So you cannot compare them.

PARNR is CHAR 12 where PERNR is NUMC 10.

Regards,

Sesh

Read only

Former Member
0 Likes
753

Hi Narshimha,

Since the technical attributes of the two fields is not same u need to transfer the contents to dummy field which will have same technical fields like 'pernr'. For that u can use the loop after the first select query.

Than u can use the for all entries variant of the select query.

If u have to use for all entries this is the only way.

Thanks and Regards,

Saurabh

Read only

Former Member
0 Likes
753

Hi,

you can compare Ihpa and pa0001 using ihpa-aedat = pa001-aedtm.

this date of last change.

regards,

Ruchika