cancel
Showing results for 
Search instead for 
Did you mean: 

Receiver File Name Variable Substitution :payload: Fatal Error

former_member192079
Participant
0 Kudos

Hi all

i have a scenario of idoc to file.., i need to create a dynamic file name taking 1 field variable from the payload. The idoc -xml structure in XI is :

<b><INVOICE03></b>

<b> <IDOC BEGIN="1"</b>>

<b><EDI_DC40 SEGMENT="1"></b>

<field1> ashu </field1>

<b> </EDI_DC40>

<ENEDL20></b>

<field2> rawat</field1>

<b> <ENEDL20>

</IDOC>

<INVOICE03></b>

i need to pick th value of field2 , for the target file name..

In variable substitution i had given var = INVOICE03,1,IDOC,1,E1EDL40,1,E1EDL20,1,VBELN,1

<i>

STILL I AM GETTING THE ERROR </i> :varsubst.VariableDataSourceException: Caught SAXException while parsing XML payload: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) .

NOTE : my target variable is getting populated properly.

i tried a lot of combinations in REFERENCE VARIABLE , even giving ( payload: xxx)

but for all changes it is giving the same error....

i referred the following blogs also :

Regards

AR

Accepted Solutions (1)

Accepted Solutions (1)

santhosh_kumarv
Active Contributor
0 Kudos

Hi,

The error is because of the variable substitution.

Can u paste the payload of the target field.

try this:

var = INVOICE03,1,IDOC,1,enedl20,1,field2,1

to set the file name to the fields2 value the payload that u have already posted.

Regards

Santhosh

former_member192079
Participant
0 Kudos

HI

the target payload is :

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

- <DELVRY03>

- <IDOC BEGIN="1">

+ <EDI_DC40 SEGMENT="1">

<TABNAM>EDI_DC40</TABNAM>

<MANDT>900</MANDT>

<DOCNUM>0000000002093240</DOCNUM>

<DOCREL>46C</DOCREL>

<STATUS>30</STATUS>

<DIRECT>1</DIRECT>

<OUTMOD>2</OUTMOD>

<IDOCTYP>DELVRY03</IDOCTYP>

<MESTYP>DESADV</MESTYP>

<STDMES>DESADV</STDMES>

<SNDPOR>SAPQA1</SNDPOR>

<SNDPRT>LS</SNDPRT>

<SNDPRN>ZLOG900</SNDPRN>

<RCVPOR>XIDEV</RCVPOR>

<RCVPRT>KU</RCVPRT>

<RCVPFC>WE</RCVPFC>

<RCVPRN>8300000717</RCVPRN>

<CREDAT>20070820</CREDAT>

<CRETIM>143341</CRETIM>

<SERIAL>20070703104747</SERIAL>

</EDI_DC40>

- <E1EDL20 SEGMENT="1">

<b> <VBELN>0083030974</VBELN> </b>

<VSTEL>5000</VSTEL>

<VKORG>STK</VKORG>

<INCO1>C&F</INCO1>

<INCO2>Melsele</INCO2>

<VSBED>03</VSBED>

<BTGEW>12000.000</BTGEW>

<NTGEW>0.000</NTGEW>

<GEWEI>GRM</GEWEI>

<VOLUM>0.000</VOLUM>

<ANZPK>00000</ANZPK>

<PODAT>20070703</PODAT>

<POTIM>104747</POTIM>

+ <E1EDL22 SEGMENT="1">

<VSTEL_BEZ>ID Warehouse</VSTEL_BEZ>

<VKORG_BEZ>Stock Transfer</VKORG_BEZ>

<INCO1_BEZ>Cost & Freight</INCO1_BEZ>

<VSBED_BEZ>Road</VSBED_BEZ>

</E1EDL22>

+ <E1EDL21 SEGMENT="1">

<LFART>ZRUS</LFART>

<EXPKZ>X</EXPKZ>

<LPRIO>03</LPRIO>

<TRAGR>0001</TRAGR>

- <E1EDL23 SEGMENT="1">

<LFART_BEZ>Delivery:Russian Exp</LFART_BEZ>

<LPRIO_BEZ>High</LPRIO_BEZ>

<TRAGR_BEZ>On pallets</TRAGR_BEZ>

</E1EDL23>

</E1EDL21>

+ <E1EDL18 SEGMENT="1">

<QUALF>ORI</QUALF>

</E1EDL18>

+ <E1ADRM1 SEGMENT="1">

<PARTNER_Q>WE</PARTNER_Q>

<PARTNER_ID>8300000717</PARTNER_ID>

<LANGUAGE>EN</LANGUAGE>

<FORMOFADDR>M/s.</FORMOFADDR>

<NAME1>NYK Logistics</NAME1>

<STREET1>Keetberglaan 2</STREET1>

<POSTL_COD1>B-9120</POSTL_COD1>

<CITY1>Melsele</CITY1>

<COUNTRY1>BE</COUNTRY1>

<REGION>RII</REGION>

</E1ADRM1>

+ <E1ADRM1 SEGMENT="1">

<PARTNER_Q>OSP</PARTNER_Q>

<PARTNER_ID>5000</PARTNER_ID>

<LANGUAGE>EN</LANGUAGE>

<NAME1>I/D WAREHOUSE : DELHI</NAME1>

<NAME2>B-84/1, Okhla Phase II, New Delhi</NAME2>

<CITY1>New Delhi</CITY1>

<TELEFAX>CST:LC/87/051655/05/61</TELEFAX>

<COUNTRY1>IN</COUNTRY1>

<REGION>DEL</REGION>

</E1ADRM1>

+ <E1ADRM1 SEGMENT="1">

<PARTNER_Q>OSO</PARTNER_Q>

<PARTNER_ID>STK</PARTNER_ID>

</E1ADRM1>

+ <E1EDT13 SEGMENT="1">

<QUALF>006</QUALF>

<NTANF>20070703</NTANF>

<NTANZ>000000</NTANZ>

<NTEND>20070703</NTEND>

<NTENZ>000000</NTENZ>

<ISDD>00000000</ISDD>

<ISDZ>000000</ISDZ>

<IEDD>00000000</IEDD>

<IEDZ>000000</IEDZ>

</E1EDT13>

+ <E1EDT13 SEGMENT="1">

<QUALF>003</QUALF>

<NTANF>20070703</NTANF>

<NTANZ>000000</NTANZ>

<NTEND>20070703</NTEND>

<NTENZ>000000</NTENZ>

<ISDD>00000000</ISDD>

<ISDZ>000000</ISDZ>

<IEDD>00000000</IEDD>

<IEDZ>000000</IEDZ>

</E1EDT13>

+ <E1EDT13 SEGMENT="1">

<QUALF>001</QUALF>

<NTANF>20070703</NTANF>

<NTANZ>000000</NTANZ>

<NTEND>20070703</NTEND>

<NTENZ>000000</NTENZ>

<ISDD>00000000</ISDD>

<ISDZ>000000</ISDZ>

<IEDD>00000000</IEDD>

<IEDZ>000000</IEDZ>

</E1EDT13>

+ <E1EDT13 SEGMENT="1">

<QUALF>007</QUALF>

<NTANF>20070703</NTANF>

<NTANZ>000000</NTANZ>

<NTEND>20070703</NTEND>

<NTENZ>000000</NTENZ>

<ISDD>00000000</ISDD>

<ISDZ>000000</ISDZ>

<IEDD>00000000</IEDD>

<IEDZ>000000</IEDZ>

</E1EDT13>

+ <E1EDT13 SEGMENT="1">

<QUALF>010</QUALF>

<NTANF>20070703</NTANF>

<NTANZ>000000</NTANZ>

<NTEND>20070703</NTEND>

<NTENZ>000000</NTENZ>

<ISDD>00000000</ISDD>

<ISDZ>000000</ISDZ>

<IEDD>00000000</IEDD>

<IEDZ>000000</IEDZ>

</E1EDT13>

+ <E1EDT13 SEGMENT="1">

<QUALF>015</QUALF>

<NTANF>20070703</NTANF>

<NTANZ>000000</NTANZ>

<NTEND>20070703</NTEND>

<NTENZ>000000</NTENZ>

<ISDD>00000000</ISDD>

<ISDZ>000000</ISDZ>

<IEDD>00000000</IEDD>

<IEDZ>000000</IEDZ>

</E1EDT13>

+ <E1EDL33 SEGMENT="1">

<ALAND>IN</ALAND>

<EXPVZ>4</EXPVZ>

<ZOLLA>0001</ZOLLA>

<IEVER>3</IEVER>

- <E1EDL34 SEGMENT="1">

<EXPVZ_BEZ>Air</EXPVZ_BEZ>

<ZOLLA_BEZ>New Delhi</ZOLLA_BEZ>

<IEVER_BEZ>Road</IEVER_BEZ>

</E1EDL34>

</E1EDL33>

+ <E1EDL24 SEGMENT="1">

<POSNR>000010</POSNR>

<MATNR>000000000001005372</MATNR>

<ARKTX>ALPRAZOMED TAB 0.5MG 5X10B BE</ARKTX>

<MATKL>S5202</MATKL>

<WERKS>5000</WERKS>

<LFIMG>2.000</LFIMG>

<VRKME>15S</VRKME>

<LGMNG>10.000</LGMNG>

<MEINS>S10</MEINS>

<NTGEW>0.000</NTGEW>

<BRGEW>12000.000</BRGEW>

<GEWEI>GRM</GEWEI>

<VOLUM>0.000</VOLUM>

<VOLEH>CMQ</VOLEH>

<LADGR>Z002</LADGR>

<TRAGR>0001</TRAGR>

<VTWEG>ST</VTWEG>

<SPART>20</SPART>

<GRKOR>000</GRKOR>

<POSEX>000000</POSEX>

- <E1EDL25 SEGMENT="1">

<LADGR_BEZ>Injectibles- for MP</LADGR_BEZ>

<TRAGR_BEZ>On pallets</TRAGR_BEZ>

<VTWEG_BEZ>Stock Transfer</VTWEG_BEZ>

<SPART_BEZ>Formulations</SPART_BEZ>

