Problem with Sending IDoc to SAP

Hi,

I have searched the forum, but found no answer to my problem. I try to describe what I have done so far and where my problem is.
First I create a XSD for ORDERS05 in WE60, so I could create a record in SAP BC which I called “order”.
The routing rule to send IDoc from BC to SAP was defined as follows:
Sender: BC
Receiver: SAPTEST
MessageType: ORDER
Transport: ALE (R/3 IDOC)
Destination: TD1
A flow service was automatically created, which includes a Map (sets tranService to “pub.sap.transport.ALE:OutboundProcess” and server to “TD1”) and a OutboundProcess.
Between these two services I call a service with a Map setting the data in the IDoc and call a transformHierarchyToFlat. Here is the first problem I have, because boundNote had the right data inside, but IdocList is empty after transformHierarchyToFlat.

Another problem I have is that i don’t know what to map to IDOC_CONTROL(_REC_40) or IDOC_DATA(_REC_40). I have read the AdapterGuide, but didn’t understand where to find the data or control stuff.
Do I have to set $tid and $action? If yes with which values?
Last question, what is tranService good for, it is never used in the service.
Thanks,

Michael

PS: I use SAP BC Developer 4.7 on Windows
The EDI_DC40 data I have set are (maybee something wrong here):
@SEGMENT 1
TABNAM EDI_DC40
MANDT 800
DIRECT 2
IDOCTYP ORDERS05
MESTYP ORDERS
SNDPOR SAPBC
SNDPRT LS
SNDPRN BC
RCVPRO SAPTD1
RCVPRT LS
RCVPRN SAPTEST

Maybe it is easier for you to see my service to find the problem i have. I had to delete the schemas from the IDoc, to get under the 97,7kB maximum upload.
The Flow Service “testidoc” is to fill the data into the record and will be uses by the flow service “ORDER”.

[ATTACH]95[/ATTACH]
outbound.zip (90.8 KB)

Varrius,

Check out your service that maps to the IDOC structure and the convertion to flat format.

If the DATA Record and Control Record appears correctly, you can proceed further.

You need to fill the control record in the IDOC hierarchy structure and then convert to flat format.

$action can be set to “1” and $tid is not required (preferably $tid to be dropped, if you are sending IDOCs in a loop)

HTH
Bhavani Shankar

Hi Bhavani Shankar,

I have created the IDOC structure by using an XSD-schema, so I think this should be correct. Then I filled this structure with data with “set Value…” and this is also shown in the Results.
Now i call the transformHierarchyToFlat where the IDOC is the input for boundNode and the output is iDocList. But when I run this, iDocList is empty and I don’t understand why, because the needed fields in the IDOC are filled and are mapped to boundNode.

The EDI_DC40 record is the Control Record, isn’t it? But what is the Data Record, there are some records on the same level like EDI_DC40.
Thanks,

Michael

Which version of SAP adapter are you using ?

Since in SAP Adapter 6.x, the transform* services are deprecated.
We are using pub.sap.idoc.documentToIDoc, for which the document is created as follows :

document->->IDOC as a list.

IDOC name is cAse sensitive and is the same as IDOC Type in SAP.

Hope this helps
Bhavani Shankar

I’m using SAP BC 4.7

I tried tried to use pub.sap.idoc.recordToIDoc but the IDocList is also empty. As input for the boundNode I use a record with the name ORDERS05 and the structure
ORDERS05
-(record) IDOC
–(string) @BEGIN
–(record) EDI_DC40
–(record) E1EDK01
– …

All required fields are filled.
pub.sap.idoc.documentToIDoc seems to be not available in 4.7

Try to put the ORDERS05 under boundNode and let us know the result.

Prepare such a document and then map the boundNode to boundNode.

boundNode(document)->ORDERS05(document)->IDOC(as a list)

HTH
Bhavani

I created a record boundNode and it looks like:

(record) boundNode
-(record) ORDERS05
–(record) IDOC
—(string) @BEGIN
—(record) EDI_DC40
—(record) E1EDK01

but now I get the following exception in transformHierarchyToFlat

java.lang.ClassCastException: com.wm.util.Values
and the details to the exception show the Call Stack with pub.sap.idoc:transformHierarchyToFlat and myService in it.
When I trace the service, I get the following message after the exception occurs.

