Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
sheftalenduser
Contributor
Contributor

Unable to write XML IDoc files into our SAP system.

Hello

I'm trying to write an XML IDoc file into our Dev SAP system as a proof-of-concept. I have some sample XML as input flowing into a tXMLMap component, then converted from Document to String and finally wired into a tSAPIDocOutput component. The tSAPIDocOutput is derived from a SAP iDocs entry in my Repository under SAP Connections. When the job is run the output is

"Malformed IDOC: The control record (first line) must contain exactly 524 characters."

The canvas is below:

0683p000009M4a6.png

 

 

 

 

 

 

 

 

I'm unsure about the SAP iDoc Repository set up; The field XML-IDoc-file output is mysterious in that the Help says "Click Browse... to set the file(s) path and name." Clicking Finish doesn't create a file in the path specified so I'm not sure what this is for. My SAP iDoc is below:0683p000009M4aB.png

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I'd appreciate any suggestions.

Kind regards


Andrew

Labels (3)
5 Replies
nfz11
Creator III
Creator III

Can you put a tLogRow right before the SAP component to see exactly what is being sent there?  The error message indicates that there is something wrong with the header.

sheftalenduser
Contributor
Contributor
Author

This is the trace of the job. I've added a control segment at element EDI_DC40. It would be useful to know where the error "Malformed IDOC: The control record (first line) must contain exactly 524 characters." originates - Talend or SAP.

Starting job TestXmlFileInput at 14:02 21/05/2019.



2019-05-21 14:02:05  [INFO ] (main): sitssapintegration.testxmlfileinput_0_1.TestXmlFileInput - TalendJob: 'TestXmlFileInput' - Start.

[statistics] connecting to socket on port 3344

[statistics] connected

2019-05-21 14:02:05  [INFO ] (main): org.talend.sap.impl.SAPConnectionFactory - Creating SAP connection

2019-05-21 14:02:06  [INFO ] (main): org.talend.sap.impl.SAPConnectionFactory - SAPConnection@5fcd892a [

  jco.client.ashost=etna.shef.ac.uk

 ,jco.client.client=220

 ,jco.client.destination=318e3bd3-eb79-460c-800e-c584964fe58d

 ,jco.client.lang=EN

 ,jco.client.passwd=<secret>

 ,jco.client.sysnr=00

 ,jco.client.user=TALENDSITS

 ,jco.destination.auth_type=CONFIGURED_USER

 ,propertiesProvider=org.talend.sap.impl.SAPConnectionDataProvider

]

2019-05-21 14:02:06  [DEBUG] (main): sitssapintegration.testxmlfileinput_0_1.TestXmlFileInput - tXMLMap_1_TXMLMAP_OUT - Start to work.

2019-05-21 14:02:06  [DEBUG] (main): sitssapintegration.testxmlfileinput_0_1.TestXmlFileInput - tXMLMap_1_TXMLMAP_OUT - Parameters:KEEP_ORDER_FOR_DOCUMENT = false |

2019-05-21 14:02:06  [DEBUG] (main): sitssapintegration.testxmlfileinput_0_1.TestXmlFileInput - tFileInputXML_2 - Start to work.

2019-05-21 14:02:06  [DEBUG] (main): sitssapintegration.testxmlfileinput_0_1.TestXmlFileInput - tFileInputXML_2 - Parameters:FILENAME = "C:/Talend ESB/SAP/gc_sits_text_xml.XML" | LOOP_QUERY = "/" | MAPPING = [{QUERY=".", NODECHECK=true, SCHEMA_COLUMN=theXml}] | LIMIT =  | DIE_ON_ERROR = false | ADVANCED_SEPARATOR = false | IGNORE_NS = false | IGNORE_DTD = false | USE_SEPARATOR = false | GENERATION_MODE = Dom4j | CHECK_DATE = false | ENCODING = "ISO-8859-15" |

2019-05-21 14:02:06  [DEBUG] (main): sitssapintegration.testxmlfileinput_0_1.TestXmlFileInput - tFileInputXML_2 - Retrieving the record 1.

2019-05-21 14:02:06  [TRACE] (main): sitssapintegration.testxmlfileinput_0_1.TestXmlFileInput - row2 - <?xml version="1.0" encoding="ISO-8859-15"?>

<FIDCCP02>

<IDOC BEGIN="1">

