<?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 in PP in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit-in-pp/m-p/2641317#M608092</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kishore,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I once implemented an exit for the second issue you have mentioned i.e to relese only the confirmed quantity from mb31 transaction. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I mention here the logic which i implemented and give the code to be  implemented in the mentioned Customer exit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apart from implementing the code you will have to define appropriate messages as used in the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;****&lt;STRONG&gt;Logic&lt;/STRONG&gt;***&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Transaction MB31 is entered to release the finished items.&lt;/P&gt;&lt;P&gt;Check1 ensures adequate goods have been issued or not.&lt;/P&gt;&lt;P&gt;Check2 ensures quantity being released for a material component is how much lesser that the total quantity.&lt;/P&gt;&lt;P&gt;Check3 &amp;amp; Check4 looks for new confirmations for the operations in an order, apart from the ones already released&lt;/P&gt;&lt;P&gt;Check5 Informs the qty confirmed has already been released.&lt;/P&gt;&lt;P&gt;Check6 allows only the left quantity to be released..&lt;/P&gt;&lt;P&gt;******&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;***Additional details&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;1) Checks if goods issue has been done or not for a material (For every unique material entry in RESB) by looking up for an entry in table AUFM for a particular material with movement type 261(good issue for order) and 262 (goods issue reversal for an order).&lt;/P&gt;&lt;P&gt;2) Another check is there for the quantity, to see that the quantity being released is equal to the amount being issued or not.&lt;/P&gt;&lt;P&gt;3) Check to find if the confirmation has been done for a particular order against a particular operation.&lt;/P&gt;&lt;P&gt;4) Check on the amount of quantity to be delivered is provided by checking the number of confirmations.&lt;/P&gt;&lt;P&gt;5) Check to see if any new confirmations have been done to release more number of items.&lt;/P&gt;&lt;P&gt;********&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;****&lt;STRONG&gt;Code  in exit MBCF0002&lt;/STRONG&gt;**&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  INCLUDE ZXMBCU02                                                   *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-tcode = 'MB31'.&lt;/P&gt;&lt;P&gt;  TABLES :  afpo, aufm, afko, afvc, afru .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : i_resb LIKE TABLE OF resb WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;         i_aufm LIKE TABLE OF aufm WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;         i_afru LIKE TABLE OF afru WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;         i_afvc LIKE TABLE OF afvc WITH HEADER LINE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA :  qty LIKE aufm-menge, qty1 LIKE afru-smeng, qty2 LIKE aufm-menge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : v_confirm(2) TYPE n, v_cancel(2) TYPE n, v_cnt_261(2) TYPE n,&lt;/P&gt;&lt;P&gt;           v_cnt_else(2) TYPE n.&lt;/P&gt;&lt;P&gt;DATA : i_afko LIKE afko, wa_afru LIKE LINE OF i_afru, confirmation LIKE&lt;/P&gt;&lt;P&gt;                       afru-rueck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT SINGLE * FROM afko INTO i_afko WHERE aufnr = i_mseg-aufnr.&lt;/P&gt;&lt;P&gt;  SELECT * FROM afru INTO TABLE i_afru WHERE aufnr = i_mseg-aufnr.&lt;/P&gt;&lt;P&gt;  SELECT * FROM resb INTO TABLE i_resb WHERE aufnr = i_mseg-aufnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT i_resb.&lt;/P&gt;&lt;P&gt;    CLEAR : qty, v_cnt_261, v_cnt_else.&lt;/P&gt;&lt;P&gt;*Indicator: Phantom item indicator&lt;/P&gt;&lt;P&gt;    IF i_resb-dumps = 'X' .&lt;/P&gt;&lt;P&gt;      CONTINUE.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;*Indicator: Item is deleted&lt;/P&gt;&lt;P&gt;    IF I_RESB-XLOEK = 'X'.&lt;/P&gt;&lt;P&gt;    CONTINUE.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Indicator: bulk material&lt;/P&gt;&lt;P&gt;    IF I_RESB-SCHGT = 'X' .&lt;/P&gt;&lt;P&gt;    CONTINUE.&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;   clearing of aufm[] required&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SELECT * FROM aufm INTO TABLE i_aufm WHERE matnr = i_resb-matnr AND&lt;/P&gt;&lt;P&gt;    rsnum = i_resb-rsnum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF i_aufm[] IS INITIAL.&lt;/P&gt;&lt;P&gt;      v_cnt_else = v_cnt_else + 1.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    LOOP AT i_aufm WHERE rspos = i_resb-rspos.&lt;/P&gt;&lt;P&gt;      IF i_aufm-bwart = 261.&lt;/P&gt;&lt;P&gt;        v_cnt_261 = v_cnt_261 + 1.&lt;/P&gt;&lt;P&gt;*addtion to check  IF i_aufm-bwart = 262&lt;/P&gt;&lt;P&gt;      ELSEIF i_aufm-bwart = 262.&lt;/P&gt;&lt;P&gt;        v_cnt_else = v_cnt_else + 1.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF v_cnt_else &amp;gt;= v_cnt_261.&lt;/P&gt;&lt;P&gt; MESSAGE ID 'ZSER' TYPE 'A' NUMBER '016' WITH i_mseg-aufnr i_resb-matnr&lt;/P&gt;&lt;P&gt;                                                      .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CLEAR qty.&lt;/P&gt;&lt;P&gt;      LOOP AT i_aufm WHERE rspos = i_resb-rspos.&lt;/P&gt;&lt;P&gt;        IF i_aufm-bwart = 261.&lt;/P&gt;&lt;P&gt;          qty = qty + i_aufm-menge.&lt;/P&gt;&lt;P&gt;*addtion to check  IF i_aufm-bwart = 262&lt;/P&gt;&lt;P&gt;        ELSEIF i_aufm-bwart = 262.&lt;/P&gt;&lt;P&gt;          qty = qty - i_aufm-menge.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF i_resb-bdmng &amp;lt;&amp;gt; qty.&lt;/P&gt;&lt;P&gt;        qty = i_resb-bdmng - qty.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID 'ZSER' TYPE 'W' NUMBER '016' WITH i_mseg-aufnr i_resb-matnr&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                                                   'QUANTITY' qty.&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;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*LOOP AT OPERATIONS WITHIN AN ORDER WITH ROUTING NO.&lt;/P&gt;&lt;P&gt;  SELECT * FROM afvc INTO TABLE i_afvc WHERE aufpl = i_afko-aufpl.&lt;/P&gt;&lt;P&gt;  LOOP AT i_afvc.&lt;/P&gt;&lt;P&gt;*CHECK CONFIMATION FOR AN OPERATION EXISTS IN ALL CONFIRMATIONS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    READ TABLE i_afru WITH KEY rueck = i_afvc-rueck.&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID 'ZSER' TYPE 'A' NUMBER '017' WITH i_mseg-aufnr i_afvc-vornr.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR : v_confirm, v_cancel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*LOOP AT ALL CONFIRMED OPERATIONS FOR ALL OPERATION CONFIRMATIONS&lt;/P&gt;&lt;P&gt;    LOOP AT i_afru WHERE rueck = i_afvc-rueck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*CHECK FOR CANCEL CONFIRMATION FIELD (0/1 - CONFIRM/REVERSE)&lt;/P&gt;&lt;P&gt;      IF i_afru-stzhl = 0 .&lt;/P&gt;&lt;P&gt;        v_confirm = v_confirm + 1.&lt;/P&gt;&lt;P&gt;*QTY1 = QTY1 - I_AFRU-GMNGA.&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;        v_cancel = v_cancel + 1.&lt;/P&gt;&lt;P&gt;*QTY1 = QTY1 + I_AFRU-GMNGA.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;    IF v_cancel =&amp;gt; v_confirm .&lt;/P&gt;&lt;P&gt; MESSAGE ID 'ZSER' TYPE 'A' NUMBER '017' WITH i_mseg-aufnr i_afvc-vornr.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    confirmation = i_afvc-rueck .&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR : qty, qty1, qty2.&lt;/P&gt;&lt;P&gt;  CLEAR : i_afru.&lt;/P&gt;&lt;P&gt;  REFRESH i_aufm[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT * FROM aufm INTO TABLE i_aufm WHERE aufnr = i_mseg-aufnr.&lt;/P&gt;&lt;P&gt;*QTY2 IS DELIVERED QTY&lt;/P&gt;&lt;P&gt;  LOOP AT i_aufm WHERE bwart = '101' OR bwart = '102' .&lt;/P&gt;&lt;P&gt;    IF i_aufm-bwart = '101'.&lt;/P&gt;&lt;P&gt;      qty2 = qty2 + i_aufm-menge .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ELSEIF i_aufm-bwart = '102'.&lt;/P&gt;&lt;P&gt;      qty2 = qty2 - i_aufm-menge .&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SORT i_afru BY rueck rmzhl.&lt;/P&gt;&lt;P&gt;  LOOP AT i_afru INTO wa_afru WHERE rueck = confirmation.&lt;/P&gt;&lt;P&gt;*CALCULATE QUANTITY ALEADY CONFIRMED&lt;/P&gt;&lt;P&gt;    IF wa_afru-stzhl &amp;lt;&amp;gt; 0 .&lt;/P&gt;&lt;P&gt;      qty1 = qty1 - wa_afru-gmnga.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      qty1 = qty1 + wa_afru-gmnga.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*CLEAR WA_AFRU.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*QTY1 --- CONFIRMED&lt;/P&gt;&lt;P&gt;*WA_AFRU-GMNGA --- TO BE CONFIRMED  " i_afko-gamng --- total quantity&lt;/P&gt;&lt;P&gt;*I_MSEG-ERFMG -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt; TOTAL TO BE RELEASED CONFIRM&lt;/P&gt;&lt;P&gt;*QTY = I_AFKO-GAMNG - QTY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF qty2  =  qty1.&lt;/P&gt;&lt;P&gt;MESSAGE ID 'ZSER' TYPE 'A' NUMBER '019' WITH wa_afru-gmnga i_mseg-erfmg.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*qty = qty - qty2.&lt;/P&gt;&lt;P&gt;  IF qty2 &amp;lt; qty1.&lt;/P&gt;&lt;P&gt;    qty = qty1 - qty2.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF i_mseg-erfmg &amp;gt; qty .&lt;/P&gt;&lt;P&gt;    MESSAGE ID 'ZSER' TYPE 'A' NUMBER '018' WITH qty i_mseg-erfmg.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also i recall putting a check on tcode in the begining of the code so probly this exit is being called in other transactions as well.&lt;/P&gt;&lt;P&gt;Check if it is being called in c011 as well and solves the purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also to search for exits go to transaction SMOD and from menu select &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Utilities-&amp;gt;find&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and provide the package name for the main program of transaction MB31.&lt;/P&gt;&lt;P&gt;You will get a list of exits.&lt;/P&gt;&lt;P&gt;Put a break-point in the ones which you think can solve the purpose and see if anyone of these is getting called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Vikas&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Always rewards points to useful suggestions.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 Aug 2007 04:35:50 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-08-22T04:35:50Z</dc:date>
    <item>
      <title>User exit in PP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit-in-pp/m-p/2641316#M608091</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Pl' give any examples of use exits used for PP modules, etc....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;e.g. while production order confirmation (TC&lt;DEL&gt;CO11) qty should be equal to &amp;amp; less than issued qty. ( CO27&lt;/DEL&gt;-- 261mvt) only , It should not accept order qty. greated than issue qty.&lt;/P&gt;&lt;P&gt;If order cancelled,teco... effects should be taken into consideration......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In QM  also , it should accept production order confirmed qty. only which is issued by production people by MB31 ( mvt-101).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Aug 2007 12:41:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit-in-pp/m-p/2641316#M608091</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-21T12:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: User exit in PP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit-in-pp/m-p/2641317#M608092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Kishore,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I once implemented an exit for the second issue you have mentioned i.e to relese only the confirmed quantity from mb31 transaction. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I mention here the logic which i implemented and give the code to be  implemented in the mentioned Customer exit.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Apart from implementing the code you will have to define appropriate messages as used in the code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;****&lt;STRONG&gt;Logic&lt;/STRONG&gt;***&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;Transaction MB31 is entered to release the finished items.&lt;/P&gt;&lt;P&gt;Check1 ensures adequate goods have been issued or not.&lt;/P&gt;&lt;P&gt;Check2 ensures quantity being released for a material component is how much lesser that the total quantity.&lt;/P&gt;&lt;P&gt;Check3 &amp;amp; Check4 looks for new confirmations for the operations in an order, apart from the ones already released&lt;/P&gt;&lt;P&gt;Check5 Informs the qty confirmed has already been released.&lt;/P&gt;&lt;P&gt;Check6 allows only the left quantity to be released..&lt;/P&gt;&lt;P&gt;******&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;***Additional details&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;1) Checks if goods issue has been done or not for a material (For every unique material entry in RESB) by looking up for an entry in table AUFM for a particular material with movement type 261(good issue for order) and 262 (goods issue reversal for an order).&lt;/P&gt;&lt;P&gt;2) Another check is there for the quantity, to see that the quantity being released is equal to the amount being issued or not.&lt;/P&gt;&lt;P&gt;3) Check to find if the confirmation has been done for a particular order against a particular operation.&lt;/P&gt;&lt;P&gt;4) Check on the amount of quantity to be delivered is provided by checking the number of confirmations.&lt;/P&gt;&lt;P&gt;5) Check to see if any new confirmations have been done to release more number of items.&lt;/P&gt;&lt;P&gt;********&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;****&lt;STRONG&gt;Code  in exit MBCF0002&lt;/STRONG&gt;**&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;  INCLUDE ZXMBCU02                                                   *&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;STRONG&gt;----&lt;/STRONG&gt;&lt;/P&gt;&lt;HR originaltext="-----------------------------------------------------------------" /&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;IF sy-tcode = 'MB31'.&lt;/P&gt;&lt;P&gt;  TABLES :  afpo, aufm, afko, afvc, afru .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : i_resb LIKE TABLE OF resb WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;         i_aufm LIKE TABLE OF aufm WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;         i_afru LIKE TABLE OF afru WITH HEADER LINE,&lt;/P&gt;&lt;P&gt;         i_afvc LIKE TABLE OF afvc WITH HEADER LINE .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA :  qty LIKE aufm-menge, qty1 LIKE afru-smeng, qty2 LIKE aufm-menge.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  DATA : v_confirm(2) TYPE n, v_cancel(2) TYPE n, v_cnt_261(2) TYPE n,&lt;/P&gt;&lt;P&gt;           v_cnt_else(2) TYPE n.&lt;/P&gt;&lt;P&gt;DATA : i_afko LIKE afko, wa_afru LIKE LINE OF i_afru, confirmation LIKE&lt;/P&gt;&lt;P&gt;                       afru-rueck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT SINGLE * FROM afko INTO i_afko WHERE aufnr = i_mseg-aufnr.&lt;/P&gt;&lt;P&gt;  SELECT * FROM afru INTO TABLE i_afru WHERE aufnr = i_mseg-aufnr.&lt;/P&gt;&lt;P&gt;  SELECT * FROM resb INTO TABLE i_resb WHERE aufnr = i_mseg-aufnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  LOOP AT i_resb.&lt;/P&gt;&lt;P&gt;    CLEAR : qty, v_cnt_261, v_cnt_else.&lt;/P&gt;&lt;P&gt;*Indicator: Phantom item indicator&lt;/P&gt;&lt;P&gt;    IF i_resb-dumps = 'X' .&lt;/P&gt;&lt;P&gt;      CONTINUE.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;*Indicator: Item is deleted&lt;/P&gt;&lt;P&gt;    IF I_RESB-XLOEK = 'X'.&lt;/P&gt;&lt;P&gt;    CONTINUE.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Indicator: bulk material&lt;/P&gt;&lt;P&gt;    IF I_RESB-SCHGT = 'X' .&lt;/P&gt;&lt;P&gt;    CONTINUE.&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;   clearing of aufm[] required&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;    SELECT * FROM aufm INTO TABLE i_aufm WHERE matnr = i_resb-matnr AND&lt;/P&gt;&lt;P&gt;    rsnum = i_resb-rsnum.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF i_aufm[] IS INITIAL.&lt;/P&gt;&lt;P&gt;      v_cnt_else = v_cnt_else + 1.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;    LOOP AT i_aufm WHERE rspos = i_resb-rspos.&lt;/P&gt;&lt;P&gt;      IF i_aufm-bwart = 261.&lt;/P&gt;&lt;P&gt;        v_cnt_261 = v_cnt_261 + 1.&lt;/P&gt;&lt;P&gt;*addtion to check  IF i_aufm-bwart = 262&lt;/P&gt;&lt;P&gt;      ELSEIF i_aufm-bwart = 262.&lt;/P&gt;&lt;P&gt;        v_cnt_else = v_cnt_else + 1.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    IF v_cnt_else &amp;gt;= v_cnt_261.&lt;/P&gt;&lt;P&gt; MESSAGE ID 'ZSER' TYPE 'A' NUMBER '016' WITH i_mseg-aufnr i_resb-matnr&lt;/P&gt;&lt;P&gt;                                                      .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      CLEAR qty.&lt;/P&gt;&lt;P&gt;      LOOP AT i_aufm WHERE rspos = i_resb-rspos.&lt;/P&gt;&lt;P&gt;        IF i_aufm-bwart = 261.&lt;/P&gt;&lt;P&gt;          qty = qty + i_aufm-menge.&lt;/P&gt;&lt;P&gt;*addtion to check  IF i_aufm-bwart = 262&lt;/P&gt;&lt;P&gt;        ELSEIF i_aufm-bwart = 262.&lt;/P&gt;&lt;P&gt;          qty = qty - i_aufm-menge.&lt;/P&gt;&lt;P&gt;        ENDIF.&lt;/P&gt;&lt;P&gt;      ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;      IF i_resb-bdmng &amp;lt;&amp;gt; qty.&lt;/P&gt;&lt;P&gt;        qty = i_resb-bdmng - qty.&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;MESSAGE ID 'ZSER' TYPE 'W' NUMBER '016' WITH i_mseg-aufnr i_resb-matnr&lt;/P&gt;&lt;/LI&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;                                                   'QUANTITY' qty.&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;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*LOOP AT OPERATIONS WITHIN AN ORDER WITH ROUTING NO.&lt;/P&gt;&lt;P&gt;  SELECT * FROM afvc INTO TABLE i_afvc WHERE aufpl = i_afko-aufpl.&lt;/P&gt;&lt;P&gt;  LOOP AT i_afvc.&lt;/P&gt;&lt;P&gt;*CHECK CONFIMATION FOR AN OPERATION EXISTS IN ALL CONFIRMATIONS&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    READ TABLE i_afru WITH KEY rueck = i_afvc-rueck.&lt;/P&gt;&lt;P&gt;    IF sy-subrc &amp;lt;&amp;gt; 0.&lt;/P&gt;&lt;P&gt; MESSAGE ID 'ZSER' TYPE 'A' NUMBER '017' WITH i_mseg-aufnr i_afvc-vornr.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    CLEAR : v_confirm, v_cancel.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*LOOP AT ALL CONFIRMED OPERATIONS FOR ALL OPERATION CONFIRMATIONS&lt;/P&gt;&lt;P&gt;    LOOP AT i_afru WHERE rueck = i_afvc-rueck.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*CHECK FOR CANCEL CONFIRMATION FIELD (0/1 - CONFIRM/REVERSE)&lt;/P&gt;&lt;P&gt;      IF i_afru-stzhl = 0 .&lt;/P&gt;&lt;P&gt;        v_confirm = v_confirm + 1.&lt;/P&gt;&lt;P&gt;*QTY1 = QTY1 - I_AFRU-GMNGA.&lt;/P&gt;&lt;P&gt;      ELSE.&lt;/P&gt;&lt;P&gt;        v_cancel = v_cancel + 1.&lt;/P&gt;&lt;P&gt;*QTY1 = QTY1 + I_AFRU-GMNGA.&lt;/P&gt;&lt;P&gt;      ENDIF.&lt;/P&gt;&lt;P&gt;    ENDLOOP.&lt;/P&gt;&lt;P&gt;    IF v_cancel =&amp;gt; v_confirm .&lt;/P&gt;&lt;P&gt; MESSAGE ID 'ZSER' TYPE 'A' NUMBER '017' WITH i_mseg-aufnr i_afvc-vornr.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    confirmation = i_afvc-rueck .&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  CLEAR : qty, qty1, qty2.&lt;/P&gt;&lt;P&gt;  CLEAR : i_afru.&lt;/P&gt;&lt;P&gt;  REFRESH i_aufm[].&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SELECT * FROM aufm INTO TABLE i_aufm WHERE aufnr = i_mseg-aufnr.&lt;/P&gt;&lt;P&gt;*QTY2 IS DELIVERED QTY&lt;/P&gt;&lt;P&gt;  LOOP AT i_aufm WHERE bwart = '101' OR bwart = '102' .&lt;/P&gt;&lt;P&gt;    IF i_aufm-bwart = '101'.&lt;/P&gt;&lt;P&gt;      qty2 = qty2 + i_aufm-menge .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    ELSEIF i_aufm-bwart = '102'.&lt;/P&gt;&lt;P&gt;      qty2 = qty2 - i_aufm-menge .&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  SORT i_afru BY rueck rmzhl.&lt;/P&gt;&lt;P&gt;  LOOP AT i_afru INTO wa_afru WHERE rueck = confirmation.&lt;/P&gt;&lt;P&gt;*CALCULATE QUANTITY ALEADY CONFIRMED&lt;/P&gt;&lt;P&gt;    IF wa_afru-stzhl &amp;lt;&amp;gt; 0 .&lt;/P&gt;&lt;P&gt;      qty1 = qty1 - wa_afru-gmnga.&lt;/P&gt;&lt;P&gt;    ELSE.&lt;/P&gt;&lt;P&gt;      qty1 = qty1 + wa_afru-gmnga.&lt;/P&gt;&lt;P&gt;    ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*CLEAR WA_AFRU.&lt;/P&gt;&lt;P&gt;  ENDLOOP.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*QTY1 --- CONFIRMED&lt;/P&gt;&lt;P&gt;*WA_AFRU-GMNGA --- TO BE CONFIRMED  " i_afko-gamng --- total quantity&lt;/P&gt;&lt;P&gt;*I_MSEG-ERFMG -&lt;/P&gt;&lt;HR originaltext="---" /&gt;&lt;P&gt; TOTAL TO BE RELEASED CONFIRM&lt;/P&gt;&lt;P&gt;*QTY = I_AFKO-GAMNG - QTY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF qty2  =  qty1.&lt;/P&gt;&lt;P&gt;MESSAGE ID 'ZSER' TYPE 'A' NUMBER '019' WITH wa_afru-gmnga i_mseg-erfmg.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*qty = qty - qty2.&lt;/P&gt;&lt;P&gt;  IF qty2 &amp;lt; qty1.&lt;/P&gt;&lt;P&gt;    qty = qty1 - qty2.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  IF i_mseg-erfmg &amp;gt; qty .&lt;/P&gt;&lt;P&gt;    MESSAGE ID 'ZSER' TYPE 'A' NUMBER '018' WITH qty i_mseg-erfmg.&lt;/P&gt;&lt;P&gt;  ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ENDIF.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*******&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also i recall putting a check on tcode in the begining of the code so probly this exit is being called in other transactions as well.&lt;/P&gt;&lt;P&gt;Check if it is being called in c011 as well and solves the purpose.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also to search for exits go to transaction SMOD and from menu select &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Utilities-&amp;gt;find&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and provide the package name for the main program of transaction MB31.&lt;/P&gt;&lt;P&gt;You will get a list of exits.&lt;/P&gt;&lt;P&gt;Put a break-point in the ones which you think can solve the purpose and see if anyone of these is getting called.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Vikas&lt;/P&gt;&lt;P&gt;&amp;lt;b&amp;gt;Always rewards points to useful suggestions.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2007 04:35:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit-in-pp/m-p/2641317#M608092</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-22T04:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: User exit in PP</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit-in-pp/m-p/2641318#M608093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear Vikas,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But try for my other requirements considering effects like cancellation of orders, etc.....&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 Aug 2007 13:19:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/user-exit-in-pp/m-p/2641318#M608093</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-08-22T13:19:35Z</dc:date>
    </item>
  </channel>
</rss>

