cancel
Showing results for 
Search instead for 
Did you mean: 

can we access fields from flat file into sender adapter module?

Former Member
0 Kudos

I am thinking of doing basic validation of date and amount fields for the input file so that the file errors out at the adapter module itself instead of waiting to do this at mapping time. Is it possible to access the field names in the file (as defined by content conversion perhaps or even as offsets) in adapter module code?

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi James

What kind of validation you are looking in date and amount fields

Is it against some constant value, or from some database?

While reading the file only basic Data type validation is possible. Content validation you have to do at mapping level.

Thanks

Gaurav

Former Member
0 Kudos

I need to do basic data type validation like date being 8 bytes numeric and numbers being numeric. Is there a way of doing this using adapter module or any other way so that user can be alerted of invalid data in file before message is even created for error to be trapped at mapping time?

Former Member
0 Kudos

Hi James

If you have created the DT in PI then you can add these to that DT. Go to your data type and then go to details you can use the Facets provided by PI

http://help.sap.com/saphelp_nw70/helpdata/EN/b2/439347ce019848bf3ad9c000d414c3/content.htm

Else if you are using an external definition. Edit the XSD and you can incorporate these facets

Hope this solves your basic data type validation problem

Thanks

Gaurav

Former Member
0 Kudos

I have tried using facet with pattern="[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]" for date, but if I send the field as "xxxxxxxx", it does not fail anywhere. How are facets useful? If I define the facet above, should I be expectng the file pick up to fail at the adapter level because the incoming data does not match the type/facet defined for that field? It does not seem to be working that way.

Former Member
0 Kudos

>>It does not seem to be working that way

Its not meant to work that way either,the facets provided in data type is just for mere documentation/clarity and are not considered at the time of message mapping .

You need to handle the validation in Message mapping.

Payload validation is available from PI 7.1 though.

Thanx

Aamir