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

syntax error

Former Member
0 Likes
854

Hi

Following statement got error. pls help me

ELSEIF it_detail-blart <> 'GI' 'GG' 'SA' AND it_detail-sgtxt(5) = 'PLANT'.

it_sum-others = it_detail-dmbtr.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
836

Use like this...

ELSEIF ( it_detail-blart eq 'GI' or

it_detail-blart eq 'GG' or

it_detail-blart eq 'SA' ) AND it_detail-sgtxt(5) = 'PLANT'.

7 REPLIES 7
Read only

Former Member
0 Likes
837

Use like this...

ELSEIF ( it_detail-blart eq 'GI' or

it_detail-blart eq 'GG' or

it_detail-blart eq 'SA' ) AND it_detail-sgtxt(5) = 'PLANT'.

Read only

Former Member
0 Likes
836

Hi,

try like this.u should not give offset in where condition .


DATA sbook_tab TYPE TABLE OF sbook. 
SELECT * 
       FROM sbook 
       INTO TABLE sbook_tab 
       WHERE class IN ('C','F','Y'). 
IF sy-subrc = 0. 
  "Error handling 
ENDIF. 

rgds,

bharat.

Read only

Former Member
0 Likes
836

Hi sorry there is a mistake in above statement

my coding is

ELSEIF it_detail-blart ne ('GI' 'GG' 'SA') AND it_detail-sgtxt(5) = 'PLANT'.

it_sum-others = it_detail-dmbtr.

Read only

0 Likes
836

Hi Kumar,

as said by Ramu us can write like this

................................
ELSEIF ( it_detail-blart ne 'GI' or
          it_detail-blart ne 'GG' or 
          it_detail-blart ne 'SA' )
     AND it_detail-sgtxt(5) = 'PLANT'.
it_sum-others = it_detail-dmbtr.
ENDIF.

Best regards,

raam

Read only

Former Member
0 Likes
836

Hi,

ELSEIF it_detail-blart = 'GI' 'GG' 'SA' AND it_detail-sgtxt(5) = 'PLANT'.

it_sum-others = it_detail-dmbtr.

i think u forgot '=' .

regards,

kk.

Read only

Former Member
0 Likes
836

Hi,,

ELSEIF it_detail-blart IN ( 'GI', 'GG', 'SA' )

AND it_detail-sgtxt(5) = 'PLANT'.

it_sum-others = it_detail-dmbtr.

or

Hi

Following statement got error. pls help me

ELSEIF ( it_detail-blart eq 'GI' or

it_detail-blart eq 'GG' or

it_detail-blart eq 'SA' ) AND

it_detail-sgtxt(5) = 'PLANT'.

it_sum-others = it_detail-dmbtr.

Try these two.

Regards,

madan.

Read only

Former Member
0 Likes
836

then use

ELSEIF it_detail-blart NA ( 'GIGGSA' ) AND it_detail-sgtxt(5) = 'PLANT'.

OR IF YOU WANT ONLY NE.....

Then use with OR option

ELSEIF ( it_detail-blart NE 'GI' OR

it_detail-blart NE 'GG' OR

it_detail-blart NE 'SA' ) it_detail-sgtxt(5) = 'PLANT'.