0% found this document useful (0 votes)
516 views14 pages

(LTMOM) Extend Purchasing Contracts To Allow Scale Conditions - SAP Blogs

SAP -Data Migration using LTMC and how to enhance using LTMOM

Uploaded by

senthil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
516 views14 pages

(LTMOM) Extend Purchasing Contracts To Allow Scale Conditions - SAP Blogs

SAP -Data Migration using LTMC and how to enhance using LTMOM

Uploaded by

senthil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

2/16/2020 [LTMOM] Extend purchasing contracts to allow scale conditions | SAP Blogs

Community

Ask a Question Write a Blog Post Login

Technical Articles

Kimveasna Pen
October 29, 2019 5 minute read

[LTMOM] Extend purchasing contracts to allow scale


conditions
Follow RSS feed Like

1 Like 330 Views 0 Comments

Introduction

In this post, I will describe my own experience to extend migration object “Purchasing contract” in order to
allow input of condition scales.

As per SAP deliverd template, we can only enter simple conditions, without quantity nor value scales. As
described in my previous post about Migration Cockpit, I will demonstrate that it is not much di cult than
to use BAPI to create a contract.

Though this blog post is speci c to purchasing contracts, you should apply the same approach for any
migration object enhancement.

1. Assess the current situation


2. Understand and make BAPI work
3. Set up mappings in LTMC
4. Debug BAPI call in case of error

Assess the current situation


Out of the box, scales cannot be lled in the delivered template:
https://blogs.sap.com/2019/10/29/ltmom-extend-purchasing-contracts-to-allow-scale-conditions/ 1/14
2/16/2020 [LTMOM] Extend purchasing contracts to allow scale conditions | SAP Blogs

This can be con rmed if you open the object in the migration modeler (LTMOM), nothing in the source
structure:

And nothing in the structure mapping:

https://blogs.sap.com/2019/10/29/ltmom-extend-purchasing-contracts-to-allow-scale-conditions/ 2/14
2/16/2020 [LTMOM] Extend purchasing contracts to allow scale conditions | SAP Blogs

But don’t be afraid, we are at home, remember target structures are actually structures of BAPI
BAPI_CONTRACT_CREATE:

https://blogs.sap.com/2019/10/29/ltmom-extend-purchasing-contracts-to-allow-scale-conditions/ 3/14
2/16/2020 [LTMOM] Extend purchasing contracts to allow scale conditions | SAP Blogs

This simply means once we know how to call BAPI, we know how to call it from Migration Cockpit. But hold
on, this may sound as a dumb question, but do you know how to create a contract actually?

Make BAPI work rst

The following may be obvious, but the correct approach is not to go and ll randomly your structure
mappings and eld mappings until it works. Just take a breath, go step by step

1. Do you really know how to manually create a contract in (ME31K for instance)?
2. Then, do you know how to create the exact same contract with BAPI?
3. Then, and only then, go and map structure and elds accordingly in LTMOM

Create manually a sample contract with ME31K


First things rst, start by creating a sample contract with scale conditions (as you would like Migration
Cockpit to create them). You can use ME31K or Fiori app, as you wish.

In my case, I want my contract to contain price conditions with scales.

https://blogs.sap.com/2019/10/29/ltmom-extend-purchasing-contracts-to-allow-scale-conditions/ 4/14
2/16/2020 [LTMOM] Extend purchasing contracts to allow scale conditions | SAP Blogs

Try not to make it too simple, put at least 2 items, di erent values, etc.

Try to create the same contract with BAPI


Now that we have a sample contract, our goal is to be able to programmatically reach the same document.
We are really lucky, as this BAPI is not just a lonely “Create” function, but contains method like “GetDetails”.

I will not go through a long explanation of what is exactly a BAPI, but you may know you can see it (the real
object which holds this function) with SWO1:

Or with transaction BAPI:

https://blogs.sap.com/2019/10/29/ltmom-extend-purchasing-contracts-to-allow-scale-conditions/ 5/14
2/16/2020 [LTMOM] Extend purchasing contracts to allow scale conditions | SAP Blogs

Or even simpler, in object list of the function group:

Method display, actually BAPI_CONTRACT_GETDETAIL is a great helper function in our case as it will speed
up our analysis: a call to BAPI_CONTRACT_GETDETAIL with our sample contract number as argument will
reveal a lot of the expected input parameters for scales in BAPI_CONTRACT_CREATE.

Call it in SE37:

https://blogs.sap.com/2019/10/29/ltmom-extend-purchasing-contracts-to-allow-scale-conditions/ 6/14
2/16/2020 [LTMOM] Extend purchasing contracts to allow scale conditions | SAP Blogs

And output structures and values re ect more or less the expected input parameters:

