<?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: user exit for generating external serial in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit-for-generating-external-serial/m-p/1910347#M379012</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 21 Jan 2011 07:56:41 GMT</pubDate>
    <dc:creator>former_member632991</dc:creator>
    <dc:date>2011-01-21T07:56:41Z</dc:date>
    <item>
      <title>user exit for generating external serial</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit-for-generating-external-serial/m-p/1910345#M379010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;i want to generate external serial no at the time of goods receipt or MIGO transaction.&lt;/P&gt;&lt;P&gt;is there any user exit or BADI for that??&lt;/P&gt;&lt;P&gt;i hv searched but could not find.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Sonika&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 27 Feb 2007 10:42:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit-for-generating-external-serial/m-p/1910345#M379010</guid>
      <dc:creator>former_member632991</dc:creator>
      <dc:date>2007-02-27T10:42:03Z</dc:date>
    </item>
    <item>
      <title>Re: user exit for generating external serial</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit-for-generating-external-serial/m-p/1910346#M379011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi sonika,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can use BADI MB_DOCUMENT_BADI for this .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In method MB_DOCUMENT_PREPARE you can populate a table with serial number and then link it with the document.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please find below my code where i set serial number in migo &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Rewards if it solved your issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Best regards.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;METHOD if_ex_mb_document_badi~mb_document_before_update.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;...&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;In this code serial number is linked with batch number &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : w_sernp TYPE serail.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : it_ser TYPE STANDARD TABLE OF iseri.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : w_ser TYPE iseri.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : wv_serial(13) ,&lt;/P&gt;&lt;P&gt;         wv_pos TYPE i ,&lt;/P&gt;&lt;P&gt;         wv_count(3) TYPE n .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : wv_equi TYPE equi.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : w_anzsn TYPE anzsn ,&lt;/P&gt;&lt;P&gt;        it_mes TYPE  tsmesg .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : wv_dotime TYPE i .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : w_bstch TYPE bsinf ,&lt;/P&gt;&lt;P&gt;         w_bstup TYPE bsinf .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  FIELD-SYMBOLS : &amp;lt;mseg&amp;gt; TYPE LINE OF ty_t_mseg ,&lt;/P&gt;&lt;P&gt;                  &amp;lt;mkpf&amp;gt; TYPE LINE OF ty_t_mkpf .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT xmkpf ASSIGNING &amp;lt;mkpf&amp;gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    LOOP AT xmseg ASSIGNING &amp;lt;mseg&amp;gt;&lt;/P&gt;&lt;P&gt;         WHERE mblnr = &amp;lt;mkpf&amp;gt;-mblnr&lt;/P&gt;&lt;P&gt;           AND mjahr = &amp;lt;mkpf&amp;gt;-mjahr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Search for material serial profile in MARC&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      SELECT SINGLE sernp INTO w_sernp&lt;/P&gt;&lt;P&gt;         FROM marc&lt;/P&gt;&lt;P&gt;         WHERE matnr = &amp;lt;mseg&amp;gt;-matnr&lt;/P&gt;&lt;P&gt;           AND werks = &amp;lt;mseg&amp;gt;-werks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;searching last serial number define for the batch number used&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      WRITE &amp;lt;mseg&amp;gt;-charg TO wv_serial NO-ZERO.&lt;/P&gt;&lt;P&gt;      CONDENSE wv_serial.&lt;/P&gt;&lt;P&gt;      CONCATENATE wv_serial '-%' INTO wv_serial.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SELECT * FROM equi INTO wv_equi&lt;/P&gt;&lt;P&gt;        WHERE sernr LIKE wv_serial&lt;/P&gt;&lt;P&gt;        ORDER BY sernr DESCENDING.&lt;/P&gt;&lt;P&gt;        EXIT.&lt;/P&gt;&lt;P&gt;      ENDSELECT .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF NOT wv_equi-sernr IS INITIAL.&lt;/P&gt;&lt;P&gt;        wv_serial = wv_equi-sernr.&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;        REPLACE '%' WITH '000' INTO wv_serial.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Determination of serial number.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      SEARCH wv_serial FOR '-' .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      wv_pos = sy-fdpos + 1 .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      wv_count = wv_serial+wv_pos.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      wv_dotime = &amp;lt;mseg&amp;gt;-menge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      DO wv_dotime TIMES.&lt;/P&gt;&lt;P&gt;        ADD 1 TO wv_count.&lt;/P&gt;&lt;P&gt;        wv_serial+wv_pos = wv_count.&lt;/P&gt;&lt;P&gt;        w_ser-serialnr = wv_serial.&lt;/P&gt;&lt;P&gt;        w_ser-mblpo = &amp;lt;mseg&amp;gt;-zeile.&lt;/P&gt;&lt;P&gt;        APPEND w_ser TO it_ser.&lt;/P&gt;&lt;P&gt;      ENDDO.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;Transfer serial number table for be visible by function module SERNR_ADD_BAPI_MM&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'DOCUMENT_SERIALNOS_IMPORT'&lt;/P&gt;&lt;P&gt;           TABLES&lt;/P&gt;&lt;P&gt;                ser_tab = it_ser.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;update Material document with serial number&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CALL FUNCTION 'SERNR_ADD_BAPI_MM'&lt;/P&gt;&lt;P&gt;           EXPORTING&lt;/P&gt;&lt;P&gt;                profile              = w_sernp&lt;/P&gt;&lt;P&gt;                material             = &amp;lt;mseg&amp;gt;-matnr&lt;/P&gt;&lt;P&gt;                m_charge             = &amp;lt;mseg&amp;gt;-charg&lt;/P&gt;&lt;P&gt;                m_werk               = &amp;lt;mseg&amp;gt;-werks&lt;/P&gt;&lt;P&gt;                m_lager              = &amp;lt;mseg&amp;gt;-lgort&lt;/P&gt;&lt;P&gt;                quantity             = wv_dotime&lt;/P&gt;&lt;P&gt;                mblnr                = &amp;lt;mseg&amp;gt;-mblnr&lt;/P&gt;&lt;P&gt;                mjahr                = &amp;lt;mseg&amp;gt;-mjahr&lt;/P&gt;&lt;P&gt;                zeile                = &amp;lt;mseg&amp;gt;-zeile&lt;/P&gt;&lt;P&gt;                blart                = &amp;lt;mkpf&amp;gt;-blart&lt;/P&gt;&lt;P&gt;                bwart                = &amp;lt;mseg&amp;gt;-bwart&lt;/P&gt;&lt;P&gt;                shkzg                = &amp;lt;mseg&amp;gt;-shkzg&lt;/P&gt;&lt;P&gt;                bstch                = w_bstch&lt;/P&gt;&lt;P&gt;                bstup                = w_bstup&lt;/P&gt;&lt;P&gt;           IMPORTING&lt;/P&gt;&lt;P&gt;                anzsn                = w_anzsn&lt;/P&gt;&lt;P&gt;           CHANGING&lt;/P&gt;&lt;P&gt;                t_smesg              = it_mes&lt;/P&gt;&lt;P&gt;           EXCEPTIONS&lt;/P&gt;&lt;P&gt;                konfigurations_error = 1&lt;/P&gt;&lt;P&gt;                serialnumber_errors  = 2&lt;/P&gt;&lt;P&gt;                OTHERS               = 3.&lt;/P&gt;&lt;P&gt;      IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;        WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;ENDMETHOD.&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 17 Jul 2007 13:53:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit-for-generating-external-serial/m-p/1910346#M379011</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-07-17T13:53:58Z</dc:date>
    </item>
    <item>
      <title>Re: user exit for generating external serial</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit-for-generating-external-serial/m-p/1910347#M379012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 21 Jan 2011 07:56:41 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit-for-generating-external-serial/m-p/1910347#M379012</guid>
      <dc:creator>former_member632991</dc:creator>
      <dc:date>2011-01-21T07:56:41Z</dc:date>
    </item>
  </channel>
</rss>

