cancel
Showing results for 
Search instead for 
Did you mean: 

Content Conversion with Substructures

Former Member
0 Kudos

I'm very new at all of this, and I have a bit of a complex mapping. In an attempt to make it a little tidier, I made several substructures when I set up the data type.

For example, most of the lines start with a 'record id' made up of 4 fields. So I created a structure with those 4 fields, and then another structure with the rest of those fields, and then put both structures together to define the line.

I thought I was making things cleaner, but when I got to the file content conversion, I realized I'd just made a big mess.

Here is a somewhat simplified example of my structure, after it comes out of the mapping.

<EmployeeData01>

<RecordID>

<RecordType>01</RecordType>

<SSN>1234-56-7890</SSN>

<EmployeeID></EmployeeID>

</RecordID>

<Employee>

<FirstName>Mickey</FirstName>

<MiddleName>M</MiddleName><LastName>Mouse</LastName>

<Prefix>Sir</Prefix>

<Title>Jr</Title>

<Gender>M</Gender>

</Employee>

</EmployeeData01>

Originally I tried just using the employeedata01, and that gets me an error in the adapter monitor about the RecordID structure not being defined.

Then I tried not defining employeedata01 and instead defining RecordID and Employee. That works, sort of. But it puts the RecordID segment and the Employee Segment on seperate lines.

Is there a way to do this with the structure I have? I know I can solve it by going back and completely rewriting my structure, but I'd really rather not have to do that.

Thanks for any help at all.

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi vanda,

u wanno get the xml structure as a flat file in ur reciever file adapter.so in the conetnt conversion

in the recordset structure

mention the records u require

so in ur case it is

<b>employeedata01,recordid,employee</b>

mention the end seperator as 'nl' and if in case it is a fixed length file mention the fixed lengths of the fields and if variable length file then the seperator is ';'(semi colon)

Former Member
0 Kudos

Hi!

Did you solve your problem with the content conversion? I am facing a problem that is quite similar to yours and I just don't get it.

I found a blog, how to use an ABAP-Mapping for converting a nested structure to the requested flat format. But I would like to avoid such a mapping.

Former Member
0 Kudos

Hi Vanda,

I think the explanation given below if carefully followed can help you solve problems with content conversion.

While doing content conversion you have to mention the field names in header of data type: fieldNames. Hence if the key field is not present it will throw an error in adapter monitoring, FIELD NOT FOUND.

To make note mapping cannot be performed with a flat file as XI understands only XML. Hence content conversion required.

Please go thru these links for step by step procedure to do the same:

/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30

/people/sap.user72/blog/2005/01/06/how-to-process-csv-data-with-xi-file-adapter

/people/michal.krawczyk2/blog/2004/12/15/how-to-send-a-flat-file-with-fixed-lengths-to-xi-30-using-a-central-file-adapter

/people/anish.abraham2/blog/2005/06/08/content-conversion-patternrandom-content-in-input-file

http://help.sap.com/saphelp_erp2005/helpdata/en/2c/181077dd7d6b4ea6a8029b20bf7e55/content.htm

/people/venkat.donela/blog/2005/06/08/how-to-send-a-flat-file-with-various-field-lengths-and-variable-substructures-to-xi-30

I hope I have answered your query.

Regards,

Abhy

PS: AWARD POINTS FOR HELPFUL ANSWERS.

Former Member
0 Kudos

Abhy,

I am using content conversion already. I'm trying to figure out how to configure the content conversion.

Those blogs are not so useful, because they are all about sender adapters, and this is a receiver adapter.

The sender is ABAP Proxy, the receiver is a file adapter.

The mapping works fine, and maps the document in XML exactly how I want it mapped.

My problem is getting the file adapter configured properly to receive XML and write it out the way that I need it written.

Here are the things I've tried:

#1

Recordset Structure: EmployeeData01

Parameters:

EmployeeData01.fieldFixedLengths with all the individual field lengths for the whole record

Result: Error in the adapter monitor

Error: Message processing failed: Exception: Exception in XML Parser (format problem?):'java.lang.Exception: Message processing failed in XML parser: 'Conversion configuration error: Unknown structure 'RecordID' found in document', probably configuration error in file adapter (XML parser error)'

#2

Recordset Structure: Employee,RecordID

Parameters:

RecordID.fieldFixedLengths - with lengths for the record id fields

