Application Development 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: 

Regarding select query

Former Member
0 Kudos
234

Hi,

There are two tables PRPS & VBAP

I am going to link this both table by.

PRPS-POSID = VBAP-PS_PSP_PNR.

The Data type of both the fields are different

POSID data Type is CHar24

PS_PSP_PNR data type is NUMC 8

selecting from vbap

for all entries of prps

where ps_psp_pnr = posid.

gives an error .

becouse of different data elements.

what should i do to run this query?.

10 REPLIES 10

Former Member
0 Kudos
121

Hi

You need find out Primary key for joining 2 tables. otherwise it will show error.

Thanks

sasmita

Former Member
0 Kudos
121

Hi,

I think the length and domain are different then joining will not work.

Instead of joinning these two tables, you can fetch the records from one table and make an internal table, and use the "for all entries" option.

Regards

R. Rengaraj

0 Kudos
121

You can use subset of the field which is longer

Former Member
0 Kudos
121

link this way:

<b>prps-posid = vbap-PS_PSP_PNR</b>

**reward if helpful

regards,

madhumitha

Former Member
0 Kudos
121

Hi,

I think you will have equate PRPS-PSPNR = VBAP-PS_PSP_PNR and not

PRPS-POSID = VBAP-PS_PSP_PNR.

PSPNR field is the one holding the WBS Elements in the table PRPS.

regards,

Mahesh

Former Member
0 Kudos
121

Vikram,

I come across the same problem when I was working for PS module.

The solution is,

U need to select the data from two individual tables based on the condition specified and then loop in one table, and read another table equating both the fileds, and if they are equal, consider that record.

Hope this may add a bit to u.

Regards,

Sujatha.

sreeramkumar_madisetty
Active Contributor
0 Kudos
121

Hi

U need to select the data from two individual tables based on the condition specified and then loop in one table, and read another table equating both the fileds, and if they are equal, consider that record.

like

Loop at table1.

read table 2 with key mapping field.

statement.

Regards,

kumar

Former Member
0 Kudos
121

Hey ...do this way...

while retrieving details using prps make declare the length of the prps-posid in internal table as length of vbap-ps_psp_pnr...

and then by using for all entries pass the values by using internal table...

either ways u link u have to shift the declaration length which will be helpful...

0 Kudos
121

How do you declare the length of the prps-posid in the internal table as length of vbap-ps_psp_pnr???

Former Member
0 Kudos
121

Thanks to all