cancel
Showing results for 
Search instead for 
Did you mean: 

if statement rule in one column

0 Kudos
292

Hi i need your help again SAP community

i am trying to do a validation rule in information steward my data is coming to IS as per below screenshot sample capture.jpg

the objective of the rule is to identify materials that doesnt match the below criteria

if IBP_BUSINESSUNIT = BR then IBP_SUBBUSUNIT = BR or CH anthiny other than this will return false

thanks for your help

Accepted Solutions (0)

Answers (4)

Answers (4)

Julian_Riegel
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hey there,

From what I can see the data is not prepared yet to implement the rule that you require for validation. I suggest building two views on that excel beforehand.

One with a where condition on Charactersitic Description = 'IBP_BUSINESSUNIT' and one with Charactersitic Description = 'IBP_SUBBUSUNIT' - and take all needed attributes accordingly - rename those with redundant column name in each view. I.E CharacteristicValue_SUBBUSUNT and CharacteristicValue_IBP_BUSINESSUNIT etc.

Afterwards, join these two views on PK Material number to bring the information per Material into one row. After that, you can use above mentioned Code on the resulting view with slight enhancements.

Also, if you have the option to change the format of the excel itself you can do that instead bringing the relevant Businessunit and Subunit information per Material into one row within excel

If you have a Data Services in place you can prepare the data also therein using pivot transform or similar and building the validation rule on that resulting table:

BEGIN
IF(CharacteristicValue_IBP_BUSINESSUNIT ='BR' AND
(CharacteristicValue_SUBBUSUNTT ='BR' OR CharacteristicValue_SUBBUSUNIT ='CH'))
RETURN TRUE;
ELSE
RETURN FALSE;
END
0 Kudos

Hi Julian i have done this before but it is not returning accurate results i have no idea why i think there is an issue with tables still investigating the issue

Julian_Riegel
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hey there,

BEGIN
IF (IBP_BUSINESSUNIT = 'BR' AND (IBP_SUBBUSUNIT = 'BR' OR IBP_SUBBUSUNIT = 'CH'))
   RETURN TRUE;
ELSE
RETURN FALSE;
END
former_member466847
Active Participant
0 Kudos

Hello based on your query it is being defined as an And Or type. so if 1 or both are false it will return a false.
May i suggest an == (is equal to) and an 'and' join to check both values?
what value does that return?