Skip to Content
Technical Articles

Use LTMOM to enhance fixed asset migration object to create sub-asset

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.

14 Comments
You must be Logged on to comment or reply to a post.
  • 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

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

      • 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

         

  • 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

  • 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

    • 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

  • 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

  • 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

    • 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?

       

  • 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