Enterprise Resource Planning Blogs by Members
Gain new perspectives and knowledge about enterprise resource planning in blog posts from community members. Share your own comments and ERP insights today!
cancel
Showing results for 
Search instead for 
Did you mean: 
jlivio90
Active Participant

Objective


The objective of this blog is to help you to enhance an existing migration object, specifically the Fixed Asset, but might be helpful to clear some doubts for other objects as well.

 

Additional remarks


The blog has no introductory aspects, it is recommended that you are familiar with the Migration Cockpit and the Migration Object Modeler, otherwise it will appear incomplete.

No ABAP skills required, but helpful if you have.

 

Introduction


It is common among fixed asset management processes to have complex assets, which consist of one or more sub-assets that are associated with a main asset. The sub-assets are associated with the same number of the main asset but separately identified by the sub-number.



SAP delivers within the S/4HANA Migration Cockpit an object for the migration of fixed assets, but this object contains some restrictions, one of these is the creation of sub-assets.

In this blog I will show how to enhance the object delivered for fixed asset migration to migrate a fixed asset as a sub-asset.

For additional information about the object restrictions, I suggest reading the documentation for the object available in the migration cockpit and the SAP Notes indicated in the documentation.



 

Understanding the API capability


There are different ways to understand how an API works, I suggest always start with the documentation, but there isn't a rule for that.

Whatever way you choose to understand the API behavior, the first step is to identify the API used by the migration object.

For that go to transaction LTMOM, open you object and double click on the "Target Structures" menu, in the shown screen you’ll see the field “Function Module”.



Copy the function module name and go to transaction SE37 to display its attributes.



Once you are displaying the attributes of the function, look for the "Function Module Documentation".



Documentation analysis should be done based on your business requirement.

It means, look for a parameter that is related to what you are looking for and read the information provided to understand how the parameter works.





Based on the documentation above, we understand that the API requires in the field CREATESUBNUMBER the value “X” to create a sub-asset instead a main asset, with that information we now know what is required to adapt in the field mapping of the migration object to achieve our goal.

Now let's start to change a migration object, for that, go back to transaction LTMOM and make a copy of the Fixed Asset migration object (Z_FIXED_ASSET_XXX) of your project.

 

Identify technical requirements


We already know that the migration object delivered by SAP was designed to migrate the main asset only, so it is expected that the structures of the object need to be adapted for the creation of the sub-asset.

If your requirement is not the same as the proposed for this blog, will be necessary to perform two steps before you change the migration object:

  • First, understand the field mapping.

  • Second, test and simulate the new mapping to conver your requirement.


For the second step, use the transation SE37 to test and simulate your own mapping and check if the results will cover your requirement as expected.

For the business scenario that I proposed for this blog, I did these steps and will present here the conclusion.

There are three fields that need to be changed, which are:

  • Main asset number – this field should receive the asset number created in the system.

  • Asset Subnumber – this field should receive the subnumber of the main asset.

  • Checkbox-create – as shown in the documentation this field should receive the value ‘X’.




In order to do that will be necessary to change the Source Structure, below is one of the standard source structures of the fixed asset migration object.



The different structures that contain in the migration object are related with each other by the key fields BUKRS + ANLN1 + ANLN2.


In our business scenario, we should be able to repeat this key several times in order to create several sub-assets for one single main asset, which won’t work in the curret state.


Thus, we need to add a new parameter in this key that allow us to repeat the Asset number and Asset subnumber, otherwise, the system will abort the process due to key duplication.


Look at the screenshots below to understand the scenario AS-IS/TO-BE.

AS-IS



TO-BE


Hands-on


Let’s adapt the migration object, please follow the steps below:

1. Include one field as key in all the structures of the migraiton object,

Remember, this new field will be used to sorting the sequence of the sub-asset creation, define a type that you can apply this kind of logic.



2. Adjust all the foreign key relationship between the structures.



 

3. Map the fields as shown in the screenshot below.

Note: Assign the conversion rules CVT_ANLN1 and CVT_ANLN2 respectively.



 

4. Assign a rule to move the fixed value ('X') to the checkbox field



 

5. Finally, generate the migration object again.



 

If you follow these steps, now you should be able to create the sub-assets with the Migration Cockpit.

Note that the field we add in the structure will not actually interact with the API structure, this is just to allow us to repeat the main asset number many times. In other words, even the field being a numeric type, its value will not be the actual subnumber, that column only is to sort the sequence that the sub-asset will be created.

I hope this document helps you with your requirement.

 

Regards.
26 Comments
former_member606069
Discoverer
0 Kudos
Thanks Jandorson,

Followed the steps as described, but failed in simulation stage.. Errors  as follows ; Is there any fix for this ?

System error (portion 0000000001, conversion object Z_FIXED_ASSET_AP_001, at 092903)

Message no. DMC_RT_MSG039

System error (portion 0000000001, conversion object Z_FIXED_ASSET_AP_001, at 092903)

Message no. DMC_RT_MSG039

Field symbol has not been assigned yet. (conversion object Z_FIXED_ASSET_AP_001)

