<?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 BAPI_MATERIAL_AVAILABILITY returns different ATP quantity than CO09 in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability-returns-different-atp-quantity-than-co09/m-p/8559376#M1658931</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the following code to get ATP quantity of material, it returns (field: AV_QT_PLT = d_WKBST) the current stock quantity (it doesn't subtract orders and deliveries from that quantity). I need to get a return value from BAPI which value is as "Cummulative ATP quantity" from CO09.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can see in my code which parameters i used to get the value - CHECK_RULE is 'A' etc.&lt;/P&gt;&lt;P&gt;I take the value: BAPICM61V-WKBST as my return value - maybe i need to take some other value to get what i need (cummulative ATP quantity)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  Z_ATP_CUMMULATIVE.

Parameter: p_matnr like BAPIMATVP-MATNR,
           p_werks like BAPIMATVP-WERKS default 'AR01' obligatory,
           p_unit  like BAPIADMM-UNIT.


*Data: int_wmdvsx like BAPIWMDVS occurs 0 with header line,
*      int_wmdvex like BAPIWMDVE occurs 0 with header line.

Data: int_wmdvsx  type table of bapiwmdvs with header line,
      int_wmdvex  type table of bapiwmdve with header line,
      d_WKBST like BAPICM61V-WKBST.



           CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
             EXPORTING
               PLANT                    = p_werks
               MATERIAL                 = p_matnr
               UNIT                     = p_unit
               CHECK_RULE               = 'A'
*              STGE_LOC                 =
*              BATCH                    =
*              CUSTOMER                 =
*              DOC_NUMBER               =
*              ITM_NUMBER               =
*              WBS_ELEM                 =
*              STOCK_IND                =
*              DEC_FOR_ROUNDING         =
*              DEC_FOR_ROUNDING_X       =
*              READ_ATP_LOCK            =
*              READ_ATP_LOCK_X          =
            IMPORTING
*              ENDLEADTME               =
               AV_QTY_PLT               = d_WKBST
*              DIALOGFLAG               =
*              RETURN                   =
             TABLES
               WMDVSX                   = int_wmdvsx
               WMDVEX                   = int_wmdvex
                     .


Write:/ d_WKBST.

 If sy-subrc = 0.

 endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: mihailosundic on Jan 28, 2012 9:54 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SOLVED:&lt;/P&gt;&lt;P&gt;OK i have found the issue, i just needed to take the value from my table: &lt;STRONG&gt;int_wmdvex&lt;/STRONG&gt; and field is: &lt;STRONG&gt;COM_QTY&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have the same value as cumm.ATP qty from CO09.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: mihailosundic on Jan 28, 2012 10:03 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 28 Jan 2012 08:53:47 GMT</pubDate>
    <dc:creator>mihailo_sundic</dc:creator>
    <dc:date>2012-01-28T08:53:47Z</dc:date>
    <item>
      <title>BAPI_MATERIAL_AVAILABILITY returns different ATP quantity than CO09</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability-returns-different-atp-quantity-than-co09/m-p/8559376#M1658931</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the following code to get ATP quantity of material, it returns (field: AV_QT_PLT = d_WKBST) the current stock quantity (it doesn't subtract orders and deliveries from that quantity). I need to get a return value from BAPI which value is as "Cummulative ATP quantity" from CO09.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can see in my code which parameters i used to get the value - CHECK_RULE is 'A' etc.&lt;/P&gt;&lt;P&gt;I take the value: BAPICM61V-WKBST as my return value - maybe i need to take some other value to get what i need (cummulative ATP quantity)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;REPORT  Z_ATP_CUMMULATIVE.

Parameter: p_matnr like BAPIMATVP-MATNR,
           p_werks like BAPIMATVP-WERKS default 'AR01' obligatory,
           p_unit  like BAPIADMM-UNIT.


*Data: int_wmdvsx like BAPIWMDVS occurs 0 with header line,
*      int_wmdvex like BAPIWMDVE occurs 0 with header line.

Data: int_wmdvsx  type table of bapiwmdvs with header line,
      int_wmdvex  type table of bapiwmdve with header line,
      d_WKBST like BAPICM61V-WKBST.



           CALL FUNCTION 'BAPI_MATERIAL_AVAILABILITY'
             EXPORTING
               PLANT                    = p_werks
               MATERIAL                 = p_matnr
               UNIT                     = p_unit
               CHECK_RULE               = 'A'
*              STGE_LOC                 =
*              BATCH                    =
*              CUSTOMER                 =
*              DOC_NUMBER               =
*              ITM_NUMBER               =
*              WBS_ELEM                 =
*              STOCK_IND                =
*              DEC_FOR_ROUNDING         =
*              DEC_FOR_ROUNDING_X       =
*              READ_ATP_LOCK            =
*              READ_ATP_LOCK_X          =
            IMPORTING
*              ENDLEADTME               =
               AV_QTY_PLT               = d_WKBST
*              DIALOGFLAG               =
*              RETURN                   =
             TABLES
               WMDVSX                   = int_wmdvsx
               WMDVEX                   = int_wmdvex
                     .


Write:/ d_WKBST.

 If sy-subrc = 0.

 endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: mihailosundic on Jan 28, 2012 9:54 AM&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SOLVED:&lt;/P&gt;&lt;P&gt;OK i have found the issue, i just needed to take the value from my table: &lt;STRONG&gt;int_wmdvex&lt;/STRONG&gt; and field is: &lt;STRONG&gt;COM_QTY&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I have the same value as cumm.ATP qty from CO09.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Edited by: mihailosundic on Jan 28, 2012 10:03 AM&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 28 Jan 2012 08:53:47 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability-returns-different-atp-quantity-than-co09/m-p/8559376#M1658931</guid>
      <dc:creator>mihailo_sundic</dc:creator>
      <dc:date>2012-01-28T08:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_AVAILABILITY returns different ATP quantity than CO09</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability-returns-different-atp-quantity-than-co09/m-p/8559377#M1658932</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;One problem has occured in results of my ATP report.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When i have a production order for 20.000 pcs for one material, and i have 500 pcs on stock for the same material, and i have no sales orders or deliveries, com_qty returns the value of the production order = 20.000 pcs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My ATP should be 20.500 as i have 500 on stock and 20.000 pcs that will be produced in 5 days, but it shows only 20.000 pcs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does it have something to do with not passing requirements date? If it has, how do i pass that date to BAPI (i can't see that value in exporting part of the function)?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It would be good to have possibility to get the ATP based on quantities that are on stock (without production orders quantities), and also quantity based on both stock and production orders. (i might implement a check-box for including production order quantities and a requirements date field that will be passed to BAPI).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please, if there are any suggestions on any problem feel free to help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Feb 2012 19:02:46 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability-returns-different-atp-quantity-than-co09/m-p/8559377#M1658932</guid>
      <dc:creator>mihailo_sundic</dc:creator>
      <dc:date>2012-02-11T19:02:46Z</dc:date>
    </item>
    <item>
      <title>Re: BAPI_MATERIAL_AVAILABILITY returns different ATP quantity than CO09</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability-returns-different-atp-quantity-than-co09/m-p/8559378#M1658933</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I used a different type of ATP check, althow we use 'A' in sales orders, but '03' was just what i wanted.&lt;/P&gt;&lt;P&gt;Cheers.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Feb 2012 21:56:16 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/bapi-material-availability-returns-different-atp-quantity-than-co09/m-p/8559378#M1658933</guid>
      <dc:creator>mihailo_sundic</dc:creator>
      <dc:date>2012-02-18T21:56:16Z</dc:date>
    </item>
  </channel>
</rss>

