2007 Aug 30 11:02 AM
Hi,
Iam working one userexit COPA0005 which having function module EXIT_SAPLKEII_002.
Import parameters is I_ERKRS
Table T_ITEM
The table is not refering any tables.
My requirement is below
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.
I write the code
DATA: ce1_0001 type ce10001.
data : wa_item type ce10001.
IF i_erkrs EQ '0001'.
LOOP AT t_item into wa_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 wa_item index sy-index.
ENDLOOP.
ELSE.
EXIT.
ENDIF.
Is it correct code?Or any changes.
Thanks,
sudhakar
Hi,
Iam working one userexit COPA0005 which having function module EXIT_SAPLKEII_002.
Import parameters is I_ERKRS
Table T_ITEM
The table is not refering any tables.
My requirement is below
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.
I write the code
DATA: ce1_0001 type ce10001.
data : wa_item type ce10001.
IF i_erkrs EQ '0001'.
LOOP AT t_item into wa_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 wa_item index sy-index.
ENDLOOP.
ELSE.
EXIT.
ENDIF.
Is it correct code?Or any changes.
Thanks,
sudhakar
2007 Aug 30 12:11 PM
Hi Change ur code to the following
DATA : wa_item TYPE ce10001.
IF i_erkrs EQ '0001'.
LOOP AT t_item INTO wa_item.
IF wa_item-pstyv = 'TAS'.
wa_item-vv504 = '0.00'.
ENDIF.
MODIFY t_item FROM wa_item INDEX sy-index
TRANSPORTING vv504.
ENDLOOP.
ELSE.
EXIT.
ENDIF.
Hope That Helps
Anirban M.
2007 Aug 31 6:02 AM
Hi Amit,
Thanks for reply.But iam getting error "The specified type has no structure and therefore no component called VV504".
Thanks & Regards,
Sudhakar
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |