‎2007 Sep 07 7:29 PM
Hi gurus,
I have a condition where I need to select vkbur, vkgrp, kunnr abd bzirk from knvv for all entries in one of my internal table it_tab01. Now although I have an customer id that is there in both knvv and my internal table it_tab01 but then also nothing is getting copied into it_sales. can you just tell me whats going wrong.
select vkgrp vkbur bzirk kunnr into table it_sales
from knvv
for all entries in it_tab01
where kunnr = it_tab01-custid.
Thanks
Rajeev Gupta
‎2007 Sep 07 7:33 PM
HI,
The reason could be that the customer id in the it_tab01 is not of the same format as in KNVV...
if that is the case just try using this.
loop aa it_tab01.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = IT_TAB01-CUSTID
IMPORTING
OUTPUT = IT_TAB01-CUSTID.
select single vkgrp vkbur bzirk kunnr into it_sales
from knvv
where kunnr = it_tab01-custid.
IF SY-SUBRC EQ 0.
APPEND IT_SALES.
endloop.
‎2007 Sep 07 7:33 PM
HI,
The reason could be that the customer id in the it_tab01 is not of the same format as in KNVV...
if that is the case just try using this.
loop aa it_tab01.
call function 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING
INPUT = IT_TAB01-CUSTID
IMPORTING
OUTPUT = IT_TAB01-CUSTID.
select single vkgrp vkbur bzirk kunnr into it_sales
from knvv
where kunnr = it_tab01-custid.
IF SY-SUBRC EQ 0.
APPEND IT_SALES.
endloop.
‎2007 Sep 07 7:42 PM
thanks for the reply Mahesh, but that is not the case, I tried doing what you told me.
Thanks
rajeev Gupta
‎2007 Sep 07 7:44 PM
hi,
If this logic does not work then you should check with the data in KNVV.. i dont see any other reason apart from this for data not being selected.
Debug the application and get some cust id's and open the table KNVV in se16 and see if you havve values or not..
Thanks
mahesh
‎2007 Sep 07 7:45 PM
Have you run the program in debug and verified the contents of the internal table?
Brian
‎2007 Sep 07 7:42 PM
I believe Mahesh is correct that the format of the data might not match.
I had the same problem in a program yesterday, and I resolved the problem in the manner he describes.
Good luck
Brian
‎2007 Sep 07 7:45 PM