‎2008 May 26 12:05 PM
hi
can any one tell me how can i select xblnr field with 3 position with two character .
REFRESH gt_mkpf.
SELECT mblnr
mjahr
xblnr
FROM mkpf
INTO TABLE gt_mkpf
FOR ALL ENTRIES IN gt_temp
WHERE mblnr EQ gt_temp-mblnr
and mjahr eq p_mjahr
AND *( xblnr3(2) GE s_cdate-low3(2)*+
*AND xblnr3(2) LE s_cdate-high3(2) )* AND+ xblnr NE space...
‎2008 May 26 12:08 PM
Hi,
u cannot use offset parameters in select statements.
rgds,
bharat.
‎2008 May 26 12:22 PM
Hi,
u can do one thing in this case.......
first selct all entries and then delete what ever u want.......
i.e.
first write ur select querry as,..........
SELECT mblnr
mjahr
xblnr
FROM mkpf
INTO TABLE gt_mkpf
FOR ALL ENTRIES IN gt_temp
WHERE mblnr EQ gt_temp-mblnr
and mjahr eq p_mjahr.
loop at gt_mkpf.
delete gt_mkpf where xblnr+3(2) LE s_cdate-low3(2) .
delete gt_mkpf where xblnr+3(2) GE s_cdate-high3(2).
delete gt_mkpf where xblnr EQ space.
try this once.....
Thankq,
kk.
‎2008 May 26 12:39 PM
Hi Rakesh,
U can't specify offset in left side variables of the select where as we can do the same with right side variables. Do like this to achieve ur requirement.
FROM field list mkpf
INTO TABLE gt_mkpf
FOR ALL ENTRIES IN gt_temp
WHERE mblnr EQ gt_temp-mblnr
and mjahr eq p_mjahr
AND xblnr NE space.
AND ( xblnr3(2) GE s_cdate-low3(2)+
--AND xblnr3(2) LE s_cdate-high3(2) ) AND+ --
LOOP AT gt_temp INTO wa WHERE
( xblnr+3(2) GE s_cdate-low3(2)
AND xblnr+3(2) LE s_cdate-high3(2) ).
If the above statement gives syntax error the do like this.
LOOP AT gt_temp INTO wa .
IF xblnr+3(2) GE s_cdate-low3(2)
AND xblnr+3(2) LE s_cdate-high3(2).
APPEND wa TO it_mseg.
As delete Inside loop is not advisable we can append the required data to new itab instead of deleting the unwanted from the original table.
ENDLOOP.
Thanks,
Vinod.