<?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 code error in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-error/m-p/3342705#M801400</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a small report which helps in entering the external order number which is a combination of material number and serial number. My problem is that when I go through the transaction KO02 and enter the order number and click on the master data , heer I am supposed to enter the external order number .The problem is that this exit of mine is allowing me to save the external order number only when the serial number is numeric, when i enter the alpha numeric serial numbers it says invalid entry, can anyone help me. &lt;/P&gt;&lt;P&gt;Here is the exit what I have written. &lt;/P&gt;&lt;P&gt;data: l_matnr type matnr, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_sernr type gernr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check syst-dynnr = '0600'. &lt;/P&gt;&lt;P&gt;check i_actvt = '02' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"change &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or i_actvt = '32'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"save &lt;/P&gt;&lt;P&gt;if i_aufk-auart = 'CENT'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i_aufk-aufex is initial. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syst-msgid = 'Z001'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syst-msgno = '999'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syst-msgty = 'E'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syst-msgv1 = 'Enter the External order Number'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;raise e_message. &lt;/P&gt;&lt;P&gt;endif. &lt;/P&gt;&lt;P&gt;l_matnr = i_aufk-aufex(5). &lt;/P&gt;&lt;P&gt;l_sernr = i_aufk-aufex+5(15). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORTING &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INPUT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= l_matnr &lt;/P&gt;&lt;P&gt;IMPORTING &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OUTPUT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= l_matnr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORTING &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INPUT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= l_sernr &lt;/P&gt;&lt;P&gt;IMPORTING &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OUTPUT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= l_sernr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select count(*) from equi where &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matnr = l_matnr and &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sernr = l_sernr. &lt;/P&gt;&lt;P&gt;if sy-dbcnt = 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syst-msgid = 'Z001'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syst-msgno = '999'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syst-msgv1 = 'External order Number is Invalid'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syst-msgty = 'E'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;raise e_message. &lt;/P&gt;&lt;P&gt;endif. __.____._&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Jan 2008 16:49:46 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2008-01-24T16:49:46Z</dc:date>
    <item>
      <title>code error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-error/m-p/3342705#M801400</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have created a small report which helps in entering the external order number which is a combination of material number and serial number. My problem is that when I go through the transaction KO02 and enter the order number and click on the master data , heer I am supposed to enter the external order number .The problem is that this exit of mine is allowing me to save the external order number only when the serial number is numeric, when i enter the alpha numeric serial numbers it says invalid entry, can anyone help me. &lt;/P&gt;&lt;P&gt;Here is the exit what I have written. &lt;/P&gt;&lt;P&gt;data: l_matnr type matnr, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;l_sernr type gernr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;check syst-dynnr = '0600'. &lt;/P&gt;&lt;P&gt;check i_actvt = '02' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"change &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or i_actvt = '32'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;"save &lt;/P&gt;&lt;P&gt;if i_aufk-auart = 'CENT'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if i_aufk-aufex is initial. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syst-msgid = 'Z001'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syst-msgno = '999'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syst-msgty = 'E'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syst-msgv1 = 'Enter the External order Number'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;raise e_message. &lt;/P&gt;&lt;P&gt;endif. &lt;/P&gt;&lt;P&gt;l_matnr = i_aufk-aufex(5). &lt;/P&gt;&lt;P&gt;l_sernr = i_aufk-aufex+5(15). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORTING &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INPUT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= l_matnr &lt;/P&gt;&lt;P&gt;IMPORTING &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OUTPUT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= l_matnr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT' &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EXPORTING &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;INPUT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= l_sernr &lt;/P&gt;&lt;P&gt;IMPORTING &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;OUTPUT &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;= l_sernr. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select count(*) from equi where &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;matnr = l_matnr and &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sernr = l_sernr. &lt;/P&gt;&lt;P&gt;if sy-dbcnt = 0. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syst-msgid = 'Z001'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syst-msgno = '999'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syst-msgv1 = 'External order Number is Invalid'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;syst-msgty = 'E'. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;raise e_message. &lt;/P&gt;&lt;P&gt;endif. __.____._&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2008 16:49:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-error/m-p/3342705#M801400</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-24T16:49:46Z</dc:date>
    </item>
    <item>
      <title>Re: code error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-error/m-p/3342706#M801401</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Change your code as follows, it should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;DATA: l_matnr TYPE matnr,

l_sernr TYPE gernr.

CHECK syst-dynnr = '0600'.
CHECK i_actvt = '02'  "change
   OR i_actvt = '32'. "save

IF i_aufk-auart = 'CENT'.
  IF i_aufk-aufex IS INITIAL.
    syst-msgid = 'Z001'.
    syst-msgno = '999'.
    syst-msgty = 'E'.
    syst-msgv1 = 'Enter the External order Number'.
    RAISE e_message.
  ENDIF.

  l_matnr = i_aufk-aufex(5).
  l_sernr = i_aufk-aufex+5(15).

  CALL FUNCTION 'CONVERSION_EXIT_ALPHA_INPUT'
    EXPORTING
      input  = l_matnr
    IMPORTING
      output = l_matnr.

  CALL FUNCTION 'CONVERSION_EXIT_GERNR_INPUT'
    EXPORTING
      input  = l_sernr
    IMPORTING
      output = l_sernr.

  SELECT COUNT(*) FROM equi
                 WHERE matnr = l_matnr
                   AND sernr = l_sernr.

  IF sy-dbcnt = 0.
    syst-msgid = 'Z001'.
    syst-msgno = '999'.
    syst-msgv1 = 'External order Number is Invalid'.
    syst-msgty = 'E'.
    RAISE e_message.
  ENDIF.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2008 16:56:49 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-error/m-p/3342706#M801401</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-24T16:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: code error</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/code-error/m-p/3342707#M801402</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the error may not be in the code, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but may come from the inexistence of matnr+sernr in table EQUI. &lt;/P&gt;&lt;P&gt;Verify that. &lt;/P&gt;&lt;P&gt;Hope this helps,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Jan 2008 18:16:44 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/code-error/m-p/3342707#M801402</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2008-01-24T18:16:44Z</dc:date>
    </item>
  </channel>
</rss>

