cancel
Showing results for 
Search instead for 
Did you mean: 

Empty elements when spliting flat file into several XML messages

Former Member
0 Kudos

REDEFINITION OF PROBLEM AND RESOLUTION

I have a plain text tab separated input like this:

Fecha_Pedido Nro_Pedido Nro_Factura Fecha_Factura Cod_Barra Descripcion Cant_Pedida Cant_Facturada Diferencia Nro_Lote Fecha_Vencimiento Nro_Orden Precio Porcentaje_Descuento Cantidad / Bonif

03/09/2007 29848 A-0001-00909725 05/09/2007 7795306502503 RITALINA LA 20 MG. X 30 CAPSULAS 60 60 0 F0006 29/08/2008 57955 115,3 1,06 0

03/09/2007 29848 A-0001-00909725 05/09/2007 7795306502510 RITALINA LA 30 MG. X 30 30 30 0 F4074 30/09/2008 57955 128,18 1,06 0

03/09/2007 29853 A-0001-00909728 05/09/2007 7795383000824 LAPENAX 25 MG X 100 COMP. 20 20 0 336391 29/04/2008 57956 88,64 1,06 0

03/09/2007 29853 A-0001-00909728 05/09/2007 7795383000848 LAPENAX 100 MG X 30 COMP. 20 20 0 349732 31/05/2009 57956 88,64 1,06 0

06/09/2007 86408 A-0001-00910976 10/09/2007 7795306193213 REGITINA LIAM 10MG. 1ML. 1X1 AR 20 20 0 S0038B 30/03/2011 94305 21,94 1,06 0

06/09/2007 86408 A-0001-00910976 10/09/2007 7795383000060 CALCITONINA 100UI 5 AMP. X 1 5 5 0 S0020 29/03/2010 94305 84,92 1,06 0

There are one header line and six lines of data.

By means of a content conversion, an xml is generated, wich is passed to a multimapping message mapping (MM) at Enhanced Interface Determination (ID)level.

Splitting is made by means of generate a new context for every change in "Nro_Factura" (Invoice number in spanish).

Resulting message is:

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

<ns1:Z_CA_CREA_FACTELECPROVEEDOR xmlns:ns1="urn:sap-com:document:sap:rfc:functions">

<XIFECHA>2007-10-05</XIFECHA>

<XIHORA>13:32:33</XIHORA>

<ZMM_FACTE_DETAIL />

<ZMM_FACTE_HEADER>

<item>

<EBELN />

<XBLNR />

<AEDAT>2007-10-05</AEDAT>

</item>

</ZMM_FACTE_HEADER>

</ns1:Z_CA_CREA_FACTELECPROVEEDOR>

Only one message of three are displayed!

Furthermore, most of the elements appear empty!

Switching ID from enhanced to standard, missing elements suddenly appears, but message is not splitted as you can see below:

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

<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">

<ns0:Message1>

<ns1:Z_CA_CREA_FACTELECPROVEEDOR xmlns:ns1="urn:sap-com:document:sap:rfc:functions">

<FECHAARCH>2007-09-26</FECHAARCH>

<FILENAME>FAC REMITO FARMANET MAM 3X2.TXT</FILENAME>

<HORAARCH>16:45:27</HORAARCH>

<PATH>
DESAR\FILES\PROVEEDORES\0000100046\INPUT</PATH>

<XIFECHA>2007-10-02</XIFECHA>

<XIHORA>14:45:36</XIHORA>

<ZMM_FACTE_DETAIL>

<item>

<EBELN>4500029848</EBELN>

<XBLNR>0001A00909725</XBLNR>

<POSNR>1</POSNR>

<EAN11>7795306502503</EAN11>

<MENGE>60</MENGE>

</item>

<item>

<EBELN>4500029848</EBELN>

<XBLNR>0001A00909725</XBLNR>

<POSNR>2</POSNR>

<EAN11>7795306502510</EAN11>

<MENGE>30</MENGE>

</item>

</ZMM_FACTE_DETAIL>

<ZMM_FACTE_HEADER>

<item>

<LIFNR>0000100046</LIFNR>

<EBELN>4500029848</EBELN>

<XBLNR>0001A00909725</XBLNR>

<AEDAT>2007-10-02</AEDAT>

</item>

</ZMM_FACTE_HEADER>

</ns1:Z_CA_CREA_FACTELECPROVEEDOR>

<ns1:Z_CA_CREA_FACTELECPROVEEDOR xmlns:ns1="urn:sap-com:document:sap:rfc:functions">

<FECHAARCH>2007-09-26</FECHAARCH>

<FILENAME>FAC REMITO FARMANET MAM 3X2.TXT</FILENAME>

<HORAARCH>16:45:27</HORAARCH>

<PATH>
DESAR\FILES\PROVEEDORES\0000100046\INPUT</PATH>

<XIFECHA>2007-10-02</XIFECHA>

<XIHORA>14:45:36</XIHORA>

<ZMM_FACTE_DETAIL>

<item>

<EBELN>4500029853</EBELN>

<XBLNR>0001A00909728</XBLNR>

<POSNR>3</POSNR>

<EAN11>7795383000824</EAN11>

<MENGE>20</MENGE>

</item>

<item>

<EBELN>4500029853</EBELN>

<XBLNR>0001A00909728</XBLNR>

<POSNR>4</POSNR>

<EAN11>7795383000848</EAN11>

<MENGE>20</MENGE>

</item>

</ZMM_FACTE_DETAIL>

<ZMM_FACTE_HEADER>

<item>

<LIFNR>0000100046</LIFNR>

<EBELN>4500029853</EBELN>

<XBLNR>0001A00909728</XBLNR>

<AEDAT>2007-10-02</AEDAT>

</item>

</ZMM_FACTE_HEADER>

</ns1:Z_CA_CREA_FACTELECPROVEEDOR>

<ns1:Z_CA_CREA_FACTELECPROVEEDOR xmlns:ns1="urn:sap-com:document:sap:rfc:functions">

<FECHAARCH>2007-09-26</FECHAARCH>

<FILENAME>FAC REMITO FARMANET MAM 3X2.TXT</FILENAME>

<HORAARCH>16:45:27</HORAARCH>

<PATH>
DESAR\FILES\PROVEEDORES\0000100046\INPUT</PATH>

<XIFECHA>2007-10-02</XIFECHA>

<XIHORA>14:45:36</XIHORA>

<ZMM_FACTE_DETAIL>

<item>

<EBELN>4500086408</EBELN>

<XBLNR>0001A00910976</XBLNR>

<POSNR>5</POSNR>

<EAN11>7795306193213</EAN11>

<MENGE>20</MENGE>

</item>

<item>

<EBELN>4500086408</EBELN>

<XBLNR>0001A00910976</XBLNR>

<POSNR>6</POSNR>

<EAN11>7795383000060</EAN11>

<MENGE>5</MENGE>

</item>

</ZMM_FACTE_DETAIL>

<ZMM_FACTE_HEADER>

<item>

<LIFNR>0000100046</LIFNR>

<EBELN>4500086408</EBELN>

<XBLNR>0001A00910976</XBLNR>

<AEDAT>2007-10-02</AEDAT>

</item>

</ZMM_FACTE_HEADER>

</ns1:Z_CA_CREA_FACTELECPROVEEDOR>

</ns0:Message1>

</ns0:Messages>

The problem is as follows.

Content conversion genrates the following messages struture:

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

<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">

<ns0:Message1>

<MT_Farmanet>

<Farmanet_Posicion>

<Fecha_Pedido>03/09/2007</Fecha_Pedido>

<Nro_Pedido>29848</Nro_Pedido>

<Nro_Factura>A-0001-00909725</Nro_Factura>

<Fecha_Factura>05/09/2007</Fecha_Factura>

<Cod_Barra>7795306502503</Cod_Barra>

<Descripcion>RITALINA LA 20 MG. X 30 CAPSULAS</Descripcion>

<Cant_Pedida>60</Cant_Pedida>

<Cant_Facturada>60</Cant_Facturada>

<Diferencia>0</Diferencia>

<Nro_Lote>F0006</Nro_Lote>

<Fecha_Vencimiento>29/08/2008</Fecha_Vencimiento>

<Nro_Orden>57955</Nro_Orden>

<Precio>115,3</Precio>

<Porcentaje_Descuento>1,06</Porcentaje_Descuento>

<Cantidad_Bonif>0</Cantidad_Bonif>

</Farmanet_Posicion>

<Farmanet_Posicion>

. . .

<Nro_Factura>A-0001-00909725</Nro_Factura>

. . .

</Farmanet_Posicion>

<Farmanet_Posicion>

. . .

<Nro_Factura>A-0001-00909728</Nro_Factura>

. . .

</Farmanet_Posicion>

<Farmanet_Posicion>

. . .

<Nro_Factura>A-0001-00909728</Nro_Factura>

. . .

</Farmanet_Posicion>

<Farmanet_Posicion>

. . .

<Nro_Factura>A-0001-00910976</Nro_Factura>

. . .

</Farmanet_Posicion>

<Farmanet_Posicion>

. . .

<Nro_Factura>A-0001-00910976</Nro_Factura>

. . .

</Farmanet_Posicion>

</ns0:Message1>

</ns0:Messages>

Thas a mistake. Messages and Message1 levels are generated automatically when you define an occurrence 0..undounded at MM.

This is done also at run time.

Therefore you must define a content conversion from "MT_Farmanet" ahead.

Messages and Messagge1 levels are generated dinamically in order make multimapping to work.

Multimapping must be used from within Enhanced ID.

Receiver agreement can remains Standard.

Output must be passed to adapters by means of a receiver agreement.

They can not be passed to BPM trougth a receiver agreement.

Multimapping can be used within a BPM by means of multiline abstract interface container elements.

Multiline container elements can be then referenced from ForEach or ParForEach blocks.

Adding Messages and Message1 at content conversion level produce the following effect in MM:

<Messages> (added by MM) for 0..unbound output messages)

<Messages1> (added by MM) for 0..unbound output messages)

<Messages> (from content conversion)

<Messages1> (from content conversion)

<MT_Farmanet>

<Farmanet_Posicion>

. . .

</Farmanet_Posicion>

. . .

<Farmanet_Posicion>

. . .

</Farmanet_Posicion>

</MT_Farmanet>

<Messages1> (from content conversion)

<Messages> (from content conversion)

<Messages1> (added by MM for 0..unbound output messages)

<Messages> (added by MM for 0..unbound output messages)

Therefore, input structure does not correspond to expected one.

All input elements result empty.

As long as Nro_Factura element is allways seen as empty only one message is generated.

Only dynamic configuration is not empty:

<XIFECHA>2007-10-05</XIFECHA> (CurrentDate function)

<XIHORA>13:32:33</XIHORA> (User defined function)

<AEDAT>2007-10-05</AEDAT> (CurrentDate function)

Modifying file content conversion not to include Messages and Message1 levels fix the problem instantly.

Message was edited by: Gustavo Oga

Gustavo Oga

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Gustavo,

what is your requirement?do you need to split a single input file ,which has multiple POs,into multiple output xml files right?

in that case you can go for mutli mapping without BPM if are >XI3.0 SP14.with extended interface determination.

Babu sri

Answers (4)

Answers (4)

Former Member
0 Kudos

Thanks everyone

Former Member
0 Kudos

Hi,

Following advice from Jai Shankar. R, i substitute the name space in comuniccation channel from "http://sap.com/xi/XI/SplitAndMerge", wich is the ns that appears generating a test instance at the moment you switch occurrence of the target message from 1 to "0..unbounded", to "http://delsud.com.ar/xi/remitoelectronico", wich is the ns of Interface Determination.

From that moment "items" under <ZMM_FACTE_DETAIL> appear but only <POSNR> is fille from a "counter". Other element mappings remain missing and splitting only occurs for first part of the input message.

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

<ns1:Z_CA_CREA_FACTELECPROVEEDOR xmlns:ns1="urn:sap-com:document:sap:rfc:functions">

<FECHAARCH>2007-09-26</FECHAARCH>

<FILENAME>FACREMITO FARMANET MAM 3X2.TXT</FILENAME>

<HORAARCH>16:45:27</HORAARCH>

<PATH>
DESAR\FILES\PROVEEDORES\0000100046\INPUT</PATH>

<XIFECHA>2007-10-08</XIFECHA>

<XIHORA>18:05:52</XIHORA>

<ZMM_FACTE_DETAIL>

<item>

<POSNR>1</POSNR>

</item>

</ZMM_FACTE_DETAIL>

<ZMM_FACTE_HEADER>

<item>

<LIFNR>0000100046</LIFNR>

<EBELN />

<XBLNR />

<AEDAT>2007-10-08</AEDAT>

</item>

</ZMM_FACTE_HEADER>

</ns1:Z_CA_CREA_FACTELECPROVEEDOR>

Thanks Jai

Former Member
0 Kudos

Dear friends,

Thanks for your answer.

More details:

Final scenario consist in to receive one flat txt file and to produce several RFC calls as invoice number changes from one to another being the records sorted by that column.

A multi mapping is used at interface determination level to split message.

BPM process every message and finally send a RFC to ERP one at a time.

The key fact is that message splits in one only piece and every element from the xml generated from file content conversion is missing.

If you switch interface determination from enhanced to standard, split is not executed but every element is mapped correctly.

Coplete mapping details: <a href="http://www.delsud.com.ar/images/forums/Full_Mapping_details.mht">Full_Mapping_details</a>

Former Member
0 Kudos

Hi

if you want that the multiple files at the receiver than you have to put the occurence for the target structure as 0..unbounded.

when you use the enhanced option in the interafce determination then in the interafce mapping and in the message mapping the occurence for the target side will be 0..unbounded.

if you still have the problem please reply me back

Thanks

Rinku