Message no. DMC_RT_MSG041

jlivio90
Active Participant
0 Kudos

Hi Aruna.

Could you check if the table T093U is empty?

former_member606069
Discoverer
0 Kudos
Yes , Table T093U is empty for the company code. I will try with entries and get back to you.

Thanks for your prompt response.
jlivio90
Active Participant
0 Kudos

This is probably one of the root causes of this issue, but, I remember that when I was testing this migration object the functional consultant fixed a lot of customization.

To fill this table we found a SAP Note, but in the end, it did not work properly, so we filled manually. ?

Good luck!

former_member616716
Discoverer
0 Kudos
Hi Janderson,

We have followed the steps mentioned, how ever it is creating a new asset instead of sub Asset.

Request you to suggest on the same.

Thanks in advance

VNK
jlivio90
Active Participant
0 Kudos
Hi.

Did you move 'X' to the parameter CREATESUBNUMBER (step 4) ?

If you did, debug and check if this parameters is filled.

 

BR.

J
Harel
Explorer
0 Kudos
Hi Janderson,

Perfect post.

I follow all the steps and it working perfect.

I have just one problem with step 4.

The value 'X' not move to the BAPI (I check in DEBUG).

Any idea?

Thanks and BR

Harel

 

kimveasna_xyz
Explorer
0 Kudos
Hi,

It looks it behaves like the old LSMW. In order to have the create flag filled with' 'x' you must first map the field in 'structure mapping, say to key structure s_key. And then map field to move('x').

Another remark is the main asset must be created beforehand, then sub-assets. I will check whether I can do it within the same loading.

 

Kim
kimveasna_xyz
Explorer
Hello Janderson,

Nice blog. I am using version S/4 1809 on premise, here is what I did to make it work:

  • there is no need to add a third field ANLN3, as you can as well use ANLN2 in your example because you leave it equal to 0 (or maybe I have missed something). This will save you from adding ANLN3 to all structures + key updates

  • in standard template, if we replace SET_ANLN1 by CVT_ANLN1, we must make sure to keep at least the part of the code ** Start of dummy coding - Do NOT delete ... IF 1 = 2 ...., otherwise you will face generation issue because of the missing routine _RULE_MODIFY_TRVALD_2_P

  • CVT_ANLN2 is not provided as standard, a substitution with simple MOVE is sufficient

  • in structure mapping, I had to map R_CREATESUBNUMBER << S_KEY (otherwise it remains blank)

  • in field mapping of R_CREATESUBNUMBER, I added a custom code to leave it blank when ANLN2 is 0 ==> this will enable the creation of the main asset, prerequisite to the creation of the following subassets

  • asset numbers can only be external numbering

  • main asset and subassets can be created in the same loading. But because subsequent subassets require the main asset to be created first, simulation will always fail. But you can just skip it and the actual creation will be in success (as main asset is committed in DB)


 

Kim
0 Kudos
Hi Kim,

Thanks for the approach proposed for creating Asset and Sub asset in single loading.

I have small doubt on below approach:

In field mapping of R_CREATESUBNUMBER, I added a custom code to leave it blank when ANLN2 is 0 ==> this will enable the creation of the main asset, prerequisite to the creation of the following subassets

As per above below will be the sample data for Asset and Subassets:























Company Code Asset Number Asset Subnumber
1710 1500000 0
1710 1500000 1
1710 1500000 2

Based on above data 1st record will be created as Main asset, 2nd and 3rd records will be created as subassets? Right?

And also if possible can you specify the custom code which you have used for R_CREATESUBNUMBER and also specify where you have written it.

Regards

Vikram
0 Kudos
Hello Janderson,

I have tried to the same steps which you mentioned above.

Step1) Created ANLN3 in all required structures

Step2) Assigned Foreign key relationships

Step3) Assigned conversion rules for ANLN1 as (selected CVN_ANLN1 from standard rules), but i am unable to find conversion rule for CVT_ANLN2. So i just mapped it with ANLN2 source field.

Step4) MOVE 'X' rule applied to Checkbox create.

But still I am facing functional module not generated, due to attached error



Kindly can you help me out to create SubAssets.

Regards

Vikram
0 Kudos
Hi Kim,

I tried your approach based on the above suggestions.

  • in standard template, if we replace SET_ANLN1 by CVT_ANLN1, we must make sure to keep at least the part of the code ** Start of dummy coding – Do NOT delete … IF 1 = 2 …., otherwise you will face generation issue because of the missing routine _RULE_MODIFY_TRVALD_2_P

  • CVT_ANLN2 is not provided as standard, a substitution with simple MOVE is sufficient


In above steps, i made changes SET_ANLN1 by CVT_ANLN1 and for ANLN2 i just remapped it with Asset subnumber (Move rule).

But i am facing generation issue,



 

kindly can you help me on solving the generation issue and if possible can you explain on we must make sure to keep at least the part of the code ** Start of dummy coding – Do NOT delete .

May be I am doing any mistake here.

Regards

Vikram
kimveasna_xyz
Explorer
0 Kudos
Hi Vikram,

