‎2006 Sep 20 9:29 PM
Hello friends,
I need to extract data from VBFA table in to an Internal Table
based on where condition from IT_VBRK internal table comparing
VBFA-vbeln = it_vbrk-vbeln.
But when doing so i also have a check where i have to check
for it_vbrk-aubel.
However If it_aubel is blank i want to skip that record completely.
I am trying to do without looping it_vbrk.
I dont want to delete the records in it_vbrk where AUBEL is blank.
below is the code that i tried but dosent work,
SELECT vbelv
vbeln
INTO TABLE it_vbfa
FROM vbfa
FOR ALL ENTRIES IN it_vbrk
WHERE vbeln EQ it_vbrk-vbeln
AND vbtyp_v EQ 'C'
and it_vbrk-aubel NE ' '.
Any advice,
Shejal Shetty.
‎2006 Sep 20 9:33 PM
You cannot use two itab fields in your SELECT.. you can do it this way..
delete it_vbrk where aubel eq space.
check not it_vbrk is initial.
SELECT vbelv
vbeln
INTO TABLE it_vbfa
FROM vbfa
FOR ALL ENTRIES IN it_vbrk
WHERE vbeln EQ it_vbrk-vbeln
AND vbtyp_v EQ 'C'.
~Suresh
‎2006 Sep 20 9:33 PM
You cannot use two itab fields in your SELECT.. you can do it this way..
delete it_vbrk where aubel eq space.
check not it_vbrk is initial.
SELECT vbelv
vbeln
INTO TABLE it_vbfa
FROM vbfa
FOR ALL ENTRIES IN it_vbrk
WHERE vbeln EQ it_vbrk-vbeln
AND vbtyp_v EQ 'C'.
~Suresh
‎2006 Sep 20 9:34 PM
Hi,
Store the IT_VBRK in a temporary internal table and delete the records that don't have the value for AUBEL..
IT_VBRK_TMP = IT_VBEK.
DELETE IT_VBRK_TMP WHERE AUBEL = ' '.
SELECT vbelv
vbeln
INTO TABLE it_vbfa
FROM vbfa
FOR ALL ENTRIES IN it_vbrk_tmp
WHERE vbeln EQ it_vbrk_tmp-vbeln
AND vbtyp_v EQ 'C'.
Thanks,
Naren
‎2006 Sep 20 9:37 PM
Thanks Everyone for the suggestions.
So it has to be done only after i delete the blanks AUBEL.
or
loop through it_VBRK and check for blank aubel.
Shejal.
‎2006 Sep 20 9:35 PM
I think you have to do something like copy it_vbrk to it_vbrk_cop then delete it_vbrk_cop where aubel is blank. You can use it_vbrk_cop in the select.
Rob
‎2006 Sep 20 9:44 PM
Hi Shejal,
try this
if not it_vbrk-aubel is initial.
SELECT vbelv vbeln
INTO TABLE it_vbfa
FROM vbfa
FOR ALL ENTRIES IN it_vbrk
WHERE vbeln EQ it_vbrk-vbeln
AND vbtyp_v EQ 'C'
and aubel EQ it_vbrk-aubel.
endif.
Hope it works. If it does pl reward accordingly
K
‎2006 Sep 20 9:49 PM
Karthik,
Thanks for the suggestion,
But it wont work because it is always comparing with one value of it_VBRK-aubel( the value in the header line and is the last record in it_vbrk).
Thanks
Shejal.