2006 Sep 15 8:59 AM
Hello experts,
Please take a look at my code below:
AT LINE-SELECTION.
DATA: lv_fnam(50) TYPE c,
lv_fval(50) TYPE c,
lv_asset_dum TYPE anla-anln1,
lv_assetsub_dum TYPE anla-anln2.
GET CURSOR FIELD lv_fnam VALUE lv_fval.
IF sy-subrc = 0.
CASE lv_fnam.
WHEN 'WA_OUTPUT-ASSET_SUBNUM'.
SPLIT lv_fval AT '-' INTO lv_asset_dum lv_assetsub_dum.
SET PARAMETER ID 'BUK' FIELD wa_output-company.
SET PARAMETER ID 'AN1' FIELD lv_asset_dum.
SET PARAMETER ID 'AN2' FIELD lv_assetsub_dum.
CALL TRANSACTION 'AW01N' AND SKIP FIRST SCREEN.
WHEN 'WA_OUTPUT-EQUIP_NUM'.
SET PARAMETER ID 'EQN' FIELD lv_fval.
CALL TRANSACTION 'IE03' AND SKIP FIRST SCREEN.
ENDCASE.
ENDIF.
the value of WA_OUTPUT-ASSET_SUBNUM is shown as asset number + asset subnumber.
for example:
1468-0000
Now, when we look at transaction AW01N it requires the company code, asset number and the sub number.
When you look at my code, I am splitting WA_OUTPUT-ASSET_SUBNUM at '-' and put them in 2 variables
as shown above. But when I call transaction AW01N it says that 'No depreciation areas defined for
asset 1468-0. It weird since when I manually enter those values it is fine.
Help would be greatly appreciated. Thanks a lot guys and take care!
2006 Sep 15 9:05 AM
what should the values for asset no and subnumber ?
check it in Debugging what values are coming for both the fields ?
Regards
srikanth
Hello experts,
Please take a look at my code below:
AT LINE-SELECTION.
DATA: lv_fnam(50) TYPE c,
lv_fval(50) TYPE c,
lv_asset_dum TYPE anla-anln1,
lv_assetsub_dum TYPE anla-anln2.
GET CURSOR FIELD lv_fnam VALUE lv_fval.
IF sy-subrc = 0.
CASE lv_fnam.
WHEN 'WA_OUTPUT-ASSET_SUBNUM'.
SPLIT lv_fval AT '-' INTO lv_asset_dum lv_assetsub_dum.
SET PARAMETER ID 'BUK' FIELD wa_output-company.
SET PARAMETER ID 'AN1' FIELD lv_asset_dum.
SET PARAMETER ID 'AN2' FIELD lv_assetsub_dum.
CALL TRANSACTION 'AW01N' AND SKIP FIRST SCREEN.
WHEN 'WA_OUTPUT-EQUIP_NUM'.
SET PARAMETER ID 'EQN' FIELD lv_fval.
CALL TRANSACTION 'IE03' AND SKIP FIRST SCREEN.
ENDCASE.
ENDIF.
the value of WA_OUTPUT-ASSET_SUBNUM is shown as asset number + asset subnumber.
for example:
1468-0000
Now, when we look at transaction AW01N it requires the company code, asset number and the sub number.
When you look at my code, I am splitting WA_OUTPUT-ASSET_SUBNUM at '-' and put them in 2 variables
as shown above. But when I call transaction AW01N it says that 'No depreciation areas defined for
asset 1468-0. It weird since when I manually enter those values it is fine.
Help would be greatly appreciated. Thanks a lot guys and take care!
2006 Sep 15 9:05 AM
what should the values for asset no and subnumber ?
check it in Debugging what values are coming for both the fields ?
Regards
srikanth
2006 Sep 15 9:07 AM
Hi,
After splitting, I got 1468 in lv_asset_dum and 0000 in lv_assetsub_dum. But after calling transaction AW01N it says that there is no depreciation area for 1468-0.
2006 Sep 15 9:08 AM
in place of
lv_assetsub_dum TYPE anla-anln2.
declare like
lv_assetsub_dum(4) TYPE n.
because lv_assetsub_dum it is char type and u insert value 0000 to it char type variable not contain zero value it surplus it.
2006 Sep 15 9:06 AM
There does not seem something wrong with the code..why dont you call the transaction without skipping the first screen to check if the set parameters are correct !!!
2006 Sep 15 9:09 AM
have u debugged and checked the values of asset and subasset.
and use these statements also after GET CURSOR
CONDENSE lv_fnam.
CONDENSE lv_fval.
2006 Sep 15 9:17 AM
Hello again experts,
here now is my revised code. It still has the same problem which says no depreciation areas defined for asset 1468-0.
After debugging it, lv_asset_dum has a value of 1468 and lv_assetsub_dum has a value of 0000. This should work fine if I enter it manually.
AT LINE-SELECTION.
DATA: lv_fnam(50) TYPE c,
lv_fval(50) TYPE c,
lv_asset_dum TYPE anla-anln1,
lv_assetsub_dum(4) TYPE n.
GET CURSOR FIELD lv_fnam VALUE lv_fval.
IF sy-subrc = 0.
CASE lv_fnam.
WHEN 'WA_OUTPUT-ASSET_SUBNUM'.
SPLIT lv_fval AT '-' INTO lv_asset_dum lv_assetsub_dum.
CONDENSE: lv_asset_dum, lv_assetsub_dum.
SET PARAMETER ID 'BUK' FIELD wa_output-company.
SET PARAMETER ID 'AN1' FIELD lv_asset_dum.
SET PARAMETER ID 'AN2' FIELD lv_assetsub_dum.
CALL TRANSACTION 'AW01N'.
WHEN 'WA_OUTPUT-EQUIP_NUM'.
SET PARAMETER ID 'EQN' FIELD lv_fval.
CALL TRANSACTION 'IE03' AND SKIP FIRST SCREEN.
ENDCASE.
ENDIF.
2006 Sep 15 9:26 AM
once go to transaction <b>AW01N</b> and c what is depreciation areas in this transaction .i m not able to understand its functionality ....
in left side part depreciation areas are given..
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |