cancel
Showing results for 
Search instead for 
Did you mean: 

Split input Message to several IDOCs Message

Former Member
0 Kudos

Hi together,

i'am a PI starter and I have a problem with the mapping. I customize a JDBC Scenario from DB2 Database to an IDOC Adpater. The Scenario works fine and I can see the IDOC Meassges in the ERP System.

so far so good.

Now i got more rows in the output Message from the DB2 database. Only the last one I see in the target System. Here is the example of the extract payload.

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

- <ns:PAKSTP.resultSet xmlns:ns="urn:sap.com:jdbcAdapter">

- <row>

<D1ERF>25</D1ERF>

<D2ERF>6</D2ERF>

<D3ERF>91</D3ERF>

<D4ERF>19</D4ERF>

<Z1ERF>13</Z1ERF>

<Z2ERF>39</Z2ERF>

<ERFUS>UMSTELLUNG</ERFUS>

<D1AEN>28</D1AEN>

<D2AEN>1</D2AEN>

<D3AEN>4</D3AEN>

<D4AEN>20</D4AEN>

<Z1AEN>11</Z1AEN>

<Z2AEN>7</Z2AEN>

<AENUS>MEIER</AENUS>

<STATU>N</STATU>

<GSBER>1</GSBER>

<PKKDN>1040253</PKKDN>

<PKANR>04</PKANR>

<PKNA1>DEBITOR1</PKNA1>

<PKNA2>CO. KG</PKNA2>

<PKNA3 />

<PKSTR>FISCHERWEG 10</PKSTR>

<PKPOF />

<PKLND>A</PKLND>

<PKPLZ>4063</PKPLZ>

<PKORT>HOERSCHING</PKORT>

<PKOID>102518</PKOID>

<PKKUS>F & B</PKKUS>

<PKTEL>07221/707-0</PKTEL>

<PKKTX />

<PKTTX />

<PKFAX>07221/73617</PKFAX>

<PKBBK>321</PKBBK>

<PKDIV>N</PKDIV>

<PKBRS>6000</PKBRS>

<PKSPS />

<PKBUN>64</PKBUN>

<PKBON>1</PKBON>

<PKSPZ>J</PKSPZ>

<PKBBN>0</PKBBN>

<PKBBS>0</PKBBS>

<PKKON />

<PKFIR>64</PKFIR>

<PKPVS>N</PKPVS>

<PKPVB>N</PKPVB>

<PKPVV>N</PKPVV>

<PKPVZ>N</PKPVZ>

<D1PKA>0</D1PKA>

<D2PKA>0</D2PKA>

<D3PKA>0</D3PKA>

<D4PKA>0</D4PKA>

<PKABZ>0</PKABZ>

<D1PKE>0</D1PKE>

<D2PKE>0</D2PKE>

<D3PKE>0</D3PKE>

<D4PKE>0</D4PKE>

<PKEMZ>0</PKEMZ>

<D1PKB>0</D1PKB>

<D2PKB>0</D2PKB>

<D3PKB>0</D3PKB>

<D4PKB>0</D4PKB>

<PKBUZ>0</PKBUZ>

<PKVKN>684</PKVKN>

<PKVGB>0</PKVGB>

<PKEKD>0</PKEKD>

</row>

- <row>

<D1ERF>25</D1ERF>

<D2ERF>6</D2ERF>

<D3ERF>91</D3ERF>

<D4ERF>19</D4ERF>

<Z1ERF>13</Z1ERF>

<Z2ERF>39</Z2ERF>

<ERFUS>UMSTELLUNG</ERFUS>

<D1AEN>11</D1AEN>

<D2AEN>9</D2AEN>

<D3AEN>3</D3AEN>

<D4AEN>20</D4AEN>

<Z1AEN>11</Z1AEN>

<Z2AEN>39</Z2AEN>

<AENUS>BRANCHE080</AENUS>

<STATU>J</STATU>

<GSBER>1</GSBER>

<PKKDN>1050002</PKKDN>

<PKANR>00</PKANR>

<PKNA1>Debitor2 GMBH</PKNA1>

<PKNA2 />

<PKNA3 />

<PKSTR>DRAIweg. 13</PKSTR>

<PKPOF />

<PKLND>D</PKLND>

<PKPLZ>77815</PKPLZ>

<PKORT>BUEHL</PKORT>

<PKOID>23223</PKOID>

<PKKUS>APHINA</PKKUS>

<PKTEL />

<PKKTX />

<PKTTX />

<PKFAX />

<PKBBK>80</PKBBK>

<PKDIV>N</PKDIV>

<PKBRS>9999</PKBRS>

<PKSPS />

<PKBUN>1050002</PKBUN>

<PKBON>1</PKBON>

<PKSPZ>J</PKSPZ>

<PKBBN>0</PKBBN>

<PKBBS>0</PKBBS>

<PKKON />

<PKFIR>1050002</PKFIR>

<PKPVS>N</PKPVS>

<PKPVB>N</PKPVB>

<PKPVV>N</PKPVV>

<PKPVZ>N</PKPVZ>

<D1PKA>0</D1PKA>

<D2PKA>0</D2PKA>

<D3PKA>0</D3PKA>

<D4PKA>0</D4PKA>

<PKABZ>0</PKABZ>

<D1PKE>0</D1PKE>

<D2PKE>0</D2PKE>

<D3PKE>0</D3PKE>

<D4PKE>0</D4PKE>

<PKEMZ>0</PKEMZ>

<D1PKB>0</D1PKB>

<D2PKB>0</D2PKB>

<D3PKB>0</D3PKB>

<D4PKB>0</D4PKB>

<PKBUZ>0</PKBUZ>

<PKVKN>417</PKVKN>

<PKVGB>0</PKVGB>

<PKEKD>0</PKEKD>

</row>

</ns:PAKSTP.resultSet>

The problem is, that I must say to the Message Mapping, that I want to create several IDOCs.

Thanks for qour help.

Wolfgang

Accepted Solutions (1)

Accepted Solutions (1)

Shabarish_Nair
Active Contributor
0 Kudos

this is what you need - /people/michal.krawczyk2/blog/2005/12/04/xi-idoc-bundling--the-trick-with-the-occurance-change

Former Member
0 Kudos

Hello Shabarish ,

i do these steps before, but which field must I map to to the structure(field) IDOC.

Thanks for your assistance.

Wolfgang

Former Member
0 Kudos

Hi

check the step 5 of the document in my above post

(the ex. is File to Idoc, but all steps are similar)

Regards

Vishnu

Former Member
0 Kudos

Hello Wolfgang,

you have to map the field row of the jdbc message. For every row an idoc message has to be created.

Regards.

Volker

Shabarish_Nair
Active Contributor
0 Kudos

>

> Hello Shabarish ,

>

> i do these steps before, but which field must I map to to the structure(field) IDOC.

>

>

> Thanks for your assistance.

> Wolfgang

find a field/node which will fit the log. This node / field should come as many times as you need the IDoc to be generated.

eg. in case in your if there is a node say employee and it repeats and it is based on this that you need the IDoc to be created then map that node to the IDoc node

As rightly pointed above it should be the row since its the JDBC poll and the data is found in each repeating row tag

Former Member
0 Kudos

HI Vishnu,

it is important that the input XML have the same occurence. My input XML the row has the occureence

0..... unbounded not 1....unboundend.

Thanks Wolfgang

Former Member
0 Kudos

if row does not contain any data how are you filling up the idoc ?

mapping row to idoc structure should solve this

Rajesh

Former Member
0 Kudos

HI together,

it is right that I get several row tags from the select.

But if i map the "field" row to the "field" idoc i get an red flag in the XML Monitor.

I Get following error message:

Runtime exception occurred during application

mapping com/sap/xi/tf/_MM_DEBITOR_;

com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot create target element

/DEBMAS06/IDOC[2]/E1KNA1M. Values missing in queue context. Target~

Wolfgang

Shabarish_Nair
Active Contributor
0 Kudos

>

> Runtime exception occurred during application

> mapping com/sap/xi/tf/_MM_DEBITOR_;

> com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot create target element

> /DEBMAS06/IDOC[2]/E1KNA1M. Values missing in queue context. Target~

>

>

> Wolfgang

note that mapping the IDoc tag only will not be sufficient. You need to map the below tags of the IDoc will required values from the source. When you map a field you should also take care of mapping its node.

Former Member
0 Kudos

addition to that..

this error is related to missing of field in source for the target field check the mapping for tht field

if source field is missing in this case and target occ is 1 then do a check before mapping (something like if sourcefield of row exits ... then map to target field of idoc else someconstant to target)

Rajesh

Edited by: Rajesh on Mar 18, 2009 8:49 PM

Former Member
0 Kudos

Hi,

your are very fast I can't test and replay in your speed

.....

Okay, I mapped only tree fields. Here is the payload if i use only one dataset it is running.

- <DEBMAS06>

- <IDOC BEGIN="1">

- <E1KNA1M SEGMENT="1">

<KUNNR>1040253</KUNNR>

</E1KNA1M>

</IDOC>

</DEBMAS06>

Wolfgang

Former Member
0 Kudos

it looks like your PKKDN field of source(if i am correct) is missing as a result not able to produce the target E1KANM .

check that particular row recordset and check the data there..

take your own time now )

Rajesh

Former Member
0 Kudos

It is right that i mapped the field pkkdn to the field kunnr. But If you have a look to my first text, the structure field pkkdn is filled, in both row tags.

Former Member
0 Kudos

if you have mapped something inb/n src n target then right click on that and chk the queue what is having ..

before this test your mapping from test tab by coping the payload from sxmb

-moni and check the queue..

Rajesh

Former Member
0 Kudos

here is the Queue of the field PKKDN

<null> dark grey

[1040253]white

[1040253]grey

[1050002]white

[1050002]dark grey

here is the Queue of the field IDOC

[]white

[]white

[]dark grey

Former Member
0 Kudos

Hello Together,

must I create a context change in the field IDOC ?

Thanks

Wolfgang

Shabarish_Nair
Active Contributor
0 Kudos

>

> Hello Together,

>

> must I create a context change in the field IDOC ?

>

> Thanks

> Wolfgang

play around with the context changes. Context changes are something tough to explain in written words

But ideally in your case since IDoc is the root node you can map it after changing the context to the highest node.

Former Member
0 Kudos

Not in idoc in source..

Rajesh

Former Member
0 Kudos

sorry together,

I don't understand what do you think.

Can you give me a step by step explanation how to get a running scenrio ?

Thanks

Wolfgang

Former Member
0 Kudos

Hi together,

I will inform you, that the scenario is running now, today !

I don't change my scenario from last week. And now it is running. ?????

Thanks for all for your assistence

Wolfgang

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi

In future, search SDN for answers, many docs are available.

check this

https://www.sdn.sap.com/irj/scn/wiki?path=/display/xi/file%252bto%252bmultiple%252bidoc%252bsplittin...

Regards

Vishnu