sending multiple IDOCs to SAP

Hi Folks,

I’m new in webMethods, already made some services in several subjects but easier ones.

Now I have a problem which is real strange and I don’t know why it happens, maybe somebody already solved a kind of this problem:

What I needed is to split EDIFACT ORDERS msg to multiple IDOCs and there is no problem with this. After the splitting i have IDOC/ORDERS05/IDOC/IDOC[0] record and of course the others [1], [2], and so on.
After this step in the model we use we have the sendIDOC script which has been made by another person and only submitting one IDOC (waiting for IDOC/ORDERS05/IDOC) variable. Because of this i modified it to loop over the above mentioned IDOC list, map each one to a tempIDOC variable (which is the doc refrenece of ORDERS05 as the original one) and do the pub.sap.idoc:transformHierarchyToFlat and pub.sap.transport.ALE:OutboundProcess for every
IDOC.

The IDOC_CONTROL_REC_40 and IDOC_DATA_REC_40 seems okay and when I’m tracing the service
at the end I can find all IDOC correctly in our SAP, but when I use normal flow, putting EDIFACT
file into a directory and let it thorugh the system by using above mentioned way, at the end only
the first IDOC is 100% correct, the others has all necessary segments but only the E1EDP01 containes
data, the header ones not (e.g. E1EDK01, E1EDK14); they are there, but there is no data in.

At the beginning the pipeline is saved into file and I don’t understad this why it is good when I trace it step by step by restoring the pipeline values at the beginning and why the result not okay in SAP when it runs automatically from the model? (the model is calling the modified sendIDOC service)

Do somebody have almost similar issue already?

Any remark/idea would be highly appretiated! …because i’m near to go crazy! :frowning:

Bye!
Balazs (stinger)

This seems to me to be one of those typical Business Connector questions that are really hard to answer without seeing the flow services and data. All I can say is keep trying and eventually you will find a solution. If it is any consolation - going crazy with Business Connector is the normal reaction ! I have had many such problems some of which I manage to sort out without quite knowing why. :mad:

Is your IDOC segments E1EDK01, E1EDK14 etc… in the other idoc’s are in the right order? accordingly to ORDERS schema/doctype before you send to SAP?If the order mismatches in SAP the segments will not show up as expected.My 2 cents.

HTH,
RMG

Balazs,

It sounds like the header segment values are being dropped from the pipeline somewhere after the first doc is processed, but it doesn’t make sense that it would not happen in trace mode as well. One thing you may want to consider is leaving the sendIDOC service as it was originally written (send one IDOC at a time). You could modify your service which maps the EDIFACT msg to multiple orders so that it publishes one document per IDOC rather than a document list containing all the IDOCs.

This would eliminate the need to perform the looping in the sendIDOC service and may also make future monitoring a bit easier since each IDOC would be handled separately.

Hi Folks,

First of all: thanks the remarks you made so quickly!

Tillmanm,
Thanks your comment, you are right, first i thought also this one, but during trace for the second and further IDOCs the header segments was there also before posting it to SAP (also in the source IDOC document before i map it to a temp one and do the transformHierarchyToFlat). …this is real strange…

Also for the first time i left the original service (sendIDOC) and processed the whole document as one IDOC (whihc containing multiple records anyway, IDOC/ORDERS05/IDOC/IDOC[0], [1] and so on) , but in this case in SAP all IDOCs contained a lot of unnecessary segments - more than needed (i mean for exapmle a lot of E1EDKA14 segments which were empty).
But also i’m thinking maybe i need to choose this way to continue to develop/try instead of making my life even harder with tryings with this looping over the document list of idocs what i’m creating at the end of mapping.

Thanks your comment RMG,
But yes, the segments are in the right order as i checked even in the document in WM and also in SAP after going in, just the segments are empty (except in the first idoc, because that one is correct)
I think i will follow/try tomorrow the way what Tillmanm advised and will come back with results.

Greetings 4 U All!

Balazs,

Since you are already looping through the EDIFACT ORDERS message, you should be able to publish one IDOC within the appropriate loop and eliminate the need to loop through an IDOC list entirely. For example, if you are generating one IDOC per EDIFACT ORDERS order number, publish the IDOC from within the loop where you are generating the E1EDK01 segment. Just create the EDI_DC40 segment once and map it to each IDOC you generate.

Mary

Hi Mary,

Thanks your comment, but actually i’m not publish the IDOC data, just leave it in the pipeline in mapping step (service) and the sendIDOC service (next step in model) will use the value from pipeline.
After the mapping step the correct values (also header segs with data) are in the pipeline and i know it sounds strange, but really when i’m doing trace with restoring back pipeline value and looping over the IDOC list and sending them all to SAP every IDOC has the correct data in. But when I let WM to pick EDIFACT file with our ftp service, submit it to TN and let it run through the system according the model, at the end in SAP only the first IDOC is correct, the rest also has all segs, but only the E1EDP01 contains data.
I’m still trying…
But eve I was thinking on not to split and put this way into SAP, but because of the way we do it in the flow i think it cannot be made without splitting it and get multiple IDOCs.
(because when first I put it into SAP it was one correct IDOC with multiple E1EDP01 segmens according to how many LIN I have got in EDIFACT file, but responsible colleagues told me it’s not okay, they want separate IDOCs per LIN)

Will come back with future results.

Balazs