10-17-2008 1:22 PM
Hi All,
I am using following select statement in a program line within a SmartForm which results in an error.
SELECT *
FROM VBPA
INTO CORRESPONDING FIELDS OF TABLE T_KUNNR1
WHERE VBELN = '220'
AND PARVW = 'SP'.
If I modify this statement as below then it is working fine.
SELECT *
FROM VBPA
INTO CORRESPONDING FIELDS OF TABLE T_KUNNR1.
Can anyone please suggest me what is the problem with above statement.
Regards,
Avaneet
10-17-2008 1:24 PM
10-17-2008 1:24 PM
10-17-2008 1:29 PM
Hi srinivasu,
I have also tried with leading zeros before 220, but no luck.
10-17-2008 1:30 PM
10-17-2008 1:40 PM
Hi All,
I dont know the exact error. But if I use following statement, no data is displayed in the output while if i see in the table VBPA, one row is available with VBELN = '220' and PARVW = 'SP'.
SELECT *
FROM VBPA
INTO CORRESPONDING FIELDS OF TABLE T_KUNNR1
WHERE VBELN = '220'
AND PARVW = 'SP'.
But If I use following statement, data is displayed in the output.
SELECT *
FROM VBPA
INTO CORRESPONDING FIELDS OF TABLE T_KUNNR1.
I have also tried to store '220' and 'SP' in variables and uses these variables in the select statement. But this is also not working.
Please help to resolve this issue.
10-17-2008 1:47 PM
it was told already that '220' is definetly wrong (it is also wrong if you store in variable), the value has to be '0000000220' (if you don't know why than make a search on conversion exits + check the domain behind VBPA-VBELN in SE11)
SP is OK (I checked), however there is a converiosn exit as well
first replace the 220 in your select statement, if still no entry with this combination, than simply there are no entries with this combination
10-17-2008 1:48 PM
hi..avaneet..
vbeln has 10 character space.
when u r giving a specific value in Select stmt as in ur case its '220' , we should always give with its total length.
so in ur where clause give it as
SELECT *
FROM VBPA
INTO CORRESPONDING FIELDS OF TABLE T_KUNNR1
WHERE VBELN = '0000000220'
AND PARVW = 'SP'.
regards,
Padma
If this also not gves proper answer,
check the declaration for ur field vbeln in t_kunnr1.
try to give it as
vbeln type vbpa-vbeln
Edited by: Padmashree RamMaghenthar on Oct 17, 2008 6:19 PM
10-17-2008 1:50 PM
Thank-you - now you've been explicit, I can make suggestions. Next time, try to give sufficient information without being promted.
If you look at the domains VBELN and PARVW, you'll see they both have conversion routines - ALPHA and PARVW respectively. Use those conversion routines before doing the select.
DATA: l_vbeln TYPE vbeln,
l_parvw TYPE parvw.
l_vbeln = '220'.
l_parvw = 'SP'.
CALL FUNCTION MODULE 'CONVERSION_EXIT_ALPHA_INPUT'
EXPORTING INPUT = l_vbeln
IMPORTING OUTPUT = l_vbeln.
CALL FUNCTION MODULE 'CONVERSION_EXIT_PARVW_INPUT'
EXPORTING INPUT = l_parvw
IMPORTING OUTPUT = l_parvw.
SELECT *
FROM VBPA
INTO CORRESPONDING FIELDS OF TABLE T_KUNNR1
WHERE VBELN EQ l_vbeln
AND PARVW EQ l_parvw.
So, the vbeln value was held internally with leading zeros, AND the parvw value 'SP' is held internally as 'AG'. But don't ever select using "AG", always use the conversion exits.
matt
10-17-2008 1:53 PM
Hi,
I have also tried with 10 digit VBELN value like this:
SELECT *
FROM VBPA
INTO CORRESPONDING FIELDS OF TABLE T_KUNNR1
WHERE VBELN = '0000000220'
AND PARVW = 'SP'.
But it is still not selecting any data.
If I see the table entries in VBPA from transaction SE11, it is showing an entry with VBELN = 220.
10-17-2008 1:53 PM
this work for me... I executed it..
DATA: BEGIN OF t_kunnr1 OCCURS 0.
INCLUDE STRUCTURE vbpa.
DATA: END OF t_kunnr1.
SELECT *
FROM vbpa
INTO CORRESPONDING FIELDS OF TABLE t_kunnr1
WHERE vbeln = '0000000001'
AND parvw = 'SP'.
if sy-subrc eq 0.
WRITE:/ 'Done'.
endif.
10-17-2008 1:53 PM
that'll work, because "SP" (sold-to party) is internally stored as "AG" (Auftraggeber), old German legacy...to add to the confusion, there also is an internal value "SP" (Spediteur = Carrier).
Thomas
P.S. just saw now that you mentioned "AG" already...please ignore
10-17-2008 1:57 PM
Hi
First chack in SE11 by giving the entries 000000220 and SP
then see how many records it is displaying
10-17-2008 1:58 PM
>
> P.S. just saw now that you mentioned "AG" already...please ignore
Too late!
10-17-2008 1:58 PM
avaneet,
when we see in the table, it display only values without preceeding zeros.
check this structure declaration and try it.
types: begin of ty_vbpa,
vbeln type vbpa-vbeln,
posnr type vbpa-posnr,
parvw type vbpa-parvw,
kunnr type vbpa-kunnr,
lifnr type vbpa-lifnr,
end of ty_vbpa.
data: t_kunnr1 type standard table of ty_vbpa.
wa_kunnr1 type ty_vbpa.
now use the above fields in select query and check it.
it wil work.
10-17-2008 2:00 PM
First I did not find, 'cause I checked in German...
Funny thing there is an SP (Spediteur) ==> CR (Forwarding agent) as well
10-17-2008 2:02 PM
As Thomas said, delightfully adding to the confusion. But now the original poster knows all about conversion exits, he'll never have this problem again. Well, here's hoping anyway.
10-17-2008 2:05 PM
10-17-2008 2:05 PM
10-17-2008 2:07 PM
>
> Hi ,
> Try to declare the structure again ....
>
>
>
> Regards,
> Bharani
Try to read the whole thread before posting.
10-17-2008 1:24 PM
No, my telepathy skills are weak this afternoon. You'll have to tell me.
What error are you getting? ( Though srinivasu bv is probably correct ).
10-17-2008 1:30 PM
Hi,
Here VBELN is char 10 and store with leading zero , so for the retriving this we need to add the leading zeros.
Try this way
SELECT *
FROM VBPA
INTO CORRESPONDING FIELDS OF TABLE T_KUNNR1
WHERE VBELN = '0000000220'
AND PARVW = 'SP'.
the second one dont have the where clause so it will work fine.
regards,
Bharani
10-17-2008 1:30 PM
Hi avaneet,
Try holding the values 220 and SP in a local variables and use that local variables in the select statement probably it may work.
Cheers!!
10-17-2008 1:36 PM
Hi,
Use this...
Data: v_vbeln like VBPA-VBELN,
v_parvw like VBPA-PARVW.
v_vbeln = '220'.
v_parvw = 'SP'.
SELECT *
FROM VBPA
INTO CORRESPONDING FIELDS OF TABLE T_KUNNR1
WHERE VBELN = v_vbeln
AND PARVW = v_parvw.
10-17-2008 2:14 PM
Try
SELECT *
FROM VBPA
INTO CORRESPONDING FIELDS OF TABLE T_KUNNR1
WHERE VBELN = '0000000220' AND PARVW = 'AG'.
Respect the field definitions and conversion-exits.
Regards
10-17-2008 2:17 PM
Hi Avannet
What about the error ?
still you are getting same errror or what??
10-17-2008 2:17 PM
Thanks Matt.
I used conversion routines suggested by you and now it starts working.
Again thanks a lot.