Problems looping over E1EDP02 when creating the RFFsegment for EDIINVOIC

Hi!

I’m using the EDI-module for Business Connector (4.0.1) and I’m having some problems when I should create the RFF+ON segment in the INVOIC.

When I create the RFF-segments I first loop over E1EDK02, and that works fine. Then I should get the buyers ordernumber in E1EDP02.
But this loop does not work and I can not find the problem.

See the attached picture for my flow.

Thanks!

Hi Rollo,

I can’t tell if you are restoring the complete Idoc structure from the pipeline, but if you are you should see that the E1EDP02 segment is a child of the E1EDP01 segment. So your first loop should read ‘/E1EDP01’ and the second loop you have disabled should be ‘/E1EDP01/E1EDP02’. Don’t forget to move the branch step under the second loop.

Regards,
Devan

Here in second case E1EDP02 is a record list, that is the reason you kept in loop. Once you enter into the loop EIEDP02 becomes a record. with in the record you have variable QUALF. Inorder to branch on QUALF you need to menction the Record Name with in that you need to menction the variable. That is the reason it worked out in first case and not in the second case. Keep E1EDP02/QUALF in the branch step, it will work.

Let me know, if you didn’t get.

Hi,

I do not know is this is still the case in BC 4.01 but there definitely were issues with looping in the 3.52. Loops would not work in many cases when there was only on element in the array. Is this you case for E1EDP02?
The ugly trick was to do a test like
BRANCH (evaluate labels to true)
…SEQUENCE E1EDP02[0]: it is an array
…|-Loop over the items and process them
…SEQUENCE E1EDP02: only one item
…|-Process the item
It is hard to say what was causing this - we discovered for instance that when you would do a documentToRecord with an invalid record reference for the “name” input, loops would fail…

hope this help

bruno

As Bruno pointed out, if there is only one item, it will not end up in the array and instead it will show up as a record. So all your loop statments will fail. But I know that the service that parses the incoming data to Idata like documentToRecord and the corresponding SAP adapter service like SAPFlattoHierarchy, you can specify the elements which you want to appear in a record list when you specify the schema. So even one item will occur as a record list.

Hi!
Thanks for your replies!
I’m sorry to say, it didn’t work!

When the loops are executed and the result is shown all segments down to E1EDP01, see the picture, are expanded and all are under IDOC_DATA_REC_40[xx].

The interesting thing is that the PIA-segments under LIN are working just fine and that info is from E1EDP19!

Hello Rollo,
As you get the IDOC from SAP, you need to convert to an hierarchial format using “TransformFlatToHierarchy”
(Package Name : SAP, pub.sap.IDOC:TransformFlatToHierarchy)
This service requires the IDOC format in the “conformsTo”. Download the DTD for the IDOC from SAP and upload the same as a record in BC.

Output is a RecordList of the IDOC.

One of the subrecordList would be E1EDP01, with E1EDP02 as a child to it.

Now you have to loop around the desired segments and use branch statements as and when you intend to check the values.

HTH. Post back, in case u have problems still

Hi again!

It almost works now!!
I forgot to map up E1EDP02 in the service where I mapp the EDI-message.

So now it almost works, I just lost RFF+DQ, but that feels like a small problem!

Thank you for all you help!

rollo