2010 May 26 6:27 AM
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!
2010 May 26 6:32 AM
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!
2010 May 26 6:32 AM
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
2010 May 26 7:04 AM
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
2010 May 26 7:26 AM
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
2010 May 26 7:32 AM
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 ?
| User | Count |
|---|---|
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |