cancel
Showing results for 
Search instead for 
Did you mean: 

File-XI-IDOC : error in sxmb_moni because of empty idoc

Former Member
0 Kudos

Hi !

I'm converting a CSV file to IDOC segments (CREMAS04).

XI uses a lookup table to convert CSV records to IDOC segments. It is normal that some records could not be converted. When I process a CSV file that has ALL non-convertable records, I get an error in sxmb_moni :

<SAP:Category>XIAdapter</SAP:Category>

<SAP:Code area="IDOC_ADAPTER">ATTRIBUTE_IDOC_RUNTIME</SAP:Code>

<SAP:P1>MSGGUID 99889D40A4D811DBAD4A0017A4510466: Tag found instead of tag IDOC BEGIN=</SAP:P1>

And the final payload is:

<?xml version="1.0" encoding="UTF-8" ?>

<CREMAS04 />

In the integration repository, the occurance of the complex type CREMAS04 is "1..1", I modified the xsd to minOccurs=0 , maxOccurs=1 , and imported it, but it keeps showing me "1..1"...

How do I deal with these case ?? I don't want error red flags in monitor because of empty idocs...

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Have you tried using mapping?

You can convert the CSV file into a simple XML using file adapter configuration. Then, you can use mapping to transform the simple XML into IDOC.

During mapping, you have much greater flexibility to examine the source XML for validity in creating the IDOC.

Regards,

Bill

Former Member
0 Kudos

Hi !

Thanks for your answer. That's what I'm doing. The problem is that the root node of the idoc is "1..1", and when there is no input data, the IDOC outputs with only this tag "</CREMAS04>" that causes an IDOC_ADAPTER error because of the "invalid" structure, however the case of no valid input data should be possible.

Thanks.

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

When the Idoc is being sent out of XI using the Idoc adapter, the Idoc adapter will validate the data against the Idoc metadata stored in IDX2.

the Idoc adapter is going to convert the Idoc - XML into the corresponding Idoc format so that it can be sent to the SAP R3 system.

In your case, as the Idoc tag is 1..1 the validation is failing in the Idoc adapter as it does not find the payload to match with the Idoc metatdata.

What you can do isntead is use MAPWITHDEFAULT and map all the fieldds / segments which are mandatory with BLANK constansts so that an empty Idoc will be postd to the target SAP r3 system.

Regards

Bhavesh

Former Member
0 Kudos

Hi Bhavesh !

Thanks !

The problem is that because of mapping rules, the value of my target fields is SUPPRESS, not "empty".

For example, I have a file with this records:

A

A

B

A

"B" records should fill an IDOC segment, "A" not.

If I receive a file with only "A" records, for example 48 "A" records...then the IDOC segment, now, is receiving 48 SUPPRESS values...then the mapWithDefault doesn't work because they are SUPPRESS and not EMPTY.

Any ideas?

Thanks,

Matias.

bhavesh_kantilal
Active Contributor
0 Kudos

Matias,

Am not much of a graphical mapping expert ( node functions etc at times overwhelm me ) and the quickest solution to these problems to me sounds like using a Java / XSL mappig.

So, if no solution strikes with Graphical mapping , let me know!

Regards

Bhavesh

former_member189558
Contributor
0 Kudos

Mathias,

If it is SUPPRESS then you can replace the SUPPRESS with a space from a UDF.

Use a Q-function and check for 2 consequetive context changes.

Thanks and Regards,

Himadri

PS: You can check the exists function also. I guess it may work as well.

Message was edited by:

Himadri Chakraborty

Answers (5)

Answers (5)

Former Member
0 Kudos

Hi Himadri !!

It worked fine !

Thank you !

Thanks everyone !

Points were rewarded.

STALANKI
Active Contributor
0 Kudos

If you want to instantiate the idoc segment that many times 'A' occurs in the field name ex: Alphabet.

it is very simple set the context to root and write a simple udf that takes the entire queue.

for i=0 to a.length() i++

result.addValue(" ").

map Alphabet. to ur idoc segment and it should work. The above code is algo.You have to follow the syntax of the mapping.

How many ever elements are there that many empty spaces will be created. We really do not require to use java or xsl for this case

former_member189558
Contributor
0 Kudos

Hi Matias,

Where are you changing the occurance...

You need to do the following:

<b>1) export the idoc XSD in ur local machine and change the occurance in the XSD.

2) Import it directly in the target message in the mapping..... there is a option in the top right of the mapping where you can import directly...</b>

Cheers,

Himadri

Former Member
0 Kudos

Hi Himadri !

I already changed the occurance in the XSD. The XML structure of the IDOC (CREMAS04) is :

CREMAS04 -> IDOC -> EDI_DC40 -> ....

-> E1LFA1M -> ....

I've changed the occurance of CREMAS04 from "1..1" to "0..1", and the one of IDOC, from "1.1" to "0..unbounded" to allow me multiple documents inside the same IDOC file.

BUT, after importing the changed XSD, the occurance of IDOC changed successfuly, but the ocurrance of CREMAS04 is still the same...

Thanks.

Former Member
0 Kudos

if you are using BPM, then before calling adapter, check whether it is empty IDOC or filled one, then call adapter based on that.

--Archana

Former Member
0 Kudos

Did you save it and activate those objects.. pls go to the activiation and activate all the objects once again..

this might help

thanks-Gopal