cancel
Showing results for 
Search instead for 
Did you mean: 

SFTP File Content Conversion Error:The variable substitution can not parse the message xml: Content is not allowed in prolog.

Former Member
0 Kudos

Hi

My Scenario is IDOC to SFTP using File Content Conversion.

I have successfully configured the whole scenario and i am able to send FCC file to sftp directory.

But when implementing variable substitution i am facing following error


ERROR:


Transmitting the message to endpoint <local> using connection AFW failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: javax.resource.ResourceException: javax.resource.ResourceException: The variable substitution can not parse the message xml: Content is not allowed in prolog.


For Variable substitution i am taking two values from the payload one from the Header segment and one from the Indicator segment.

The target structure looks like below

<Record_Set>

      <Header>

              <IDOC_NO>000001234<IDOC_NO>  {variable used in variable substitution}

      </Header>

      <Data_Segment>

      </Data_Segment>

      <Trailer_Segment>

      </Trailer_Segment>

      <Indicator_Segment>

                <Indicator_No>1234<Indicator_No>  {variable used in variable substitution}

      <Indicator-Segment>

</Record_Set>

i have already implemented same using FTP adapter and it is working fine there but in SFTP it is giving above ERROR.

Please provide any suggestion for this .

Thanks,

Jatin Sharma

Accepted Solutions (1)

Accepted Solutions (1)

former_member186851
Active Contributor
0 Kudos

Hello Jatin,

Please check the spelling in VS.It is case sensitive.

Please post the VS parameters maintained in the channel.

Former Member
0 Kudos

Hi Raghuraman,

I have maintained the VS variables in Lower case.

for  IDOC_NO i have maintained variable as "idoc"  and for Indicator_No i have maintained as "id"

Answers (1)

Answers (1)

engswee
Active Contributor
0 Kudos

Hi Jatin

Can you confirm if you are using MessageTransformBean to perform FCC in the SFTP receiver channel?

If so, then variable substitution will not work. The error "Content is not allowed in prolog" you are getting is a common error whenever Java logic is trying to parse data that is expected to be in XML format. Variable substitution requires the payload in XML format, however it is no longer in XML format due to FCC transformation.

Rgds

Eng Swee

Former Member
0 Kudos

Hi Eng Swee Yeoh


Yes i am using MessageTransformBean in order to perform FCC in the SFTP receiver channel.


Is there any way around so that i can use the variables i have mentioned above in my "File Name" rather then VS.

Former Member
0 Kudos

You may have to use dynamic configuration in UDF. and assign the file names.

Combining three different aspects of PI in one shot - Process Integration - SCN Wiki

engswee
Active Contributor
0 Kudos

Hi Jatin

Since you are using MessageTransformBean for FCC, then VS is not an option for you.

You will need to use Dynamic Configuration and ASMA then. Construct the file name with a UDF in message mapping and save that into Dynamic Configuration, then set ASMA in the receiver channel. Since you are using SFTP adapter, make sure the namespace used in the UDF matches the namespace in the receiver channel. Refer to sample wiki of DC and ASMA below - note that that is using File adapter which has a different namespace

Dynamic file name and directory in Receiver File Adapter - summary of possibilities - Process Integr...

Rgds

Eng Swee

Former Member
0 Kudos

So as per the link usage of Bean is not mentioned in the module parameter .

Can this be achieved without using AF_Modules/DynamicConfigurationBean in the module tab?

Is it sufficient to just give file name as * in the receiver channel?

Regards

Advit