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

Weird problem after calling transaction...

aris_hidalgo
Contributor
0 Likes
1,077

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!

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
1,020

what should the values for asset no and subnumber ?

check it in Debugging what values are coming for both the fields ?

Regards

srikanth

7 REPLIES 7
Read only

Former Member
0 Likes
1,021

what should the values for asset no and subnumber ?

check it in Debugging what values are coming for both the fields ?

Regards

srikanth

Read only

0 Likes
1,020

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.

Read only

0 Likes
1,020

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.

Read only

Former Member
0 Likes
1,020

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 !!!

Read only

Former Member
0 Likes
1,020

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.

Read only

0 Likes
1,020

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.

Read only

0 Likes
1,020

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