<?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: help in the abap code in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985515#M72903</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;Further to previous reply.. you can set a flag in ZAGR to 'X' and check that in ZBET if the flag is initial then process other wise donot process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clear the flag at new order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Balu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 03 Aug 2005 16:33:06 GMT</pubDate>
    <dc:creator>Former Member</dc:creator>
    <dc:date>2005-08-03T16:33:06Z</dc:date>
    <item>
      <title>help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985511#M72899</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi folks,&lt;/P&gt;&lt;P&gt;      &lt;/P&gt;&lt;P&gt;I am checking for various condition types through this code for various orders. Each order has a different set of condition records. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My requirement: when a order has a condition record for the condition type 'ZAGR' (AGREED PRICE) it should execute that block and ignore all the other condition types for that record and directly go to 'ZBET'to fetch the final amount&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to incorporate that piece code here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code goes like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at cdata  into zcdata where &lt;/P&gt;&lt;P&gt;        knumv = bodyitabtotal-knumv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; case zcdata-kschl.&lt;/P&gt;&lt;P&gt;         when 'ZRAT' OR 'ZFLE' OR 'ZRCR' OR 'ZFIX'.&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;          .&lt;/P&gt;&lt;P&gt;       when 'ZAGR'.&lt;/P&gt;&lt;P&gt;         . &lt;/P&gt;&lt;P&gt;         .&lt;/P&gt;&lt;P&gt;         .&lt;/P&gt;&lt;P&gt;        when 'ZONT'.&lt;/P&gt;&lt;P&gt;            concatenate zzkeyword  zpofield&lt;/P&gt;&lt;P&gt;                 into CTEXT3&lt;/P&gt;&lt;P&gt;               separated by space&lt;/P&gt;&lt;P&gt;          MOVE zcdata-kbetr to w_accitab-zrate.&lt;/P&gt;&lt;P&gt;          MOVE zcdata-kwert to w_accitab-zsubtotal.&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;        .&lt;/P&gt;&lt;P&gt;      when 'ZSMG'.&lt;/P&gt;&lt;P&gt;         .&lt;/P&gt;&lt;P&gt;         .&lt;/P&gt;&lt;P&gt;         .&lt;/P&gt;&lt;P&gt;        when 'ZBET'.&lt;/P&gt;&lt;P&gt;         if zcdata-kbetr = ' ' AND zcdata-kwert = ' '.&lt;/P&gt;&lt;P&gt;              MOVE '  ' TO w_accitab-zamount.&lt;/P&gt;&lt;P&gt;          ELSE.&lt;/P&gt;&lt;P&gt;             MOVE zcdata-kwert to w_accitab-zamount.&lt;/P&gt;&lt;P&gt;          ENDIF.&lt;/P&gt;&lt;P&gt;        when  others.&lt;/P&gt;&lt;P&gt;          continue.&lt;/P&gt;&lt;P&gt;      endcase.&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;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2005 16:01:21 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985511#M72899</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-03T16:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985512#M72900</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;First option:&lt;/P&gt;&lt;P&gt;You prepare ne ITab and fill all the records with condition type ZBET. Read the itab in each condition type statements for the final amount.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Second option:&lt;/P&gt;&lt;P&gt;Set a flag to 'X' when ever condition record found. then execute the ZBET only when the flag is 'X'. startign of the case statement the flag will be clear for the order.&lt;/P&gt;&lt;P&gt;so for every condition record add the check if flad is initial. so ass soon as it encounters the first condition record...the next is ZBET is executed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps&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;Balu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2005 16:09:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985512#M72900</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-03T16:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985513#M72901</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;slight correction.... it should ignore 'ZBET' too. i.e when it encounters any data in the 'ZAGR' condition type it should exit from the loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sorry abt that..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2005 16:16:22 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985513#M72901</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-03T16:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985514#M72902</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;so your reqirement is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;you have orders with multiple condition records. When you program loop encounters the ZAGR condition it should only process that condtion for the order and exit from the loop and proceed with other order....and what ever condition records exceuted prior to ZAGR they will stay..&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When ZAGR is executed.. ZBET shouldnot be executed...ZBET should execute only for other condition types..is this your requirement??&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need more clarity on your requirement.&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;Balu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2005 16:27:15 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985514#M72902</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-03T16:27:15Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985515#M72903</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;Further to previous reply.. you can set a flag in ZAGR to 'X' and check that in ZBET if the flag is initial then process other wise donot process.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Clear the flag at new order.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This will work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Balu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2005 16:33:06 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985515#M72903</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-03T16:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985516#M72904</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This code will exit the loop completly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;when 'ZAGR'.
