cancel
Showing results for 
Search instead for 
Did you mean: 

xml file in dynamic file name in file receiver adapter

Former Member
0 Kudos

Hi,

I'm doing the dynamic file name in file receiver adapter. I have done as per instructed in /people/jayakrishnan.nair/blog/2005/06/20/dynamic-file-name-using-xi-30-sp12-part--i

All turned out okay. I have got the file name I require. Except that the file format is XML and I need to suppress the filename node occupied by the dynamic file name.

The content conversion mentioned in /people/sravya.talanki2/blog/2005/08/11/solution-to-the-problem-encountered-using-variable-substitution-with-xi-sp12, does not seem to solve my problem. As it is only for file format other than the XML one, because we only do the content conversion if we want to "convert" the format of the content from XML to the other format.

Does anybody have the solution to my problem? thanks in advance

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thank you Raj for the direction

The way to do it is :

1. In ID, advanced tab, put a check on the adapter-specific message attributes - file name.

2. Put a "*" on the file name scheme

3. In IR, create a UDF to set up target file name :

DynamicConfiguration conf = (DynamicConfiguration) container

.getTransformationParameters()

.get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create("http://sap.com/xi/XI/System/File","FileName");

// set up file name for receiver adapter

String SourceFileName = conf.get(key);

conf.put(key, TargetFileName);

return " ";

4. Map the above UDF to the header level of the target structure.

Regards,

Idi

Former Member
0 Kudos

>>I'm doing the dynamic file name in file receiver adapter. I have done as per instructed in

YOu don't need to do all that extra steps(mapping etc ) just to get the filename on receiver side.

you have 2 options:-

Variable substitution:Filename value is passed either in message header or body and used on the receiver file adapter ,you will see the value of filename in the payload.

Dynamic configuration:Filename value is passed as adapter specific message attribute,filename won't show up in the payload.

You can use dynamic configuration in your case.

Please search SDN for blogs regarding dynamic configurations.

Thanx

Aamir

Former Member
0 Kudos

Hi,

In the target structure, make the filename node as last node of the structure and In receiver comm channel,pass the below parameter in Content conversion.

<recdset>.fixedLengthTooShorthandling - Cut

Regards,

Srini

Former Member
0 Kudos

Hi,

In the content conversion of recr CC,pass below parameters.

<xxx>.fieldFixedLengths - 0

<xxx>.fixedLengthTooShortHandling - Cut

Regards,

Srini

Former Member
0 Kudos

Hi Srini,

I want the output file to be in XML format. So I don't want to do content conversion.

Anyway, I've tried putting :

<xxx>.addHeaderLine - 0

<xxx>.fieldFixedLengths - 0

<xxx>.fixedLengthTooShortHandling - Cut

And the error message came up for content conversion.

Please note that I want the output file to be in XML format, not some other format, and I want to suppress the filename field.

Thank you.

justin_santhanam
Active Contributor
0 Kudos

Idi,

While Populating Filename where you are actually mapping the value to? If you don't want the file name to be part of XML , then map to the root node of the target.

Is this what are u looking for?

raj.

Former Member
0 Kudos

this is the structure

<header>

<detail>detail content</detail>

</header>

<file>

<filename>filename.xml</filename>

<file>

After variable substitution, it would be easy to suppress the file node if the file format is not XML. That would be done in content conversion, but that is not the case.

justin_santhanam
Active Contributor
0 Kudos

Idi,

Is this is your source structure or target structure?

raj.

Former Member
0 Kudos

Above is the structure of the output file.

Anyway, I don't have a source file. I generate the dynamic file name before calling the abap proxy.

justin_santhanam
Active Contributor
0 Kudos

Idi,

>Anyway, I don't have a source file. I generate the dynamic file name before calling the abap proxy.

I'm extremely sorry. I couldn't able to get your scenario. If you don't mind, could you please explain your scenario. I will try to help you out!

raj,

Former Member
0 Kudos

I want to produce an xml file based on SAP data.

the structure :

<header>

<detail> </detail>

</header>

i put up,

<file>

<filename></filename>

</file>

for variable substitution to have dynamic file name in receiver adapter. this far all are okay. I'm able to have the file name required.

the problem is when i want to suppress the file node, because it is an xml file I will not be able to use content conversion.

Former Member
0 Kudos

Hi,

you will not be able to suppress the filename node without using content conversion and you will not use content conversion as you want output in XML format.

so the solution to your problem is do not create the filename node in target msg structure...............then create a UDF in which you will take DynamicConfiguration and you will set the FileName parameter to the desired filename you want and take the output of the UDF to the header node of the target msg which does not has a value for it.............then in ID in receiver file comm channel check the option of adapter-specific message attributes and in it check the filename option............then XI will take the output filename as you have dynamically created in UDF.

Regards,

Rajeev Gupta