cancel
Showing results for 
Search instead for 
Did you mean: 

Split File in File Sender

Former Member
0 Kudos
65

Hi,

I have a source file that can be up to 4MB's and I want to Split it for every 10,000 records in the file. I can't use "Recordsets per Message" because my file has a single Header and multiple Detail records.

Is there any way to split this message in the file sender?

Accepted Solutions (0)

Answers (1)

Answers (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

If you dont need Header information then use Recordset per message and specify no of records as you need and dont do mapping of header fields to target . Just map the required fields in the target structure. If you need Header information then you might have to do some logic in the mapping to identify first message which requires header and rest messages not.

Former Member
0 Kudos

Hi,

Each of the files requires a header. So if the sender file has 20,000 records then there should be 2 files created, first with Header + 10,000 records and second with Header + 10,000 records.

rodrigoalejandro_pertierr
Active Contributor
0 Kudos

i recommend you to create an xslt mapping and split the source file with it.

in the ESR first resolve all the mapping program, then call the XSLT.

so you ESR configuration will be:

Message mapping: XXXX

Opertation mapping will have two mapping: XXXX and XSLT.

here give you and example or XSL i use to split Idocs. the XSL receive and idoc WPUUMS01 with 1000 record and the XSL split it into Two.

use it as reference to solve your issue


<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ns1="http://spsa.com/POS/DailySales">
	<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
	<xsl:template match="ns1:mt_SalesValidation_response">
      <WPUUMS01>
       <xsl:for-each select="row[position() mod 500 = 1]"> 
         <IDOC>
            <xsl:attribute name="BEGIN">
               <xsl:value-of select="1" />
            </xsl:attribute>
            <EDI_DC40>1
              <SNDPRN>
			    <xsl:value-of select="../OUT_WERKS"/>
              </SNDPRN>
            </EDI_DC40>
            <xsl:for-each select=".| following-sibling::row[position() &lt; 500]">
               <E1WPU01>	
                  <xsl:attribute name="SEGMENT">
                     <xsl:value-of select="1"/>
                  </xsl:attribute>
                  <BELEGDATUM>
                     <xsl:value-of select="../OUT_ERSDA"/>
                  </BELEGDATUM>
                  <BELEGWAERS>PEN</BELEGWAERS>
                <E1WPU02>
					<xsl:attribute name="SEGMENT">
						<xsl:value-of select="1"/>
						</xsl:attribute>
					<QUALARTNR>EANN</QUALARTNR>
					<ARTNR>
            			<xsl:value-of select="EAN11"/>
					</ARTNR>
					<VORZMENGE>-</VORZMENGE>
					<UMSMENGE>
            			<xsl:value-of select="TOT_CANTIDAD"/>
					</UMSMENGE>
					<UMSWERT>
						<xsl:value-of select="TOT_VTA"/>
					</UMSWERT>
                </E1WPU02>
                 </E1WPU01>
              </xsl:for-each>
         </IDOC>
     </xsl:for-each>
      </WPUUMS01>
   </xsl:template>
</xsl:stylesheet>

Hope Helps

Edited by: Rodrigo Alejandro Pertierra on May 18, 2011 12:28 PM