Receive an SAP iDoc as flat file via FTP

I want to reveice an SAP iDoc as flat file via an FTP port of the integration server, convert it in an appropriate way and invoke the service “InboundProcess” to send it to the SAP R/3 system.

Has anyone an idea, how this can be achieved? Any advice is greatly appreciated.

Thanks.
Andreas Vollmer

I created a service with input parameter
edidata (String)
Then I call the service
pub.sap.idoc:decodeString
Then
pub.sap.transport.ALE:InboundProcess

This works,

I have problems the other way around.
I want to receive an IDOC from SAP to BC, then convert it into Flat File Format (not the format encodeString) but the format SAP write IDOC to File Port.

Do you know how?

Juergen

Does anyone have an answer to Juergen’s question RE convert to FlatFile Format for SAP File Port: “RE: Receive an SAP iDoc as flat file via FTP
by: mussjue.14826 on: 14-May-2003 5:23 AM”

I find that utilising the following services in the exact order below does not convert it correctly. i.e. gives the internal segment names rather than the external segment names. In the case of PEXR2002 IDOC is segment names prefixed with ‘E1’ rather than ‘E2’
pub.sap.idoc.encodeSDATA
pub.sap.idoc.encodeString

I’m using 6.1. I think the same thing works in earlier versions, except the locations of the services may be in different folders within the SAP adapter folder. I use these services to convert SAP IDocs from a flat file to a document and to a flat file from a document. I got some of the info from WmUsers and the rest from support. This works for my implementations. All my IDoc document structions in webMethods are defined with the E1 prefix, not E2.

IDoc Flat File to Document Structure:
pub.sap.idoc:decodeString
pub.sap.idoc:decodeSDATA (this step converts the E2 to E1 if it isn’t already E1)
pub.sap.idoc:transformFlatToHierarchy

Document Structure to IDoc Flat File:
pub.sap.idoc:transformHierarchyToFlat
pub.sap.idoc:encodeSDATA
pub.sap.idoc:endodeString

Hope this helps,
Michelle

Thanks for your reply Michelle. Unfortunately it is the E2 (External segment names) that I want. I have tried a variety of ways to get a webMethods version of the IDOC back to a Flat File Format that a SAP File Port will accept. But it always produces E1 segment names. What step do you put in prior to pub.sap.idoc:transformHierarchyToFlat as something needs to map to the inboundNode? These are the steps I have taken and still get the same result:
A trigger is set up for the PEXR2002 IDOC being sent in from SAP then in the Flow service have:

pub.sap.idoc:decodeSDATA
pub.sap.idoc:transformFlatToHierarchy
pub.sap.idoc:transformHierarchyToFlat
pub.sap.idoc:encodeSDATA
pub.sap.idoc:endodeString

Any further input would be greatly appreciated.
Kind Regards,
Hugo

Was there a response to Hugo’s requirement of getting the E2?

Hugo, are you able to work around this issue and are you able to now produce E2 segment names instead of E1?

We are using wM 6.5, SAP Adapter 4.5, and are looking for E2 segment names. Please advice us on the same.

Thanks,
Shiv

Convert IDOC which you recieve from SAP into Hierarchy using service “pub.sap.idoctransformFlattoHierarchy” then precess document

I think by default the idoc coming into webMethod system is an Flatfile only.