Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Empty elements when spliting flat file into several XML messages

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

Former Member

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question