cancel
Showing results for 
Search instead for 
Did you mean: 

Veriable substitution issue in multimapping

sandip_hole
Participant
0 Kudos

Hi Experts,

I am working on the requirement where i need to create multiple flat files using multimapping for this. I am working on SAP PI 7.31 SP07, using SFTP adapter and messagetransformbean to create flat files.

I am going for the variable substitution option as i want file name should be dynamic.(considering limitation of ASMA and dynamic configuration in
multimapping)

Getting the error "The variable substitution cannot be parse the message xml: Content is not allowed in prolog"

Variable name- var1 reference- payload:NotificationAttachments,1,DocumentDetails,1,IncidentNumber,1

Output struture-

NotificationAttachments(1)

     ->DocumentDetails(0-n)

               ->IncidentNumber(1)

               ->DocNumber(1)

               ->DocDescription(1)

               ->Path(1)

Please note one file can have multiple DocumentDetails.

When i use reference for header data i.e. message:interface_name this works fine, but i want ot use IncidentNumber in file name from the payload.

Can some one tell me is there something wrong on configuration, or there is some limitation here.

Appreciate quick help.

Thanks,

Sandip

Accepted Solutions (0)

Answers (3)

Answers (3)

sandip_hole
Participant
0 Kudos

Hello All,

It works perfectly when i remove MessageTransformBean and write .xml file.

this means xpath is correct. I suspect bug here,

Please let me know your thoughts....?

Regards,

Sandip

iaki_vila
Active Contributor
0 Kudos

Hi Sandip,

How are you accessing to the first occurrence of incident number?

Have you checked this example: ?

Regards.

sandip_hole
Participant
0 Kudos

I suppose payload:NotificationAttachments,1,DocumentDetails,1,IncidentNumber,1

should take first occurance of Incidennumber.

I have checked the blog and it can be achived by adding one more redundent structure, just by fooling adapter not to write this redundent data in file.

But again this quention remains unanswered.

Thanks,

Sandip

sandip_hole
Participant
0 Kudos

Hi Inaki,

Even i tried the the workarround explained in

Variable substitution in case of non-XML target files in a multi-mapping scenario

There also i am getting the same error "The variable substitution cannot be parse the message xml: Content is not allowed in prolog"

Regards,

Sandip

ankit_srivastava3
Participant
0 Kudos

Hello Sandip,

Please check the XML that is generated after mapping and which is used for the message transformation to a text.

Now in that XML check for

1. Any extra whitespace or any other character like "-" before start of the xml content.

Regards,

Ankit

ankit_srivastava3
Participant
0 Kudos

Also, please have a look at the comment section on by Stefan Grube.

Former Member
0 Kudos

can u try adding one more extra field in your target structure at header level in the mapping and later suppress it in the receiver file adapter during creation

sandip_hole
Participant
0 Kudos

just to add more details of the scenario.

A message from ECC has multiple incident details and each incident can have multiple attachment details. So i am using two opration mappings (2 receiver interfaces). One OM creates file of all the incident details, second OM is used to create file for attachement details per incident (hence the multimapping)

Former Member
0 Kudos

Hello,

May be u can check ur xpath? BTW, few days back i have seen a similar thread hope it's not somekind of bug (will cross check the same once i reach office)

Thanks

Amit Srivastava

gagandeep_batra
Active Contributor
0 Kudos

Hi Sandip:

Did you try without messagetransformbean

Regards

GB

sandip_hole
Participant
0 Kudos

No, I have not tried without MTB, since i need a flat file at target

Thanks,

Sandip

sandip_hole
Participant
0 Kudos

Hi Amit,

Did you got a chance to cross check this?

Thanks,

Sandip