Employee.fieldFixedLengths - with lengths for the rest of the fields

Result: Mapping works, but prints out the record id section and the employee section on seperate lines, instead of one line

What I need to know is how to set up the file content conversion parameters in order to make the entire employeedata01 (recordid + employee) print out on one line

Does this help clarify my question?

Former Member
0 Kudos

Hi Vanda,

I did understand your problem now.So you want content conversion at the receiver end and that is basically to get the entire data in one line.For that please go through these links below.It clearly explains your requirement.

/people/arpit.seth/blog/2005/06/02/file-receiver-with-content-conversion

http://help.sap.com/saphelp_nw04/helpdata/en/d2/bab440c97f3716e10000000a155106/frameset.htm

Regards,

abhy

Former Member
0 Kudos

Abhy,

I've already read both of those. The blog does not help because it does not have any sort of nested structure, like my example does. Attempting to map like the blog is what gets me my second example above, where my data ends up printed out on two seperate lines.

I re-read the help file, just to be sure, but there is nothing additional in there that addresses this situation.

The complication here is because I have these substructures inside my main structure.

Here's a bigger snip of the structure:


<EmployeeData01>
	<RecordID>
		Fields
		.
		.

	</RecordID>
	<Employee>
		Fields
		.
		.
	</Employee>
</EmployeeData01>
<AddressData02>
	<RecordID>
		Fields
		.
		.
	</RecordID>
	<Address>
		Fields
		.
		.
	</Address>
</AddressData02>

Neither the help, or the example in the blog has a structure like that, with two seperate substructures inside each line item. That's where I am having the problem.

Message was edited by: Vanda Bushfield

Former Member
0 Kudos

Hi Vanda,

I did go through the blog and i found this line which say "The ‘endSeparator’ parameter needs to given for substructure only. For eg: it may be a ‘nl’ (new line)"

Even in the help file i did see something about substructures. So just go through the links again carefully and see if you can solve your problem.

Regards,

abhy

Former Member
0 Kudos

I saw the line about the endseperator parameter, but I don't WANT a new line. It's giving me a new line without that paremeter in there. Do you have any knowledge of how I can configure that parameter to make it not give me a new line? That would be helpful.

The help file does have the word 'substructure' in it, but it's not using it the same way here. It's referring to things like my employeedata01 and my addressdata02 as substructures. If you look at it that way, what I need to figure out is how to deal with sub-sub-structures.

If you think there is something in here that applies to my case, can you help me understand how? Because I just don't see it.

Or if you know how the endseperator works in more detail, that would be helpful as well, but what's in that blog and helpfile aren't enough to help me.

I tried putting in a # for an end seperator, just to see what would happen, and it didn't seem to have any affect at all. But even if it did, I don't want a character there, I just want it to not line break.

Former Member
0 Kudos

Hi

Maybe you should change context to EmployeeData01. and afterwards map each element directly.

regards

wojtek

Former Member
0 Kudos

I'm sorry, I'm not sure I understand your answer.

What do you mean by 'change context'?

I already tried setting up EmployeeData01 as a structure in the adapter, if that's what you meant. It didn't work.

bhavesh_kantilal
Active Contributor
0 Kudos

Hi,

We can help you out if you give us the format of your source file and also the format in which you want your source structure to be.

Regards,

bhavesh

Former Member
0 Kudos

Here is a trimmed down piece from the source.

<Employee>

<PerID>1234-56-7890</PerID>

<Vorna>Mickey</Vorna>

<Inits>M</Inits>

<Nachn>Mouse</Nachn>

<Anred>Sir</Anred>

<Namzu>Jr</Namzu>

<Gesch>M</Gesch>

</Employee>

All I want for the format is all the data for the employee on one line. I'm writing out a fixed width file.

Former Member
0 Kudos

Are you using file adapter?

If yes You can only do simple mapping.

If your are using as a result only something like that:

<employee></employee>. So maybe make concatenate but it's stupid.

regards

wojtek

Former Member
0 Kudos

I am using an ABAP Proxy as input, and a file adapter as output.

There is alot going on in the mapping, I just gave you guys a very small piece of it.

There are 4 other types of line items coming out as well, besides the address and a ton of fields in each one. Each of the different types of line items starts with the 'recordid' structure, and then has a second structure like the 'employee' structure in this example with the rest of the data in it.