<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: LSMW using BAPI method for ME21N in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-using-bapi-method-for-me21n/m-p/8561080#M1659104</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you missed what I said.&lt;/P&gt;&lt;P&gt;I said you should create 2 files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one file looks like:&lt;/P&gt;&lt;P&gt;217836 NB 1826162667 0127 00&lt;/P&gt;&lt;P&gt;217836 NB 1826162668 0127 00 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the other is like your original file was:&lt;/P&gt;&lt;P&gt;217836 NB 1826162667 0127 00 1 LEAN SIX SIGMA PRIMER MRO Z 4.00 EA 60.00 1 EA &lt;/P&gt;&lt;P&gt;217836 NB 1826162667 0127 00 2 LEAN SIX SIGMA PRIMER MRO Z 4.00 EA 860.00 1 EA &lt;/P&gt;&lt;P&gt;217836 NB 1826162668 0127 00 1 LEAN SIX SIGMA PRIMER MRO Z 4.00 EA 160.00 1 EA&lt;/P&gt;&lt;P&gt;217836 NB 1826162668 0127 00 2 LEAN SIX SIGMA PRIMER MRO Z 4.00 EA 560.00 1 EA &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the structure of the source files is to be setup like that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-header&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;item&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 15 Feb 2012 09:31:48 GMT</pubDate>
    <dc:creator>JL23</dc:creator>
    <dc:date>2012-02-15T09:31:48Z</dc:date>
    <item>
      <title>LSMW using BAPI method for ME21N</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-using-bapi-method-for-me21n/m-p/8561076#M1659100</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi to all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using LSMW BAPI method for the transaction ME21N Iam able to post a PO document successfully, But in my flat file I have a header and followed by item in the same line, while I was posting with same header for different line items its posting different PO's for different  line items but suppose it has to post one document with multiple items.&lt;/P&gt;&lt;P&gt;My flat file fields are like this : (where as ABCD my header and rest are line items) I am using only one structure 'podata' in LSMW and I am not using any identifier.&lt;/P&gt;&lt;P&gt;header--Line items &lt;/P&gt;&lt;P&gt;A B C D S P Q W E X &lt;/P&gt;&lt;P&gt;A B C D 1 D 3  F K L &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Business Object -     BUS2012      &lt;/P&gt;&lt;P&gt;Method                -    CREATEFROMDATA1&lt;/P&gt;&lt;P&gt;Message Type    -    PORDCR1&lt;/P&gt;&lt;P&gt;Basic Type         -     PORDCR101&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; As per my requirement if I have multiple line items for the same header then only one PO should be posted.&lt;/P&gt;&lt;P&gt;Could you suggest me, How can I achieve this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Lahari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2012 02:07:55 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-using-bapi-method-for-me21n/m-p/8561076#M1659100</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-13T02:07:55Z</dc:date>
    </item>
    <item>
      <title>Re: LSMW using BAPI method for ME21N</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-using-bapi-method-for-me21n/m-p/8561077#M1659101</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Lahari,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You may need to write code in LSMW in "Maintain Field Mapping and Conversion Rules" Step.&lt;/P&gt;&lt;P&gt;Like transferring the records line by line &amp;amp; then transferring all the records with the same header i.e transferring the transaction at the last header record, You can use the technique &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; At END OF... &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt; as used in ABAP here.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2012 06:18:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-using-bapi-method-for-me21n/m-p/8561077#M1659101</guid>
      <dc:creator>SharathYaralkattimath</dc:creator>
      <dc:date>2012-02-13T06:18:50Z</dc:date>
    </item>
    <item>
      <title>Re: LSMW using BAPI method for ME21N</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-using-bapi-method-for-me21n/m-p/8561078#M1659102</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you can look into [Modifications for Experienced Users|http://help.sap.com/saphelp_nw70/helpdata/en/b0/d268c7206911d2b430006094b944c8/content.htm]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However,&lt;/P&gt;&lt;P&gt;more easy to use is to create a second table from your source file which you manipulate in a way that it only has one record per PO. just remove the lines that represent multiple items.&lt;/P&gt;&lt;P&gt;then define a source structure that has a header structure and a subnordinate  item structure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The file with the single records becomes your header file, the file with all records the item file.&lt;/P&gt;&lt;P&gt;SAP internally joins those 2 files in the READ step based on common fields (e.g. your PO number).&lt;/P&gt;&lt;P&gt;so you get one header with multiple item lines.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 13 Feb 2012 20:15:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-using-bapi-method-for-me21n/m-p/8561078#M1659102</guid>
      <dc:creator>JL23</dc:creator>
      <dc:date>2012-02-13T20:15:29Z</dc:date>
    </item>
    <item>
      <title>Re: LSMW using BAPI method for ME21N</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-using-bapi-method-for-me21n/m-p/8561079#M1659103</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jurgen,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your reply.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As poer your suggestion, I passed my flat file data into a single file and in the begin of transaction, I divided the data into 2 structures as Header &amp;amp; Item.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Still I am unable to achieve the desired results, can you please elaborate more on how SAP internally joins the structures again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To be more clear my flat file data look like this :&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;217836	NB	&lt;U&gt;1826162667&lt;/U&gt;	0127	00&lt;/STRONG&gt;   1	LEAN SIX SIGMA PRIMER	MRO	Z	4.00	EA	60.00	1	EA	&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;217836	NB	&lt;U&gt;1826162667&lt;/U&gt;	0127	00&lt;/STRONG&gt;	2	LEAN SIX SIGMA PRIMER	MRO	Z	4.00	EA	860.00	1	EA	&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;217836	NB	&lt;U&gt;1826162668&lt;/U&gt;	0127	00&lt;/STRONG&gt;	1	LEAN SIX SIGMA PRIMER	MRO	Z	4.00	EA	160.00	1	EA&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;217836	NB	&lt;U&gt;1826162668&lt;/U&gt;	0127	00&lt;/STRONG&gt;	2	LEAN SIX SIGMA PRIMER	MRO	Z	4.00	EA	560.00	1	EA	&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The bold ones being header and the remaining Items, the underlined field is PO number.&lt;/P&gt;&lt;P&gt;In normal process this file is considered to have 4 records, and tries to create 4 PO's.But my requirement is to create only 2 PO's with 2 items each.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;Lahari&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2012 08:15:14 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-using-bapi-method-for-me21n/m-p/8561079#M1659103</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2012-02-15T08:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: LSMW using BAPI method for ME21N</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-using-bapi-method-for-me21n/m-p/8561080#M1659104</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;you missed what I said.&lt;/P&gt;&lt;P&gt;I said you should create 2 files.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;one file looks like:&lt;/P&gt;&lt;P&gt;217836 NB 1826162667 0127 00&lt;/P&gt;&lt;P&gt;217836 NB 1826162668 0127 00 &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and the other is like your original file was:&lt;/P&gt;&lt;P&gt;217836 NB 1826162667 0127 00 1 LEAN SIX SIGMA PRIMER MRO Z 4.00 EA 60.00 1 EA &lt;/P&gt;&lt;P&gt;217836 NB 1826162667 0127 00 2 LEAN SIX SIGMA PRIMER MRO Z 4.00 EA 860.00 1 EA &lt;/P&gt;&lt;P&gt;217836 NB 1826162668 0127 00 1 LEAN SIX SIGMA PRIMER MRO Z 4.00 EA 160.00 1 EA&lt;/P&gt;&lt;P&gt;217836 NB 1826162668 0127 00 2 LEAN SIX SIGMA PRIMER MRO Z 4.00 EA 560.00 1 EA &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the structure of the source files is to be setup like that:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-header&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt;item&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2012 09:31:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/lsmw-using-bapi-method-for-me21n/m-p/8561080#M1659104</guid>
      <dc:creator>JL23</dc:creator>
      <dc:date>2012-02-15T09:31:48Z</dc:date>
    </item>
  </channel>
</rss>

