Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

data type mismach

Former Member
0 Likes
849

Dear Gurus,

Hi from majed Khan,

my problem in this code

if it_vbrk[] is not initial.

sort it_vbrk by vbeln.

loop at it_vbrk into wa_vbrk.

select belnr budat blart awkey into wa_bkpf

from bkpf

where awkey eq wa_vbrk-vbeln.

append wa_bkpf to it_bkpf.

endselect.

endloop.

endif.

above code is taking lot of time to execute , when i m trying for

FOR ALL ENTREIS . then.

it showing error like bkpf-awkey = vbrk-vbeln mismatch.

becouse awkey of lenth = 20 where as vbeln of lenth = 10.

how to use above code for fast exicution.

Point will assured. Thanks Dear All.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
732

Hi Majed Khan,

To use FOR ALL ENTRIES all field must be same.

Try to add new field in table it_vbrk, let name it 'AWKEY' where its value is same with vbrk-vbeln. The use it in FOR ALL ENTRIES .


LOOP AT IT_VBRK.
  MOVE IT_VBRK-VBELN TO IT_VBRK-AWKEY.
  MODIFY IT_VBRK.
ENDLOOP.

SELECT BELNR BUDAT AWKEY
INTO TABLE IT_BKPF
FROM BKPF
FOR ALL ENTRIES IN IT_VBRK
WHERE AWKEY =  IT_VBRK-AWKEY.

Regards,

5 REPLIES 5
Read only

Former Member
0 Likes
732

Hi,

Instead of this below select query, get the data fro table BKPF into some other internal table and use Read Tale statement.

Regards,

Suresh

Read only

Former Member
0 Likes
733

Hi Majed Khan,

To use FOR ALL ENTRIES all field must be same.

Try to add new field in table it_vbrk, let name it 'AWKEY' where its value is same with vbrk-vbeln. The use it in FOR ALL ENTRIES .


LOOP AT IT_VBRK.
  MOVE IT_VBRK-VBELN TO IT_VBRK-AWKEY.
  MODIFY IT_VBRK.
ENDLOOP.

SELECT BELNR BUDAT AWKEY
INTO TABLE IT_BKPF
FROM BKPF
FOR ALL ENTRIES IN IT_VBRK
WHERE AWKEY =  IT_VBRK-AWKEY.

Regards,

Read only

Former Member
0 Likes
732

Hi Majed,

Try this code.

TABLES bkpf.

RANGES r_awkey FOR bkpf-awkey.

LOOP AT it_vbrk INTO wa_vbrk.
r_awkey-sign = 'I'.
r_awkey-option = 'EQ'.
r_awkey-low = wa_vbrk-vbeln.
APPEND r_awkey.
ENDLOOP.

if r_awkey[] is not initial.
select belnr budat blart awkey into wa_bkpf
from bkpf
INTO TABLE it_bkpf
where awkey IN r_awkey.
endif.

Regards

Wenceslaus

Read only

Former Member
0 Likes
732

hi Majid,

do this way to correct the error

include a new field awkey in it_vbrk ..

i.e,

 data : begin of it_vbrk occurs 0,
         .......
         awkey like bkpf-awkey,
          end   of it_vbrk. 
loop at it_vbrk.
 it_vbrk-awkey = it_vbrk-vbeln. 
 modify it_vbrk index sy-tabix transporting awkey.
endloop.

 select belnr budat blart awkey into wa_bkpf
from bkpf
for all entris in it_vbrk.
where awkey eq it_vbrk-awkey.

Message was edited by:

Santosh Kumar Patha

Read only

0 Likes
732

Hi dear Santosh, and all dear Guru,

very very thanks

Thanks for solving my Problem,