<EDI_DC40 SEGMENT="1"><TABNAM>EDI_DC40</TABNAM><MANDT>398</MANDT><DOCNUM>0000000001760002</DOCNUM><DOCREL>750</DOCREL><STATUS/><DIRECT>2</DIRECT><OUTMOD/><IDOCTYP>FIDCCP02</IDOCTYP><MESTYP>FIDCC2</MESTYP><SNDPOR>SAPQPR</SNDPOR><SNDPRT>LS</SNDPRT><SNDPRN>DEMOCIS001</SNDPRN><RCVPOR>SAPQR3</RCVPOR><RCVPRT>LS</RCVPRT><RCVPRN>QR3CLNT398</RCVPRN><CREDAT>20190520</CREDAT><CRETIM>163931</CRETIM><SERIAL/></EDI_DC40>

<E1FIKPF SEGMENT="1">

<BUKRS>GLS001</BUKRS>

<BELNR>2335248373</BELNR>

<BLART>ZH</BLART>

<BLDAT>20190429</BLDAT>

<BUDAT>20190429</BUDAT>

<WWERT>20190430</WWERT>

<USNAM>SHEFFIELD</USNAM>

<XBLNR>180187085</XBLNR>

<BKTXT>29/04/2019 04:21:11</BKTXT>

<WAERS>GBP</WAERS>

<GLVOR>RFBU</GLVOR>

<E1FISEG SEGMENT="1">

<BUZEI>001</BUZEI>

<BSCHL>15</BSCHL>

<KOART>D</KOART>

<SHKZG>H</SHKZG>

<MWSKZ>ZZ</MWSKZ>

<DMBTR>1781.78</DMBTR>

<WRBTR>1781.78</WRBTR>

<PSWBT>1781.78</PSWBT>

<PSWSL>GBP</PSWSL>

<VALUT>20190429</VALUT>

<ZUONR>-</ZUONR>

<SGTXT>Miss I C Hadlington</SGTXT>

<VORGN>RFBU</VORGN>

<KOKRS>S000</KOKRS>

<SAKNR>0000021000</SAKNR>

<XREF1>ACCOM</XREF1>

<XREF2>UOSRCP</XREF2>

<XREF3>_822947-868645</XREF3>

<E1FINBU SEGMENT="1">

<KUNNR>0001236174</KUNNR>

<ZTERM>C001</ZTERM>

</E1FINBU>

</E1FISEG>

<E1FISEG SEGMENT="1">

<BUZEI>002</BUZEI>

<BSCHL>40</BSCHL>

<KOART>S</KOART>

<SHKZG>S</SHKZG>

<DMBTR>1781.78</DMBTR>

<WRBTR>1781.78</WRBTR>

<PSWBT>1781.78</PSWBT>

<PSWSL>GBP</PSWSL>

<VALUT>20190429</VALUT>

<ZUONR>ONLINE-CRWR</ZUONR>

<SGTXT>Miss I C Hadlington</SGTXT>

<VORGN>RFBU</VORGN>

<KOKRS>S000</KOKRS>

<HKONT>0000023144</HKONT>

<XREF2>UOSRCP</XREF2>

<XREF3>_822947-868645</XREF3>

<E1FINBU SEGMENT="1"/>

</E1FISEG>

</E1FIKPF>

</IDOC>

</FIDCCP02>|

2019-05-21 14:02:06  [DEBUG] (main): sitssapintegration.testxmlfileinput_0_1.TestXmlFileInput - tXMLMap_1 - Outputting the record 1 of the output table 'out'.

2019-05-21 14:02:06  [DEBUG] (main): sitssapintegration.testxmlfileinput_0_1.TestXmlFileInput - tFileInputXML_2 - Retrieved records count: 1 .

2019-05-21 14:02:06  [DEBUG] (main): sitssapintegration.testxmlfileinput_0_1.TestXmlFileInput - tFileInputXML_2 - Done.

2019-05-21 14:02:06  [DEBUG] (main): sitssapintegration.testxmlfileinput_0_1.TestXmlFileInput - tXMLMap_1 - Written records count in the table 'out': 1.

2019-05-21 14:02:06  [DEBUG] (main): sitssapintegration.testxmlfileinput_0_1.TestXmlFileInput - tXMLMap_1_TXMLMAP_OUT - Done.

2019-05-21 14:02:06  [DEBUG] (main): sitssapintegration.testxmlfileinput_0_1.TestXmlFileInput - tXMLMap_1_TXMLMAP_IN - Start to work.

2019-05-21 14:02:06  [DEBUG] (main): sitssapintegration.testxmlfileinput_0_1.TestXmlFileInput - tXMLMap_1_TXMLMAP_IN - Parameters:KEEP_ORDER_FOR_DOCUMENT = false |

