on 03-17-2012 10:00 AM
9 | Maiden Name | 16 | NAME2 |
| 40 | Name at Birth | PA0002 | O | Return the value from P0002-NAME2 | a) If P0002-NAME2 length > 16 , throw SAP max length error and write to exception file |
10 | Address Line 1 | 24 | STRAS | CHAR | 60 | Street and House Number | PA0006 | O | Return the value from P0006-STRAS where P0006-SUBTY=1 | a) If P0006-STRAS length > 24 , throw SAP max length error and write to exception file |
11 | Address Line 2 | 20 | LOCAT | CHAR | 40 | 2nd Address Line | PA0006 | O | Return the value from P0006-LOCAT where P0006-SUBTY=1 | a) If P0006-LOCAT length > 20 , throw SAP max length error and write to exception file |
12 | Address Line 3 | 16 | ORT01 | CHAR | 40 | City | PA0006 | O | Return the value from P0006-ORT01 where P0006-SUBTY=1 | a) If P0006-ORT01 length > 16 , throw SAP max length error and write to exception file |
The logic is really clear, use standard function legnth,greter than function and equals functions with if then and form a logic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
somebody please tell me the logic need to follow for those fields from the begin to end of all fields,it would be appreciated
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Create a funcition name and pass arguments as input source field
Example For Name. Same you can follow for other fields
String output ="";
try{
if (name.length <=16){
output=name;
} else{
throw new StreamTransformationException("Length is greater");
} catch (Exception e){
throw new StreamTransformationException("Length is greater");
}
return name;
Hi Anu,
you will have to write UDF in case you want to throw execptions if the field values exceeds the length specified.
Logic can be:
Check the length outside of udf. If length is less than 16(say) then pass value as it to UDF. If length exceeds 16 char then pass value "Fail" to udf where in throw exception.
UDF code:
if(!input.contains("Fail"))
{
return input;
}
else
try{
throw new StreamTransformationException("Lengths greater than value specfied.");
}
catch (Exception ex)
{
ex.printStackTrace();
throw new StreamTransformationException("Lengths greater than value specfied.");
}
Regards,
Deepak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.