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
826

Dear Experts,

I ha written following code and getting error.

if i_bseg_temp-mwskz eq '11'.

i_bseg_open-w_wct = i_bseg_temp-dmbtr.

modify i_bseg_open.

elseif i_bseg_open-mwskz in ('P1', 'P2', 'P3', 'P4', 'P5', 'P6', 'X1', 'X2', 'X3', 'X4', 'X5', 'X6').

i_bseg_open-w_tds = i_bseg_open-w_tds + i_bseg_Temp-dmbtr.

modify i_bseg_open.

endif.

Can any one help me in this.

Regards,

maverick

1 ACCEPTED SOLUTION
Read only

former_member192467
Active Participant
0 Likes
797

Hi,

What is the error you are getting?

check if i_bseg_open-w_tds ,i_bseg_open-w_tds and i_bseg_Temp-dmbtr are of the same type. Else change it to same type and move.

7 REPLIES 7
Read only

former_member192467
Active Participant
0 Likes
798

Hi,

What is the error you are getting?

check if i_bseg_open-w_tds ,i_bseg_open-w_tds and i_bseg_Temp-dmbtr are of the same type. Else change it to same type and move.

Read only

0 Likes
797

Thaks for ur reply.

I just want to know can i use IN operator with IF ELSEIF conditional structures.

if yes what is the syntax.

Regards

Maverick

Read only

0 Likes
797

what error are you getting??

is i_bseg_open a internal table with header line or its just a work area?

Read only

0 Likes
797

Hi,

You cant use IN operator in IF statement..

Edited by: Alexander on Jul 2, 2009 11:59 AM

Read only

0 Likes
797

Hi,

You cannot use IN with IF statements.

Read only

0 Likes
797

Thanks Dear

This is want I want to know.

Thaks again

Read only

Pawan_Kesari
Active Contributor
0 Likes
797

>

> elseif i_bseg_open-mwskz in ('P1', 'P2', 'P3', 'P4', 'P5', 'P6', 'X1', 'X2', 'X3', 'X4', 'X5', 'X6').

I think above statement will not work, you need to define range and use that as below..



TYPES : tt_mwskz TYPE RANGE OF bseg-mwskz ,
        t_mwskz  TYPE LINE OF tt_mwskz    .

DATA : i_mwskz TYPE tt_mwskz ,
       ls_mwskz TYPE t_mwskz .

ls_mwskz-sign   = 'I' .
ls_mwskz-option = 'EQ' .
ls_mwskz-low = 'P1' .
APPEND ls_mwskz TO i_mwskz .

ls_mwskz-low = 'P2' .
APPEND ls_mwskz TO i_mwskz .

* Append all P3 to X6

IF i_bseg_temp-mwskz EQ '11'.
  i_bseg_open-w_wct = i_bseg_temp-dmbtr.
  MODIFY i_bseg_open.
ELSEIF i_bseg_open-mwskz IN i_mwskz.
  i_bseg_open-w_tds = i_bseg_open-w_tds + i_bseg_temp-dmbtr.
  MODIFY i_bseg_open.
ENDIF.

Edited by: Pawan Kesari on Jul 2, 2009 3:24 PM

Edited by: Pawan Kesari on Jul 2, 2009 3:25 PM

Edited by: Pawan Kesari on Jul 2, 2009 3:26 PM