2014 Apr 25 6:13 AM
Hi ,
In my select query
SELECT BELNR
VBELN
FKDAT
NETWR
BUKRS
WAERK
GJAHR
from vbrk
INTO TABLE it_vbrk
where vbeln in s_vbeln
and gjahr in s_gjahr
and fkdat in s_fkdat
and bukrs = p_bukrs.
IF not it_vbrk[] is INITIAL.
SELECT vbeln
volum
voleh
matnr
arktx from vbrp
INTO TABLE it_vbrp
FOR ALL ENTRIES IN it_vbrk
where vbeln = it_vbrk-vbeln.
endif.
IF NOT it_vbrk[] is INITIAL.
SELECT BUKRS
BELNR
GJAHR
BLART
BLDAT
XBLNR
from bkpf
INTO TABLE it_bkpf
FOR ALL ENTRIES IN it_vbrk
where bukrs = it_vbrk-bukrs
AND xblnr = it_vbrk-vbeln
and bstat <> 'A'.
ENDIF.
Getting error 'When you use the additional 'FOR ALL ENTRIES IN itab' the fields 'XBLNR'. and the 'IT_VBRK-VBELN' must have same type and same length'.
2014 Apr 25 6:19 AM
Hello Meenakshi.
I guess the error message is very clear.
The data and data types should match.
IF NOT it_vbrk[] is INITIAL.
SELECT BUKRS
BELNR
GJAHR
BLART
BLDAT
XBLNR
from bkpf
INTO TABLE it_bkpf
FOR ALL ENTRIES IN it_vbrk
where bukrs = it_vbrk-bukrs
AND xblnr = it_vbrk-vbeln
and bstat <> 'A'.
ENDIF.
Regards.
2014 Apr 25 6:50 AM
Thanks for your reply......i find the length length of vbrk-vbeln is 20 and bkpf-xblnr is 16 only....may this might be the problem.....
2014 Apr 25 6:55 AM
2014 Apr 25 6:58 AM
But in my req they specified...
a. Select BKPF based on VBRK like detailed below:
2014 Apr 25 11:51 AM
Hi Meenakshi,
In the internal table it_vbrk, define an extra field like xblnr_t type bkpf-xblnr. After accessing the data through your first select statement, loop at that internal table with field symbol and copy the value of vbeln into xblnr_t upto 16 characters.
Now in third select statement, use like this,
SELECT BUKRS
BELNR
GJAHR
BLART
BLDAT
XBLNR
from bkpf
INTO TABLE it_bkpf
FOR ALL ENTRIES IN it_vbrk
where bukrs = it_vbrk-bukrs
AND xblnr = it_vbrk-xblnr_t
and bstat <> 'A'.
If you still get any problem, feel free to ask... I also once got this situation but this is not your fault as this is sometimes the functional needs..
Regards
Dhananjay
2014 Apr 25 12:02 PM
It probably will work, but still suffers from the big flaw that it is using FOR ALL ENTRIES.
2014 Apr 25 7:01 AM
The really big problem with your program, and which would get it a fail if I were your reviewer, is that you are using FOR ALL ENTRIES. Please rewrite your select using INNER JOIN.