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

logic?

Former Member
0 Likes
940

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 don’t 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

8 REPLIES 8
Read only

Former Member
0 Likes
915

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

Read only

0 Likes
915

Hi,

But still iam getting the same error.

Thanks & regards,

Sudhakar

Read only

0 Likes
915

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'.

Read only

0 Likes
915

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

Read only

0 Likes
915

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

Read only

0 Likes
915

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.

Read only

0 Likes
915

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

Read only

Former Member
0 Likes
915

Thanks for repling.

sudha