cancel
Showing results for 
Search instead for 
Did you mean: 

How we Can Validate the Code list through SDK

0 Kudos

Hello Experts,

I want to validate the some code list like Distribution Channel , Division which are code list. So i am trying to Validate through SDK but i don't know how i can do. Is it possible to check validation through scripting if some one pass the wrong data through ERP and record should not be created and raise error message.

Accepted Solutions (1)

Accepted Solutions (1)

former_member226
Employee
Employee
0 Kudos

Hi,

May be you can have try with CodeList reuse library delivered as part of "AP.PlatinumEngineering" namespace. A sample code would be as follow where you can get all possible values for DivisionCode data type and then you can just validate if value received from ERP is matching with the one form CodeList.

import ABSL;
import AP.PlatinumEngineering;
import AP.Common.GDT;
var DataType = "DivisionCode";
var AllowedCodes = Codelist.Get(DataType,"http://sap.com/xi/AP/Common/GDT");

Thanks

Saurabh

Suchita92
Participant
0 Kudos

Hi saurabhkabra2009 ,

This is excellent. Thanks for sharing the knowledge about the PlatinumEngineering Reuse function.

I was wondering is there a way to see/find what all is available under AP.PlatinumEngineering ?

Thanks,

Regards

former_member226
Employee
Employee

Hi,

Unfortunately, there is no official documentation available for PlatinumEngineering namespace based libraries. Its all hit and trial for now. 🙂

0 Kudos

Hello Saurabh,

I have tested ,it is working we can validate code list through above approach.

Thanks,

Sanjay

Answers (2)

Answers (2)

Suchita92
Participant
0 Kudos

Hi Sanjay,

As I understand , you want to validate the value of say Distribution Channel or Division on C4C when the value is passed from ERP to make sure, ERP only pass the allowed values and if ERP pass the wrong value then you want to raise an error.

I think SDK is the wrong place to do this validation if you want to check for the values coming from ERP. This validation should happen in the Middleware (CPI or PI) and Middleware should log this error. (because you mentioned if ERP is sending wrong value for Sales area (SO,Division,Distribution Channel). C4C Documents offer the Integration Error tab where error due to integration can be seen & this is something can be used on C4C to show meaningful error to user.

Ideally Code List mapping is the correct way to handle the ERP & C4C value mappings for integrated scenarios - where you maintain what values from ERP should map to what values in C4C. This makes sure, whatever value ERP passes, C4C always consider the correct value as maintained in C4 System.

On Contrary, If you want to raise error based on Sales Area selected by user so that wrong sales area is not passed to ERP - then that is something should be handled in C4C and possible options are

1) Code-list mapping - which ensure correct values are passed to ERP for C4C codelist

2) Code List restriction so that user is not shown a value they shouldn't be selecting ( You restrict the division and distribution channel values via code list restriction on business role so that C4C user is shown and therefore can select only the values allowed to them.)

3) KUT validation Rule - based on other condition you want to validate user's selection of Sales area.

SDK to be used only if none-of the above can be used.

Thanks,

Suchita

0 Kudos

Above 3 points which you mentioned is correct but if some one enter manually and pass the data for C4C it is created the record in C4C thats why i want validation.

cianbarrett
Active Participant
0 Kudos

Hello Sanjay,

There's no reason why this shouldn't work. Create a ValidationOnSave Event on the BO Root Node and check for values. It would however cause the web service to fail if a false value is returned.

- Cian