Problem in Mapping EDI Segments to IDoc Segments

Hi all,
One of my requirement is to convert an EDI file to an Idoc. I have take to an Orders EDI file which is present in a FTP server and send it to SAP system as an DELIVRY Idoc.

I have used following services.Please tell me whether i am right in my approach or not.

First I used following services to read data from FTP server.

Logon
get
logout.
I could successfully read the file stored in FTP server using above services.

To convert the EDI file to Idoc i followed the steps below.

bytesToString
envelopeProcess
LOOP over ‘/UNEDI_HEADER/UNB’
(Map UNB segments to IDOc Header EDI_DC40). Till this place Mapping is Successful.

getTemplate
getEDIString
convertToValues

After using above services. Mapping is done from UNH segment to FTX segment(still some more segments are to be mapped). The problem is that i unable Map data from this segments to Idoc segments. I approached mapping in the following order.

Map( Map data of BGM segment to E1EDL20 segment)
LOOP over ‘/UNEDIORDERS/UNH/DTM’
Map( Map data of BGM segment to Idoc segment)
LOOP over ‘/UNEDIORDERS/UNH/FTX’
Map( Map data of FTX segment to Idoc segment)

The problem is that the values of variable in segment BGM,DTM and FTX are not being copied to Variables of Idoc. Giving Initial values to Idoc variables are being accepted in the Mapping statements(I mean initial values are displayed in output).I debugged the service, i could see that loops are processed and map statements are also getting executed, but output i meaning values are not copied( i am mapping proper variables which have data).

Could any one tell me what could the problem?
I am also attaching the file ORDERS of EDI format.
Please help.
Thanks in advance
MNR

Orders EDI File
EDI_850.txt (0.7 k)

Are you finding issues only for these segments BGM,DTM and FTX mapping to IDOC?

your comments:
I debugged the service, i could see that loops are processed and map statements are also getting executed, but output i meaning values are not copied( i am mapping proper variables which have data)

Please make sure again step thru each loop step whether segment mapping is occuring for each individual IDOC segment fields and see if any segment is messing up or could be related to your recordReference problem.

we cannot do assumption on your mapping style,your debug only should help you on this.

please reply us with ur final debug research.

HTH,
RMG

Narsimha,

I dont remember the structure of E1EDL20 segment on top of my head, so i am just assuming.if it is a document list, then in the properties of the LOOP over ‘/UNEDIORDERS/UNH/DTM’ step you have to specify the output array as E1EDL20.
try this out and let us know if it helped.

ramesh.

As ramesh said try in Loop step of InArray-UNEDIORDERS/UNH/DTM’ and OutArray-/E1EDL20 and you have to remap it again,test the same for other segments unless OutArray segments are recordlists.

HTH,
RMG

Sorry,Friends i could implement your suggestions as my business connector is down

Hi
Friends can anyone please look at the attached package once and tell me what could be the problem regarding mapping.The problem is same as mentioned in my first mail.

Please help.

Thanks in Advance
MNR

EDIToIDOC
EDI_850.zip (66.5 k)

I will try to load your package on my IS6.1,when ever i get time,but meanwhile please try to debug with the above sugesstions,see if that helps.

HTH,
RMG

Narsimha,

I’ve made some changes to the flow service.check out if it works.

ramesh.


68.5 K
EDI_850.zip
""

Narsimha,

I’ve made some changes to the flow service.check out if it works.

ramesh.


EDI_850.zip (68.5 k)

Hi Ramesh,
Thanks for the effort.
I didnot get the output. We cannot loop over UNH as it is not an array.
I have a single EDI850 document in my FTP file. In this case the output of convertToValues does not give an Array output for UNH. In case of Multiple EDI documents in a file we get a Array output for UNH when convertToValue flow service is used.

I tried by removing the loop over UNH. AND looping over BGM and FTX but even that didn’t work.

Incase of loop over FTX. which has three segments only last segment is added to IDOC (where actually three segments should be created).

I am still trying for output.

Thanks
MNR

MNR,

According to the flow service,it seems like UNH is an Array.Anyway see if you can save the pipeline after convertToValues and post the package again.

ramesh.

Hi All
As Suggested i used Out-Array element of a Loop for FTX segment of EDI to map a SAP Idoc segment.My FTX segment is an Array of size 3. Now i am using loop and gave the idoc segment in the out-array as /DELVRY/IDOC/E1EDL20/E1TXTH8/E1TXTP8 and my in-array is /EDI850/UNH/FTX

The output of the loop has 3 rows but not legible.
The output is something like this below
[Lcom.wm.data.IData;@3e67d7
[Lcom.wm.data.IData;@3e5ed
[Lcom.wm.data.IData;@6c397c

Is it correct output. Should i perform any other operations.

Did you step thru the loops and see if the data gets mapped to E1TXP8 segment?

Other alternative to solve your issue is create a temporary record rec_E1TXTP8(not recordlist) and then loop in-array is /EDI850/UNH/FTX inside the loop map the appropriate fields to rec_E1TXP8 and as last step in the loop appendToRecordList or appendToDocumentList service and map inputs fromItem(rec_E1TXP8)and for toList(Origial E1TXP8 recordlist) and ouput toList (original E1TXP8 reclist) then drop the fromItem,rec_E1TXP8.come out of loop you should see all the 3rows in E1TXP8 segment.

Please try this way it should work,similarly follow for other recordlist segments.

HTH,
RMG

MNR,

sending a sample of FTX segment mapping.follow the same procedure for other segments.

ramesh.


EDI_850.zip (69.1 k)

Hi All,
Thanks Ramesh.
Thanks RMG.

Mapping is being done successfully so far.I have used out-array of loops and Mapped to original document IDOC segments as suggested.
It worked.

To Send IDOC to SAP i am using flow service called postSAP. I am passing System name and Idoc to it as input . It is giving an error msg that empty Idoc is being sent. when debugged i found that the service
transformHierarchyToFlat is not generating Idoclist list successfully.

I tested transformHierarchyToFlat in a separate flow service. It is not generating Idoclist from the given Idoc.

When read about transformHierarchyToFlat in SAPBCAdapterGuide it says
Idoclist is Contains the IDoc(s) as object of the Java IDoc Class
Library.I suspect that some path setting were not done properly. Do we have to set any classpath for BC i am using SAP BC 4.7 version.