‎2007 Sep 06 10:53 AM
Iam woking one exit.My requirement is
1. Check if operating concern (I_ERKRS) is 0001 than go to step 2 else go to
step 4.
2. Read CE10001 table and verify value for Item Category (CE10001-PSTYV).
3. If 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 warhouse cost value field(CE10001-VV504)
4. exit from function module.
This logic should be implemented for all line items in each billing document. E.g. if 5 line items are generated into COPA for one billing document step 1-4 need to be execute 5 times. Number of line items can be determined from T_ITEM table.
i implement the logic is
IF i_erkrs EQ '0001'.
LOOP AT t_item INTO wa_item where wa_item-pstyv = TAS.
if sy-subrc eq 0.
wa_item-vv504 = c_0 .
endif.
MODIFY t_item FROM wa_item.
ENDLOOP.
ELSE.
EXIT.
endif.
but when i compling iam getting the error in loop --- where " the line type of the table must be statically define.
please sugget me why iam gettign error.where i have change the code.Is there any changes in the code.
Thanks & regards,
sudhakar
‎2007 Sep 06 11:04 AM
Hi suhhakar,
You are having error in the bolded line.The sy-subrc check is not required here as the loop passes only the values which matches the criteria.try removing sy-subrc check. Also wa_item is not required in the where condition
IF i_erkrs EQ '0001'.
LOOP AT t_item INTO wa_item where <b>wa_item-</b>pstyv = TAS.
<b>if sy-subrc eq 0.</b>
wa_item-vv504 = c_0 .
<b>endif.</b>
MODIFY t_item FROM wa_item.
ENDLOOP.
ELSE.
EXIT.
endif.
Message was edited by:
Sheron Mathew
‎2007 Sep 06 11:39 AM
Hi,
But still iam getting the same error.
Thanks & regards,
Sudhakar
‎2007 Sep 06 11:44 AM
IF i_erkrs EQ '0001'.
LOOP AT t_item INTO wa_item where wa_item-pstyv = TAS.
if sy-subrc eq 0.
wa_item-vv504 = c_0 .
endif.
MODIFY t_item FROM wa_item.
ENDLOOP.
ELSE.
EXIT.
endif.
You need 'TAS' not TAS.
You can also do it like this
wa_item-vv504 = c_0 .
modify t_item from wa_item transporting w504
where pstyv eq 'TAS'.
‎2007 Sep 06 11:50 AM
I have changed the code like as u suggested 'TAS'.But still iam getting the same error "loop --- where " the line type of the table must be statically define.
Please suggest.
Thanks & regards,
sudkar
‎2007 Sep 06 11:58 AM
IF i_erkrs EQ '0001'.
LOOP AT t_item INTO wa_item where<b> pstyv</b> = 'TAS'.
if sy-subrc eq 0.
wa_item-vv504 = c_0 .
endif.
MODIFY t_item FROM wa_item.
ENDLOOP.
ELSE.
EXIT.
endif.
regards,
Ananth
‎2007 Sep 06 12:02 PM
hi,
check whether both internal table and workarea are of same type with same structure or not. and try like this,
IF i_erkrs EQ '0001'.
LOOP AT t_item INTO wa_item where wa_item-pstyv = 'TAS'.
if sy-subrc eq 0.
wa_item-vv504 = c_0 .
endif.
MODIFY t_item FROM wa_item transporting w504 where pstyv eq 'TAS'..
ENDLOOP.
ELSE.
EXIT.
endif.
if helpful reward some points.
with regards,
Suresh ALuri.
‎2007 Sep 06 12:34 PM
In this function exit EXIT_SAPLKEII_002,T_ITEM is not refering any type.
so, we are using CE10001 Structure same type for T_ITEM.
Why it is showing the error.
Thanks
sudhar
‎2007 Sep 06 1:46 PM