Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Mandatory filed starts with Special Character

Hello All

Request your help in mapping. I am using SAP PI 7.3

I have source field "ID" with 1.1 occurrence. if ID starts with "?" or any other special character then the entire message should fail in SAP PI 7.3

Example: ID == ?_Example,  then entire message should fail. else the value in the ID field should be passed

can we achieve it through graphical mapping? if not can somebody share the UDF for the same.



Former Member

Hi James

You can throw an exception in a UDF. Example below of the source code.

if (input.startsWith("?")){

  throw new RuntimeException("Enter Exception Text");

} else {

  return input;



Eng Swee

0 View this answer in context
Not what you were looking for? View more on this topic or Ask a question