<?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: handling condition in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338157#M1229775</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I debugg, I see that Kotabnr value is always 000 which shouldnt be right , its never 000. This si teh reason most of the time the output for v_list that is the price list is opposite i.e where it has to be 02 its 01 and where it has to be 01 its 02, its not showing up correctly . Please if someonece can please help me out with tis would be highly appreciated.&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, 03 Mar 2009 22:04:51 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2009-03-03T22:04:51Z</dc:date>
    <item>
      <title>handling condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338150#M1229768</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Gurus!&lt;/P&gt;&lt;P&gt;In my present code it is able to handle the list price i.e showing '01''s.&lt;/P&gt;&lt;P&gt;I would like to do something like this :-&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; we can only have 1 item for the billing document #/item # combination&lt;/P&gt;&lt;P&gt; otherwise the net values and quantities will be exaggerated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The logic should be to read through the conditions and display in &lt;/P&gt;&lt;P&gt;the report the u201Clastu201D condition only.  So, if list price(01), &lt;/P&gt;&lt;P&gt;read all and only show the last one with the 01 for list. &lt;/P&gt;&lt;P&gt; When it is Off List, as soon as you hit a record in the loop &lt;/P&gt;&lt;P&gt;that makes it Off List(02), no need to read any further and just&lt;/P&gt;&lt;P&gt; keep that condition with 02 for off list.  End result is only 1 record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have some odd conditions that are considered u201Cactiveu201D(konv-kinak), &lt;/P&gt;&lt;P&gt;but donu2019t have any value yet show up in the conditions that we would loop through. &lt;/P&gt;&lt;P&gt;Need to add logic to NOT consider these condition records when &lt;/P&gt;&lt;P&gt;the Condition Value (KOMV-KWERT) = $0.00.  The 02 this should &lt;/P&gt;&lt;P&gt;apply to are ZPTM and ZDSP.  We cannot exclude anything that is &lt;/P&gt;&lt;P&gt;$0 as there are times when they produce a $0 list price(01) invoice&lt;/P&gt;&lt;P&gt; for customers and that may be the only condition.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: lv_kotabnr type c length 15.
types: begin of it_konv ,
         kinak type konv-kinak,
         kschl type konv-kschl,
         kolnr type konv-kolnr,
       end of it_konv,
       begin of it_t685 ,
         kozgf type t685-kozgf,
       end of it_t685,
       begin of it_t682i,
        kotabnr type t682i-kotabnr,
        kolnr   type t682i-kolnr,
        kozgf type t682i-kozgf  ,
      end of it_t682i         ,
      begin of it_price ,
        ZPRICE_TYPE type zsd_price_type-ZPRICE_TYPE,
      end of it_price  .
      DATA: t_konv type table of it_konv, "Internal table
            wa_konv type it_konv, "Work Area
            t_t685 type table of it_t685,
            wa_t685 type it_t685,
            t_t682i type table of it_t682i,
            wa_t682i type it_t682i,
            t_price type table of  it_price,
            wa_price type it_price.        " replace ',' with '.'
refresh t_konv.
select KINAK
       KSCHL
       KOLNR
  from konv
  into table t_konv
 where kinak = ' '
   and knumv eq vbrk-knumv
   and kposn eq vbrp-posnr .
check not t_konv is initial.
refresh t_t685.
select kozgf
  into table t_t685
  from T685
   for all entries in t_konv
 where kappl = 'V'
   and kschl = t_konv-kschl.
if sy-subrc eq 0.
  refresh t_t682i.
Loop at t_konv into wa_konv.
    Loop at t_t685 into wa_t685.                                                                                
move : wa_konv-kolnr to wa_t682i-kolnr,                       
             wa_t685-kozgf to wa_t682i-kozgf.                       
      append wa_t682i to t_t682i.                                    
    endloop.
  endloop.
  select kotabnr
         kolnr
         kozgf
    into table t_t682i
    from T682I
     for all entries in t_t682i
   where kappl = 'V'
     and kolnr eq t_t682i-kolnr
     and kozgf eq t_t682i-kozgf.
  if sy-subrc eq 0.
     select  zprice_type
      into v_list from zsd_price_type
       where kotabnr = wa_t682i-kotabnr .
      exit.

endselect.
endif.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;.  Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2009 20:01:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338150#M1229768</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-02T20:01:51Z</dc:date>
    </item>
    <item>
      <title>Re: handling condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338151#M1229769</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;COuld I get some help with this please.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 02 Mar 2009 20:57:34 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338151#M1229769</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-02T20:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: handling condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338152#M1229770</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just want to select the price list if its 01 or 02 as per the code. I would like to selecet it in such a manner that    we can only have 1 item for the billing document #/item # combination otherwise the net values and quantities will be exaggerated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;   The logic should be to read through the conditions and display in the report the u201Clastu201D condition only.  So, if list price, read all and only show the last one with the 01 for list.  When it is Off List, as soon as you hit a record in the loop that makes it Off List, no need to read any further and just keep that condition with 02 for off list.  End result is only 1 record.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt; if sy-subrc eq 0.
    select ZPRICE_TYPE
      into table t_price
      from zsd_price_type
       for all entries in t_t682i
     where kotabnr = t_t682i-kotabnr .
    loop at t_price into wa_price  .
      if wa_price-zprice_type = '01'.
        continue.   
      if wa_price-zprice_type  = '02'.
        v_list = wa_price-zprice_type.
        exit.
        endif.
    endif.
