cancel
Showing results for 
Search instead for 
Did you mean: 

Content Conversion......

Former Member
0 Kudos

I have a problem with content conversion.

In my scenario I have got my structure correct so that I can use receiver content conversion and it works. Now the second part to my scenario is to use variable substitution on the file name which also works.

Here is the problem… The field in the message that I use to take the value for the variable substitution from is not meant to seen in the end file.

How do I exclude this field? I have tried putting in its separate own node altogether and then not specifying that node in the conversion parameters but I get an error message about an unknown structure…

I have also tried adding the field to a trailer structure so that it is just one field in a bigger structure and again I get an error message.

My target structure could be….

Header

Name

Address

Header

Details

ID

Tel

Details

Trailer

Count

Recv

MetaData

Trailer

So how do I get it so that the metadata field is not present in my target file….

Message was edited by:

SAP XI

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos
Former Member
0 Kudos

Michal Im not sure I understand....

My MetaData field is mapped to a field in the source structure and uses the substring mapping funtion...

Are you saying I can do all of this a different way now?

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

of course you can

variable substitution is a thing of a past

use adapter specific attributes and set your filename in your MESSAGE MAPPING

this way there's no need to send unnecessary fields to the file adapter

Regards,

michal

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Yes, you can map set the filename Dynamically in your mapping program itself.

You do not need to use VariableNameSubsititution.

If you follow michal's blog or if you use the code template I have posted in my reply earlier, you will understand what needs to be done.

Regards

Bhavesh

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

Instead of using variable name substitution in your receiver file adapter, you can set the file name dynamically in your message mapping using a User Defined Function itself.

1. In your receiver file adapter, select Adapter Specific Identifiers --> FileName

2. Use this code in your Message Mapping to set the filename,

Assume DynamicFileName is the filename in to be used.

<i>//Assign the FileName here

String DyncamicFileName=;

DynamicConfiguration conf = (DynamicConfiguration) container

.getTransformationParameters()

.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create(

“http://sap.com/xi/XI/System/File”,

“FileName”);

conf.put(key, DynamicFileName);</i>

If you still want to use Variable Name Substitution, Sravya has discusses this exact requirement in this blog, take a look at it,

/people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12

Regards

Bhavesh

Former Member
0 Kudos

I have tried Sravya's way and I get the following error

'java.lang.Exception: Message processing failed in XML parser: 'java.lang.Exception: Column value '244' too long (>0 for 0. column) - must stop', probably configuration error in file adapter (XML parser error)'

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

you can easily set the filename in your mapping

and no need to use variable substitution for that

(you need to use adapter specific attirbutes)

/people/michal.krawczyk2/blog/2005/11/10/xi-the-same-filename-from-a-sender-to-a-receiver-file-adapter--sp14

this way it much better then variable substitution and it will

allow you not to send any not needed fields to the target message

Regards,

michal

-


<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>