EXIT.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code will exit the current loop and continue to the next record for processing.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;when 'ZAGR'.
CONTINUE.&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich HEilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2005 16:43:40 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985516#M72904</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-08-03T16:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985517#M72905</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Balu, It really helped. The idea is good. But I have an situation in the condition table where I fetch the records.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a record for the condition type ' ZONT' i.e 'online price '  before the 'ZAGR' how to manage it here? &lt;/P&gt;&lt;P&gt;For the condition type 'ZBET' it works before in the condition table the record for 'ZBET' comes after 'ZAGR' but there are condition types that have records before ''ZAGR'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;How to go about it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2005 18:45:50 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985517#M72905</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-03T18:45:50Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985518#M72906</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I cannot use ' EXIT' because I have to append the data the itable within the loop every time it runs. I cannot 'exit' from loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2005 18:47:58 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985518#M72906</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-03T18:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985519#M72907</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You wrote....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;i&amp;gt;slight correction.... it should ignore 'ZBET' too. i.e when it encounters any data in the 'ZAGR' condition type it should exit from the loop.&amp;lt;/i&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So my question is,  what is your requirement exactly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2005 18:55:13 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985519#M72907</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-08-03T18:55:13Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985520#M72908</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sorry for the confusion. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Requirement: I am looping through the internal table that has the records for various condition types from KONV. The focal point is ' ZAGR' condition type, but this is not the first record in KONV there are records pertained to other condition types before 'ZAGR' like 'ZONT' and few more after 'ZAGR' like 'ZBET'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;while looping through the records if an order has an arecord for 'ZAGR' means that the order has been set for an flat rate of agreed price and all the other condition types for that record is not required because it is a flat rate - but there may be records for other condition types for the same order and I should not pick up that data for the order because it is a flat rate.Therefore I should skip all the other condition types.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Like Balu suggessted I used a flag and with the help of it I was succeeded in getting rid of all the condition types that come after ZAGR on the KONV table but there are condtion types like 'ZONT' that are populated befroe 'ZAGR' in the KONV table.&lt;/P&gt;&lt;P&gt;So when the data is fetched and looped it pikcs up the data for 'ZONT' because it is prior to 'ZAGR' in the table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have to avoid it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope I have explained my requirement clearly.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2005 19:08:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985520#M72908</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-03T19:08:59Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985521#M72909</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now I think I understand......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


* Check cdata for a ZAGR entry, if there is one, just process that 
* record, othewise do your loop.
read table cdata into zcdata with key kschl = 'ZAGR'.
if sy-subrc  = 0.

* Then do what ever you need to do

else.
* Otherwise process the table as normal.

  loop at cdata into zcdata
           where knumv = bodyitabtotal-knumv.

    case zcdata-kschl.
      when 'ZRAT' or 'ZFLE' or 'ZRCR' or 'ZFIX'.

      when 'ZAGR'.

      when 'ZONT'.
        concatenate zzkeyword zpofield
        into ctext3
        separated by space
        move zcdata-kbetr to w_accitab-zrate.
        move zcdata-kwert to w_accitab-zsubtotal.

      when 'ZSMG'.

      when 'ZBET'.
        if zcdata-kbetr = ' ' and zcdata-kwert = ' '.
          move ' ' to w_accitab-zamount.
        else.
          move zcdata-kwert to w_accitab-zamount.
        endif.
      when others.
        continue.
    endcase.

  endloop.