*  endif.
endloop.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If someone can please help out would be highly apprectaited.&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;Aarav&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2009 18:15:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338152#M1229770</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-03T18:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: handling condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338153#M1229771</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;try with this select statement &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; select ZPRICE_TYPE&lt;/P&gt;&lt;P&gt;      into table t_price&lt;/P&gt;&lt;P&gt;      from zsd_price_type&lt;/P&gt;&lt;P&gt;       for all entries in t_t682i&lt;/P&gt;&lt;P&gt;     where kotabnr = t_t682i-kotabnr &lt;/P&gt;&lt;P&gt;        and ( zprice_type = '01' or zprice_type = '02' ).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and later in the loop statement remove the if conditions i think they will not be necessary as you will get only the records of 01 and 02.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Siddarth&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2009 18:23:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338153#M1229771</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-03T18:23:59Z</dc:date>
    </item>
    <item>
      <title>Re: handling condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338154#M1229772</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its giving me runtime error and not only that we havent specified as to what field the value of zprice_type goes in , maybe thats wyy its going into runtime error. Even it has to select the last condition showing 01 to print for list price and the first condition type showing 02 to print and on first 02 it should print and exit, while in the case of 01 it looks for the next 01 and next and the last 01 it finds it prints that.&lt;/P&gt;&lt;P&gt;This v_list is one of teh fields of the query created.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  Loop at t_konv into wa_konv.
    Loop at t_t685 into wa_t685.
      move : wa_konv-kolnr to wa_t682i-kolnr,
             wa_t685-kozgf to wa_t682i-kozgf.
      append wa_t682i to t_t682i.
    endloop.
  endloop.
  select kotabnr
         kolnr
         kozgf
    into table t_t682i
    from T682I
     for all entries in t_t682i
   where kappl = 'V'
     and kolnr eq t_t682i-kolnr
     and kozgf eq t_t682i-kozgf.
  if sy-subrc eq 0.
    select ZPRICE_TYPE  into table t_price
      from zsd_price_type for all entries in t_t682i
          where kotabnr = t_t682i-kotabnr 
           and  ( zprice_type = '01' or zprice_type = '02' ).
     v_list = wa_price-zprice_type.
    Loop at t_price into wa_price where ZPRICE_TYPE is  initial.  " included into wa_price
      exit.
      endloop.
endif.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2009 19:05:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338154#M1229772</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-03T19:05:29Z</dc:date>
    </item>
    <item>
      <title>Re: handling condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338155#M1229773</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;gt; &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;  Loop at t_konv into wa_konv.
&amp;gt;     Loop at t_t685 into wa_t685.
&amp;gt;       move : wa_konv-kolnr to wa_t682i-kolnr,
&amp;gt;              wa_t685-kozgf to wa_t682i-kozgf.
&amp;gt;       append wa_t682i to t_t682i.
&amp;gt;     endloop.
&amp;gt;   endloop.
&amp;gt;   if not t_t682i[] is initial.  "&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; mandatory
&amp;gt;   select kotabnr
&amp;gt;          kolnr
&amp;gt;          kozgf
&amp;gt;     into table t_t682i
&amp;gt;     from T682I
&amp;gt;      for all entries in t_t682i
&amp;gt;    where kappl = 'V'
&amp;gt;      and kolnr eq t_t682i-kolnr
&amp;gt;      and kozgf eq t_t682i-kozgf.
&amp;gt;   if sy-subrc eq 0.
&amp;gt;if not t_t682i[] is initial.  "mandatory
&amp;gt;     select ZPRICE_TYPE  into table t_price
&amp;gt;       from zsd_price_type 
&amp;gt;        for all entries in t_t682i
&amp;gt;           where kotabnr = t_t682i-kotabnr 
&amp;gt;            and  ( zprice_type = '01' or zprice_type = '02' ).
&amp;gt;      v_list = wa_price-zprice_type.
&amp;gt;     Loop at t_price into wa_price where ZPRICE_TYPE is  initial.
&amp;gt;       exit.
&amp;gt;       endloop.
&amp;gt; endif.
&amp;gt; endif.
endif.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2009 19:08:39 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338155#M1229773</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-03-03T19:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: handling condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338156#M1229774</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This ig giving me all 00 values in my v_list column, which is nnot the  case.&lt;/P&gt;&lt;P&gt;It should show me as per the list price or offlist price i.e 01 or 02 and only when not applicable 00.But here it shows all as 00.&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, 03 Mar 2009 19:26:24 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338156#M1229774</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-03T19:26:24Z</dc:date>
    </item>
    <item>
      <title>Re: handling condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338157#M1229775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When I debugg, I see that Kotabnr value is always 000 which shouldnt be right , its never 000. This si teh reason most of the time the output for v_list that is the price list is opposite i.e where it has to be 02 its 01 and where it has to be 01 its 02, its not showing up correctly . Please if someonece can please help me out with tis would be highly appreciated.&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, 03 Mar 2009 22:04:51 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338157#M1229775</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-03T22:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: handling condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338158#M1229776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this: Its using custom tables...so you need to bedug and find out...&lt;/P&gt;&lt;P&gt;  &lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
