<?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: validating Input file in LSMW in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-input-file-in-lsmw/m-p/1366791#M181313</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;In the MAPPING step, you link the file fields to structures SAP fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After linking the fields, do a doubleclick on the field you need to check, now the system'll open and editor where you write your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So insert here your validation and write a log if it's wrong, use the global data G_SKIP_RECORD to skip the record (not SKIP_TRANSACTION).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All data you insert in this step, they'll be used in CONVERTION step by the system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ......&lt;/P&gt;&lt;P&gt;  WRITE 'ERROR'.&lt;/P&gt;&lt;P&gt;  G_SKIP_RECORD = 'X'.&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 06 May 2006 11:11:42 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2006-05-06T11:11:42Z</dc:date>
    <item>
      <title>validating Input file in LSMW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-input-file-in-lsmw/m-p/1366788#M181310</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 am doing an initial stock upload using LSMW. I am&lt;/P&gt;&lt;P&gt; passing a file in .CSV format . How do i validate the&lt;/P&gt;&lt;P&gt; entries in CSV files in LSMW, so that incorrect entries&lt;/P&gt;&lt;P&gt; do not get processed at all.&lt;/P&gt;&lt;P&gt;              &lt;/P&gt;&lt;P&gt; Thanks&lt;/P&gt;&lt;P&gt;  Nishant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 May 2006 10:47:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-input-file-in-lsmw/m-p/1366788#M181310</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-06T10:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: validating Input file in LSMW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-input-file-in-lsmw/m-p/1366789#M181311</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;You should insert the abap code you need in the MAPPING step.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There's a std MACRO to allow to skip the transaction: SKIP_TRANSACTION.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So for example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SELECT SINGLE * FROM T001 WHERE BUKRS = FILE-COMPANY.&lt;/P&gt;&lt;P&gt;IF SY-SUBRC &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt;  WRITE: / 'Company code is wrong'.&lt;/P&gt;&lt;P&gt;  SKIP_TRANSACTION.&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In this way you can read a log after upolaading the file and the LSMW'll load only the correct record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 May 2006 10:58:11 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-input-file-in-lsmw/m-p/1366789#M181311</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-06T10:58:11Z</dc:date>
    </item>
    <item>
      <title>Re: validating Input file in LSMW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-input-file-in-lsmw/m-p/1366790#M181312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Max,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to LSMW and dont have much idea as to where this piece of coding should be done and how to read a log.Can you please elaborate on this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Nishant&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 May 2006 11:03:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-input-file-in-lsmw/m-p/1366790#M181312</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-06T11:03:30Z</dc:date>
    </item>
    <item>
      <title>Re: validating Input file in LSMW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-input-file-in-lsmw/m-p/1366791#M181313</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;In the MAPPING step, you link the file fields to structures SAP fields.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;After linking the fields, do a doubleclick on the field you need to check, now the system'll open and editor where you write your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So insert here your validation and write a log if it's wrong, use the global data G_SKIP_RECORD to skip the record (not SKIP_TRANSACTION).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All data you insert in this step, they'll be used in CONVERTION step by the system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF ......&lt;/P&gt;&lt;P&gt;  WRITE 'ERROR'.&lt;/P&gt;&lt;P&gt;  G_SKIP_RECORD = 'X'.&lt;/P&gt;&lt;P&gt;ENDIF&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Max&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 May 2006 11:11:42 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-input-file-in-lsmw/m-p/1366791#M181313</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-06T11:11:42Z</dc:date>
    </item>
    <item>
      <title>Re: validating Input file in LSMW</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/validating-input-file-in-lsmw/m-p/1366792#M181314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks MAx, that solved my problem...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i have given u full points for this....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 May 2006 11:14:23 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/validating-input-file-in-lsmw/m-p/1366792#M181314</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2006-05-06T11:14:23Z</dc:date>
    </item>
  </channel>
</rss>

