08-29-2007 12:18 PM
Hi,
I have written the logic for below requirement
1.Check if operating concern(I_ERKRS) is 0001 than go to step 2 else go to step
2.Read each record of T_Item which is of structure CE10001 table and verify
the value for item category(CE10001-PSTYV) .
3. If the item Category (CE10001-PSTYV) is TAS Than change Warehouse cost value field (CE10001-VV504) value to 0.00 irrespective of its current value).
Else dont change value of warehouse cost value field(CE10001-VV504).
4.Exit from the function module.
<b>Code is :</b>
DATA: ce1_0001 LIKE ce10001.
CASE i_erkrs.
WHEN '0001'.
LOOP AT t_item.
MOVE-CORRESPONDING t_item TO ce1_0001.
IF ce1_0001-pstyv = 'TAS'.
ce1_0001-vv504 = '0.00'.
ENDIF.
MOVE-CORRESPONDING ce1_0001 TO t_item.
MODIFY t_item FROM t_item.
ENDLOOP.
ELSE.
EXIT.
ENDCASE.
But it is showing error is NO open "IF" statement.
why it is showing error.Please give me suggestions,where i have change the code.
Thanks,
sudhakar
08-29-2007 12:21 PM
See you have put ELSE statement after the ENDIF.
Use else inside if.
DATA: ce1_0001 LIKE ce10001.
CASE i_erkrs.
WHEN '0001'.
LOOP AT t_item.
MOVE-CORRESPONDING t_item TO ce1_0001.
IF ce1_0001-pstyv = 'TAS'.
ce1_0001-vv504 = '0.00'.
ENDIF.
MOVE-CORRESPONDING ce1_0001 TO t_item.
MODIFY t_item FROM t_item.
ENDLOOP.
<b>ELSE.</b> " This is the error put it in right place where u need.
EXIT.
ENDCASE.
Reward Points if Iseful
Regards,
Vimal
08-29-2007 12:24 PM
da problem lies with else statement.u've already closed if with endif before sle statement.conclude it after else.
reward points if it helps
08-29-2007 12:31 PM