Loop at t_konv into wa_konv.
    Loop at t_t685 into wa_t685.
      move : wa_konv-kolnr to wa_t682i-kolnr,
             wa_t685-kozgf to wa_t682i-kozgf.
      append wa_t682i to t_t682i.
clear: wa_t682i.   "&amp;lt;&amp;lt;change
    endloop.
  endloop.
  if not t_t682i[] is initial.  "&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; mandatory
  select kotabnr    kolnr   kozgf
    into table t_t682i
    from T682I
     for all entries in t_t682i
   where kappl = 'V'
     and kolnr eq t_t682i-kolnr
     and kozgf eq t_t682i-kozgf.
  if sy-subrc eq 0.
if not t_t682i[] is initial.  "&amp;lt;&amp;lt;mandatory
    select ZPRICE_TYPE  into table t_price
      from zsd_price_type 
       for all entries in t_t682i
          where kotabnr = t_t682i-kotabnr 
           and  ( zprice_type = '01' or zprice_type = '02' ).
                     v_list = wa_price-zprice_type.
    Loop at t_price into wa_price where ZPRICE_TYPE EQ Space.  "&amp;lt;&amp;lt;change
      exit.  "&amp;lt;&amp;lt; try skip
   endloop.
endif.
endif.
endif.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2009 22:13:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338158#M1229776</guid>
      <dc:creator>former_member156446</dc:creator>
      <dc:date>2009-03-03T22:13:58Z</dc:date>
    </item>
    <item>
      <title>Re: handling condition</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338159#M1229777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This returns all values for that field as 00.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
data: lv_kotabnr type c length 15.
types: begin of it_konv ,
         kinak type konv-kinak,
         kschl type konv-kschl,
         kolnr type konv-kolnr,
       end of it_konv,
       begin of it_t685 ,
         kozgf type t685-kozgf,
       end of it_t685,
       begin of it_t682i,
        kotabnr type t682i-kotabnr,
        kolnr   type t682i-kolnr,
        kozgf type t682i-kozgf  ,
      end of it_t682i         ,
      begin of it_price ,
        ZPRICE_TYPE type zsd_price_type-ZPRICE_TYPE,
      end of it_price  .
DATA: t_konv type table of it_konv, "Internal table
      wa_konv type it_konv, "Work Area
      t_t685 type table of it_t685,
      wa_t685 type it_t685,
      t_t682i type table of it_t682i,
      wa_t682i type it_t682i,
      t_price type table of  it_price,
      wa_price type it_price.
refresh t_konv.
select KINAK
       KSCHL
       KOLNR
  from konv
  into table t_konv
 where kinak = ' '
   and knumv eq vbrk-knumv
   and kposn eq vbrp-posnr .
check not t_konv is initial.
refresh t_t685.
select kozgf
  into table t_t685
  from T685
   for all entries in t_konv
 where kappl = 'V'
   and kschl = t_konv-kschl.
if sy-subrc eq 0.
  refresh t_t682i.
  Loop at t_konv into wa_konv.
    Loop at t_t685 into wa_t685.
      move : wa_konv-kolnr to wa_t682i-kolnr,
             wa_t685-kozgf to wa_t682i-kozgf.
      append wa_t682i to t_t682i.
      clear: wa_t682i.
    endloop.
  endloop.
  if not t_t682i[] is initial.
    select kotabnr
           kolnr
           kozgf
      into table t_t682i
      from T682I
       for all entries in t_t682i
     where kappl = 'V'
       and kolnr eq t_t682i-kolnr
       and kozgf eq t_t682i-kozgf.
    if sy-subrc eq 0.
      if not t_t682i[] is initial.
        select ZPRICE_TYPE  into table t_price
          from zsd_price_type for all entries in t_t682i
              where kotabnr = t_t682i-kotabnr
               and  ( zprice_type = '01' or zprice_type = '02' ).
        v_list = wa_price-zprice_type.
    Loop at t_price into wa_price where ZPRICE_TYPE EQ Space.
      exit.
      endloop.
      endif.
    endif.
  endif.
endif.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Mar 2009 22:57:29 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/handling-condition/m-p/5338159#M1229777</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-03-03T22:57:29Z</dc:date>
    </item>
  </channel>
</rss>