endif.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2005 19:18:28 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985521#M72909</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-08-03T19:18:28Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985522#M72910</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; I need the 'knumv' to be checked too because it is unique to each order, and I am running this within a loop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The format of the code goes like this...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select distinct ...... into table bodyitab1(internal table) &lt;/P&gt;&lt;P&gt;*fetching all the information of the sales orders into the table&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  insert lines of bodyitab1 into table bodyitabtotal.&lt;/P&gt;&lt;P&gt;  .&lt;/P&gt;&lt;P&gt;  .&lt;/P&gt;&lt;P&gt; loop at bodyitabtotal&lt;/P&gt;&lt;P&gt;  .&lt;/P&gt;&lt;P&gt;  .&lt;/P&gt;&lt;P&gt;  .&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;UL&gt;&lt;LI level="1" type="ul"&gt;&lt;P&gt;reading all the data into various variables and reading into 'w_accitab' &lt;/P&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;  select knumv kschl kbetr kwert kinak&lt;/P&gt;&lt;P&gt;    from konv into table cdata for all entries in  &lt;/P&gt;&lt;P&gt;bodyitabtotal where konv~knumv = bodyitabtotal-knumv&lt;/P&gt;&lt;P&gt;    .&lt;/P&gt;&lt;P&gt;    .&lt;/P&gt;&lt;P&gt;  *fetching the rates, amounts, for each sales order based on  'knumv' and checking for the condition types&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;  loop at cdata  into zcdata where knumv = bodyitabtotal-knumv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     case zcdata-kschl.&lt;/P&gt;&lt;P&gt;        when 'ZAGR'.&lt;/P&gt;&lt;P&gt;     .&lt;/P&gt;&lt;P&gt;     .&lt;/P&gt;&lt;P&gt;     .&lt;/P&gt;&lt;P&gt;   append w_accitab to accitab.&lt;/P&gt;&lt;P&gt;         clear accitab-zamount.&lt;/P&gt;&lt;P&gt;   clear accitab.&lt;/P&gt;&lt;P&gt;      clear w_accitab.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     endloop.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;here the loop ends and this completes the cycle for one order&lt;/P&gt;&lt;P&gt;so when I use the read statement it has to check for 'ZAGR' for that order only but if you see the query &lt;/P&gt;&lt;P&gt;cdata' has the condition records for all entries in 'bodyitabtotal' because all orders do not have 'ZAGR' condition type&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I hope you understand the flow of the program.&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2005 19:59:59 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985522#M72910</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-03T19:59:59Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985523#M72911</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Santhosh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is this how it looks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT bodyitabtotal.
*-- select all condition records from konv for the 
*   currect order in the loop into internal table
  REFRESH cdata.
  SELECT knumv kschl kbetr kwert kinak
    FROM konv 
    INTO TABLE cdata 
   WHERE knumv = bodyitabtotal-knumv.
  READ TABLE cdata INTO zcdata 
               WITH KEY kschl = 'ZAGR'.
  IF sy-subrc = 0.
*-- ZAGR condition type exists for this order
  ELSE.
    LOOP AT cdata INTO zcdata.
*-- do processing of all other condition types
    ENDLOOP.
  ENDIF.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Remember, in your code, you are in the loop of 'bodyitabtotal' and then in your 'select from konv', you are doing a 'for all entries in bodyitabtotal'. This is wrong because you only want the condition records of the current order not all orders.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this is clear.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2005 20:22:56 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985523#M72911</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-03T20:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985524#M72912</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok,  how about this.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


&amp;lt;b&amp;gt;read table cdata into zcdata with key 
                 knumv = bodyitabtotal-knumv
                 kschl = 'ZAGR'.&amp;lt;/b&amp;gt;
if sy-subrc  = 0.
 
* Then do what ever you need to do
 
else.
* Otherwise process the table as normal.
 
  loop at cdata into zcdata
           where knumv = bodyitabtotal-knumv.


