cancel
Showing results for 
Search instead for 
Did you mean: 

How to skip records without mandatory fields

Former Member
0 Kudos

Hi Experts,

I need a suggestion from you:

We have a requirement where in we have to skip the source records, where the mandatory fields are missing and if possible log it in PI server.

Please advice how can we handle this ?

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

u can do it in graphical mapping using UDF- check all the values of payload if value is missing then skip that record else generate a record.

chirag

Answers (4)

Answers (4)

Former Member
0 Kudos

Query solved with above inputs..

Former Member
0 Kudos

Hi Puneet,

To skip the records, you can achieve it in graphical mapping using exists and createif function.

MandatoryField -> exists -> createIf -> removeContext -> TargetStructureNODE

Regards,

Aravind

Former Member
0 Kudos

Aravind,

You are right but i think "Exists" funciton will not work here as the source field will always exist in the structure either with value or blank...

Former Member
0 Kudos

Hi Friends,

Just got a trick to handle this:

Input_Mandatory_field > Fix Value ("" as false and if lookup fails: true)> creatif> removeContext> OutputmessageTypeNode

hope it will help others..

Former Member
0 Kudos

hi,

u can also try by taking source field - mapwithdefault use blank not space.........then a blank constant[] and then compare it with equalS text function and send it to creatif and then removeContext and then target field........

Former Member
0 Kudos

hi,

you can do that with message mapping, just use one of the mandatory fields (or a concatenation of them) to generate the output. as for the logging depends what you want to achieve, but you will need a udf

anupam_ghosh2
Active Contributor
0 Kudos

Hi Puneet,

In PI 7.0 we read all records into a message. Then we apply java mapping program for validation. This program generally written using DOM parser will go through each record one by one and validate it with a set of requirements. if a set of records does not contain mandatory fields we send error emails to a set of users. this triggering of emails is done by RFC. In your case you can simply move to next record. In case you want to log it in PI server then you can use an ABAP program to log the error messages for each record in a table. The records which are valid can be passed onto next mapping. With use of BPM this becomes simpler to implement.

regards

Anupam

Edited by: anupamsap on Mar 8, 2011 10:11 AM

Former Member
0 Kudos

Hi,

could you please share the pseudo code for you java mapping/ UDF ?

Edited by: Puneet Singhal on Mar 8, 2011 11:06 AM

anupam_ghosh2
Active Contributor
0 Kudos

Hi Puneet,

Is your mandatory field comming as separate field within source message then you can use the mapping what Aravind has posted. In case it is comming in, as part of a line then you need to post here the source and target mesage structure. Then only code for UDF or java mapping may be suggested. Also if possible include sample input and output.

regards

Anupam

Edited by: anupamsap on Mar 8, 2011 11:27 AM

Former Member
0 Kudos

Yes the source will be seperate fields in the source structure.

Lets assume:

Input as :

InputRootnode

Input1 (mandatory)

Input2

Input3(mandatory)

Input4

Output as:

OutputRootNode

Output1

Output2

Output3

Output14