Hard to tell from your screenshot. I would recommend you to display the generated function module and launch a check in abap editor: the error may be more obvious. At least you could see the duplicate form. From there, trace back to where it is used in mapping (in abap code): you should locate the field mapping in error. Then in visual mapping make sure you are not defining a new conversion called 0001 (from your screenshot).

And check in the left panel, is there a custom conversion you may have defined twice?

 
0 Kudos
Hi Kim,

Now the above issues are solved and I am able to create required Sub Assets in my system.

But now I am facing different issue regarding the other fields data.

For example, I am passing the below information in Cockpit template
















































Company Code External/Legacy Asset Number Asset Subnumber Asset Class Asset Description Asset Description 2 Serial Number
3901 000024000005 0005 241050 Test_10102019_SUB111 123455
3901 000024000005 0006 241050 Test_10102019_SUB2111 123456
3901 000024000005 0007 241050 Test_10102019_SUB311 123457
3901 000024000005 0008 241050 Test_10102019_SUB411 123458

But after migrating these records, the final output in Master table (ANLA) like below (same data for all other subassets)
















































Company Code External/Legacy Asset Number Asset Subnumber Asset Class Asset Description Asset Description 2 Serial Number
3901 000024000005 0005 241050 Test_10102019_SUB111 123455
3901 000024000005 0006 241050 Test_10102019_SUB111 123455
3901 000024000005 0007 241050 Test_10102019_SUB111 123455
3901 000024000005 0008 241050 Test_10102019_SUB111 123455

Except Sub number field, all fields data are copying from first record and replicating it to all other sub assets for specific Asset .

Kindly can you help me, if you have faced such an issue.

Regards

Vikram
former_member328919
Participant
0 Kudos
Hi Vikram,

You said that : "Now the above issues are solved"

Could you please explain how you solve this issue

Thanks a lot in advance

Best Regards
Lily
Explorer
0 Kudos
Thank you Janderson for sharing, I have one quesiton that in hands-on step 3, the conversion rules CVT-ANLN1, how to generate it? In default conversion rule, it is SET-ANLN1, if it needs to use "CVT", it needs create parameter for it. In the rule list, i can't find both two rules, could you give more guidance about it? Thanks a lot!
lmamalis
Explorer
0 Kudos
This is the correct approach on uploading sub-assets. Though, this will only work with external numbering.

If someone wants to use internal numbering for uploading the assets, he/she will have to load assets and sub-assets in different files (assets of course go first).

The only thing that needs to be taken care of in this approach is the mapping of ANLN1 field of the file to the already migrated main asset number.

For this I can think of the following 3 approaches:

  1. Create a field-based rule that will select the asset number from the database. For this, the old asset number should have been maintained in some field of the main asset number during the main asset number upload.

  2. Update the file with the main asset number so that no conversion is needed.

  3. Map the old number to the new number using a conversion rule in migration cockpit.


I have used the first one but this requires to write 1-2 lines of code so it depends on what everyone feels comfortable with.

Lampros
0 Kudos

Hello kim,

Can you please provide custom code to leave R_CREATESUBNUMBER blank when ANLN2 is 0 and in field mapping where to put the code ?

0 Kudos
Hi Vikram,

Can you please tell me how did you resolve above replication issue?
0 Kudos
Hello, a question, if I need to migrate today, can I add Fixed Assets acquired this year?

Thanks
0 Kudos
Hi Lampros,

could you share the code and also may be support it with the example of the field you used as mentioned in approach 1.

Regards

Jasmit
0 Kudos
hi lili,

hope you have found that issue, the CVT RULE is already mapped as standard
0 Kudos
Hi Janderson,

I'm not able to create the rule to move 'X' to the checkbox, do you have some tip for this?

Thank you!
0 Kudos
Hi Experts,

I am changing the SET_ANLN1 to CVT_ANLN1 in the field mapping rule. but im facing an error when generate the migration object - Error message: The FORM "_RULE_MODIFY_TRVALD_2_P" does not exist,but there is a FORM with the similar

i seen in the above comments some part of code need to be commented. in the moving rule?

Please let me know which of the lines are to be **commented or condition added.. This is bit urgent for. Kindly help.

 

Thanks in advance.

 

Regards,

Karthikeyan
0 Kudos
Hi, I can't create the rule for the "X" checkbox, I get this warning and it doesn't allow me to move forward:

"Rule assignment not possible; Source structure is not assigned to target structure"

Message No.: CNV_DMC_MC103

Could you help me?
thank you!
former_member797021
Discoverer
0 Kudos
About the field R_CREATESUBNUMBER and the custom code added we have to know a few things.

First of all your modification have to be at "Structure Mappin" --> R_CREATESUBNUMBER << Maters Details.

One of most important things that you have to consider is to Start your code with a dot ".". This dynpro of code shown a part of code that is incomplete for what you must start with a dot to close the LOOP.

In addition you have to aprocched this knowing that is needed to "Continue" the LOOP as long as your subnumber will be equals to '0000'.


If you still have problems, debug!

 

Luis de la Puente

 
Labels in this area