10-17-2008 2:23 AM
In my below select stmt,
I don't want to select when j_3astcu is SPACE
I mean when gt_soldto1-store_no is SPACE i don't want that value to be selected ?
how can I apply this logic below ?
IF NOT gt_soldto1[] IS INITIAL.
SELECT * " kunnr name2 j_3astcu
FROM kna1
INTO corresponding fields of TABLE gt_kna1
FOR ALL ENTRIES IN gt_soldto1
WHERE ( name2 LIKE 'Store#%'
OR name2 LIKE 'Store%' )
OR ( j_3astcu <> SPACE
AND j_3astcu = gt_soldto1-store_no )
AND LAND1 = 'US'.
OR LAND1 = 'US'.
ENDIF. " IF NOT gt_soldto[] IS INITIAL.
HELP ME PLEASE.
THANKS IN ADV.
10-20-2008 3:47 AM
Will the below stmt helps?
SELECT * " kunnr name2 j_3astcu
FROM kna1
INTO corresponding fields of TABLE gt_kna1
FOR ALL ENTRIES IN gt_soldto1
WHERE ( name2 LIKE 'Store#%'
OR name2 LIKE 'Store%' )
OR ( j_3astcu NE SPACE
AND j_3astcu = gt_soldto1-store_no )
OR LAND1 = 'US'.
( j_3astcu NE SPACE
AND j_3astcu = gt_soldto1-store_no )
Instead of deleting ?
Sorry .
THANKS IN ADV.
10-17-2008 2:47 AM
change the follwoing in where as
*j_3astcu NE SPACE*
AND j_3astcu = gt_soldto1-store_no )
rest in where condition you know better
10-17-2008 3:11 AM
10-17-2008 3:15 AM
Why you have 'OR' in the where condition?
paste your statement again, and tell what you want to do with that
10-17-2008 4:20 AM
remove that space check from where condition. after the select delete if you want
SELECT * " kunnr name2 j_3astcu
FROM kna1
INTO corresponding fields of TABLE gt_kna1
FOR ALL ENTRIES IN gt_soldto1
WHERE ( name2 LIKE 'Store#%'
OR name2 LIKE 'Store%' )
OR j_3astcu = gt_soldto1-store_no
OR LAND1 = 'US'.
if sy-subrc eq 0,
delete gt_kna1 where j_3astcu = ''.
endif.
10-20-2008 3:47 AM
Will the below stmt helps?
SELECT * " kunnr name2 j_3astcu
FROM kna1
INTO corresponding fields of TABLE gt_kna1
FOR ALL ENTRIES IN gt_soldto1
WHERE ( name2 LIKE 'Store#%'
OR name2 LIKE 'Store%' )
OR ( j_3astcu NE SPACE
AND j_3astcu = gt_soldto1-store_no )
OR LAND1 = 'US'.
( j_3astcu NE SPACE
AND j_3astcu = gt_soldto1-store_no )
Instead of deleting ?
Sorry .
THANKS IN ADV.
10-20-2008 4:39 AM
" OR condition will help you..? i am doubtful. if it true or false , it will select the record
OR ( j_3astcu NE SPACE
AND j_3astcu = gt_soldto1-store_no )