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

Inner join Statement sometime working sometimes not.

Former Member
0 Likes
762

Hi guys,

we have this code below... the weird this is that sometimes, the sy-subrc is set to 0 sometimes it is set to 4 even though the filetering parameters are the same...

select single a~kunnr

into v_kunnr

from knvp as a inner join kna1 as b

on akunnr eq bkunnr

where a~vkorg = v_vkorg

and a~vtweg = v_vtweg

and a~spart = '20'

and a~parvw = 'WE'

and a~kunn2 = v_kunnr

and b~ktokd = 'Z104'.

Can you help me with this? What's the reason behind this?

Thank you!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
717

Hello,

There is a conversion exit associated with the field parvw, CONVERSION_EXIT_PARVW_INPUT. Could be that's one of the reason for the irregularity. Better to use this before the select statement and check the results.

Vikranth

Hi guys,

we have this code below... the weird this is that sometimes, the sy-subrc is set to 0 sometimes it is set to 4 even though the filetering parameters are the same...

select single a~kunnr

into v_kunnr

from knvp as a inner join kna1 as b

on akunnr eq bkunnr

where a~vkorg = v_vkorg

and a~vtweg = v_vtweg

and a~spart = '20'

and a~parvw = 'WE'

and a~kunn2 = v_kunnr

and b~ktokd = 'Z104'.

Can you help me with this? What's the reason behind this?

Thank you!

4 REPLIES 4
Read only

Former Member
0 Likes
718

Hello,

There is a conversion exit associated with the field parvw, CONVERSION_EXIT_PARVW_INPUT. Could be that's one of the reason for the irregularity. Better to use this before the select statement and check the results.

Vikranth

Read only

0 Likes
717

Hi,

Thanks for your response, PARVW here is constant. I dont find any reason why there is a need for conversion.

Is this not related to select single with inner join?

Thank you

Read only

0 Likes
717

Hi,

Display values of KNVP table through SE16 and see the value difference of Partner Function by clicking individual record.

Maintaining constant will not help, you have use conversion exit before your select query and need to pass this value to the select where clause.

You can use either of below two exits.

CONVERSION_EXIT_PARVW_INPUT

CONVERSION_EXIT_PARVW_OUTPUT

Regards,

Nitin Gaikwad

Read only

Former Member
0 Likes
717

Hi,

what are you fetching from the below select query

select single a~kunnr

into v_kunnr

from knvp as a inner join kna1 as b

on akunnr eq bkunnr

where a~vkorg = v_vkorg

and a~vtweg = v_vtweg

and a~spart = '20'

and a~parvw = 'WE'

and a~kunn2 = v_kunnr

and b~ktokd = 'Z104'.

I hope you are extracing the customer numbre by linking the table KNVP and KNA1.

If the above statemnet is true then in the above select query the condition paraemeters you are comparing is wrong

select single a~kunnr

into v_kunnr

from knvp as a inner join kna1 as b

on akunnr eq bkunnr

where a~vkorg = v_vkorg

and a~vtweg = v_vtweg

and a~spart = '20'

and a~parvw = 'WE'

and a~kunn2 = v_kunnr You are extracing the kuunr but how come here comparing the condition

and b~ktokd = 'Z104'.

comment the bold line and check whether working or not ?