Problem with documentToIdoc

Hi all,

I’m testing the SAP Adapter 6.5. We are going to do a conversion to wM7.
Now I’m trying to send an idoc to SAP in the following way:

  1. first I created a SAP document type using a certain idocType
  2. I complete this document with some test data
  3. I use pub.sap.idoc:documentToIdoc to convert the document to an iDocList
  4. I use the service pub.sap.transport.ALE:OutboundProcess to send the idoc

But in step 3 the service pub.sap.idoc:documentToIdoc the document is not converted to the iDocList. Because I can see that the returned iDocList is empty.
I don’t see any error in the logs.

I tried this with several document (created from an idoc), but the returned iDocList was always empty.

Can someone help me with this?

Thx

for Step 3: you can use the following service to convert document to IDOC. this is the way we implemented before invoking pub.sap.transport.ALE:OutboundProcess, thats work fine…

Service Namespace:
pub.sap.idoc:transformHierarchyToFlat


Hope this helps!

Thanks for your reply, arulchristhuraj!

I just found the problem. As I told I created a SAP document type from an idoc (f.e. ZPENV_DATA). The SAP document type looks like this:

ZPENV_DATA
IDOC (list)
@BEGIN
EDI_DC40

Z1PENV_PROD_IN

In the service pub.sap.idoc:documentToIdoc the input is a document. So I mapped ZPENV_DATA to document. But this wasn’t working (for both services pub.sap.idoc:documentToIdoc and pub.sap.idoc:transformHierarchyToFlat).
Mapping looked like this:
ZPENV_DATA ---------- document

But then I created under the input document a new document (f.e. doc) and I mapped ZPENV_DATA to that one. And both service work. So the mapping looks like this:
ZPENV_DATA -----_____ document
------doc
And doing it by this solves my problem. DocList is not empty anymore.

Thx

Arul,

BTW,starting from SAP Adapter6.5 the parsing service new name is…

pub.sap.idoc:documentToIdoc (SAPAdapter 6.5 new service)

a.k.a—
pub.sap.idoc:transformHierarchyToFlat (SAPAdapter 4.x service)

HTH,
RMG

Hi RMG,

Thanks for your valuable inputs!!

-Arul