Recognizing outbound SAP IDOC

I have SAP46c sending to wm 6.01 a DESADV Idoc. The connection is good as the correct service gets executed. My problem is that the IDOC_CONTROL_REC_40 and IDOC_DATA_REC_40 documents are present in the pipeline but they contain no data. Their structures are empty. I am using pub.sap.idoc:transformFlatToHierarchy.

What are some of the things that could cause this? Incorrect Message Type, incorrect Idoc version, invalid configuration? ’

Any ideas will be greatly appreciated.
Thanks

Chris,

Are you setting the “conformsTo” parameter for the pub.sap.idoc:transformFlatToHierarchy service to the record layout of your DESADV? I suggest you set that parameter when you use this flow step.

Once you do this, try saving the pipeline after the pub.sap.idoc:transformFlatToHierarchy step to see if this helps.

In general the SAP adapter that handles IDOCs is pretty consistent in the way it handles IDOCS and should be able to take your DESADV after the requisite routing rules are setup.

HTH.

Andrew I’m getting a null pointer exception at the pub.sap.idoc:transformFlatToHierarchy.
I suspect its because the Document List definitions IDOC_CONTROL_REC and IDOC_DATA_REC have no structure to them.

My understanding is that once the Routing Rule is executed it creates the structures for you based on the Idoc Message Type. The conforms to is optional. According to the docs if it is not present then IDOC_CONTROL_REC and IDOC_DATA_REC are created as List vs. rec.

Anymore info would help?

Chris,

I am not sure why you are getting a NPE at this first step. You should, at least, have data in the IDOC_CONTROL_REC_40 since it is used to determine routing, specifically, in the IDOC_CONTROL_REC_40 MESTYP,SNDPRN, and RCVPRN. ( At least that has been my assumption all along.) Without data in these fields, I doubt the IDOC will be routed correctly if that was empty. Unless your Adapter has “content based routing” configured which isn’t good when you’re don’t want that. See the Adapter guide for more details on content based routing.

Also, is the the first IDOC type that is flowing from SAP to wm?

Finally, Have you looked at the Transaction Store under the “Routing…”? Take a look at one of the DESADVs in this list by clicking on the TID and view “As Values” You should see what was sent in the IDOC_DATA_REC_40 and IDOC_CONTROL_REC_40, if at all. I am curious to what you see here. If these show as empty, I believe the issue lies with how SAP is configured to send IDOCs to wm.

HTH.

Andrew interestingly when I view as values or XML I can see the content of the Idoc. When I look at the pipeline file on disk I can see the contents of the idoc but when I view in results I have have empty CONTROL recordList.

I’ll have to check the content based routing.

I didn’t install or configure this setup. I inherited it.

This is our first Idoc from SAP to wm.

Chris,

I can certainly relate to the interesting situations you find yourself, after inheriting code/configuration for someone else. It isn’t much fun at all!

It looks like you are getting the IDOC correctly in Wm so SAP and wm config are fine. I can’t understand why your control record list is disappearing on you after(?) the transformFlatToHierarchy service. It’s quite baffling, really.

I seem to recall reading on a wm forum (It could be this one) regarding a suggestion to use pub.sap.idoc:decodeSDATA BEFORE pub.sap.idoc:transformFlatToHierarchy. It might be worth a try, if nothing else works. The adapter doc seems to suggest that “decodeSDATA” needs to be called immediately after an IDOC is received from SAP. I have had no need to use it but there may be something specific with your implementation.

Good luck.

Andrew the control records are disappearing before transformFlatToHierarchy that’s why I’m getting NPE. I’m thinking it’s a routing rule problem.

I’m reading in the docs that you edit the routing rule in Developer but it doesn’t state where. Do you happen to know.

Thanks.

Additional info
In my routing rule I have a main flow service wm.PartnerMgr.flows.WildCard.WildCard:DESADV
but the only folders I have under wm.PartnerMgr are xtn and gateway.
Should I not see a flows folder as well?

If my assumption is correct has anyone seen this before.

Chris,

The routing rules are stored in the “Package” that is specified when you first created the routing rule. To check yours, go in to edit your routing rule and you will see the package that was used under the Package field. The “Default” package is usually used as, you guessed it, the default package for routing rules.

Also, do you have anything specified in the “Pre-Processing Service” parameter in your routing rule? If you do, this could be causing your failure.

Andrew

I figured out the Pkg question. No pre-processing service specified.
It’s funny when I look at the actual pipeline file the Idoc contents are there but developer is not displaying it.
hmmmm?

Hmmmm indeed.

So you tried to restorePipelineFromFile into your flow and you don’t see the IDOC_CONTROL_REC_40 or the IDOC_DATA_REC_40 record lists?

If you want to, send me your pipeline file & flow service and I could try it here…

A late suggestion:
Did you choose idoc record types 4.x in your SAP port definition (WE21). Only then CONTROL_REC_40 and DATA_REC_40 segments are used. Otherwise CONTROL_REC and DATA_REC.

Hi Chris,

A “feature” of webMethods is that sometimes you are not allowed to do a savePipeline(FromFile) when at the begining of a service when it is invoked externally (like now with SAP). Try to use the pub.sap.idoc:transformFlatToHierarchy first and after this service use the savePipeline. The you should see the results. So it looks like no data is there but actually there is…

Regards,
Hugo

Thanks Hugo.
I had the same problem than Chris, and your so simple solution worked.