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”.
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,
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.
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
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.
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,
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.
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
EDIT:
solved my new problem by using the right SNDPRN.