<?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: blocking negative stock orders... in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/blocking-negative-stock-orders/m-p/2069275#M428430</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You have not told what should happen if the it_fg_xvbap-lsmeng  values comes more than 6.&lt;/P&gt;&lt;P&gt;It should accept or it should skip that?&lt;/P&gt;&lt;P&gt;You keep a IF statement before that&lt;/P&gt;&lt;P&gt;if it_fg_xvbap-lsmeng  &amp;lt;  v_quantity.&lt;/P&gt;&lt;P&gt;  v_new qty = v_quantity - it_fg_xvbap-lsmeng &lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;so now it won't calculate or&lt;/P&gt;&lt;P&gt;you can multiply with '-1' when it becomes more than 6 also.&lt;/P&gt;&lt;P&gt;if it_fg_xvbap-lsmeng  &amp;gt; v_quantity.&lt;/P&gt;&lt;P&gt;  it_fg_xvbap-lsmeng = it_fg_xvbap-lsmeng * -1.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt; v_new qty = v_quantity - it_fg_xvbap-lsmeng &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Mar 2007 14:12:35 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2007-03-15T14:12:35Z</dc:date>
    <item>
      <title>blocking negative stock orders...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/blocking-negative-stock-orders/m-p/2069273#M428428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have this user exit.......I have fixed quantity for this order process not to exceed 6...if  I give 7 or more than that........it should not take and error...message should come....I made this code.....every thing working fine....except this error message and stoping the negative stock........actually in the below problem.......zfreegoods-quantity is 6 (its fixed)..based on that i made this code......&lt;/P&gt;&lt;P&gt;but the problem is when I am calculating &amp;lt;b&amp;gt;v_new qty = v_quantity - it_fg_xvbap-lsmeng&amp;lt;/b&amp;gt;  if i give more than 6 qty then its a negative quantity......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;how to stop this.......my code is below for ur reference....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        read table it_zfreegoods with key matnr = it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;        if sy-subrc eq 0.&lt;/P&gt;&lt;P&gt;          v_mitem1_qty = it_fg_xvbap-kwmeng.&lt;/P&gt;&lt;P&gt;          v_quantity = it_zfreegoods-quantity.&lt;/P&gt;&lt;P&gt;          clear v_lines.&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;        if it_zfreegoods-matnr ne it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;          it_fg_xvbap-kwmeng = it_fg_xvbap-kmpmg.&lt;/P&gt;&lt;P&gt;          modify it_fg_xvbap.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        v_lines = v_lines + 1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;        if it_zfreegoods-zfreemodel eq it_fg_xvbap-matnr.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;       &amp;lt;b&amp;gt;   v_newqty = v_quantity - it_fg_xvbap-lsmeng.&amp;lt;/b&amp;gt;&lt;/P&gt;&lt;P&gt;             it_fg_xvbap-kwmeng = v_newqty.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;          modify it_fg_xvbap.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;         if v_mixitem_qty ne it_zfreegoods-quantity.&lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;lt;b&amp;gt;          if v_quantity ne it_zfreegoods-quantity.&amp;lt;/b&amp;gt;            if fcode eq 'SICH'.&lt;/P&gt;&lt;P&gt;              message e020(zsnd) with it_zfreegoods-quantity .&lt;/P&gt;&lt;P&gt;            else.&lt;/P&gt;&lt;P&gt;              message s020(zsnd) with it_zfreegoods-quantity .&lt;/P&gt;&lt;P&gt;            endif.&lt;/P&gt;&lt;P&gt;          endif.&lt;/P&gt;&lt;P&gt;        endif.&lt;/P&gt;&lt;P&gt;      endloop.&lt;/P&gt;&lt;P&gt;      xvbap[] = it_fg_xvbap[].&lt;/P&gt;&lt;P&gt;    endif.   "  it_zfreegoods table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance for you valuable advices,,&lt;/P&gt;&lt;P&gt;Madhu.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2007 14:07:03 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/blocking-negative-stock-orders/m-p/2069273#M428428</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-15T14:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: blocking negative stock orders...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/blocking-negative-stock-orders/m-p/2069274#M428429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello MAdhu,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Check like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
if  it_fg_xvbap-lsmeng ge 1.
v_newqty = v_quantity - it_fg_xvbap-lsmeng.
endif.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Vasanth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2007 14:11:37 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/blocking-negative-stock-orders/m-p/2069274#M428429</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-15T14:11:37Z</dc:date>
    </item>
    <item>
      <title>Re: blocking negative stock orders...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/blocking-negative-stock-orders/m-p/2069275#M428430</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;You have not told what should happen if the it_fg_xvbap-lsmeng  values comes more than 6.&lt;/P&gt;&lt;P&gt;It should accept or it should skip that?&lt;/P&gt;&lt;P&gt;You keep a IF statement before that&lt;/P&gt;&lt;P&gt;if it_fg_xvbap-lsmeng  &amp;lt;  v_quantity.&lt;/P&gt;&lt;P&gt;  v_new qty = v_quantity - it_fg_xvbap-lsmeng &lt;/P&gt;&lt;P&gt;endif.&lt;/P&gt;&lt;P&gt;so now it won't calculate or&lt;/P&gt;&lt;P&gt;you can multiply with '-1' when it becomes more than 6 also.&lt;/P&gt;&lt;P&gt;if it_fg_xvbap-lsmeng  &amp;gt; v_quantity.&lt;/P&gt;&lt;P&gt;  it_fg_xvbap-lsmeng = it_fg_xvbap-lsmeng * -1.&lt;/P&gt;&lt;P&gt; endif.&lt;/P&gt;&lt;P&gt; v_new qty = v_quantity - it_fg_xvbap-lsmeng &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;regards,&lt;/P&gt;&lt;P&gt;Anji&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2007 14:12:35 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/blocking-negative-stock-orders/m-p/2069275#M428430</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-15T14:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: blocking negative stock orders...</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/blocking-negative-stock-orders/m-p/2069276#M428431</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Anji,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it should not accept if it_fg_xvbap-lsmeng is grater than v_quantity....&lt;/P&gt;&lt;P&gt;v_quantity(base quantity) is fixed as 6 taking from the custom table.....&lt;/P&gt;&lt;P&gt;but if the user enters 7 or more.....it should not accept.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Mar 2007 14:40:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/blocking-negative-stock-orders/m-p/2069276#M428431</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2007-03-15T14:40:56Z</dc:date>
    </item>
  </channel>
</rss>

