cancel
Showing results for 
Search instead for 
Did you mean: 

How to ignore some fields on Receiver File?

Former Member
0 Kudos

Hi folks,

I have this inbound structure example:

<?xml version="1.0" encoding="UTF-8"?>
<ns0:MT_ObrasAdjud_Out xmlns:ns0="http://pt.edp/r3/obrasadjudicadas">
  <codforn>123543</codforn>
  <numdoc>000003</numdoc>
  <tipodoc>CAO</tipodoc>
  <encoding_scheme>UTF-8</encoding_scheme>
  <filetype>pdf</filetype>
  <filedata>01010101001001</filedata>
</ns0:MT_ObrasAdjud_Out>

Using File Conversion with my Receiver File Adapter I want to convert this xml file to a flat file, but only using the element <b><filedata></b> and ignore the others. However, I also need the others elements to use as variable substitution.

Anybody knows how to do it?

Thanks in Advance,

Ricardo.

Accepted Solutions (1)

Accepted Solutions (1)

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

>>>>Anybody knows how to do it?

stop using variable substitution and create the filename inside your mapping -

adapter specific attributes

(much easier and you can have a real structure as a target...)

it's that easy

Regards,

michal

Former Member
0 Kudos

Hi Michal,

Thanks for the advice!

Using adapter specific attributes I can use the elements of source message to do it? If so, I can do a map excluding all the others elements for target message, my target message will be one element <filedata>.

But using variable substitution, I can’t ignore those fields with file conversion?

Thanks again,

Ricardo.

MichalKrawczyk
Active Contributor
0 Kudos

Hi Ricardo,

>>>>Using adapter specific attributes I can use the elements of source message to do it?

or course!!! that's the idea and you do it all in message mapping

(very small advanced function as shown in many blogs)

>>>>But using variable substitution, I can’t ignore those fields with file conversion?

don't know I stopped working with variable substitution

as soon as I learned about adapter specific attributes

as they are sooo much better

>>>>I can do a map excluding all the others elements for target message, my target message will be one element <filedata>.

that's the main idea

Regards,

michal

Former Member
0 Kudos

Ricardo,

Not sure about ur requirement. But if you dont want the file name then what for you are using variable substitution.

Anyway you can do onething. You prepare your target structure such that first column is your data. Then this followed by other elements. Then in file content conversion give only the first column. Also specify the parameter

NameA.absoluteRowWidth=<noOfColumns>

If the separators do not contain any line breaks, the text document is generated as a single line of text. To restrict the width of the text, use this parameter. <noOfColumns> represents the maximum number of columns in this case. This parameter also functions together with the specification of a line break for xml.endSeparator.

This value requires NameA.addHeaderLine=0 to be specified.

Then you can have your data and variable substitution also.

---Satish

Former Member
0 Kudos

Hi Satish

Following your suggestion, I have the "filedata" as my first column. In the file conversion using the parameter filedata.absoluteRowWidth=<noOfColumns> I get an error in adapter monitor "Invalid 'absoluteRowWidth' value '' found". Without this parameter I still get the other elements into my file

Flat file -> <b>01010001110000010000011</b>,000003,CAO,UTF-8,pdf,20070209,123543

I only want the value on bold. Do I did something wrong?

Regards,

Ricardo.

Answers (3)

Answers (3)

Former Member
0 Kudos

HI,

You can always specify fieldFixedLengths of zero for the fields you do not want to appear on the file and specify a fixedLengthTooShortHandling value of cut so you do not get an error, or have I mis-understood your problem?

Former Member
0 Kudos

Hi,

I had the same problem and i sort it out in doing that:

<?xml version="1.0" encoding="UTF-8"?>

<ns0:MT_ObrasAdjud_Out xmlns:ns0="http://pt.edp/r3/obrasadjudicadas">

<b> <config> </b>

<codforn>123543</codforn>

<numdoc>000003</numdoc>

<tipodoc>CAO</tipodoc>

<encoding_scheme>UTF-8</encoding_scheme>

<filetype>pdf</filetype>

<b> </config>

<data></b>

<filedata>01010101001001</filedata>

<b></data></b>

</ns0:MT_ObrasAdjud_Out>

Creating two more nodes as in the example, you will be able to write the flat file just with the filedata field.

Then, in the content conversion parameters you only have to write the data.

cheers

Former Member
0 Kudos

Hi Eduardo,

In recordset name I have only the name of the structure that I want = Data and the parameter Data.fieldSeparator = , because is mandatory.

I still getting both structures!

123543,000003,CAO,UTF-8,pdf,20070209

<b>01010101001000000000000000000000000000110101010101</b>

How can specify one of them to be writen?

Regards,

Ricardo.

Former Member
0 Kudos

did you active your mapping and file adpter after changes in mapping map only one field and disable all other fields.

Thanks

Sreeram.G.Reddy

Former Member
0 Kudos

All the objects are activated.

I don't want disable those fields because I need them for variable substitution!

I just want write a substructure <Data> and Not <Config>.

Regards,

Ricardo.

Former Member
0 Kudos

you create two structures in Mapping one with only field and other one remaining fields .

in RecordSet Structure use only one field Structure this should slove ur problem.

Thanks

Sreeram.G.Reddy

Former Member
0 Kudos

If you read my earlier post you will see that it is what I did

Former Member
0 Kudos

can you send me the screen shot because both structure should be at same level.

Former Member
0 Kudos

Of course, what is your e-mail address?

Former Member
0 Kudos

sreeram.g.reddy@gmail.com send your mapping screen shot and file adpter screen shot

Former Member
0 Kudos

Hi folks

Thank you for all your great ideas!

The issue was fixed using adapter specific attributes, thanks Michal

But if anybody nows how to ignore specific fields during file conversion, please tell me.

Once again, thanks a lot

Ricardo.

Former Member
0 Kudos

I reopen the thread trying to get the answer about how can I ignore fields on receiver file adapter.

MichalKrawczyk
Active Contributor
0 Kudos

Hi,

why not try my idea and map to the target file only the fileds that you need?

Regards,

michal

Former Member
0 Kudos

please dont specify those fields which you dont want in file adapter. specify only those required.