‎2006 Oct 20 10:16 PM
Hello friends,
I am writing a select querry,and this querry is not fetching any data.
SELECT kunnr
kdgrp
INTO TABLE it_knvv
FROM knvv
WHERE kunnr = it_zzsd0010-kunnr.
I looked into Debug mode and for it_zzsd0010-kunnr there is data in KNVV-kunnr.
But i observed that
KNVV-KUNNR = 10 char and
ZZSD0010-KUNNR = 8 char. does it matter?
Shejal.
‎2006 Oct 20 10:39 PM
yes..
Check the field it_zzsd0010-kunnr if it is padded with zeros...Otherwise you have to use the function module which I have mentioned in my earlier reply..
Thanks,
Naren
‎2006 Oct 20 10:18 PM
Hi,
Is the customer a number or a alpha numeric...
If it just number...try using the FM CONVERSION_EXIT_ALPHA_INPUT to modify the customer to internal format and then use if the KNVV select...
Thanks,
Naren
‎2006 Oct 20 10:23 PM
Thanks Naren, But do u think is it because of the the length of char.
Both are KUNNR and are 10 char length, IN KNVV-KUNNR the data has leading zeros to make it to 10 char length and in ZZSD0010 table the Kunnr field is 10 char length but it does not always have 10 char.
Shejal.
‎2006 Oct 20 10:33 PM
Hi ,
iT MATTERS THATS THE REASON WHY YOU ARE NOT ABLE TO FETCH DATA.
try this.
DATA : V_zero3(10) type c value '0000000000',
v_count(3) type n,
v_count2(3) type n ,
v_zerot(10).
LOOP AT it_zzsd0010.
SHIFT it_zzsd0010-KUNNR LEFT DELETING LEADING '0'.
v_count = strlen( it_zzsd0010-KUNNR ).
v_count2 = 10 - v_count.
if not v_count2 is initial.
move v_zero3+0(v_count2) to v_zerot.
else .
v_zerot = ' '.
endif.
concatenate v_zerot it_zzsd0010-KUNNR into it_zzsd0010-KUNNR.
MODIFY it_zzsd0010.
ENDLOOP.
SELECT kunnr
kdgrp
INTO TABLE it_knvv
FROM knvv
WHERE kunnr = it_zzsd0010-kunnr.
rewards points if helpful.
Thanks
venki
‎2006 Oct 20 10:34 PM
Hi ,
iT MATTERS THATS THE REASON WHY YOU ARE NOT ABLE TO FETCH DATA.
try this.
DATA : V_zero3(10) type c value '0000000000',
v_count(3) type n,
v_count2(3) type n ,
v_zerot(10).
LOOP AT it_zzsd0010.
SHIFT it_zzsd0010-KUNNR LEFT DELETING LEADING '0'.
v_count = strlen( it_zzsd0010-KUNNR ).
v_count2 = 10 - v_count.
if not v_count2 is initial.
move v_zero3+0(v_count2) to v_zerot.
else .
v_zerot = ' '.
endif.
concatenate v_zerot it_zzsd0010-KUNNR into it_zzsd0010-KUNNR.
MODIFY it_zzsd0010.
ENDLOOP.
SELECT kunnr
kdgrp
INTO TABLE it_knvv
FROM knvv
WHERE kunnr = it_zzsd0010-kunnr.
rewards points if helpful.
Thanks
venki
‎2006 Oct 20 10:39 PM
yes..
Check the field it_zzsd0010-kunnr if it is padded with zeros...Otherwise you have to use the function module which I have mentioned in my earlier reply..
Thanks,
Naren
‎2006 Oct 20 11:11 PM
‎2006 Oct 22 6:04 AM
Hi,
If you dont want to use the function module,you can use the the code below:(no need calculate and concatenate).
OVERLAY will take care of appending variable number of zeros.
data: lc_overlay(10) value '0000000000'.
Shift kunnr right deleting trailing space.
OVERLAY kunnr with lc_overlay.
Mark points if you find answer useful.
Regs,
Ags..