1
votes

I would like to get customer address (street) from one table (kna1) when customer partner role is "WE" in other table (vbpa).

I've done it like this however it returns completely different address from wrong customer. What am I doing wrong?

SELECT SINGLE stras
FROM kna1
INNER JOIN vbpa ON (vbpa-kunnr)
WHERE parvw EQ 'WE'
INTO @zadrwe.

Thank you.

1
Your inner join is not correct.Umar Abdullah

1 Answers

6
votes

Your inner Join is not correct.You can use below code to see correct value.

DATA zadrwe TYPE stras_gp.

SELECT SINGLE stras
FROM kna1
INNER JOIN vbpa ON kna1~kunnr = vbpa~kunnr   
WHERE parvw EQ 'WE'
INTO @zadrwe.