java.lang.ClassCastException: com.wm.util.Values
 at com.wm.pkg.sap.idoc.Transformer.toIDoc(Transformer.java:381)
 at pub.sap.idoc.recordToIDoc(idoc.java:271)
 at pub.sap.idoc.transformHierarchyToFlat(idoc.java:234)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:281)
 at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:693)
 at com.wm.app.b2b.server.BaseService.invoke(BaseService.java:140)
 at com.wm.lang.flow.FlowInvoke.invoke(FlowInvoke.java:292)
 at com.wm.lang.flow.FlowState.invokeNode(FlowState.java:559)
 at com.wm.lang.flow.FlowState.stepIncremental(FlowState.java:482)
 at com.wm.lang.flow.FlowState.invoke(FlowState.java:373)
 at wm.server.flow.stepFlow(flow.java:183)
 at java.lang.reflect.Method.invoke(Native Method)
 at com.wm.app.b2b.server.JavaService.baseInvoke(JavaService.java:288)
 at com.wm.app.b2b.server.ServiceManager.invoke(ServiceManager.java:693)
 at com.wm.app.b2b.server.comm.DefaultServerRequestHandler.handleMessage(DefaultServerRequestHandler.java:80)
 at com.wm.app.b2b.server.HTTPMessageHandler.process(HTTPMessageHandler.java:166)
 at com.wm.app.b2b.server.HTTPDispatch.run(HTTPDispatch.java:457)
 at com.wm.util.pool.PooledThread.run(C:/NT/Perforce/basis/4.1.0-terra/module/core/source/com/wm/util/pool/PooledThread.java:103)
 at java.lang.Thread.run(Unknown Source)

EDIT:
I added the services recordToDocument (boundNote->xmldata), stringToDocument (xmldata->node) and documentToRecord (node->boundNode) before I call transformHierarchyToFlat and it doesn’t throw the exception now, but the IDocList is still empty.

You should map IDATA DocumentReference(ORDERS05) to boundNode and confirmsto(specify fully qualified name) to the transformHierarchyToFlat service.

What inputs are you giving to this service?? Did you checked if IDOC hierarchy structure is accordingly?

HTH,
RMG

I created a Record Reference ORDER(orders05) (it is written in small letters, because ORDERS05 is already in use in that node) and removed the recordTo… record stuff.
Then I directly map this reference to the record boundNode which is the only input of transformHierarchyToFlat in the next step. The IDocList is empty again.
How can I check if the IDoc hierarchy is accordingly? I created the IDoc by using the XSD Schema exported from SAP System.
It would be great when you tell me the service by name I have to use, because I’m not very experienced with wM.
Thanks,

Michael

Is your ORDERS05 structure starting IDOC tag is showing as record or recordlist??

If not change the IDOC tag to recordlist and then map it to transform service this should work and outputs control,data records.

HTH,
RMG

I inbound your package in my WM IS.
And modify the ORDER with the introduce of Bash. It generate correct IDOC list. I think you can add node ORDERS05 in boundNode first.

Robbie.

Big Thanks to you all :slight_smile:

I had changed the IDoc element to recordlist but also had to change this in the Input/Output of my service, what I hadn’t done. But now it works and I’m sending flawed IDocs, but I think that’s another problem in my data and not in the service :wink:

EDIT:
solved my new problem by using the right SNDPRN.

my service is still running, but i got some error messages from developer in the command line.

Developer 4.7 Build 999
000000  [B2BCORE.0076.0002] BinCoder decode error creating IDataCodable com.wm.p
kg.sap.idoc.BCSegment, using BasicDataCodable instead. Excpt:java.lang.ClassNotF
oundException: com.wm.pkg.sap.idoc.BCSegment
000024  [B2BCORE.0076.0002] BinCoder decode error creating IDataCodable com.wm.p
kg.sap.idoc.BCDocument, using BasicDataCodable instead. Excpt:java.lang.ClassNot
FoundException: com.wm.pkg.sap.idoc.BCDocument
000025  [B2BCORE.0076.0002] BinCoder decode error creating IDataCodable com.wm.p
kg.sap.idoc.BCDocumentList, using BasicDataCodable instead. Excpt:java.lang.Clas
sNotFoundException: com.wm.pkg.sap.idoc.BCDocumentList

It seems that some classes are missing, but what jar do I need and where can I get it? Or am I wrong and it is another problem?

EDIT:
These messages are not shown, when I start the service through the browser and not from developer.