2009 Nov 06 6:30 AM
Hi Gurus,
I was tasked to do some changes on AS01 transaction.
What is required is when assets are created,
1. When cost centre is entered then put the correct coordinator for the specific cost centre
otherwise the error message must be displayed.
2. I have done some coding on the following user exit but i have a challenge regarding when i assign the coordinator
(Assign (coordinator) to <gdlgrp>).
3. Please assist.
tables:csks.
data: costcentre(30) value '(SAPLAIST)anlz-KOSTLV'. "cost centre
data: coordinator(30) value '(SAPLAIST)is_anla-GDLGRP'. "asset coordinator
field-symbols: <kostlv> type kostl.
field-symbols: <gdlgrp> type GDLGRP.
Assign (costcentre) to <kostlv>.
if sy-subrc = 0.
if not <kostlv> is initial.
select single zz_gdlgrp into csks-zz_gdlgrp
from csks
where kostl = <kostlv>.
Assign (coordinator) to <gdlgrp>.
if sy-subrc = 0.
if csks-zz_gdlgrp ne <gdlgrp>.
message E000(ZFI00) with
'Invalid Asset Coordinator' <gdlgrp> 'for cost center' <kostlv>.
endif.
endif.
endif.
endif.
Hi Gurus,
I was tasked to do some changes on AS01 transaction.
What is required is when assets are created,
1. When cost centre is entered then put the correct coordinator for the specific cost centre
otherwise the error message must be displayed.
2. I have done some coding on the following user exit but i have a challenge regarding when i assign the coordinator
(Assign (coordinator) to <gdlgrp>).
3. Please assist.
tables:csks.
data: costcentre(30) value '(SAPLAIST)anlz-KOSTLV'. "cost centre
data: coordinator(30) value '(SAPLAIST)is_anla-GDLGRP'. "asset coordinator
field-symbols: <kostlv> type kostl.
field-symbols: <gdlgrp> type GDLGRP.
Assign (costcentre) to <kostlv>.
if sy-subrc = 0.
if not <kostlv> is initial.
select single zz_gdlgrp into csks-zz_gdlgrp
from csks
where kostl = <kostlv>.
Assign (coordinator) to <gdlgrp>.
if sy-subrc = 0.
if csks-zz_gdlgrp ne <gdlgrp>.
message E000(ZFI00) with
'Invalid Asset Coordinator' <gdlgrp> 'for cost center' <kostlv>.
endif.
endif.
endif.
endif.
2009 Nov 06 10:11 AM
Hi Guys,
I have resolved my problem, now it is working fine.
See the solution below:
tables:csks.
data: costcentre(30) value '(SAPLAIST)anlz-KOSTLV'. "cost centre
data: coordinator(30) value '(SAPLAIST)anla-GDLGRP'. "asset coordinator
data: actual_coordinator like anla-GDLGRP. "
field-symbols: <kostlv> type kostl.
field-symbols: <gdlgrp> type GDLGRP.
Assign (costcentre) to <kostlv>.
if sy-subrc = 0.
**Get the asset coordinator from csks table
if not <kostlv> is initial.
select single zz_gdlgrp into csks-zz_gdlgrp
from csks
where kostl = <kostlv>.
Assign (coordinator) to <gdlgrp>.
**Validate asset coordinator against cost centre
if sy-subrc = 0 and not <gdlgrp> is initial.
if csks-zz_gdlgrp ne <gdlgrp>.
move <gdlgrp> to actual_coordinator.
clear <gdlgrp>.
message E000(ZFI00) with
'Invalid Asset Coordinator' actual_coordinator 'for cost center' <kostlv>.
endif.
endif.
endif.
endif.
Regards,
Themba
| User | Count |
|---|---|
| 4 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |