Skip to Content
0
Former Member
Jan 19, 2010 at 10:22 AM

Problem with variable substitution.

90 Views

Hello,

I asked this before but now I want to change the question focus.

I have scenario from IDOC to XML file.

The scenario is digital invoice for our company in Mexico and I end this scenario with java mapping that I import from SAP marketplace.

Now I have request to add to the XML file name the content of the field "<ODN_NUMBER>" from the XML data.

I try to use with variables substitution.

My payload is:

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

- <ZINVOIC02>

- <IDOC BEGIN="1">

- <EDI_DC40 SEGMENT="1">

<TABNAM>EDI_DC40</TABNAM>

<MANDT>400</MANDT>

<DOCNUM>0000000006599015</DOCNUM>

<DOCREL>700</DOCREL>

<STATUS>30</STATUS>

<DIRECT>1</DIRECT>

<OUTMOD>2</OUTMOD>

<IDOCTYP>INVOIC02</IDOCTYP>

<CIMTYP>ZINVOIC02</CIMTYP>

<MESTYP>INVOIC</MESTYP>

<STDMES>ZEDI</STDMES>

<SNDPOR>SAPDEV</SNDPOR>

<SNDPRT>LS</SNDPRT>

<SNDPRN>DEV400ECC</SNDPRN>

<RCVPOR>SAPDEV</RCVPOR>

<RCVPRT>LS</RCVPRT>

<RCVPFC>LS</RCVPFC>

<RCVPRN>MX_INV</RCVPRN>

<CREDAT>20100118</CREDAT>

<CRETIM>075931</CRETIM>

<SERIAL>20100118075931</SERIAL>

</EDI_DC40>

- <E1EDK01 SEGMENT="1">

<CURCY>USD</CURCY>

<HWAER>MXN</HWAER>

<WKURS>10.55530</WKURS>

<ZTERM>0090</ZTERM>

<KUNDEUINR>ACH971209KRA</KUNDEUINR>

<BSART>INVO</BSART>

<BELNR>0100017295</BELNR>

<BRGEW>0.045</BRGEW>

<GEWEI>KGM</GEWEI>

<FKART_RL>LR</FKART_RL>

<RECIPNT_NO>0000012977</RECIPNT_NO>

<FKTYP>L</FKTYP>

- <Z1EDK01 SEGMENT="1">

<XML_VERSION>2.0</XML_VERSION>

<ODN_PREFIX>A</ODN_PREFIX>

<ODN_NUMBER>1883</ODN_NUMBER>

<DATE_TIME>2009-11-01T17:05:10</DATE_TIME>

<DOC_SUB_TOTAL>4.22</DOC_SUB_TOTAL>

<DOC_DISCOUNT>3.00</DOC_DISCOUNT>

<DOC_TOTAL>1.40</DOC_TOTAL>

</Z1EDK01>

And the xml that I create is:

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

- http://www.sat.gob.mx/cfd/2" version="2.0" serie="A" folio="1883" fecha="2009-11-01T17:05:10" sello="NxZCWU8hMJMi Ec2fSZafpS81Z9rUScbBotvJ8lcW76GGpmcD2lFyAV7DlNQKecYMnQJnwMVoHfGjzhpFJrjLuRcyqU3nOnH1mE1JMxY/MjLkal0Ybo2aRKCorQxx+F/Vy5ucvyeDDFAt2gx0PeHJhFS3tJ6ssc6nryz3iUr8c=" noAprobacion="49806" anoAprobacion="2009" formaDePago="Pago en una sola exhibici×£n" noCertificado="00001000000100891274" condicionesDePago="90 DAYS FROM BILL OF LADING" subTotal="4.22" descuento="3.00" motivoDescuento="Customer DiscountCustomer Discount" total="1.40" tipoDeComprobante="ingreso">

- <Emisor rfc="NMS940324RY6" nombre="Netafim Mexico S.A. de C.">

<DomicilioFiscal calle="Leibnitz" noExterior="20" noInterior="901" colonia="Anzures" localidad="Mexico city" municipio="Miguel Hidalgo" estado="Distrito Federal" pais="Mexico" codigoPostal="11590" />

</Emisor>

- <Receptor rfc="ACH971209KRA" nombre="AGRICOLA 5 HERMANOS SA DE CV">

<Domicilio calle="JUAN DE LA BARRERA NO 1249 NORTE" localidad="COL. CHAPULTEPEC" municipio="CULIACAN" estado="Sinaloa" pais="Mexico" codigoPostal="80040" />

</Receptor>

- <Conceptos>

I try to use with this variable:

payload:ZINVOIC02,1,IDOC,1,E1EDK01,1,Z1EDK01,1,ODN_NUMBER,1

I received in RWB the error:

Attempt to process file failed with com.sap.aii.adapter.file.configuration.DynamicConfigurationException: Error during variable substitution: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: The following variable was not found in the message payload: var_filename

Thank you in advance for your help

Elad