cancel
Showing results for 
Search instead for 
Did you mean: 

Error handling in File content conversion

Former Member
0 Kudos

In our project , we are converting Flat file to XML by adapter modules ...

File is like this :

HEADER 123 567

DETAIL UWERU AASD fftk

DETAIL UWERU AASD fftk

DETAIL UWERU AASD fftk

DETAIL UWERU AASD fftk

FOOTER

File has been succesfully converted to XML.HEADER, DETAIL and FOOTER are the key field

values.

Now in some scenario file is like this

HEADER 123 567

DETAIL1 UWERU AASD fftk

DETAIL UWERU AASD fftk

DETAIL UWERU AASD fftk

DETAIL UWERU AASD fftk

FOOTER

As there is one DETAIL1( different from DETAIL, it can be anything other tha DETAIL ) we need to throw the error.Client wants to do it in the Integration engine level not in Adpater engine...

Any suggestions will be great ....

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Bhavesh ,

Input

-


HEADER 123 567

DETAIL UWERU AASD fftk

DETAIL UWERU AASD fftk

DETAIL UWERU AASD fftk

DETAIL UWERU AASD fftk

FOOTER

The output is like this

<root>

<header>

<f1>123</f1>

<f2>567</f2>

<detail>

<f3>UWERU</f3>

<f4>AASD</f4>

<f5>fftk</f5>

</detail>

.......

......

<footer>

.....

</footer>

Now regarding the module , we are using all standard modules , can we set the flag using SAP standard module ???

Another question is , is ot possible to make the key field values (HEADER, DETAIL and FOOTER ) is part of the output ???

Regards

Goutam

bhavesh_kantilal
Active Contributor
0 Kudos

><i>Now regarding the module , we are using all standard modules , can we set the flag using SAP standard module ???</i>

I had assumed that you were writing a Custom Module. Are you using the MessageTransformBean?

MessageTransformBean will not allow you to create the Flag etc.

1. Either write an Adapter Module ( custom ) that will do this,

or,

2. Do the validation in your mapping in a BPM and then use a BPM to decide if data is valid or not and if it is to be sent to the target or not, or directly throw a runtime exception in your mapping etc.

Regards

Bhavesh

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Bhavesh,

The key field values (DETAIL, HEADER,FOOTER) in not part of the output.

Regrading the setting a flag in module , can you send the sample module configuration or BLOg will be really helpful ...

Thanks for your help so far ...

Regards

Goutam

bhavesh_kantilal
Active Contributor
0 Kudos

Gowtam,

Need to go a bit slow on this

1. What are you currently perfrominh in your Adapter Module? What is the input, what does the output XML look like?

What I mean in my solution here is that inside your adapter module if you are able to detect the presnece of this extra ( unwanted) node , then your Output XML can have some FLAG set so that in your Receiver Determination you can use this as a condition to determine whether the data is to be sent to the target or not.

Eg:

<ROOT>

<Error>

<FLAG>YES<FLAG>

</Error>

<ActualData>

..

..

</ActualData>

</ROOT>

In your module set this FLAG and then use the Condition in receievr determination to check what needs to be done on this valid / invalid data as per requirements.

Regards

Bhavesh

Former Member
0 Kudos

Hi,

As explained above , it is better to handle , in mapping itself, see the below link

to throw Runtime Exception from maping , if you want to raise Runtimeexception in MM. And this error termination can be hndles indetermination while configuring your scenario like terminate the process or continue the process ..

/people/alessandro.guarneri/blog/2006/01/26/throwing-smart-exceptions-in-xi-graphical-mapping

Regards

Chilla

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

What is the output of your Adapter Module?

Because you are using the Module to convert the Text to XML , you can set some flag in the module and then use this in the receiver determination tro decide if file is valid or not and therby have control over what needs to be done.

Regards

Bhavesh