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

error in selection position

Former Member
0 Likes
422

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...

3 REPLIES 3
Read only

Former Member
0 Likes
401

Hi,

u cannot use offset parameters in select statements.

rgds,

bharat.

Read only

Former Member
0 Likes
401

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.

Read only

vinod_vemuru2
Active Contributor
0 Likes
401

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.