<?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: Confirmed Quantity in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/confirmed-quantity/m-p/6204996#M1376788</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try to this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ZSALESORDER_SIMULATE.
DATA: order_header_in LIKE bapisdhead,
      order_items_in LIKE TABLE OF bapiitemin,
      return LIKE bapireturn,
      wa_order_items_in LIKE LINE OF order_items_in,
      order_partners LIKE TABLE OF bapipartnr,
      wa_order_partners LIKE LINE OF order_partners,
      order_items_out LIKE TABLE OF bapiitemex,
      wa_order_items_out LIKE LINE OF order_items_out.

* Fill order_header_in
order_header_in-doc_type = 'TA'.

* Fill order_items_in
wa_order_items_in-material = '000000000000020927'.
wa_order_items_in-req_qty = '1000'.

APPEND wa_order_items_in TO order_items_in.

* Fill order_items_in
wa_order_partners-partn_role = 'AG'.
wa_order_partners-partn_numb = '0000000001'.

APPEND wa_order_partners TO order_partners.

* Execute Function Module BAPI_SALESORDER_SIMULATE
CALL FUNCTION 'BAPI_SALESORDER_SIMULATE'
  EXPORTING
    order_header_in           = order_header_in
  IMPORTING
    return                    = return
  TABLES
    order_items_in            = order_items_in
    order_partners            = order_partners
    order_items_out           = order_items_out.

* The return structure gives any error messages
WRITE: return-message.

* Print out the order items
LOOP AT order_items_out INTO wa_order_items_out.
  WRITE: wa_order_items_out-material,
         wa_order_items_out-short_text,
         wa_order_items_out-subtotal_2.
ENDLOOP.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 26 Sep 2009 07:16:54 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-09-26T07:16:54Z</dc:date>
    <item>
      <title>Confirmed Quantity</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/confirmed-quantity/m-p/6204995#M1376787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Everbody,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   i´m using the Bapi_Salesorder_Simulate to get net price of a material. But i have a problem. &lt;/P&gt;&lt;P&gt;  The confirmed quantity that returns the  bapi is 0 when i enter a higher quantity that the available stock. When i enter a lower or equal quantity that the available stock, the bapi returns the correct confirmed quantity. I need that when i enter a higher quantity, the bapi returns me the max quantity available. Is this possible?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Sep 2009 09:36:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/confirmed-quantity/m-p/6204995#M1376787</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-25T09:36:35Z</dc:date>
    </item>
    <item>
      <title>Re: Confirmed Quantity</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/confirmed-quantity/m-p/6204996#M1376788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try to this&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
REPORT  ZSALESORDER_SIMULATE.
DATA: order_header_in LIKE bapisdhead,
      order_items_in LIKE TABLE OF bapiitemin,
      return LIKE bapireturn,
      wa_order_items_in LIKE LINE OF order_items_in,
      order_partners LIKE TABLE OF bapipartnr,
      wa_order_partners LIKE LINE OF order_partners,
      order_items_out LIKE TABLE OF bapiitemex,
      wa_order_items_out LIKE LINE OF order_items_out.

* Fill order_header_in
order_header_in-doc_type = 'TA'.

* Fill order_items_in
wa_order_items_in-material = '000000000000020927'.
wa_order_items_in-req_qty = '1000'.

APPEND wa_order_items_in TO order_items_in.

* Fill order_items_in
wa_order_partners-partn_role = 'AG'.
wa_order_partners-partn_numb = '0000000001'.

APPEND wa_order_partners TO order_partners.

* Execute Function Module BAPI_SALESORDER_SIMULATE
CALL FUNCTION 'BAPI_SALESORDER_SIMULATE'
  EXPORTING
    order_header_in           = order_header_in
  IMPORTING
    return                    = return
  TABLES
    order_items_in            = order_items_in
    order_partners            = order_partners
    order_items_out           = order_items_out.

* The return structure gives any error messages
WRITE: return-message.

* Print out the order items
LOOP AT order_items_out INTO wa_order_items_out.
  WRITE: wa_order_items_out-material,
         wa_order_items_out-short_text,
         wa_order_items_out-subtotal_2.
ENDLOOP.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 26 Sep 2009 07:16:54 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/confirmed-quantity/m-p/6204996#M1376788</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-09-26T07:16:54Z</dc:date>
    </item>
  </channel>
</rss>

