cancel
Showing results for 
Search instead for 
Did you mean: 

Validation rule in PI count screen in SAP IM 3.2

former_member199619
Participant
0 Kudos

Hi,

We have our PI count screen as below. In case of Non-Serialized material, When user enters count quantity in TxQty and click on confirm checkbox BsQty gets updated with TxQty. I have created one validation rule which compares the BsQTY and SOH. If there is any difference a warning has to be thrown. In case of Non - Serialized Material, my validation rules if working properly. But in case of Serialized Material, I am getting the warning message twice.

My validation is as follows:

What the changes I have to make to my validation rule, so that it will show warning message only once in both Serialized Material and Non - Serialized Materials cases.

--Shyam

Accepted Solutions (1)

Accepted Solutions (1)

jason_latko
Advisor
Advisor
0 Kudos

Shyam,

That doesn't make sense to me.  Validation messages will only pop once if there is a single validation rule on the transaction.  The serialized case must be doing something different to cause this.  Can you show me the action(s) that run this transaction, and the validation tab of the transaction?

You also don't need the IF in your rule.  Validation rules return in a BOOLEAN context.  You have listed an IF, but you provide no THEN of ELSE for the IF.  Just the EQSTR will work and be less confusing for someone looking at the rule.

Jason Latko - Senior Product Developer at SAP

former_member199619
Participant
0 Kudos

Thanks for your reply Jason.

In case of serialized materials, initially BsQTY value is "0" and after entering the serial number and clicks on finish button, I think my validation rule is applying twice. First it is comparing with "0" and after entering the serial number the BsQTY becoming "1" and at that time also it is validating.

Below are the Material count action and Material count transaction validation tab details:


--Shyam

former_member199619
Participant
0 Kudos

Hi Jason,

As you said I have changed my validation rule.

Can you please tell me how can I stop the message coming twice for serialized materials.

--Shyam

Former Member
0 Kudos

Each rule will only fire once pre transactions.  Can you confirm that the transaction only has 1 validation with that rule. and 2, if any other transaction has the same validation rule within the same action.

former_member199619
Participant
0 Kudos

Hi  Stephen,

My transaction has only 1 validation rule.

My validation rule is working fine in case of non-serialized materials. The problem is when we perform the count for serialized materials, my validation message is coming twice.

MaterialCount Action is calling MaterialCount Transaction like below:

PISerialNumberAdd subaction is calling PISerialNumberAdd action which in turn calling MaterialCount Transaction like below:

Because MateialCount transaction is getting called twice, I am getting my validation message twice in case of serialized materials. How can I restrict this one.

--Shyam

Message was edited by: shyam prasad

jason_latko
Advisor
Advisor
0 Kudos

Shyam,

That transaction wasn't designed to accommodate your new rule.  You could fix it by saving a state variable and checking it in your rule:

Add a new boolean property to the Main Object called isSerialNumberAction

Add two edit transactions against the main object called: SetSerialNumberActionTrue and SetSerialNumberActionFalse.  Each transaction has the isSerialNumberAction boolean property in it.  True should set it to true, False should set it to false.

In MaterialCount action, add a transaction step pointing to SetSerialNumberActionFalse and add an Apply step after it.  This will set the state to false

In PSSerialNumberAdd action, add a transaction step pointing to SetSerialNumberActionTrue and add an Apply step after it.  This will set the state to true

Change your validate rule to start with:

IF

     MainObject -> isSerialNumberAction

True

Then continue with the rest of your rule under the IF.  This will skip your validation if running the PSSerialNumberAdd action.

Jason Latko - Senior Product Developer at SAP

former_member199619
Participant
0 Kudos

Hi Jason,

Thanks for your reply and sorry for late response.

In MaterialCount action, at which position i have to add "SetSerialNumberActionFalse" transaction. Like wise in PSSerialNumberAdd, at which position i have to add "SetSerialNumberActionTrue" transaction.

--Shyam

jason_latko
Advisor
Advisor
0 Kudos

Shyam,

Do them both as the first step of the action.

Jason Latko - Senior Product Developer at SAP

former_member199619
Participant
0 Kudos

Hi Jason,

As you said I have added two transactions to main object and added them in their respective actions and modified my validation rule. Even though, my validation message is coming twice in case of serialized materials.

Shyam

jason_latko
Advisor
Advisor
0 Kudos

Shyam,

Then you have done something incorrectly.  🙂

You will need to test this on the ATE so you can debug the actions, transactions, and your validation rule to see where you have gone wrong.  You could also post screen shots of everything you have done so I can look at them.

Jason Latko - Senior Product Developer at SAP

former_member199619
Participant
0 Kudos

Hi Jason,

Below are the changes I have made.

Regards,

Shyam

jason_latko
Advisor
Advisor
0 Kudos

Shyam,

Your rule is wrong, you need to skip processing if isSerialNumberAction is true, as I indicated in an earlier post:

IF

     MainObject -> isSerialNumberAction

True (This is a hand types constant)

EQSTR

     From_INTEGRAL_NUMBER

etc... Finish with your original logic here

The True constant will skip the rest of the rule and pass the validation if isSerialNumberAction boolean is set to True.

Jason Latko - Senior Product Developer at SAP

former_member199619
Participant
0 Kudos

Hi Jason,

I have changed my validation rule as you said. But I am getting the below error message

SetSerialNumberActionFalseTransaction definition is like below:

Should I specify any transaction and screenset here ?

I have given MaterialCount transaction, in that case i am not able to add multiple serial numbers.

Regards,

Shyam

jason_latko
Advisor
Advisor
0 Kudos

Shyam,

You have not specified a transaction to run.  You just gave it a step name.  Transaction drop down says " -- No Transaction --".  Pick your transaction using the drop down and try again.  It needs to be set to your SetSerialNumberActionFalse transaction so that flag will be set properly.

Jason Latko - Senior Product Developer at SAP

former_member199619
Participant
0 Kudos

Hi Jason,

I have specified the transaction like below :

I got below error message.

So I have given the Object property like below:

After applying all these changes also, I am getting my validation message twice for serialized materials. Am I doing something wrong?

Regards,

Shyam

jason_latko
Advisor
Advisor
0 Kudos

Shyam,

Yes, you are doing something wrong.  Do not specify a Target Property on the step.  That is what is causing the error.  The transaction itself should have the property in it.  Show me the property definition in the transaction.  That property should be tied to the isSerialNumberAction property in the main object.  The false transaction property should have an initial value of unchecked, the true transaction property should have an initial value of checked.

Jason Latko - Senior Product Developer at SAP

former_member199619
Participant
0 Kudos

Hi Jason,

Below is the property definition in the transaction.

Regards,

Shyam

jason_latko
Advisor
Advisor
0 Kudos

Shyam,

Initial Value should not be from object property.  It should be set to a constant, then allowing you to either check or uncheck the constant check box to set the state.  You should not change the True and False values up top either.  They should be set to True and False for both transactions.  Those values on top are used only if you want to modify the True and False string constant values for this property, maybe setting them to T or F.

You seem a bit confused on the fundamental concepts you will need to make customizations to Agentry.  Refer to the main Agentry page and review some of the basic documentation after we get through this issue. 🙂

Jason Latko - Senior Product Developer at SAP

Answers (0)