# Recognizing outbound SAP IDOC

**URL:** <https://techcommunity.softwareag.com/t/recognizing-outbound-sap-idoc/107646>\
**Category:** Forum\
**Tags:** EDI\
**Created:** [July 28, 2003, 11:36pm UTC](https://techcommunity.softwareag.com/t/recognizing-outbound-sap-idoc/107646 "2003-07-28T23:36:06Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chris\_L](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@Chris\_L](https://techcommunity.softwareag.com/u/Chris_L)\
**Post date:** [July 28, 2003, 11:36pm UTC](https://techcommunity.softwareag.com/t/recognizing-outbound-sap-idoc/107646/1 "2003-07-28T23:36:06Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ajandja](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ajandja](https://techcommunity.softwareag.com/u/ajandja)\
**Post date:** [July 29, 2003, 10:02pm UTC](https://techcommunity.softwareag.com/t/recognizing-outbound-sap-idoc/107646/2 "2003-07-29T22:02:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Chris\_L](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@Chris\_L](https://techcommunity.softwareag.com/u/Chris_L)\
**Post date:** [July 29, 2003, 10:48pm UTC](https://techcommunity.softwareag.com/t/recognizing-outbound-sap-idoc/107646/3 "2003-07-29T22:48:37Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ajandja](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ajandja](https://techcommunity.softwareag.com/u/ajandja)\
**Post date:** [July 30, 2003, 9:04pm UTC](https://techcommunity.softwareag.com/t/recognizing-outbound-sap-idoc/107646/4 "2003-07-30T21:04:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Chris\_L](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@Chris\_L](https://techcommunity.softwareag.com/u/Chris_L)\
**Post date:** [July 30, 2003, 10:40pm UTC](https://techcommunity.softwareag.com/t/recognizing-outbound-sap-idoc/107646/5 "2003-07-30T22:40:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ajandja](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ajandja](https://techcommunity.softwareag.com/u/ajandja)\
**Post date:** [July 31, 2003, 1:50am UTC](https://techcommunity.softwareag.com/t/recognizing-outbound-sap-idoc/107646/6 "2003-07-31T01:50:04Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Chris\_L](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@Chris\_L](https://techcommunity.softwareag.com/u/Chris_L)\
**Post date:** [July 31, 2003, 2:29am UTC](https://techcommunity.softwareag.com/t/recognizing-outbound-sap-idoc/107646/7 "2003-07-31T02:29:22Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Chris\_L](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@Chris\_L](https://techcommunity.softwareag.com/u/Chris_L)\
**Post date:** [July 31, 2003, 2:57am UTC](https://techcommunity.softwareag.com/t/recognizing-outbound-sap-idoc/107646/8 "2003-07-31T02:57:06Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ajandja](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ajandja](https://techcommunity.softwareag.com/u/ajandja)\
**Post date:** [July 31, 2003, 9:17pm UTC](https://techcommunity.softwareag.com/t/recognizing-outbound-sap-idoc/107646/9 "2003-07-31T21:17:28Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Chris\_L](https://avatars.discourse-cdn.com/v4/letter/c/ba9def/32.png) [@Chris\_L](https://techcommunity.softwareag.com/u/Chris_L)\
**Post date:** [July 31, 2003, 10:25pm UTC](https://techcommunity.softwareag.com/t/recognizing-outbound-sap-idoc/107646/10 "2003-07-31T22:25:17Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ajandja](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ajandja](https://techcommunity.softwareag.com/u/ajandja)\
**Post date:** [August 1, 2003, 2:34am UTC](https://techcommunity.softwareag.com/t/recognizing-outbound-sap-idoc/107646/11 "2003-08-01T02:34:30Z")

</div>

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…

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [September 25, 2003, 8:42pm UTC](https://techcommunity.softwareag.com/t/recognizing-outbound-sap-idoc/107646/12 "2003-09-25T20:42:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![hugo2](https://avatars.discourse-cdn.com/v4/letter/h/db5fbb/32.png) [@hugo2](https://techcommunity.softwareag.com/u/hugo2)\
**Post date:** [September 25, 2003, 9:20pm UTC](https://techcommunity.softwareag.com/t/recognizing-outbound-sap-idoc/107646/13 "2003-09-25T21:20:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [May 25, 2004, 7:28pm UTC](https://techcommunity.softwareag.com/t/recognizing-outbound-sap-idoc/107646/14 "2004-05-25T19:28:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:04pm UTC](https://techcommunity.softwareag.com/t/recognizing-outbound-sap-idoc/107646/15 "2021-04-02T15:04:52Z")

</div>


