‎2009 Jul 02 10:39 AM
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
‎2009 Jul 02 10:44 AM
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.
‎2009 Jul 02 10:44 AM
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.
‎2009 Jul 02 10:48 AM
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
‎2009 Jul 02 10:50 AM
what error are you getting??
is i_bseg_open a internal table with header line or its just a work area?
‎2009 Jul 02 10:55 AM
Hi,
You cant use IN operator in IF statement..
Edited by: Alexander on Jul 2, 2009 11:59 AM
‎2009 Jul 02 10:56 AM
‎2009 Jul 02 12:09 PM
‎2009 Jul 02 10:53 AM
>
> 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