2019-05-21 14:02:06  [TRACE] (main): sitssapintegration.testxmlfileinput_0_1.TestXmlFileInput - out - <?xml version="1.0" encoding="UTF-8"?>

<FIDCCP02><IDOC BEGIN="1"><E1FIKPF SEGMENT="1"><BUKRS>GLS001</BUKRS><BELNR>2335248373</BELNR><BLART>ZH</BLART><BLDAT>20190429</BLDAT><BUDAT>20190429</BUDAT><WWERT>20190430</WWERT><USNAM>SHEFFIELD</USNAM><XBLNR>180187085</XBLNR><BKTXT>29/04/2019 04:21:11</BKTXT><WAERS>GBP</WAERS><GLVOR>RFBU</GLVOR><E1FISEG SEGMENT="1"><BUZEI>001</BUZEI><BSCHL>15</BSCHL><KOART>D</KOART><SHKZG>H</SHKZG><MWSKZ>ZZ</MWSKZ><DMBTR>1781.78</DMBTR><WRBTR>1781.78</WRBTR><PSWBT>1781.78</PSWBT><PSWSL>GBP</PSWSL><VALUT>20190429</VALUT><ZUONR>-</ZUONR><SGTXT>Miss I C Hadlington</SGTXT><VORGN>RFBU</VORGN><KOKRS>S000</KOKRS><SAKNR>0000021000</SAKNR><XREF1>ACCOM</XREF1><XREF2>UOSRCP</XREF2><XREF3>_822947-868645</XREF3><E1FINBU SEGMENT="1"><KUNNR>0001236174</KUNNR><ZTERM>C001</ZTERM></E1FINBU><HKONT>0000023144</HKONT></E1FISEG></E1FIKPF></IDOC></FIDCCP02>|

2019-05-21 14:02:06  [TRACE] (main): sitssapintegration.testxmlfileinput_0_1.TestXmlFileInput - row1 - <?xml version="1.0" encoding="UTF-8"?>

<FIDCCP02><IDOC BEGIN="1"><E1FIKPF SEGMENT="1"><BUKRS>GLS001</BUKRS><BELNR>2335248373</BELNR><BLART>ZH</BLART><BLDAT>20190429</BLDAT><BUDAT>20190429</BUDAT><WWERT>20190430</WWERT><USNAM>SHEFFIELD</USNAM><XBLNR>180187085</XBLNR><BKTXT>29/04/2019 04:21:11</BKTXT><WAERS>GBP</WAERS><GLVOR>RFBU</GLVOR><E1FISEG SEGMENT="1"><BUZEI>001</BUZEI><BSCHL>15</BSCHL><KOART>D</KOART><SHKZG>H</SHKZG><MWSKZ>ZZ</MWSKZ><DMBTR>1781.78</DMBTR><WRBTR>1781.78</WRBTR><PSWBT>1781.78</PSWBT><PSWSL>GBP</PSWSL><VALUT>20190429</VALUT><ZUONR>-</ZUONR><SGTXT>Miss I C Hadlington</SGTXT><VORGN>RFBU</VORGN><KOKRS>S000</KOKRS><SAKNR>0000021000</SAKNR><XREF1>ACCOM</XREF1><XREF2>UOSRCP</XREF2><XREF3>_822947-868645</XREF3><E1FINBU SEGMENT="1"><KUNNR>0001236174</KUNNR><ZTERM>C001</ZTERM></E1FINBU><HKONT>0000023144</HKONT></E1FISEG></E1FIKPF></IDOC></FIDCCP02>|

Malformed IDOC: The control record (first line) must contain exactly 524 characters.

2019-05-21 14:02:06  [DEBUG] (main): sitssapintegration.testxmlfileinput_0_1.TestXmlFileInput - tXMLMap_1_TXMLMAP_IN - Done.

[statistics] disconnected

2019-05-21 14:02:06  [INFO ] (main): sitssapintegration.testxmlfileinput_0_1.TestXmlFileInput - TalendJob: 'TestXmlFileInput' - Done.

Job TestXmlFileInput ended at 14:02 21/05/2019. [exit code=0]

 

Anonymous
Not applicable

Hi Andrew,

 

Did you get the solution

sheftalenduser
Contributor
Contributor
Author

No solution yet. 

med1
Creator
Creator

Hey,

 

Did you receive any answer ? I had the same issue ?