</E1EDL25>

- <E1EDL26 SEGMENT="1">

<PSTYV>NLN</PSTYV>

<MATKL>S5202</MATKL>

<PRODH>010080010010100102</PRODH>

<UMVKZ>5</UMVKZ>

<UMVKN>1</UMVKN>

<UEBTO>0.0</UEBTO>

<UNTTO>0.0</UNTTO>

<XCHBW>1</XCHBW>

<MVGR1>U</MVGR1>

<MVGR2>U</MVGR2>

<MVGR3>U</MVGR3>

<MVGR4>U</MVGR4>

<MVGR5>U</MVGR5>

- <E1EDL27 SEGMENT="1">

<PSTYV_BEZ>StandStockTransItem</PSTYV_BEZ>

<MATKL_BEZ>Belgium</MATKL_BEZ>

<PRODH_BEZ>Tablets</PRODH_BEZ>

<WERKS_BEZ>Export Warehouse</WERKS_BEZ>

<MVGR1_BEZ>Unasigned</MVGR1_BEZ>

<MVGR2_BEZ>Unassigned</MVGR2_BEZ>

<MVGR3_BEZ>Unassigned</MVGR3_BEZ>

<MVGR4_BEZ>Unasigned</MVGR4_BEZ>

<MVGR5_BEZ>Unassigned</MVGR5_BEZ>

</E1EDL27>

</E1EDL26>

- <E1EDL35 SEGMENT="1">

<GRWRT>0.00</GRWRT>

</E1EDL35>

- <E1EDL43 SEGMENT="1">

<QUALF>V</QUALF>

<BELNR>7200000025</BELNR>

<POSNR>000010</POSNR>

</E1EDL43>

</E1EDL24>

</E1EDL20>

</IDOC>

</DELVRY03>

i need <VBELN>0083030974</VBELN> in file name

Regards

AR

nisarkhan_n
Active Contributor
0 Kudos

DELVRY03,1,IDOC,1,E1EDL20,1,VBELN,1

E!EDL20 is not coming under node E1EDL40, if i am not worng.

santhosh_kumarv
Active Contributor
0 Kudos

Hi,

try this

var = payload:DELVRY03,1,IDOC,1,E1EDL20,1,VBELN,1

Regards

Santhosh

former_member192079
Participant
0 Kudos

hi

i applied this also

payload: DELVRY03,1,IDOC,1,E1EDL20,1,VBELN,1

but the error is same :: com.sap.aii.adapter.file.varsubst.VariableDataSourceException: Caught SAXException while parsing XML payload: Fatal Error: com.sap.engine.lib.xml.parser.ParserException: XMLParser: No data allowed here: (hex) 45, 44, 49(:main:, row:1, col:3)

<b> even i give : payload: xyz // any dummy reference

the error is same</b>

i <i>think the whole reference parsing not yet starting in any case...</i>

Regards

AR<u></u>

justin_santhanam
Active Contributor
0 Kudos

Ashutosh,

If u want the other option refer :

Best regards,

raj.

former_member192079
Participant
0 Kudos

Thanks GAURI & RAJ...

I CANNOT CONFIGURE THIS udf IN MESAGE MAPPING..., as per the Client requirment

,i am using ABAP mapping,

The above UDF is more use full if variable field is at source side, or manupulated field...

if i got any solution i will share it...

Thx

AR

Answers (2)

Answers (2)

nisarkhan_n
Active Contributor
0 Kudos

For the varibale substution point the vairbale of the reciver strucuture which is holding the data.

former_member192079
Participant
0 Kudos

Hi N Khan

-->

<i>

For the varibale substution point the vairbale of the reciver strucuture which is holding the data. </i>

this idoc structure is at target side only..

One thing i forget to mention ,apology for that..I am using ABAP mapping..

Regards

AR

Former Member
0 Kudos

Hi Ashutosh,

You can use adapter specific attributes for this instead of variable substitution. By this u can change file name dependant upon source payload which is very simple.

If u want to go ahead with this approach, let me know I have sample code too.

-Gouri

Award points if useful

Former Member
0 Kudos

As I said u can use UDF for this.

Input field --->UDF -


> Target field.

DynamicConfiguration conf = (DynamicConfiguration) container.getTransformationParameters().get(StreamTransformationConstants.DYNAMIC_CONFIGURATION);

DynamicConfigurationKey key = DynamicConfigurationKey.create(

"http://sap.com/xi/XI/System/File",

"FileName");

String FName = conf.get(key);

conf.put(key,FName);

return FName;

In receiver comm.channel check the checkbox for ASMA -Filename.

Hope it is useful.

- Gouri

Award points if useful

former_member192892
Active Contributor
0 Kudos

Ashutosh,

Are you using the howto guide to convert idoc xml to flat file structure???

former_member192079
Participant
0 Kudos

Hi Varun

thx for u r resp..

regarding the scenario all ALE,IR, ID configurations had been properly.And

without using the Variable Substitution ,file is created sucessfully. after pushing(we19), it from R3 ..

the problem is in creating FileName...where we r wrong .....Reference variable ..or any new clue..

Regards

AR