cancel
Showing results for 
Search instead for 
Did you mean: 

Problem to transform Flat file to Data Type Structurated and map to IDOC

Former Member
0 Kudos

Hi all,

I have a file to idoc scenario.

The information is like this:

1#!445#!AI12#!1#!20070214#!DVXXXXR#!201#!31GINHG876#!#!

2#!#!ETC

3#!000000000030008888#!#!3000#!#!10#!#!20070215

4#!dades45#!b#!c#!d#!e#!f#!g

5#!pos5

where 1, 2, ... = key segments for the file adapter and #! are the field separator.

this must go to a Data Type with substructures like this:

(xml)

.1

......2

.3

......4

......5

where 2 is inside 1 and 4-5 inside 3.

The reason of this is we can get unbounded replays of 3/4/5 for one header.

But XI reads the information like if all segments are headers.

.1

.2

.3

.4

.5

So the IDOC is bad created.

Where is the issue? At Message Mapping all substructures are mapped with his default and at TEST option it works fine.

Thanks in advance for your help.

best regards

Message was edited by:

Federico Martin

Message was edited by:

Federico Martin

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Federico,

Can u just post the conversion parameters u hv set in th comm. channel to do this.

Also, check the following link

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

Regards,

Akshay

Former Member
0 Kudos

Thanks for answer:

The recordset structure at CC Chanel its:

E1BPRKPFC,1,Z1MRES,1,E1BPRESBC,,Z1SOLRES,,Z1MRES02,*

Details:

E1BPRKPFC.fieldSeparator = #!

E1BPRKPFC.keyFieldValue = 1

E1BPRKPFC.fieldNames = SEGMENT,RES_NO,PLANT,COUNTER,RES_DATE,CREATED_BY,MOVE_TYPE,COST_CTR,MOVE_PLANT,MOVE_STLOC

E1BPRKPFC.endSeparator = 'nl'

E1BPRKPFC.ignoreRecordsetName = true

and like this for every segment of the recordset structure.

I had seen your link, but the problem it's that there are only header structures, i mean

1.

2.

3.

and i need:

1.

....2.

3

....4

where 2 it's inside 1 and 4 inside 3.

Thank you in advance,

fede

Former Member
0 Kudos

Hi Federico,

You can handle this using a workaround. Wht u can do is create a data type hich will hv E1BPRKPFC, Z1MRES, E1BPRESBC, Z1SOLRES, Z1MRES02 as headers. So, read the text file and using content conversion, create this sructure.

Now, create another data type which will hv the desired structure as req by u. Using XSLT mapping, u can transform the first structure to the desired one. Then u hv to transform this structure to the target structure in another mapping. You will hv only one interface mapping n which u will provide the two mappings sequentially in order. The second mappin can be a graphical mapping.

Regards,

Akshay

Former Member
0 Kudos

Hi,

thanks for answer.

Is impossible another solution? We can't believe that can't create DT with subestructures with "standard" options.

If not, how i must create the XSLT mapping? Is any guide for do it?

thanks in advance, best regards

Former Member
0 Kudos

Hi,

You can complete the second mapping graphically. I think there is no need to go for XSLT mapping and all.

What you need to do is to map a flat XML structure to nested XML structure. Take care of parent node mappings and its occurence.

Regards,

P.Venkat

Former Member
0 Kudos

thanks all for your interest.

Shabarish has explained it's impossible to do it, but i understand that P.Venkat says it can be with graphical mapping.

I attached the images of my message mapping and interface mapping, wich uses the first one, so you can see it.

Actually the Data Type has Hierachy level, but really it now work because File Adapter CC it's unable to create it. I need it because, if not, it's impossible to read a large text flat file with unbounded replays for the extended segments.

Please refer to:

<a href="http://img291.imageshack.us/img291/7073/designermappingrc8.jpg">Message Mapping Screenshot</a>

<a href="http://img249.imageshack.us/img249/694/interfacemappingtt6.jpg">Interface Mapping Screenshot</a>

Regards,

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi people,

Well i advanced a little more in this problem. I think the focus of the problem is another one now.

The error is when File Adapter must load the information to the Data Type; we need it structured because of the unbounded segments and it's impossible to read all files like header segments (the solution proposed for convert later to XSLT mapping).

I think with a parser module, for load the XML as exactly in the IDOC, will be a solution.

I am using the application ConversionAgent19 from SAP or another XML scheme editor.

Suggestion? Manuals? Blog?

Thanks a lot for your help and sorry the inconvenience.