&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich Heilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2005 20:32:48 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985524#M72912</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-08-03T20:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985525#M72913</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;Sort the ITab with KNUMV and KSCHL... this case the ZAGR excutes first....if no other condition rec starts with ZA.. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;this is may not be right solution but according to your condition records...this should work....&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;balu&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2005 20:54:57 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985525#M72913</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-03T20:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985526#M72914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rich,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Coming closer...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is my latest code....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;loop at cdata  into zcdata where knumv = bodyitabtotal-knumv.&lt;/P&gt;&lt;P&gt;    zzconditionnumber =  bodyitabtotal-knumv.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;    read table cdata into zcdata&lt;/P&gt;&lt;P&gt;   with  key knumv = zzconditionnumber&lt;/P&gt;&lt;P&gt;             kschl = 'ZAGR'.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     if sy-subrc  = 0.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;            CTEXT3 = 'AGREED PRICE'.&lt;/P&gt;&lt;P&gt;                 MOVE zcdata-kbetr to w_accitab-zrate.&lt;/P&gt;&lt;P&gt;                 MOVE zcdata-kwert to w_accitab-zamount.&lt;/P&gt;&lt;P&gt;       ??????? &lt;/P&gt;&lt;P&gt;      else.&lt;/P&gt;&lt;P&gt;     case zcdata-kschl.&lt;/P&gt;&lt;P&gt;       .&lt;/P&gt;&lt;P&gt;       .&lt;/P&gt;&lt;P&gt;       .&lt;/P&gt;&lt;P&gt;       .&lt;/P&gt;&lt;P&gt;       when  others.&lt;/P&gt;&lt;P&gt;          continue.&lt;/P&gt;&lt;P&gt;      endcase.&lt;/P&gt;&lt;P&gt;       MOVE CTEXT3 to w_accitab-zdescription.&lt;/P&gt;&lt;P&gt;       CLEAR CTEXT3.&lt;/P&gt;&lt;P&gt;        append w_accitab to accitab.&lt;/P&gt;&lt;P&gt;          clear accitab.&lt;/P&gt;&lt;P&gt;      clear w_accitab.&lt;/P&gt;&lt;P&gt;  endif.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;     endloop.&lt;/P&gt;&lt;P&gt;endloop.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is when it finds a record for 'ZAGR'  I read the data into the work area and has to exit the case.... endcase statement and process the &lt;/P&gt;&lt;P&gt;statement  &lt;/P&gt;&lt;P&gt; MOVE CTEXT3 ....&lt;/P&gt;&lt;P&gt;How can I do it? How can I get out of the case... endcase statement and not the loop.&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Aug 2005 22:10:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985526#M72914</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-03T22:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985527#M72915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Santhosh,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am not sure why you are reading the same internal table while looping at the same. You don't have to do that. Just change it like this.&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;
LOOP AT cdata INTO zcdata 
             WHERE knumv = bodyitabtotal-knumv.
  IF zcdata-kschl = 'ZAGR'.
    CTEXT3 = 'AGREED PRICE'.
    MOVE zcdata-kbetr to w_accitab-zrate.
    MOVE zcdata-kwert to w_accitab-zamount.
  ELSE.
    CASE zcdata-kschl.
      WHEN 'ABCD'.
        ....
        ....
      WHEN OTHERS.
    ENDCASE.
  ENDIF.
  MOVE CTEXT3 to w_accitab-zdescription.
  CLEAR CTEXT3.
  APPEND w_accitab TO accitab.
  CLEAR accitab.
  CLEAR w_accitab.
ENDLOOP.
&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hope you read my previous post.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Srinivas&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 04 Aug 2005 20:59:12 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985527#M72915</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-04T20:59:12Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985528#M72916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You said that if there is a ZAGR, you only want that record, right?  You need to do a READ for that condition type first,  if you got one,  just process that record,  if you don't have one,  the LOOP and process as you were before.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;


* Read the cDATA table first to see if there is a ZAGR, if there is
* you only want that record, correct?  If SY-SUBRC = 0,  then do 
* what ever you need to do when you have a ZAGR.

&amp;lt;b&amp;gt;read table cdata into zcdata with key
                 knumv = bodyitabtotal-knumv
                 kschl = 'ZAGR'.&amp;lt;/b&amp;gt;

&amp;lt;b&amp;gt;if sy-subrc  = 0.&amp;lt;/b&amp;gt;

  ctext3 = 'AGREED PRICE'.
  move zcdata-kbetr to w_accitab-zrate.
  move zcdata-kwert to w_accitab-zamount.

&amp;lt;b&amp;gt;else.&amp;lt;/b&amp;gt;
* Otherwise loop at the Cdata table and process as normal.

&amp;lt;b&amp;gt;  loop at cdata into zcdata
           where knumv = bodyitabtotal-knumv.&amp;lt;/b&amp;gt;

    case zcdata-kschl.
      when 'ZRAT' or 'ZFLE' or 'ZRCR' or 'ZFIX'.


      when 'ZONT'.
        concatenate zzkeyword zpofield
        into ctext3
        separated by space
        move zcdata-kbetr to w_accitab-zrate.
        move zcdata-kwert to w_accitab-zsubtotal.

      when 'ZSMG'.

      when 'ZBET'.
        if zcdata-kbetr = ' ' and zcdata-kwert = ' '.
          move ' ' to w_accitab-zamount.
        else.
          move zcdata-kwert to w_accitab-zamount.
        endif.
      when others.
        continue.
    endcase.

&amp;lt;b&amp;gt;  endloop.&amp;lt;/b&amp;gt;

endif.

&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Rich HEilman&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Aug 2005 14:09:36 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985528#M72916</guid>
      <dc:creator>RichHeilman</dc:creator>
      <dc:date>2005-08-05T14:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: help in the abap code</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985529#M72917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please reward and close the issue if this is resolved.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 06 Aug 2005 04:13:30 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/help-in-the-abap-code/m-p/985529#M72917</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2005-08-06T04:13:30Z</dc:date>
    </item>
  </channel>
</rss>

