‎2008 Mar 16 10:52 AM
HI,
This select statement showing an error 'coz type of vbeln and XBLNR is different. Hw to correct this error. PLz help
SELECT vbeln
posnr
matnr
FROM lips
INTO TABLE t_lips
FOR ALL ENTRIES IN t_mkpf
WHERE vbeln EQ t_mkpf-xblnr.
‎2008 Mar 16 11:47 AM
Hi Anu,
Check below mandatory conditions when u r using for all entries.
1. Have to check driver table is initial or not before using for all entries(IF NOT t_mkpf[] IS INTIAL). Other wise if driver table is initial then the select will select all the entries of the data base.
2. At least one condition from for all entries table has to be there in the where clause.
3. Field type and length of driver and driven tables must be same(Error in ur case is because of this)
Sort the driver table and delete the adjacent duplicates from the driver table by the fields in the where clause for improving the performance.
In this case to solve ur problem u have to take one more internal table. In this u have to declare the field vbeln as mkpf-xblnr.
check below code.
TYPES: BEGIN OF t_lipstemp,
vbeln type mkpf-vbeln,
END OF t_lipstemp.
DATA: i_lipstemp TYPE STANDARD TABLE OF t_lipstemp,
wa_lipstemp TYPE t_lipstemp.
REFRESH i_lipstemp[].
LOOP AT t_mkpf INTO wa_mkpf.
CLEAR wa_lipstemp.
wa_lipstemp-vbeln = wa_mkpf-xblnr.
APPEND wa_lipstemp TO i_lipstemp.
CLEAR wa_mkpf.
ENDLOOP.
IF NOT i_lipstemp[] IS INITIAL.
SORT i_lipstemp BY vbeln.
DELETE ADJACENT DUPLICATES FROM i_lipstemp COMPARING vbeln.
SELECT vbeln
posnr
matnr
FROM lips
INTO TABLE t_lips
FOR ALL ENTRIES IN t_lipstemp
WHERE vbeln EQ t_lipstemp-vbeln.
ENDIF.
Thanks,
Vinod.
‎2008 Mar 16 11:10 AM
You could create an intermediate table in which xblnr has the same type of belnr...
Then you can do the for all entries in new_table
‎2008 Mar 16 11:31 AM
While creating internal tables for both tables
declare XBLNR and VBELN of 16 characters in size.
xblnr(16) type c
vbeln(16) type c
‎2008 Mar 16 11:47 AM
Hi Anu,
Check below mandatory conditions when u r using for all entries.
1. Have to check driver table is initial or not before using for all entries(IF NOT t_mkpf[] IS INTIAL). Other wise if driver table is initial then the select will select all the entries of the data base.
2. At least one condition from for all entries table has to be there in the where clause.
3. Field type and length of driver and driven tables must be same(Error in ur case is because of this)
Sort the driver table and delete the adjacent duplicates from the driver table by the fields in the where clause for improving the performance.
In this case to solve ur problem u have to take one more internal table. In this u have to declare the field vbeln as mkpf-xblnr.
check below code.
TYPES: BEGIN OF t_lipstemp,
vbeln type mkpf-vbeln,
END OF t_lipstemp.
DATA: i_lipstemp TYPE STANDARD TABLE OF t_lipstemp,
wa_lipstemp TYPE t_lipstemp.
REFRESH i_lipstemp[].
LOOP AT t_mkpf INTO wa_mkpf.
CLEAR wa_lipstemp.
wa_lipstemp-vbeln = wa_mkpf-xblnr.
APPEND wa_lipstemp TO i_lipstemp.
CLEAR wa_mkpf.
ENDLOOP.
IF NOT i_lipstemp[] IS INITIAL.
SORT i_lipstemp BY vbeln.
DELETE ADJACENT DUPLICATES FROM i_lipstemp COMPARING vbeln.
SELECT vbeln
posnr
matnr
FROM lips
INTO TABLE t_lips
FOR ALL ENTRIES IN t_lipstemp
WHERE vbeln EQ t_lipstemp-vbeln.
ENDIF.
Thanks,
Vinod.
‎2008 Mar 16 2:14 PM
Hello,
try :
SELECT vbeln posnr matnr FROM lips INTO TABLE t_lips
FOR ALL ENTRIES IN t_mkpf
WHERE vbeln EQ t_mkpf-xblnr+0(10).
Cordialement,
Chaouki.