This website is not affiliated with, sponsored by, or approved by SAP AG.

Including one Constraint (Global Object Dependency) in other

Logistics : SD and its sub-modules (Inquires, Quotes, Order Entry, SIS, Sales Contacts, Dist. & Billing)

Moderators: Snowy, thx4allthefish, mike_ac, Lost Identity

Including one Constraint (Global Object Dependency) in other

Postby dineshkgupta » Mon Mar 17, 2014 5:33 am

Dear Friends,

We have a business scenario where we need to include one Constraint (LO-VC Global Object Dependency) in another Constraint (LO-VC Global Object Dependency).

Consider the following example:-

Assuming that COUNTRY is a Characteristic with values US, Canada, India & China

First Constraint: CONSTRIANT_ 001 has Expression (or Source code):- COUNTRY = 'US' OR COUNTRY = 'Canada'

Second Constraint: CONSTRIANT_002 has Expression (or Source code):- COUNTRY = 'US' OR COUNTRY = 'Canada' OR 'India' OR COUNTRY = 'China'

So, the question is,

Is it possible to reuse CONSTRIANT_ 001 inside CONSTRIANT_002 [e.g. expression for CONSTRIANT_002 codes like this:- CONSTRIANT_ 001 OR OR 'India' OR COUNTRY = 'China']

Is it possible? If yes, how to achieve it?

Thanks in anticipation.
dineshkgupta
 
Posts: 4
Joined: Thu Mar 13, 2014 4:08 am

Re: Including one Constraint (Global Object Dependency) in other

Postby Sharpshooter » Mon Mar 17, 2014 7:32 am

Hi Dinesh,

No that is not possible, but my question would be why would one wish to do that? You are only making the code impossible to read without branching off to a second screen to look at the first constraint.

You have not mentioned anything about your 2 models where these constraints would be used, but I would say that normally I would try to use one single constraint that uses a variant table. Then you could invoke different table rows in each model depending on some other characteristic. This also makes it easier in the future if the countries you use were to change - simply maintain table entries instead of rewriting dependencies.

Dave
Good luck!
Sharpshooter
 
Posts: 1171
Joined: Wed Mar 17, 2010 12:01 pm
Location: In the dark

Re: Including one Constraint (Global Object Dependency) in other

Postby dineshkgupta » Tue Mar 18, 2014 1:29 am

Hello Dave,

Thanks for your inputs. I appreciate your help.

Our business case is focused around re-usability of global constraints. We want to write some global constraints with expressions that can be re-used. We would like to extend these global constraints for developing more advanced constraints.

We were thinking of using ABAP functions here but functions accepts only single value characteristics as arguments whereas we have multi value characteristics also.

Thanks & Regards,
Dinesh
dineshkgupta
 
Posts: 4
Joined: Thu Mar 13, 2014 4:08 am

Re: Including one Constraint (Global Object Dependency) in other

Postby Sharpshooter » Tue Mar 18, 2014 7:47 am

Hi Dinesh,

I will share a couple of my modeling philosophies (even though you did not ask for them!).
1 - Reusability is a good thing - this obviously means NO local dependencies.
2 - Using variant tables with constraints enhances reusability and makes maintenance easier going forward. I have done exactly what you are doing in your example using one constraint and one variant table.
3 - Variant functions should be a last resort - use only when no other option.

Another comment - there are workarounds for using variant functions with multi-value characteristics: 1) use an invisible single value characteristic for each value of the multi-value characteristic that is set by dependency and used as input to the function; 2) Use a pfunction and read the DDB with ABAP.

Yet another comment - There are ways to restrict the value domain without dependencies. In your example, you could simply restrict countries for each model in classification.

Dave
Good luck!
Sharpshooter
 
Posts: 1171
Joined: Wed Mar 17, 2010 12:01 pm
Location: In the dark

Re: Including one Constraint (Global Object Dependency) in other

Postby dineshkgupta » Tue Mar 18, 2014 10:40 am

Hello Dave,

Thank you very much for your tips. These are very useful.

Can you please elaborate little more on how we can use variant tables and constraints together for achieving constraint re-usability?

Thanks & Regards,
Dinesh
dineshkgupta
 
Posts: 4
Joined: Thu Mar 13, 2014 4:08 am

Re: Including one Constraint (Global Object Dependency) in other

Postby Sharpshooter » Tue Mar 18, 2014 12:39 pm

Code: Select all
objects
x is_a (300) class
restriction
table tabname (  cstic1    = x.cstic1,
                          country = x.country )

Like I mentioned before, without knowing more about your models, I cannot recommend what "cstic1" should really be. Maybe it is product family or something. It needs have a unique value set for each model in order to work.

So if the value of cstic1 is always 'A" for model 1 and always 'B' for model 2, the table contents would look like this:
Code: Select all
CSTIC1     COUNTRY
  A                 US
  A                 CA
  B                 US
  B                 CA
  B                 IN
  B                 CN


This may or may not be a practical solution in your case.
Hopefully it helps.
Last edited by Sharpshooter on Wed Mar 19, 2014 6:58 am, edited 1 time in total.
Good luck!
Sharpshooter
 
Posts: 1171
Joined: Wed Mar 17, 2010 12:01 pm
Location: In the dark

Re: Including one Constraint (Global Object Dependency) in other

Postby dineshkgupta » Wed Mar 19, 2014 4:42 am

Hello Dave,

Thanks for your inputs. I will try out some of your suggestions and see how it goes.

Thanks & Regards,
Dinesh
dineshkgupta
 
Posts: 4
Joined: Thu Mar 13, 2014 4:08 am


Return to Logistics SD

Who is online

Users browsing this forum: Google [Bot], Google Adsense [Bot] and 7 guests





loading...


This website is not affiliated with, sponsored by, or approved by SAP AG.