<?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: write code in LSMW in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-code-in-lsmw/m-p/2811671#M657268</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do this in the 'Maintain Field Mapping and Conversion Rules' step. In this double click on the '__BEGIN_OF_RECORD__'. This will take you to the ABAP editor and you can code the validation here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the '__BEGIN_OF_RECORD__' if you do not find, take the menu Extras -&amp;gt; Layout and select all the check boxes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*********************8&lt;/P&gt;&lt;P&gt;You can validate the fields in the LSMW in field mapping section .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example you are loading the BOM using LSMW and you want to validate those material numbers which do not exist in the material master .&lt;/P&gt;&lt;P&gt;For this purpose write a select statement to check the materials existence like below :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single matnr into v_matnr &lt;/P&gt;&lt;P&gt;from mara &lt;/P&gt;&lt;P&gt;where matnr = source-matnr .&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;skip_record. " this statement will skip the record .&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get such statements to handle the records withing LSMW during data transfer .Go to the field mapping step , there in abap conversion routine step &lt;/P&gt;&lt;P&gt;go to ' INSERT' -&amp;gt; 'GLOBAL FUNCTIONS' -&amp;gt; ( then a pop will open offering various function options for your requirement. ) In fact SKIP_RECORD is also available there .&lt;/P&gt;&lt;P&gt;************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;validate fileds in lsmw can be done in field mapping step that is 5th step&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there u can write the logic if u want any.... for u can validate the fields with the target structure fields so that target structure and target structure fields validated aginst each other&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vasu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 05 Oct 2007 11:43:57 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-10-05T11:43:57Z</dc:date>
    <item>
      <title>write code in LSMW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-code-in-lsmw/m-p/2811669#M657266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi all ,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i need to validate each record when i upload the data through &amp;lt;b&amp;gt;LSMW&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and if any record is not fulfilling the requirement i want to &amp;lt;b&amp;gt;catch&lt;/P&gt;&lt;P&gt;the line number of the flat file&amp;lt;/b&amp;gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;so that the record can be identified easily to correct it and upload it next time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Points will surely awarded if the answer solves my question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks and regards&lt;/P&gt;&lt;P&gt;JK&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 11:24:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-code-in-lsmw/m-p/2811669#M657266</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T11:24:22Z</dc:date>
    </item>
    <item>
      <title>Re: write code in LSMW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-code-in-lsmw/m-p/2811670#M657267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In the 5th Step of the LSMW, just double clcik on the MOVE statment for any of the fields(Double click on the field which you want to check),  then a line editor will open, there you can write the code, here you can write the code as normal as you write in SE38, then check whether this is existed/wrong value, then you can get the number of the line also, to get the line number, just create a Global field, then every time you can increase this global field to check the number of the line item, you need to increase this number where you are checking/validating the field&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards &lt;/P&gt;&lt;P&gt; Sudheer&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 11:30:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-code-in-lsmw/m-p/2811670#M657267</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T11:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: write code in LSMW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-code-in-lsmw/m-p/2811671#M657268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do this in the 'Maintain Field Mapping and Conversion Rules' step. In this double click on the '__BEGIN_OF_RECORD__'. This will take you to the ABAP editor and you can code the validation here.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the '__BEGIN_OF_RECORD__' if you do not find, take the menu Extras -&amp;gt; Layout and select all the check boxes. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*********************8&lt;/P&gt;&lt;P&gt;You can validate the fields in the LSMW in field mapping section .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For example you are loading the BOM using LSMW and you want to validate those material numbers which do not exist in the material master .&lt;/P&gt;&lt;P&gt;For this purpose write a select statement to check the materials existence like below :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select single matnr into v_matnr &lt;/P&gt;&lt;P&gt;from mara &lt;/P&gt;&lt;P&gt;where matnr = source-matnr .&lt;/P&gt;&lt;P&gt;if sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;skip_record. " this statement will skip the record .&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get such statements to handle the records withing LSMW during data transfer .Go to the field mapping step , there in abap conversion routine step &lt;/P&gt;&lt;P&gt;go to ' INSERT' -&amp;gt; 'GLOBAL FUNCTIONS' -&amp;gt; ( then a pop will open offering various function options for your requirement. ) In fact SKIP_RECORD is also available there .&lt;/P&gt;&lt;P&gt;************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;validate fileds in lsmw can be done in field mapping step that is 5th step&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;there u can write the logic if u want any.... for u can validate the fields with the target structure fields so that target structure and target structure fields validated aginst each other&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*************************&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Vasu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 11:43:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-code-in-lsmw/m-p/2811671#M657268</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T11:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: write code in LSMW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-code-in-lsmw/m-p/2811672#M657269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi ..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;yes with the help of u r codes i was able to validate the records&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;now my need is that after doing posting for n number of records&lt;/P&gt;&lt;P&gt;i want to get the line number of the flat file for wich the record is not posted due to some internal errors.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 12:20:18 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-code-in-lsmw/m-p/2811672#M657269</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T12:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: write code in LSMW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-code-in-lsmw/m-p/2811673#M657270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;if sy-subrc&amp;lt;&amp;gt;0.&lt;/P&gt;&lt;P&gt;line_number = sy-tabix.&lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Aneesh.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 12:22:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-code-in-lsmw/m-p/2811673#M657270</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T12:22:50Z</dc:date>
    </item>
    <item>
      <title>Re: write code in LSMW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/write-code-in-lsmw/m-p/2811674#M657271</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;1. in 5 step u can see at end of the page ' END OF THE TRANSACTION'&lt;/P&gt;&lt;P&gt;2. click on that and write your code , as well as u can cath the error record and succesfully stroted record too.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Oct 2007 12:29:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/write-code-in-lsmw/m-p/2811674#M657271</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-10-05T12:29:24Z</dc:date>
    </item>
  </channel>
</rss>