In my case, my sample contract contains 2 items and both price conditions have 3 steps. I will save you time
by summarizing my analysis steps, but I have inferred that the important elds to be populated in input
parameters are:

Scale types, to be provided in ITEM_CONDITION

https://blogs.sap.com/2019/10/29/ltmom-extend-purchasing-contracts-to-allow-scale-conditions/ 7/14
2/16/2020 [LTMOM] Extend purchasing contracts to allow scale conditions | SAP Blogs

And of course, the scales themselves

Then, I create a variant in SE37 that I can execute in a test sequence with BAPI_TRANSACTION_COMMIT:
my BAPI analysis is complete, I know for sure the required elds to manage scale conditions in a contract. I
can set the relevant mapping in LTMOM.

https://blogs.sap.com/2019/10/29/ltmom-extend-purchasing-contracts-to-allow-scale-conditions/ 8/14
2/16/2020 [LTMOM] Extend purchasing contracts to allow scale conditions | SAP Blogs

De ne mappings in Migration Cockpit Modeler

I repeat it again and again, you must be sure of your BAPI parameter before you do any mapping in LTMC.
Start by adapting source structures by adding scales under item structure (it is a copy-paste of
 BAPIMEOUTITEMSCALEQUAN)

Next, map the required target structures:

Finally, map the required elds of ITEM_COND_VALIDI:

https://blogs.sap.com/2019/10/29/ltmom-extend-purchasing-contracts-to-allow-scale-conditions/ 9/14
2/16/2020 [LTMOM] Extend purchasing contracts to allow scale conditions | SAP Blogs

For ITEM_CONDITION:

https://blogs.sap.com/2019/10/29/ltmom-extend-purchasing-contracts-to-allow-scale-conditions/ 10/14
2/16/2020 [LTMOM] Extend purchasing contracts to allow scale conditions | SAP Blogs

And for scales (quantity):

https://blogs.sap.com/2019/10/29/ltmom-extend-purchasing-contracts-to-allow-scale-conditions/ 11/14
2/16/2020 [LTMOM] Extend purchasing contracts to allow scale conditions | SAP Blogs

You may have noticed 2 custom rules:

INIT_LINE_NO : this resets global variable g_scale_item to 1


INCREMENT_LINE_NO : this increments global variable g_scale_item

g_scale_item is a global variable (you can use the same way as you use to do in LSMW) which will be used to
set value in ITEM_COND_SCALE-LINE_NO automatically.

Once all changes are done, generate function group.

Debug your migration cockpit object

If you have reached this step, you know by heart your required BAPI parameters for
BAPI_CONTRACT_CREATE: this is going to be the nal step, all previous mappings operations which you
have set up will be applied in the generated functions.

All these mappings are the less “visible” parts of the cockpit (but you can still debug it if required). To
ensure you get to BAPI_CONTRACT_CREATE with all parameters lled as expected, set an external
breakpoint in it, and check all parameters are lled correctly. If not, x your mapping, retry, etc.

Conclusion

I hope this explanation is clear enough and will help you in extending SAP-delivered migration templates to
meet your requirements. Remember LTMOM is not a monolithic tool, the logic of data creation remains

https://blogs.sap.com/2019/10/29/ltmom-extend-purchasing-contracts-to-allow-scale-conditions/ 12/14
2/16/2020 [LTMOM] Extend purchasing contracts to allow scale conditions | SAP Blogs

outside, in BAPI function (or any other function like the one for customer/supplier). Once you know how to
create with a BAPI call, you are in a safe place.

Alert Moderator

Assigned tags

SAP S/4HANA migration cockpit | LTMOM |

Related Blog Posts

S4HANA Data Migration Cockpit Modeler Authorizations


By Raghunathan Balasubramanian , Jul 11, 2018

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


By Janderson Livio , May 20, 2019
SapTeched Recap CT102 Lessons learned using LTMOM or LTMC
By Michelle Crapo , Oct 13, 2019

Related Questions

HANA MIGRATION COCKPIT and its uses


By Austin Steyn , Dec 21, 2018

How to add eld DATLT in LTMOM Target structures


By Satish Solla , Oct 22, 2019
Error to generate migration object via LTMOM
By Tai Lu , Jan 24, 2020

Be the rst to leave a comment

You must be Logged on to comment or reply to a post.

Find us on

https://blogs.sap.com/2019/10/29/ltmom-extend-purchasing-contracts-to-allow-scale-conditions/ 13/14
2/16/2020 [LTMOM] Extend purchasing contracts to allow scale conditions | SAP Blogs

Privacy Terms of Use

Legal Disclosure Copyright

Trademark Cookie Preferences

Newsletter Support

https://blogs.sap.com/2019/10/29/ltmom-extend-purchasing-contracts-to-allow-scale-conditions/ 14/14

You might also like