Skip to Content

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

UDF for checking 3 values

Hi Expert,

Can anybody help me out for creating an UDF for below requirements?A,B and C are input field and based upon the below condition the output for D will be decided.

if A starts with FX and B starts WOOT and C = ZDS

then D=317914431 (or any other value)

Regards

Faisal.


Former Member
replied

Hi Faisal,

It is better to maintain the values set in table rather then in UDF. In UDF you need to hardcode the values. but you can check the below code if it suits your req.

Input paramter = A, B, C.

String res = "res";

String Apre = "FX";

  String Bpre = "WOOT";

  String Cpre = "ZDS";


  if(A.startsWith(Apre) && B.startsWith(Bpre) && C.startsWith(Cpre))

  {

  return res;

  }

regards,

Harish

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