pd: i understood xml structure can't be more than 2 hierachical level, but if you see my data type is not more than 2:

1.

....2

(2 is the higgest one)

Regards,

Former Member
0 Kudos

HI Federico,

Conversion Agent is a third party tolo from Item Field. It is basically used to convert EDI, Excel, PDF etc.. documents into XML format and makes simple to integrate in XI. This is generate a Adapter Module and you will use this in the adapters.

please look at blogs for conversion agent

Check out this

/people/paul.medaille/blog/2005/11/18/conversion-agent-a-free-lunch

Also - /people/william.li/blog/2006/03/17/how-to-get-started-using-conversion-agent-from-itemfield

http://help.sap.com/saphelp_nw04/helpdata/en/43/4c38c4cf105f85e10000000a1553f6/frameset.htm

/people/paul.medaille/blog/2005/11/17/more-on-the-sap-conversion-agent-by-itemfield

/people/alexander.bundschuh/blog/2006/03/14/integrate-sap-conversion-agent-by-itemfield-with-sap-xi

/people/paul.medaille/blog/2005/11/18/conversion-agent-a-free-lunch

/people/william.li/blog/2006/03/17/how-to-get-started-using-conversion-agent-from-itemfield

https://websmp102.sap-ag.de/~sapdownload/011000358700001090982006E/ConvAgentDocSP16.zip

https://websmp102.sap-ag.de/~sapdownload/011000358700004921152005E/ConversionAgent.pdf

please reward points

Regards

Sreeram.G.Reddy

Former Member
0 Kudos

Dear people,

according to license problems at client, it's impossible to get the convert agent.

so now we come back to try to solve with normal mapping.

the next step is try to convert it using 2 message mappings: dt (flat xml) to dt (structurated) and this one to the idoc.

i suppose it can be done adding program at interface mapping.

I created the no hiereachical Data Type for load the information and it's fine. But i am unable to get the first mapping OK, because XI has problems with unbounded segments.

If you agreed and has time, i copy here the information and his structure.

I receive (#! defines separation and key segment fields are 1,2,3,4,5):

1#!445#!AH02#!1#!20070214#!DVPOSTER#!201#!31GINHGIN0#!#!

2#!#!ETC

3#!000000000030008888#!#!3000#!#!10#!#!20070215

4#!dades45#!b#!c#!d#!e#!f#!g

3#!000000000030008888#!#!3000#!#!10#!#!20070215

3#!000000000030008888#!#!3000#!#!10#!#!20070215

4#!dades45#!b#!c#!d#!e#!f#!g

5#!pos5

5#!pos5

5#!pos5

The destination must be:

CHASE A

1 (1..1)

....2 (1..1)

3 (1..unbounded)

....4 (0..1)

3 (1..unbounded)

3 (1..unbounded)

....4 (0..1)

5 (1..unbounded)

5 (1..unbounded)

5 (1..unbounded)

CHASE B

Or, in another case with 5 as child of 3 (like example in last mail)

1#!445#!AH02#!1#!20070214#!DVPOSTER#!201#!31GINHGIN0#!#!

2#!#!ETC

3#!000000000030008888#!#!3000#!#!10#!#!20070215

4#!dades45#!b#!c#!d#!e#!f#!g

5#!pos5

3#!000000000030008888#!#!3000#!#!10#!#!20070215

5#!pos5

3#!000000000030008888#!#!3000#!#!10#!#!20070215

4#!dades45#!b#!c#!d#!e#!f#!g

5#!pos5

1 (1..1)

....2 (1..1)

3 (1..unbounded)

....4 (0..1)

....5 (1..unbounded)

3 (1..unbounded)

....5 (1..unbounded)

3 (1..unbounded)

....4 (0..1)

....5 (1..unbounded)

3 (1..unbounded)

....4 (0..1)

....5 (1..unbounded)

#########

Questions:

How i do for map Data Type (no hierachical) -to-> Data Type (hierachical) and Data Type (hierachical) -to-> IDOC? Is any loop or context object required?

Thank you in advance for your help and sorry the long thread.

Shabarish_Nair
Active Contributor
0 Kudos

Please note the content conversion has its limitations and one of them being that it cannot build complex structures with hierarchy !!

So

(xml)

.1

......2

.3

......4

......5

Is not possible with the file adapter.

You can read it as

(xml)

.1

.2

.3

.4

.5

and then use a logic in XSLT or maybe graphical mapping itself to create the structure.

prabhu_s2
Active Contributor
0 Kudos

hi

check if this thread is of use to you