cancel
Showing results for 
Search instead for 
Did you mean: 

Exception Handling

Former Member
0 Kudos

I have a file to IDOC scenario. We are receiving minimum 1000 records in the file.

If the message mapping fails due to some bad record, the whole job terminates.

But we want to skip the Diseased Record and keep continuing with the good records?

Whether it is possible? We are having XI 3.0, SP 14

Thanks for your Help.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

There can be many kinds of "Diseased Record". If we can get to know what might cause such records, we could handle it in the mapping.

Take a case where there is a <tag> missing in one of the many records present.

In the mapping, you could check if all the tags of that record exists,and if so, we could map it to the target.

Else, you could leave it without mapping.

Another ex, might be a wrong value in one of the fields in the record(ex: number instead of a string). In such a case, we could again check if the field is a string or not and map accordingly.

There may be one or more of these records, so this check happens for each of the records.

So, if there is an error, no mapping happens, and if the record is alright, a new target record is created.

Regards,

Smitha.

Message was edited by: Smitha Rao

Former Member
0 Kudos

Thanks Smitha.

You said :

So, if there is an error, no mapping happens, and if the record is alright, a new target record is created.

How to skip the Mapping, if there is an Error in a field (Inthis case I want to skip the whole record how it is feasible)?

Note : YOu are talking about the Field level validation, but I am talking about the Record Level Validation.

Former Member
0 Kudos

Hi,

Guess i was not very clear.

Correct.You are doing a field level validation.

If the fields exist, and if the condition is true, you could map the sorce record type to the target.

For ex:

source:

<record>

<field1>

<field2>

</record>

Target:

<Trecord>

<Tfield1>

<Tfield2>

</Trecord>

What we could do is, check if the fields(field1, field2) are valid. If they are, you could map, <record> and <Trecord>. So, a target record will be created only if the fields are valid.

Regards,

Smitha.

Message was edited by: Smitha Rao

Former Member
0 Kudos

Thanks Shabarish Vijayakumar. I will try that technique.

Smitha, coming to your point let us say we are mapping Sfield1 to Tfield1 after the proper validation, and Sfield2 to Tfield2, and for field2 let us assume, the filed doesnot satisfy the Validation condition, now how can you skip this Record?

Former Member
0 Kudos

Hi,

First of all, you would be doing the validation and mapping together.

For example, say we are checking if sfield2 exists.

If sfield2 exists, then map, srecord to trecord.

What you are specifying here, is that the record be mapped if the conditions are satisfied.

If they are not, nothing happens.

i.e, no target record is created.

So, you have skipped creating a record that has error in it.

Hope this helps.

Regards,

Smitha.

Message was edited by: Smitha Rao

Shabarish_Nair
Active Contributor
0 Kudos

In short

sfield1/sfieldN -> Targetnode

sfield1 -> exists -> tfield1

and so on ....

So hence ony if the required field exists your target node will be created ...

Answers (1)

Answers (1)

Former Member
0 Kudos

Mohan,

Are you talking about Runtime exceptions in message mapping ? you say it is a file -> idoc scenario. If you are looking at <b>structurally invalid data</b> , then it will fail in your content conversion itself(assuming u are not dealing with xml files!!)

If you are looking at a <b>business level validation of the data</b> , say for example, data in a particular field is junk and not what the target sap expects, then i beleive it will not be a runtime error. one way is to have an error segment in your IDOC(ZIDOC!!) and populate it , if you see an issue with the record. well the idoc will still reach SAP , but you can ignore the idocs with error segments there.

may be you can explore this option.

Regards

Saravana